public void Leave_Attendance_Cal(string EMP_ID, DateTime date1, DateTime date2, SqlConnection con)
        {
            //Tạm thời chỉ tính cho Primacy, Bowker
            //if (PublicFunction.CUS_ID == "99" || PublicFunction.CUS_ID == "100")
            {
                DateTime date = date1;

                while (date <= date2 && date <= DateTime.Today)
                {
                    AttendanceHelper.Attendance_Calc(EMP_ID, date.ToString("yyyy/MM/dd"), con, "TBLDETAILSATTENDANCE");
                    date = date.AddDays(1);
                }
            }
        }
Ejemplo n.º 2
0
        public static void Attendance_Calc(string EMP_ID, string ATT_DT, SqlConnection con, ArrayList Ca, ArrayList ATT,
                                           string SHI_ID, List <Tbldetailsroster> rsca, Object SetTA, List <Tbltypeshift> rsTypeShift, string table, string NOT_DR)
        {
            if (SHI_ID == "NoShift")
            {
                return;
            }
            AttendanceHelper tm = new AttendanceHelper(EMP_ID, ATT_DT, con, Ca, ATT, SHI_ID, rsca, SetTA, rsTypeShift);

            tm.tb = table;

            tm.NOT_DD = NOT_DR;
            tm.UpdateSql();

            //ForCal(EMP_ID, ATT_DT, con);
        }
        public void Leave_Attendance_Cal(string EMP_ID, DateTime dtO1, DateTime dtO2, DateTime dtN1, DateTime dtN2, SqlConnection con)
        {
            DateTime dtMin = dtO1, dtMax = dtO1;

            if (dtMin > dtO2)
            {
                dtMin = dtO2;
            }
            if (dtMin > dtN1)
            {
                dtMin = dtN1;
            }
            if (dtMin > dtN2)
            {
                dtMin = dtN2;
            }

            if (dtMax < dtO2)
            {
                dtMax = dtO2;
            }
            if (dtMax < dtN1)
            {
                dtMax = dtN1;
            }
            if (dtMax < dtN2)
            {
                dtMax = dtN2;
            }

            DateTime date = dtMin;

            while (date <= dtMax && date <= DateTime.Today)
            {
                if (date >= dtO1 && date <= dtO2 || date >= dtN1 && date <= dtN2)
                {
                    AttendanceHelper.Attendance_Calc(EMP_ID, date.ToString("yyyy/MM/dd"), con, "TBLDETAILSATTENDANCE");
                }

                date = date.AddDays(1);
            }
        }