Exemplo n.º 1
0
        public AttMnDataPer processPermanentMonthlyAttSingle(DateTime startDate, DateTime endDate, EmpView _Emp, List<AttData> _EmpAttData)
        {
            //Get Attendance data of employee according to selected month
            _attMonth = new AttMnDataPer();
            try
            {
                EmpAttData = _EmpAttData;
            }
            catch (Exception ex)
            {

            }
            string EmpMonth = _Emp.EmpID + endDate.Date.Month.ToString();
            //Check for already processed data
            _attMonth.StartDate = startDate;
            _attMonth.EndDate = endDate;
            _attMonth.PreDays = 0;
            _attMonth.WorkDays = 0;
            _attMonth.AbDays = 0;
            _attMonth.LeaveDays = 0;
            _attMonth.OfficialDutyDays = 0;
            _attMonth.ExpectedWrkTime = 0;
            _attMonth.GZDays = 0;
            _attMonth.RestDays = 0;
            _attMonth.TEarlyIn = 0;
            _attMonth.TEarlyOut = 0;
            _attMonth.TGZOT = 0;
            _attMonth.TLateIn = 0;
            _attMonth.TLateOut = 0;
            _attMonth.TNOT = 0;
            _attMonth.TotalDays = 0;
            _attMonth.TWorkTime = 0;
            _attMonth.OT1 = 0;
            _attMonth.OT2 = 0;
            _attMonth.OT3 = 0;
            _attMonth.OT4 = 0;
            _attMonth.OT5 = 0;
            _attMonth.OT6 = 0;
            _attMonth.OT7 = 0;
            _attMonth.OT8 = 0;
            _attMonth.OT9 = 0;
            _attMonth.OT10 = 0;
            _attMonth.OT11 = 0;
            _attMonth.OT12 = 0;
            _attMonth.OT13 = 0;
            _attMonth.OT14 = 0;
            _attMonth.OT15 = 0;
            _attMonth.OT16 = 0;
            _attMonth.OT17 = 0;
            _attMonth.OT18 = 0;
            _attMonth.OT19 = 0;
            _attMonth.OT20 = 0;
            _attMonth.OT21 = 0;
            _attMonth.OT22 = 0;
            _attMonth.OT23 = 0;
            _attMonth.OT24 = 0;
            _attMonth.OT25 = 0;
            _attMonth.OT26 = 0;
            _attMonth.OT27 = 0;
            _attMonth.OT28 = 0;
            _attMonth.OT29 = 0;
            _attMonth.OT30 = 0;
            _attMonth.OT31 = 0;
            TDays = 0;
            WorkDays = 0;
            PresentDays = 0;
            AbsentDays = 0;
            LeaveDays = 0;
            RestDays = 0;
            GZDays = 0;
            EarlyIn = 0;
            EarlyOut = 0;
            LateIn = 0;
            LateOut = 0;
            WorkTime = 0;
            NOT = 0;
            GOT = 0;
            TDays = Convert.ToByte((endDate - startDate).Days + 1);
            CalculateMonthlyAttendanceSheet(EmpAttData);
            _attMonth.Period = endDate.Date.Month.ToString() + endDate.Date.Year.ToString();
            _attMonth.EmpMonth = EmpMonth;
            _attMonth.EmpID = _Emp.EmpID;
            _attMonth.EmpNo = _Emp.EmpNo;
            _attMonth.EmpName = _Emp.EmpName;
            return _attMonth;
        }
        private DataTable LoadPermanentMonthlyDT(List<EmpView> list, DateTime datefrom, DateTime dateto)
        {
            TAS2013Entities db = new TAS2013Entities();
            List<AttData> attData = new List<AttData>();
            List<AttData> _EmpAttData = new List<AttData>();
            foreach (EmpView emp in list)
            {
                try
                {
                    attData = db.AttDatas.Where(aa => aa.EmpID == emp.EmpID && aa.AttDate >= datefrom && aa.AttDate <= dateto).ToList();
                    PermanentMonthly cmp = new PermanentMonthly();
                    _EmpAttData = attData.Where(aa => aa.EmpID == emp.EmpID).ToList();
                    AttMnDataPer attMn = new AttMnDataPer();
                    attMn = cmp.processPermanentMonthlyAttSingle((DateTime)datefrom, (DateTime)dateto, emp, _EmpAttData);
                    AddDataToMonthlyDataAtable(attMn.Period.ToString(), attMn.EmpMonth.ToString(), (DateTime)attMn.StartDate, (DateTime)attMn.EndDate, attMn.EmpNo, (int)attMn.EmpID, attMn.EmpName, emp.SectionName, emp.DeptName, emp.TypeName, emp.LocName, emp.ShiftName, attMn.D21, attMn.D22, attMn.D23, attMn.D24, attMn.D25, attMn.D26, attMn.D27, attMn.D28, attMn.D29, attMn.D30, attMn.D31, attMn.D1, attMn.D2, attMn.D3, attMn.D4, attMn.D5, attMn.D6, attMn.D7, attMn.D8, attMn.D9, attMn.D10, attMn.D11, attMn.D12, attMn.D13, attMn.D14, attMn.D15, attMn.D16, attMn.D17, attMn.D18, attMn.D19, attMn.D20, (short)attMn.TotalDays, (short)attMn.WorkDays, (short)attMn.PreDays, (short)attMn.AbDays, (short)attMn.RestDays, (short)attMn.GZDays, (short)attMn.LeaveDays, (short)attMn.OfficialDutyDays, (short)attMn.TEarlyIn, (short)attMn.TEarlyOut, (short)attMn.TLateIn, (short)attMn.TLateOut, (short)attMn.TWorkTime, (short)attMn.TNOT, (short)attMn.TGZOT, (short)attMn.ExpectedWrkTime, (short)attMn.OT1, (short)attMn.OT2, (short)attMn.OT3, (short)attMn.OT4, (short)attMn.OT5, (short)attMn.OT6, (short)attMn.OT7, (short)attMn.OT8, (short)attMn.OT9, (short)attMn.OT10, (short)attMn.OT11, (short)attMn.OT12, (short)attMn.OT13, (short)attMn.OT14, (short)attMn.OT15, (short)attMn.OT16, (short)attMn.OT17, (short)attMn.OT18, (short)attMn.OT19, (short)attMn.OT20, (short)attMn.OT21, (short)attMn.OT22, (short)attMn.OT23, (short)attMn.OT24, (short)attMn.OT25, (short)attMn.OT26, (short)attMn.OT27, (short)attMn.OT28, (short)attMn.OT29, (short)attMn.OT30, (short)attMn.OT31);
                }
                catch (Exception ex)
                {

                }
            }
            return FlexyMonthlyReportDT;
        }