using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Job
{
public partial class FrmWorkList : Form
{
public FrmWorkList()
{
InitializeComponent();
Init();
UpdateJob();
this.groupBox1.Text = empl.Name;
}
Employee empl;//定义员工对象
public List jobList = new List();
public void Init()
{
jobList.Add(new CodeJob("编码","编码","实现购物车模块"));
jobList.Add(new CodeJob("编码", "编码基类", "完成项目基类编码"));
jobList.Add(new TestJob("测试", "压力测试", "测试项目实现模块"));
//实例化员工对象
empl = new SE("王小毛",jobList);
}
//绑定工作列表
public void UpdateJob()
{
this.dgvWorkList.DataSource = empl.WorkList;
}
//填写执行情况
private void 执行ToolStripMenuItem_Click(object sender, EventArgs e)
{
//获取当行
int index = this.dgvWorkList.CurrentRow.Index;
//打开对应窗口,填写完成指标——重写父类方法Execute()
empl.WorkList[index].Execute(this,index);
}
private void 测试ToolStripMenuItem_Click(object sender, EventArgs e)
{
FrmTest frmTest = new FrmTest();
frmTest.ShowDialog();
}
private void 完成情况ToolStripMenuItem_Click(object sender, EventArgs e)
{
int index = this.dgvWorkList.CurrentRow.Index;
empl.WorkList[index].Show();
}
}
}