public void ClearAll()
 {
     if (ds_Check_A == null)
     {
         ds_Check_A = new List <cChk>();
     }
     else
     {
         ds_Check_A.Clear();
     }
     if (DSVaoRa == null)
     {
         DSVaoRa = new List <cChkInOut>();
     }
     else
     {
         DSVaoRa.Clear();
     }
     if (DSNgayCong == null)
     {
         DSNgayCong = new List <cNgayCong>();
     }
     else
     {
         DSNgayCong.Clear();
     }
 }
Esempio n. 2
0
/*        public override string ToString() {
 *          string temp = NgayCong.ToString("d/M") + "; " + ((HasCheck) ? "HasCheck" : "--") + "; " + "; TongLam: " + TG.LamTinhCong.TotalHours.ToString("##.##") + "; Thuc: " + TongGioThuc.TotalHours.ToString("##.##") + "; LamDem" +
 *                 TG.LamTinhPC30.TotalHours.ToString("#0.##") + "; Cong: " + TongCong.ToString("#0.##") + "; PC: " + TongPhuCap.ToString("#0.##") + "; Tre: " + TongTre.TotalMinutes.ToString("####") + "; Som: " + TongSom.TotalMinutes.ToString("####") +
 *                 "\n";
 *          if (DSVaoRa != null) {
 *                  foreach (cChkInOut @out in DSVaoRa)
 *                                      temp = temp + "; I:" + ((@out.Vao != null) ? @out.Vao.TimeStr.ToString("H:mm") : "----" )
 + "; O:" + ((@out.Raa != null) ? @out.Raa.TimeStr.ToString("H:mm") : "----" ) + "\n";
 +          }
 +          return temp;
 +      }*/

        internal void them(cChkInOut tmpVaoRa1)
        {
            if (DSVaoRa == null)
            {
                DSVaoRa = new List <cChkInOut>();
            }
            DSVaoRa.Add(tmpVaoRa1);
        }
Esempio n. 3
0
 internal void them(cChkInOut tmpVaoRa1)
 {
     if (DSVaoRa == null)
     {
         DSVaoRa = new List <cChkInOut>();
     }
     DSVaoRa.Add(tmpVaoRa1);
     if (DSCheck == null)
     {
         DSCheck = new List <cChk>();
     }
     if (tmpVaoRa1.Vao != null)
     {
         DSCheck.Add(tmpVaoRa1.Vao);
     }
     if (tmpVaoRa1.Raa != null)
     {
         DSCheck.Add(tmpVaoRa1.Raa);
     }
 }
        internal void Check_GioDaXN(DateTime pTimeStr, string pSource, int tempMachineNo
                                    , int pIDXacnhan, int pShiftID, string pShiftCode,
                                    TimeSpan pOnduty, TimeSpan pOffduty, TimeSpan pLateGrace, TimeSpan pEarlyGrace, TimeSpan pAfterOT, bool pTinhPC150,
                                    int pDayCount, TimeSpan pWorkingTime, Single pWorkingday
                                    , DateTime pTimeStrIn, DateTime pTimeStrOut, int pOTMin, string pNote)
        {
            if (tempMachineNo % 2 == 1)
            {
                cChkIn tChkIn = new cChkIn()
                {
                    TimeStr = pTimeStr, Source = pSource, MachineNo = tempMachineNo
                };
                ds_Check_ID.Add(tChkIn);
            }
            else
            {
                cChkOut tChkOut = new cChkOut()
                {
                    TimeStr = pTimeStr, Source = pSource, MachineNo = tempMachineNo
                };
                ds_Check_ID.Add(tChkOut);

                if (ds_Check_ID.Count > 1 && ds_Check_ID[ds_Check_ID.Count - 2].GetType() == typeof(cChkIn))
                {
                    cChkIn    tmpChkIn    = (cChkIn)ds_Check_ID[ds_Check_ID.Count - 2];
                    cChkOut   tmpChkOut   = (cChkOut)ds_Check_ID[ds_Check_ID.Count - 1];
                    cChkInOut tmpChkINOUT = new cChkInOut()
                    {
                        Vao           = tmpChkIn, Raa = tmpChkOut, HaveINOUT = 1,
                        TongGioThuc   = tmpChkOut.TimeStr - tmpChkIn.TimeStr,
                        DaXN          = true, IsOT = true, TinhPC150 = pTinhPC150,
                        LamThem       = new TimeSpan(0, pOTMin, 0),
                        ThuocNgayCong = ThamSo.GetDate(tmpChkIn.TimeStr),                         // [TBD] xem lại thuộc ngày công
                    };
                    cShift tmpThuocCa;
                    if (pShiftID > 0)                       // ca trong ds ca
                    {
                        tmpThuocCa = DSCa.Find(item => item.ShiftID == pShiftID);
                    }
                    else if (pShiftID > int.MinValue + 100 && pShiftID < 0)                     // ca tách và ca kết hợp  [Chú ý] + 100 vì chừa khoảng này cho các loại khác
                    {
                        tmpThuocCa = new cShift()
                        {
                            ShiftID       = pShiftID, ShiftCode = pShiftCode,
                            OnnDutyTS     = pOnduty, OffDutyTS = pOffduty, chophepvaotreTS = pLateGrace, chopheprasomTS = pEarlyGrace, batdaulamthemTS = pAfterOT,
                            WorkingTimeTS = pWorkingTime, Workingday = pWorkingday, DayCount = pDayCount, QuaDem = (pDayCount == 1), LunchMinute = ThamSo._0gio, LoaiCa = 0
                        }
                    }
                    ;                             //[TBD]
                    else if (pShiftID < int.MinValue + 100)
                    {
                        tmpThuocCa = new cShift()
                        {
                            ShiftID       = pShiftID, ShiftCode = pShiftCode,
                            OnnDutyTS     = pOnduty, OffDutyTS = pOffduty, chophepvaotreTS = pLateGrace, chopheprasomTS = pEarlyGrace, batdaulamthemTS = pAfterOT,
                            WorkingTimeTS = pWorkingTime, Workingday = pWorkingday, DayCount = pDayCount, QuaDem = (pDayCount == 1), LunchMinute = ThamSo._0gio, LoaiCa = 1
                        }
                    }
                    ;
                    else
                    {
                        tmpThuocCa = new cShift()
                        {
                            ShiftID       = pShiftID, ShiftCode = "XacNhan8h",
                            OnnDutyTS     = pOnduty, OffDutyTS = pOffduty, chophepvaotreTS = pLateGrace, chopheprasomTS = pEarlyGrace, batdaulamthemTS = pAfterOT,
                            WorkingTimeTS = pWorkingTime, Workingday = pWorkingday, DayCount = pDayCount, QuaDem = (pDayCount == 1), LunchMinute = ThamSo._0gio, LoaiCa = 1
                        };                         //[TBD]
                    }
                    if (tmpThuocCa == null)
                    {
                        log4net.ILog log = log4net.LogManager.GetLogger("ERROR function Check_GioDaXN ");
                        log.Fatal("ERROR function Check_GioDaXN");
                    }

                    tmpChkINOUT.ThuocCa = tmpThuocCa;
                    tmpChkINOUT.QuaDem  = tmpThuocCa.QuaDem;
                    XL.TinhCongTheoCa(tmpChkINOUT, tmpChkINOUT.ThuocCa);
                    DSVaoRa.Add(tmpChkINOUT);
                }
            }
        }