Exemplo n.º 1
0
        public static void XacNhan_CIO_A(int MaCC, DateTime timevao, DateTime timeraa, cCa currShift, bool bDuyetCPTre, bool bDuyetCPSom, int soPhutLamThem, bool choPhepTinhPc50, string lydo, string ghichu,
                                         bool bVaoTreLaCV, bool bRaaSomLaCV)//ver 4.0.0.4
        {
            if (timeraa - timevao <= TimeSpan.Zero || timeraa - timevao > XL2._24h00)
            {
                return;                 // ko đủ điều kiện xác nhận
            }
            int outputIDXN;

            // 2. xác nhận ca dưới csdl
            DAO5.XacNhanCa(MaCC, timevao, 21, "PC", timeraa, 22, "PC",
                           currShift.ID, currShift.Code, bDuyetCPTre, bDuyetCPSom, soPhutLamThem, lydo, ghichu, out outputIDXN,
                           bVaoTreLaCV, bRaaSomLaCV);     //ver 4.0.0.4
            DAO5.CheckTinhPC50(MaCC, timevao.Date, choPhepTinhPc50);
        }
Exemplo n.º 2
0
        public static void CheckTinhPC50_UpdORInsNew_Sort(cUserInfo nhanvien, DateTime ngay, bool giatri)
        {
            var n1    = DAO5.CheckTinhPC50(nhanvien.MaCC, ngay, giatri);
            var index = nhanvien.DSXNPhuCap50.FindIndex(o => o.Ngay == ngay);

            if (index < 0)               // chưa có --> tạo mới
            {
                var ngayXN_PCTC = new structPCTC {
                    Ngay = ngay, TinhPC50 = giatri
                };
                nhanvien.DSXNPhuCap50.Add(ngayXN_PCTC);
                nhanvien.DSXNPhuCap50.Sort(new cTemp1Comparer());
            }
            else               // đã có --> cập nhật
            {
                nhanvien.DSXNPhuCap50[index] = new structPCTC {
                    Ngay = ngay, TinhPC50 = giatri
                };
            }
        }