// Timekeeping public static bool ChamCongHangNgay(PHAN_CA pc) { //Cham Cong pc.CHAM_CONG = 1; PHAN_CA.update(pc); return(true); }
// Add Shift public static bool ThemCaLamViec(List <PHAN_CA> pc) { for (int i = 0; i < pc.Count; i++) { PHAN_CA.insert(pc[i]); } return(true); }
public PanelXacNhanCong(PHAN_CA pc) { InitializeComponent(); this.pc = pc; lbCong.Text = "Ca " + pc.CA + " " + pc.THOI_GIAN.Date.ToShortDateString(); if (pc.XAC_NHAN_CONG == 1) { KhoaTrangThai(); } }
public static int TongGioCong(DateTime batDau, DateTime ketThuc) { List <PHAN_CA> ls = PHAN_CA.select(" where THOI_GIAN >= '" + batDau.ToShortDateString() + "' and THOI_GIAN <= '" + ketThuc.ToShortDateString() + "' "); int count = 0; for (int i = 0; i < ls.Count; i++) { if (ls[i].CHAM_CONG == 1) { count += CaLamViec.LayGioCong(ls[i].CA); } } return(count); }
// Get Shift public static List <PHAN_CA> LayCaLamViec(int msnv, DateTime thoiGianBatDau , DateTime thoiGianKetThuc) { List <PHAN_CA> tmp = new List <PHAN_CA>();; try { tmp = PHAN_CA.select(" where MSNV = " + msnv + " and THOI_GIAN >= '" + thoiGianBatDau.ToShortDateString() + "' and THOI_GIAN <= '" + thoiGianKetThuc.ToShortDateString() + "' "); } catch (Exception) { ; } List <PHAN_CA> result = new List <PHAN_CA>(); for (int i = 0; i < tmp.Count; i++) { result.Add(tmp[i]); } return(result); }
// Timekeeping public static bool ChamCongHangNgay(PHAN_CA pc) { //Cham Cong return(PhanCa.ChamCongHangNgay(pc)); }
// Get Shift public static List <PHAN_CA> LayCaLamViec(int msnv, DateTime thoiGian) { return(PHAN_CA.select(" where MSNV = " + msnv + " and THOI_GIAN = '" + thoiGian.ToShortDateString() + "' order by MSNV, CA")); }
// Delete Shift public static bool XoaCaLamViec(PHAN_CA pc) { PHAN_CA.delete(pc.MSNV, pc.THOI_GIAN, pc.CA); return(true); }
// Confrim Shift public static bool XacNhanCaLamViec(PHAN_CA pc) { pc.XAC_NHAN_CONG = 1; PHAN_CA.update(pc); return(true); }
// Add Shift public static bool ThemCaLamViec(PHAN_CA pc) { PHAN_CA.insert(pc); return(true); }
public bool XoaCaLamViec(PHAN_CA pc) { return(PhanCa.XoaCaLamViec(pc)); }
public bool ThemCaLamViec(PHAN_CA pc) { return(PhanCa.ThemCaLamViec(pc)); }