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;
using System.Collections;
namespace 深入_NET第三章_项目__考勤
{
public partial class FrmMain : Form
{
public Dictionary<String, Record> recordList = new Dictionary<string, Record>();
public List<SE> progrannerList = new List<SE>();
public FrmMain()
{
InitializeComponent();
}
public void BindGril(List<SE> list) {
this.dataGridView1.DataSource = new BindingList<SE>(list);
}
private void label1_Click(object sender, EventArgs e)
{
FrmMaintance f = new FrmMaintance();
// f.MaintanceType = 1;
f.FrmParent = this;
f.ShowDialog();
}
//签到=======
private void 签到ToolStripMenuItem_Click(object sender, EventArgs e)
{
if(this.dataGridView1.SelectedRows.Count!=1){
MessageBox.Show
("请选中一行");
return;
}
string workNo = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
foreach(string id in recordList.Keys){
if (workNo == id) {
MessageBox.Show("你已经签过了");
return;
}
}
Record record = new Record();
record.ID = workNo;
record.name = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
record.signInTime = DateTime.Now;
this.recordList.Add(record.ID,record);
MessageBox.Show("签到成功"
深入.NET平台和C#语言 第三章员工打卡
最新推荐文章于 2021-11-30 09:38:46 发布
这是一个使用C#和.NET框架实现的简单员工考勤系统,包含签到、签退功能,并使用Dictionary和List进行数据管理。用户界面包括数据绑定和交互操作,如添加、删除员工记录。
摘要由CSDN通过智能技术生成