Esempio n. 1
0
        internal static EditMonthlyAttendanceList GetEditMonthlyAttendanceList(int EmpID, int prid, string TotalDays, string PaidDays, string AbsentDays, string ActualOT, int LocID, string Remarks)
        {
            EditMonthlyAttendanceList eal = new EditMonthlyAttendanceList();

            if (TotalDays != null && TotalDays != "")
            {
                eal.TotalDays = (float)Convert.ToDouble(TotalDays);
            }
            else
            {
                eal.TotalDays = 0;
            }
            if (PaidDays != null && PaidDays != "")
            {
                eal.PaidDays = (float)Convert.ToDouble(PaidDays);
            }
            else
            {
                eal.PaidDays = 0;
            }

            if (AbsentDays != null && AbsentDays != "")
            {
                eal.AbsentDays = (float)Convert.ToDouble(AbsentDays);
            }
            else
            {
                eal.AbsentDays = 0;
            }

            if (ActualOT != null && ActualOT != "")
            {
                eal.ActualOT = (float)Convert.ToDouble(ActualOT);
            }
            else
            {
                eal.ActualOT = 0;
            }
            if (Remarks != null && Remarks != "")
            {
                eal.Remarks = Remarks;
            }
            else
            {
                eal.Remarks = "";
            }
            eal.LocID = LocID;
            return(eal);
        }
Esempio n. 2
0
        //public static VMEditMonthlyAttendance GetMonthlyAttendanceAttributes(List<ViewAttMonthlySummary> MonthlyAttendance, int PayrollID, string PRName,List<HR_Location> locs)
        //{
        //    VMEditMonthlyAttendance entries = new VMEditMonthlyAttendance();
        //    List<EditMonthlyAttendanceList> list = new List<EditMonthlyAttendanceList>();
        //    foreach (var item in MonthlyAttendance)
        //    {
        //        EditMonthlyAttendanceList eal = new EditMonthlyAttendanceList();
        //        eal.EmployeeID = (int)item.EmployeeID;
        //        eal.LocID= (int)item.LocIDMonth;
        //        eal.LocName = item.LocNameMonth;
        //        eal.EmpNo = item.EmpNo;
        //        eal.EmpName = item.FullName;
        //        eal.TotalDays = 0;
        //        eal.PaidDays = 0;
        //        eal.AbsentDays = 0;
        //        eal.ActualOT=0;
        //        eal.RestDays = (float)item.RestDays;
        //        eal.GZDays = (float)item.GZDays;
        //        eal.LeaveDays = (float)item.LeaveDays;
        //        if (item.TotalShortMins > 0)
        //            eal.ShortHr = (int)(item.TotalShortMins / 60);
        //        else
        //            eal.ShortHr = 0;
        //        if (item.TotalOT > 0)
        //            eal.TotalOT = (int)(item.TotalOT / 60);
        //        else
        //            eal.TotalOT = 0;
        //        if (item.AbDays != null)
        //        {
        //            eal.AbsentDays = (float)item.AbDays;
        //        }
        //        if (item.WorkDays != null)
        //        {
        //            eal.PaidDays = (float)item.WorkDays;
        //        }
        //        if (item.TotalDays != null)
        //        {
        //            eal.TotalDays = (float)item.TotalDays;
        //        }
        //        if (item.ActualOT != null)
        //        {
        //            eal.ActualOT = (int)(item.ActualOT / 60);
        //        }
        //        if (item.Remarks == null)
        //            eal.Remarks = "";
        //        else
        //            eal.Remarks = item.Remarks;
        //        list.Add(eal);
        //    }
        //    list.Add(GetTotalCount(list));
        //    entries.Locations = locs;
        //    entries.list = list.OrderBy(aa=>aa.EmployeeID).ToList();
        //    entries.Count = list.Count;
        //    entries.PayrollID = PayrollID;
        //    entries.PayrollName = PRName;
        //    return entries;
        //}

        private static EditMonthlyAttendanceList GetTotalCount(List <EditMonthlyAttendanceList> MonthlyAttendance)
        {
            EditMonthlyAttendanceList eal = new EditMonthlyAttendanceList();

            eal.EmployeeID = 999999;
            eal.EmpNo      = "";
            eal.EmpName    = "Total: " + MonthlyAttendance.Count;
            eal.TotalDays  = (float)MonthlyAttendance.ToList().Select(c => c.TotalDays).Sum();
            eal.PaidDays   = (float)MonthlyAttendance.ToList().Select(c => c.PaidDays).Sum();
            eal.AbsentDays = (float)MonthlyAttendance.ToList().Select(c => c.AbsentDays).Sum();
            eal.TotalOT    = (float)MonthlyAttendance.ToList().Select(c => c.TotalOT).Sum();
            eal.ShortHr    = (float)MonthlyAttendance.ToList().Select(c => c.ShortHr).Sum();
            eal.ActualOT   = (float)MonthlyAttendance.ToList().Select(c => c.ActualOT).Sum();
            eal.LeaveDays  = (float)MonthlyAttendance.ToList().Select(c => c.LeaveDays).Sum();
            return(eal);
        }
Esempio n. 3
0
        internal static string CheckMonthRecordIsEdited(Att_MonthData att, EditMonthlyAttendanceList editlist)
        {
            string edited = "No";

            if (editlist.PaidDays != att.WorkDays)
            {
                edited = "Time";
            }
            if (editlist.TotalDays != att.TotalDays)
            {
                edited = "Time";
            }
            if (editlist.AbsentDays != att.AbDays)
            {
                edited = "Time";
            }
            if ((editlist.ActualOT * 60) != att.TotalOT)
            {
                edited = "Time";
            }
            return(edited);
        }