實現考勤資訊管理系統
泛型集合list的新增,查詢和刪除操作
使用泛型集合繫結datagridview
用list繫結datagridview控制項的方法
datagridview 物件.datasource=list 物件;
當list 物件中的資料經過修改,新增或者刪除操作後,需要經過轉換才能正確繫結。
假如datagridview物件是mydgv,list物件是mylist,則用mylist繫結mydgv時**如下:
mydgv.datasource=new binginglist(mylist);
public partial class frmmaintance : form
public frmmain frmparent
private void textbox2_textchanged(object sender, eventargs e)
private void baocun_click(object sender, eventargs e)
else
foreach (se item in frmparent.programmerlist)
}frmparent.programmerlist.add(se);
this.close();
}catch (exception ex)
finally
}public partial class frmmain : form
public listprogrammerlist = new list();
public void bindgrid(listlist)
private void toolstripbutton1_click(object sender, eventargs e)
private void frmmain_load(object sender, eventargs e)
public void xianshi() );
dgvprogrammer.datasource = new bindinglist(programmerlist);
}private void button1_click(object sender, eventargs e)
}this.dgvprogrammer.datasource = new bindinglist(templist);
}private void toolstripbutton2_click(object sender, eventargs e)
}messagebox.show("刪除成功");
bindinglist(programmerlist);
bindgrid(programmerlist);}}
private dictionaryrecordlist = new dictionary();
private void 簽到toolstripmenuitem_click(object sender, eventargs e)
string workno = dgvprogrammer.currentrow.cells["id"].value.tostring();
foreach (string item in recordlist.keys)
}record record = new record();
record.id = workno;
record.name = this.dgvprogrammer.currentrow.cells["name"].value.tostring();
record.signintime = datetime.now;
this.recordlist.add(record.id,record);
messagebox.show("簽到成功!");
}private void 前退toolstripmenuitem_click(object sender, eventargs e)
string id = this.dgvprogrammer.currentrow.cells["id"].value.tostring();
bool isout = false;
foreach (string item in recordlist.keys)
}if(!isout)
}private void toolstripbutton3_click(object sender, eventargs e)
public partial class frmshow : form
public dictionaryrecordlist
public void xianshi()
private void frmshow_load(object sender, eventargs e)
}
SQL 員工打卡每日最早和最晚紀錄
create table tb id int,employee id starttime datetime log time go insert into tb values 1,2010 05 02 00 00 01 insert into tb values 1,2010 05 02 00 10...
mysql查詢員工排班資訊 獲取打卡人員排班資訊
企業可通過打卡應用secret呼叫本介面,獲取打卡規則為 按班次上下班 規則的指定員工指定時間段內的排班資訊。請求方式 post https 請求示例 starttime 1492617600,endtime 1492790400,useridlist james paul 引數說明 引數必須 型別...
c 基礎接觸(打卡)
using system using system.collections.generic using system.text namespace test 1.所有關鍵字都是由小寫字母組成的,c 語言中,大小寫是嚴格區分的。2.中的console.writeline 與之前的console.wri...