public ActionResult AddEditSalarytDeductionTemp(int Id, int SalaryID)
        {
            AddSalaryDeductionViewModel model = new AddSalaryDeductionViewModel();

            model.SalaryTypeList.Add(new SelectListItem()
            {
                Text = "-- Select Deduction --", Value = "0"
            });
            foreach (var item in _otherSettingMethod.getAllSystemValueListByKeyName("Deduction List"))
            {
                model.SalaryTypeList.Add(new SelectListItem()
                {
                    Text = item.Value, Value = item.Id.ToString()
                });
            }
            var salarydetails = _db.Employee_Salary_Temp.Where(x => x.Id == SalaryID).FirstOrDefault();

            model.TotalSalary = salarydetails.Amount;
            var salaryType = _otherSettingMethod.getSystemListValueById((int)salarydetails.Currency);

            model.SalaryType       = salaryType.Value;
            model.EmployeeSalaryID = salarydetails.Id;
            if (Id > 0)
            {
                var data = _db.Employee_Salary_Deduction_Temp.Where(x => x.Id == Id).FirstOrDefault();
                model.Id               = data.Id;
                model.DeductionID      = (int)data.Deduction;
                model.EmployeeSalaryID = data.EmployeeSalaryID;
                model.Comments         = data.Comments;
                model.FixedAmount      = data.FixedAmount;
                model.PercentOfSalary  = data.PercentOfSalary;
                model.IncludeInSalary  = data.IncludeInSalary;
            }
            return(PartialView("_PartialAddSalaryDeductionTemp", model));
        }
        public List <AddSalaryDeductionViewModel> returnsalaryDeductionsListTemp(int Id)
        {
            List <AddSalaryDeductionViewModel> model = new List <AddSalaryDeductionViewModel>();
            var data = _db.Employee_Salary_Deduction_Temp.Where(x => x.EmployeeSalaryID == Id && x.Archived == false).ToList();

            if (data.Count > 0)
            {
                foreach (var item in data)
                {
                    var value = _otherSettingMethod.getSystemListValueById((int)item.Deduction);
                    AddSalaryDeductionViewModel dd = new AddSalaryDeductionViewModel();
                    dd.EmployeeSalaryID = item.EmployeeSalaryID;
                    dd.Id              = item.Id;
                    dd.DeductionID     = (int)item.Deduction;
                    dd.FixedAmount     = item.FixedAmount;
                    dd.PercentOfSalary = item.PercentOfSalary;
                    dd.IncludeInSalary = item.IncludeInSalary;
                    dd.Comments        = item.Comments;
                    if (value != null)
                    {
                        dd.Deduction = value.Value;
                    }
                    model.Add(dd);
                }
            }
            return(model);
        }
        public ActionResult DeleteSalaryDeductionTemp(AddSalaryDeductionViewModel model)
        {
            int userId = SessionProxy.UserId;

            _EmployeeProfileMethod.DeletesalaryDeductionTemp(model.Id, userId);
            AddSalaryViewModel modelss = GetAllListDetailsTemp(model.EmployeeID, model.EmployeeSalaryID);

            return(PartialView("_PartialAddSalary", modelss));
        }
        public ActionResult SaveSalarytDeduction(AddSalaryDeductionViewModel model)
        {
            //var temp = DeleteSalaryDeductionTempBySalaryId(model.EmployeeSalaryID);
            //var tempE = DeleteSalaryEntitlementTempBySalaryId(model.EmployeeSalaryID);
            int userId = SessionProxy.UserId;

            _EmployeeProfileMethod.SavesalaryDeductionSet(model, userId);
            AddSalaryViewModel modelss = GetAllListDetails(model.EmployeeID, model.EmployeeSalaryID);

            return(PartialView("_PartialAddSalary", modelss));
        }
        public ActionResult SaveSalaryTemp(AddSalaryViewModel models)
        {
            int userId = SessionProxy.UserId;

            models.CurrentUserId = userId;
            _EmployeeProfileMethod.SavesalarySetTemp(models);
            AddSalaryDeductionViewModel model = new AddSalaryDeductionViewModel();

            model.SalaryTypeList.Add(new SelectListItem()
            {
                Text = "-- Select Deduction --", Value = "0"
            });
            foreach (var item in _otherSettingMethod.getAllSystemValueListByKeyName("Deduction List"))
            {
                model.SalaryTypeList.Add(new SelectListItem()
                {
                    Text = item.Value, Value = item.Id.ToString()
                });
            }
            return(PartialView("_PartialAddSalaryDeductionTemp", model));
        }