Esempio n. 1
0
        public ActionResult Create4(VMLeaveCF vmLeaveCF, int?[] SelectedEmpIds)
        {
            List <VMLeaveCFChild> vmLeaveCFChildEntries = new List <VMLeaveCFChild>();

            foreach (var empID in SelectedEmpIds)
            {
                VMLeaveCFChild vmLeaveCFChild = new VMLeaveCFChild();
                string         CollapseLeave  = Request.Form["CollapseLeave-" + empID.Value.ToString()].ToString();
                string         CarryForward   = Request.Form["CarryForward-" + empID.Value.ToString()].ToString();
                vmLeaveCFChild.EmpID         = (int)empID;
                vmLeaveCFChild.CollapseLeave = (float)Convert.ToDouble(CollapseLeave);
                vmLeaveCFChild.CarryForward  = (float)Convert.ToDouble(CarryForward);
                vmLeaveCFChildEntries.Add(vmLeaveCFChild);
            }
            vmLeaveCF.LeaveCFChild = vmLeaveCFChildEntries.ToList();
            VMLeaveCF vm = LeaveCFService.GetCreate4(vmLeaveCF);

            if (vm.ErrorMessages.Count == 0)
            {
                return(View("Index"));
            }
            else
            {
                return(View("Create3", vm));
            }
        }
Esempio n. 2
0
        public ActionResult Create3(VMLeaveCFSelection es, int?[] SelectedEmpIds)
        {
            VMLeaveCF vmLeaveCF = new VMLeaveCF();

            vmLeaveCF = LeaveCFService.GetCreate3(es, SelectedEmpIds, vmLeaveCF);
            return(View(vmLeaveCF));
        }
Esempio n. 3
0
        /// <summary>
        /// Shows the list of all Leave Carry Forward of selected employees.
        /// </summary>
        /// <param name="es"></param>
        /// <param name="SelectedEmployeeIds">Parameter of Selected Employee ids</param>
        /// <param name="vmLeaveCF"></param>
        /// <returns></returns>
        /// <remarks></remarks>
        public VMLeaveCF GetCreate3(VMLeaveCFSelection es, int?[] SelectedEmployeeIds, VMLeaveCF vmLeaveCF)
        {
            List <VMLeaveCFChild>      vmLeaveCFChildList = new List <VMLeaveCFChild>();
            List <VHR_EmployeeProfile> employees          = DDService.GetEmployeeInfo();                                       // Get All Employees from database
            FinancialYear financialYear = DDService.GetFinancialYear().First(aa => aa.PFinancialYearID == es.FinancialYearID); // Get selected financial year

            foreach (int empid in SelectedEmployeeIds)
            {
                VMLeaveCFChild      vmLeaveCFChild = new VMLeaveCFChild();
                VHR_EmployeeProfile employee       = employees.First(aa => aa.PEmployeeID == empid);// Get Specific Employee

                vmLeaveCFChild.EmpID             = employee.PEmployeeID;
                vmLeaveCFChild.EmpNo             = employee.OEmpID;
                vmLeaveCFChild.EmployeeName      = employee.EmployeeName;
                vmLeaveCFChild.FinancialYearID   = financialYear.PFinancialYearID;
                vmLeaveCFChild.FinancialYearName = financialYear.FYName;
                vmLeaveCFChild.TotalLeave        = 20;
                vmLeaveCFChild.LeaveTypeName     = "AL";
                vmLeaveCFChild.CarryForward      = 15;
                vmLeaveCFChild.CollapseLeave     = 5;
                vmLeaveCFChildList.Add(vmLeaveCFChild);
            }
            vmLeaveCF.FinancialYearID   = financialYear.PFinancialYearID;
            vmLeaveCF.FinancialYearName = financialYear.FYName;
            vmLeaveCF.LeaveCFChild      = vmLeaveCFChildList;
            return(vmLeaveCF);
        }
Esempio n. 4
0
 /// <summary>
 /// This method save all the changes in leave Carry Forward if failed show message not created
 /// </summary>
 /// <param name="vm"></param>
 /// <returns></returns>
 /// <remarks></remarks>
 public VMLeaveCF GetCreate4(VMLeaveCF vm)
 {
     return(new VMLeaveCF());
 }