P2员工月度工作P160-P163
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace WindowsFormsApplication2.Entity 8 { 9 //编写类 10 public class CodeJob : Job 11 { 12 //编写代码行数 13 public int CodingLines { get; set; } 14 //多少个BUG 15 public int Bugs { get; set; } 16 //工作日 17 public int WorkDay { get; set; } 18 19 //重学Execute方法 20 public override void Execute() 21 { 22 frmCode code = new frmCode(this); 23 code.ShowDialog(); 24 } 25 //重学show方法 26 public override string show() { 27 return "有效编码行数:" + CodingLines.ToString() + "\n遗留问题:" + Bugs.ToString() + "\n工作日"+WorkDay.ToString(); 28 } 29 } 30 }
编写代码类
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace WindowsFormsApplication2.Entity 8 { 9 //工作类 10 public abstract class Job 11 { 12 //工作类型 13 public string type { set; get; } 14 //工作名称 15 public string Name { set; get; } 16 //工作详情 17 public string Description { set; get; } 18 //创建抽象方法 19 public abstract void Execute(); 20 public abstract string show(); 21 22 } 23 24 }
工作类
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace WindowsFormsApplication2.Entity 8 { 9 public class SE 10 { 11 //员工名字 12 public string name { set; get; } 13 //一个员工可以有多个工作 14 public List<Job> job { set; get; } 15 16 } 17 }
员工类
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace WindowsFormsApplication2.Entity 8 { 9 //测试类 10 public class TestJob:Job 11 { 12 //测试个数 13 public int CaseNum { set; get; } 14 //多少个BUG 15 public int FindBugs { set; get; } 16 //用时 17 public int WorkDay { set; get; } 18 //重写Execute方法 19 public override void Execute() 20 { 21 frmTest test = new frmTest(this); 22 test.ShowDialog(); 23 } 24 //重写show方法 25 public override string show() 26 { 27 return "测试用例的个数:" + CaseNum.ToString()+"\n发现的Bug:"+FindBugs.ToString()+"\n用时"+WorkDay.ToString(); 28 } 29 } 30 }
测试工作类
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 using WindowsFormsApplication2.Entity; 11 12 namespace WindowsFormsApplication2 13 { 14 //编写窗口 15 public partial class frmCode : Form 16 { 17 18 CodeJob cj; 19 20 public frmCode() 21 { 22 InitializeComponent(); 23 } 24 public frmCode(CodeJob j) 25 { 26 InitializeComponent(); 27 this.cj = j; 28 } 29 30 31 //点击提交按钮 32 private void button1_Click(object sender, EventArgs e) 33 { 34 35 cj.Bugs= int.Parse(textBox2.Text); 36 cj.CodingLines = int.Parse(textBox1.Text); 37 cj.WorkDay = int.Parse(textBox3.Text); 38 39 MessageBox.Show("提交成功"); 40 this.Close(); 41 42 } 43 44 45 46 47 } 48 }
编写窗口
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 using WindowsFormsApplication2.Entity; 11 //测试工作窗口 12 namespace WindowsFormsApplication2 13 { 14 public partial class frmTest : Form 15 { 16 public frmTest() 17 { 18 InitializeComponent(); 19 } 20 TestJob j; 21 //添加一个沟造函数 22 public frmTest(TestJob j) { 23 this.j = j; 24 InitializeComponent(); 25 } 26 //点击提交的按钮 27 private void button1_Click(object sender, EventArgs e) 28 { 29 j.CaseNum = int.Parse(textBox1.Text); 30 j.FindBugs = int.Parse(textBox2.Text); 31 j.WorkDay = int.Parse(textBox3.Text); 32 MessageBox.Show("提交成功"); 33 this.Close(); 34 } 35 36 37 38 39 } 40 }
测试工作窗口
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 using WindowsFormsApplication2.Entity; 11 12 namespace WindowsFormsApplication2 13 { 14 public partial class list : Form 15 { 16 public list() 17 { 18 19 InitializeComponent(); 20 } 21 22 //创建一个员工对象 23 public SE s = new SE(); 24 //创建一个工作类(job)的list 25 public List<Job> job = new List<Job>(); 26 private void list_Load(object sender, EventArgs e) 27 { 28 29 //向JOB中添加数据 30 job.Add(new CodeJob() {type="编码",Name="编码1",Description="写代码",Bugs=1,CodingLines = 1,WorkDay = 1}); 31 job.Add(new CodeJob() { type = "编码", Name = "编码1", Description = "写代码", Bugs = 2, CodingLines = 2, WorkDay = 2 }); 32 job.Add(new TestJob() {type="测试",Name="测试1",Description="测试软件" }); 33 34 s.job = job; 35 s.name = "叼汉阳"; 36 dataGridView1.DataSource = job; 37 groupBox1.Text = s.name; 38 39 } 40 /// <summary> 41 /// 右键菜单的执行项 42 /// </summary> 43 /// <param name="sender"></param> 44 /// <param name="e"></param> 45 private void 执行ToolStripMenuItem_Click(object sender, EventArgs e) 46 { 47 //提取当前选中的dataGridView1index 48 int iten = dataGridView1.CurrentRow.Index; 49 50 s.job[iten].Execute(); 51 52 } 53 54 /// <summary> 55 /// 右键菜单的完成情况项 56 /// </summary> 57 /// <param name="sender"></param> 58 /// <param name="e"></param> 59 private void 完成情况ToolStripMenuItem_Click(object sender, EventArgs e) 60 { 61 //提取当前选中的dataGridView1index 62 int iten = dataGridView1.CurrentRow.Index; 63 64 MessageBox.Show( job[iten].show()); 65 } 66 } 67 }
工作列表窗口
转载于:https://www.cnblogs.com/saonan/p/6697201.html
P2员工月度工作P160-P163相关推荐
- <Java自定义工具类>计算员工月度平均下班时间方式一
计算员工月度平均下班时间方式一: 输入:String[][] strArray = {{"09:00:00", "18:00:08"},{"08:00 ...
- 在家远程办公,如何才能让员工高效工作?
work from home是一种工作安排,它能让雇员享有灵活的工作时间和地点.从传统的集中办公到远程办公,这种过度需要一个时间. 不可否认,一直强调低碳经济的21世纪,那些最先领悟到这一点的公司,可 ...
- 2021年机器人的工作量相当于全世界430万员工的工作
关注网易智能,聚焦AI大事件,读懂下一个大时代! [网易智能讯 8月13日消息]据国外媒体报道,目前关于人工智能将如何重塑未来工作地点.工作方式的预测并不鲜见.但事实上,自动化软件已经进入了人们工作的 ...
- 如何才能做好员工培训工作?
在目前人力资源并不充分的条件下,如何让企业获得更高的执行力,并形成集体上升的士气和能力呢?答案是培训和激励手段.根据经典畅销教材<人力资源管理必读12篇>中有关员工培训的内容所示,与其将希 ...
- java员工试用期工作总结
java员工试用期工作总结1 尊敬的领导: 我于____年9月11日成为本公司技术部的一名.net程序员,三个月的试用期转眼就过去了.这段我人生中弥足珍贵的经历,给我留下了精彩而美好的回忆.在这段 ...
- 怎么提醒通知自己每个月26日报送月度工作总结和计划
作为一家小型创业公司的中层管理之一,我常常会需要处理和安排各种琐碎的工作事务.有些任务事项是一次性的,做完之后就结束了:有些任务事项则是周期性的,需要每周或每月定期去做.比如每月快要结束的时候,我就需 ...
- 如何对出差员工的工作进行异地监控?
前言 对于各行各业,由于不同的工作性质,有很多人需要经常出差办公.员工在外地办公,公司管理者除了电话与微信聊天,不能通过其他直观的方式对员工的工作内容有很正确,真实,全面地了解,只能通过员工的口头上报 ...
- 怎样通过对员工电脑的按键次数来反映员工的工作效率?
在日常工作中,企业员工有很长时间都需要花费在电脑上,并且无时无刻地敲击着键盘,点击着鼠标,因此员工键盘按键次数统计也可以在一定程度上反映了员工的工作状态和工作效率.所以不少企业管理者,想要知道在一天的 ...
- 企业如何进行薪酬设计,提高员工的工作满意度?
对于企业的管理者来说,设计与管理薪酬制度是一项非常困难的工作任务,因为薪酬制度设置的合理与否,关乎员工对企业的满意程度和员工的工作积极性.良好的薪酬管理制度,将有助于企业进入良性循环,反之,则有可能降 ...
最新文章
- centos 学习日记 文件默认权限:umaks
- this和super的区别
- sql增删改查_增删改查!sql2pandas方法手册
- c语言入门至精通(全集),C语言入门至精通(全集)知识讲解.ppt
- Python中的正则表达式(基础)
- ASP.NET中使用Cache类来缓存页面的信息
- ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
- bs4爬取的时候有两个标签相同_PYTHON爬取数据储存到excel
- java多线程创建runnable_Java线程池和runnables创建runnables
- Python操作文件和目录
- 单一应用架构 垂直应用架构_如何说应用架构的语言
- perl语言编程 第四版_被称作“胶水语言”的PERL,在芯片设计和验证中可以这样使用...
- NSFileManager文件操作的十个小功能
- 手把手教你为 中文PDF电子书自动批量添加书签/目录, 彻底告别手动添加书签的烦恼
- 用Visual C#.NET编写服务器日期控件
- 项目质量管理控制过程的新老七种工具速记法
- HDU 2154:跳舞毯(递推)
- 我的Java开发学习之旅------Java经典面试题
- 斗兽棋项目开发计划书
- 实力见证,再度折桂 | 云扩科技入选《The Forrester Wave 中国RPA行业发展报告, Q3 2022》
热门文章
- 【bzoj 1340】 Escape逃跑问题 【Baltic2007】
- 解决 Android N 7.0 上 报错:android.os.FileUriExposedException
- 推荐一个Mac清理工具 CleanMyMac X 4.8.0
- 爬取段子网里面的搞笑段子
- 虚拟机安装ros时候出现“The directory ‘/home/xxx/.cache/pip‘...”的问题解决方法(亲测有用)
- 2022视频编码招聘面经
- 期货开户怎么选择好的期货公司 ?
- PHP常见的设计模式之:适配器模式
- jupyter怎么配置python_python-如何在Jupyter noteb中设置环境变量
- html倒计时代码+微信可用,微信页面倒计时代码(解决safari不兼容date的问题)