Beispiel #1
0
 internal static VM_EmpSalaryPaying Salary_To_VMEmpSalaryPaying(List <Salary> salaries)
 {
     logger.EnterMethod();
     try
     {
         VM_EmpSalaryPaying vM_EmpSalaryPaying = new VM_EmpSalaryPaying();
         foreach (var salary in salaries)
         {
             vM_EmpSalaryPaying.ListEmpPaying.Add(new VM_SalaryPaying
             {
                 Id          = salary.Id,
                 Description = salary.Description,
                 IsPaid      = salary.IsPaid,
                 StaffId     = salary.StaffId,
                 Time        = salary.Time,
                 TimePay     = salary.TimePay,
                 TotalSalary = salary.TotalSalary
             });
         }
         return(vM_EmpSalaryPaying);
     }
     catch (Exception e)
     {
         logger.Error("Error: [" + e.Message + "]");
         return(new VM_EmpSalaryPaying());
     }
     finally
     {
         logger.LeaveMethod();
     }
 }
        /// <summary>
        /// Get history paid salary for an employee
        /// </summary>
        /// <param name="empId"></param>
        /// <returns></returns>
        public ActionResult SalaryHistory(long empId)
        {
            logger.EnterMethod();
            try
            {
                var history = new VM_EmpSalaryPaying()
                {
                    ListEmpPaying = ConvertVM.Salary_To_VMSalaryPaying(this._iSalaryServices.GetSalariesForEmployee(empId))
                };
                foreach (var item in history.ListEmpPaying)
                {
                    item.SumDays = this._iSalaryServices.AttendanceInMonth(empId, item.Time);
                }
                var emp = this._iStaffServices.Get(empId);

                return(View(history));
            }
            catch (Exception e)
            {
                logger.Error("Error: [" + e.Message + "]");
                return(View("ErrorAdminPage"));
            }
            finally
            {
                logger.LeaveMethod();
            }
        }
Beispiel #3
0
 internal static VM_AnEmpSalaries VMSalary_Add_VMEmpSalaryPaying_Add_History(VM_Salary vM_Salary, VM_EmpSalaryPaying vM_EmpSalaryPaying, int history)
 {
     logger.EnterMethod();
     try
     {
         return(new VM_AnEmpSalaries()
         {
             Emp_Salary = vM_Salary,
             SalaryPaying = vM_EmpSalaryPaying,
             History = history
         });
     }
     catch (Exception e)
     {
         logger.Error("Error: [" + e.Message + "]");
         return(null);
     }
     finally
     {
         logger.LeaveMethod();
     }
 }
 internal static void VMEmpSalaryPaying_Add_Paging(ref VM_EmpSalaryPaying vM_EmpSalaryPaying, int totals, int thisPage)
 {
     vM_EmpSalaryPaying.ThisPage    = thisPage;
     vM_EmpSalaryPaying.ToltalPages = totals;
 }