Пример #1
0
 //	Timekeeping
 public static bool ChamCongHangNgay(PHAN_CA pc)
 {
     //Cham Cong
     pc.CHAM_CONG = 1;
     PHAN_CA.update(pc);
     return(true);
 }
Пример #2
0
 //	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);
 }
Пример #3
0
 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();
     }
 }
Пример #4
0
        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);
        }
Пример #5
0
        //	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);
        }
Пример #6
0
 //	Timekeeping
 public static bool ChamCongHangNgay(PHAN_CA pc)
 {
     //Cham Cong
     return(PhanCa.ChamCongHangNgay(pc));
 }
Пример #7
0
 //	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"));
 }
Пример #8
0
 //	Delete Shift
 public static bool XoaCaLamViec(PHAN_CA pc)
 {
     PHAN_CA.delete(pc.MSNV, pc.THOI_GIAN, pc.CA);
     return(true);
 }
Пример #9
0
 //	Confrim Shift
 public static bool XacNhanCaLamViec(PHAN_CA pc)
 {
     pc.XAC_NHAN_CONG = 1;
     PHAN_CA.update(pc);
     return(true);
 }
Пример #10
0
 //	Add Shift
 public static bool ThemCaLamViec(PHAN_CA pc)
 {
     PHAN_CA.insert(pc);
     return(true);
 }
Пример #11
0
 public bool XoaCaLamViec(PHAN_CA pc)
 {
     return(PhanCa.XoaCaLamViec(pc));
 }
Пример #12
0
 public bool ThemCaLamViec(PHAN_CA pc)
 {
     return(PhanCa.ThemCaLamViec(pc));
 }