Example #1
0
 //For employees
 protected void chkCtrlEmp_CheckedChanged(object sender, EventArgs e)
 {
     foreach (GridViewRow row in grid_Employee.Rows)
     {
         CheckBox ck = ((CheckBox)row.FindControl("chkCtrlEmp"));
         EmpView _EmpView = new EmpView();
         _EmpView.EmpID = Convert.ToInt32(row.Cells[1].Text);
         _EmpView.EmpName = row.Cells[3].Text;
         if (ck.Checked)
         {
             if (SelectedEmps.Where(aa => aa.EmpID == _EmpView.EmpID).Count() == 0)
                 SelectedEmps.Add(_EmpView);
         }
         else
         {
             if (SelectedEmps.Where(aa => aa.EmpID == _EmpView.EmpID).Count() > 0)
             {
                 var _emp = SelectedEmps.Where(aa => aa.EmpID == _EmpView.EmpID).First();
                 SelectedEmps.Remove(_emp);
             }
         }
     }
 }
        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;
        }