主窗口

 1 using System;
 2 using System.Collections.Generic;
 3 using System.ComponentModel;
 4 using System.Data;
 5 using System.Drawing;
 6 using System.Linq;
 7 using System.Text;
 8 using System.Threading.Tasks;
 9 using System.Windows.Forms;
10 
11 namespace WindowsFormsApplication2
12 {
13     public partial class Form1 : Form
14     {
15         public Form1()
16         {
17             InitializeComponent();
18         }
19 
20         private void Form1_Load(object sender, EventArgs e)
21         {
22             Init();
23         }
24 
25       public Employee employee;
26        public List<Abctract> la = new List<Abctract>();
27         /// <summary>
28         /// 初始化
29         /// </summary>
30         public void Init()
31         {
32             
33             la.Add(new CodeJob("编码","编码","用于编码"));
34             la.Add(new CodeJob("编码1","编码1","用于编码1"));
35             la.Add(new TestJob("测试","测试","用于测试"));
36             la.Add(new TestJob("测试1","测试1","用于测试1"));
37             
38             employee = new Employee("1000",18,"王小猫",la);
39             groupBox1.Text = employee.Name;
40             dataGridView1.DataSource = employee.WorKList;
41         }
42 
43         private void 执行ToolStripMenuItem_Click(object sender, EventArgs e)
44         {
45             int index = this.dataGridView1.CurrentRow.Index;
46             employee.WorKList[index].Execcute(this,index);
47         }
48 
49         private void 完成情况ToolStripMenuItem_Click(object sender, EventArgs e)
50         {
51             int index = this.dataGridView1.CurrentRow.Index;
52             employee.WorKList[index].show();
53         }
54     }
55 }
View Code

 

posted @ 2017-04-12 22:19  南城。  阅读(175)  评论(0)    收藏  举报