Пример #1
0
        public static LeaveYearlyReportViewModel SpLeaveBalanceListToYearlyLeaveBalanceList(sp_LeaveApplicationEmployeeBalance_Result Record, int Empcode, int YearId)
        {
            LeaveYearlyReportViewModel single = new LeaveYearlyReportViewModel
            {
                LeaveTypeId = Convert.ToInt32(Record.LeaveTypeId),

                BalanceDays = Convert.ToDecimal(Record.BalanceDays),

                TotalTaken      = Convert.ToDecimal(Record.TotalTaken),
                TotalLeaveDays  = Convert.ToDecimal(Record.TotalLeaveDays),
                EmpCode         = Empcode,
                LeaveYearId     = YearId,
                PrevYearBalance = Convert.ToDecimal(Record.PrevYearBalance),
                ThisYearEarned  = Convert.ToDecimal(Record.ThisYearEarned)
            };

            return(single);
        }
Пример #2
0
        public ActionResult Index(int OfficeId, int?DesgId, int LeaveYearId)
        {
            int EmpCode = Convert.ToInt32(Session["Empcode"]);

            ViewBag.dllOfficeTypeList = _officeService.GetClildOfficeListByEmpCode(Convert.ToInt32(ViewBag.EmpCode));

            ViewBag.dllLeaveYearList   = _LeaveApplicationService.GetLeaveYearSelectList();
            ViewBag.dllDesginationList = _designationService.GetDesignationList().ToList();
            ViewBag.OfficeId           = OfficeId;
            ViewBag.DesgId             = DesgId;
            ViewBag.LeaveYearId        = LeaveYearId;
            var emplist = _employeeService.EmployeeSearch(OfficeId, DesgId);
            List <MultipleLeaveYearlyReportViewModel> masterRecord = new List <MultipleLeaveYearlyReportViewModel>();

            foreach (var empdata in emplist)
            {
                var desgndata = _designationService.GetDesignationById(empdata.EmpDesgId);
                var empdbdata = _employeeService.GetEmployeeByID(empdata.EmpCode);
                LeaveYearlyReportViewModel homeleave = new LeaveYearlyReportViewModel();
                homeleave = _LeaveAddAdmin.YearlyOfficewiseLeaveReport(empdata.EmpCode, 1, LeaveYearId);

                LeaveYearlyReportViewModel sickleave = new LeaveYearlyReportViewModel();
                sickleave = _LeaveAddAdmin.YearlyOfficewiseLeaveReport(empdata.EmpCode, 2, LeaveYearId);

                LeaveYearlyReportViewModel casualleave = new LeaveYearlyReportViewModel();
                casualleave = _LeaveAddAdmin.YearlyOfficewiseLeaveReport(empdata.EmpCode, 3, LeaveYearId);

                LeaveYearlyReportViewModel compensationLeave = new LeaveYearlyReportViewModel();
                compensationLeave = _LeaveAddAdmin.YearlyOfficewiseLeaveReport(empdata.EmpCode, 9, LeaveYearId);

                MultipleLeaveYearlyReportViewModel single = new MultipleLeaveYearlyReportViewModel()
                {
                    EmpName             = empdbdata.Name,
                    DesgName            = desgndata.DsgName,
                    OfficeName          = _officeService.GetOfficeName(OfficeId),
                    EmpCode             = empdata.EmpCode,
                    H_BalanceDays       = homeleave.BalanceDays,
                    H_TotalLeaveDays    = homeleave.TotalLeaveDays,
                    H_TotalTaken        = homeleave.TotalTaken,
                    H_PrevYearLeaveDays = homeleave.PrevYearBalance,
                    H_ThisYearLeaveDays = homeleave.ThisYearEarned,

                    S_BalanceDays    = sickleave.BalanceDays,
                    S_TotalLeaveDays = sickleave.TotalLeaveDays,
                    S_TotalTaken     = sickleave.TotalTaken,

                    Ca_BalanceDays    = casualleave.BalanceDays,
                    Ca_TotalLeaveDays = casualleave.TotalLeaveDays,
                    Ca_TotalTaken     = casualleave.TotalTaken,

                    Co_BalanceDays    = compensationLeave.BalanceDays,
                    Co_TotalLeaveDays = compensationLeave.TotalLeaveDays,
                    Co_TotalTaken     = compensationLeave.TotalTaken,
                };
                masterRecord.Add(single);
            }



            return(View(masterRecord));
        }