public IActionResult Edit(long id) { EmployeeIncomeTax employeeIncomeTax = db.EmployeeIncomeTax.GetFirstOrDefault(i => i.Id == id); vmEmployeeIncomeTax vmEmployeeIncomeTax = new vmEmployeeIncomeTax() { Id = employeeIncomeTax.Id, SalaryUp = employeeIncomeTax.SalaryUp, SalaryDown = employeeIncomeTax.SalaryDown, SalaryGroup = employeeIncomeTax.SalaryGroup, Percentage = employeeIncomeTax.Percentage }; return(PartialView("_Edit", vmEmployeeIncomeTax)); }
public IActionResult Edit(vmEmployeeIncomeTax vmEmployeeIncomeTax) { if (ModelState.IsValid) { EmployeeIncomeTax employeeIncomeTax = db.EmployeeIncomeTax.GetFirstOrDefault(i => i.Id == vmEmployeeIncomeTax.Id); employeeIncomeTax.SalaryDown = vmEmployeeIncomeTax.SalaryDown; employeeIncomeTax.SalaryGroup = vmEmployeeIncomeTax.SalaryGroup; employeeIncomeTax.SalaryUp = vmEmployeeIncomeTax.SalaryUp; employeeIncomeTax.Percentage = vmEmployeeIncomeTax.Percentage; db.EmployeeIncomeTax.Update(employeeIncomeTax); db.Save(); } return(PartialView("_Edit")); }
public IActionResult Create(vmEmployeeIncomeTax vmEmployeeIncomeTax) { if (ModelState.IsValid) { EmployeeIncomeTax employeeIncomeTax = new EmployeeIncomeTax() { SalaryGroup = vmEmployeeIncomeTax.SalaryGroup, SalaryDown = Convert.ToDecimal(vmEmployeeIncomeTax.SalaryDown), SalaryUp = Convert.ToDecimal(vmEmployeeIncomeTax.SalaryUp), Percentage = vmEmployeeIncomeTax.Percentage }; db.EmployeeIncomeTax.Add(employeeIncomeTax); db.Save(); } return(View("Index")); }