public ActionResult DeleteConfirmed(int id) { SalaryRank salaryRank = Service.Get(id); Service.RemoveByEntity(salaryRank); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SalaryRankId,RankName,RankValue")] SalaryRank salaryRank) { if (ModelState.IsValid) { Service.Update(salaryRank, salaryRank.SalaryRankId); return(RedirectToAction("Index")); } return(View(salaryRank)); }
// GET: SalaryRanks/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SalaryRank salaryRank = Service.Get(id); if (salaryRank == null) { return(HttpNotFound()); } return(View(salaryRank)); }
public ActionResult PromotionLanding(int?Id, string Name) { var employeeSalary = SalaryService.GetAll().Single(item => item.EmployeeId == Id); var Ranks = SalaryRankService.GetAll(); //ViewBag.Salary = employeeSalary; ViewBag.Id = Id; ViewBag.SalaryRanks = Ranks; SalaryRank Rank = Ranks.Single(item => item.SalaryRankId == employeeSalary.SalaryRankId); ViewBag.RankName = Rank.RankName; ViewBag.RankValue = Rank.RankValue; ViewBag.Name = Name; return(View()); }
public ActionResult Promote(int?Id, int SalaryRankId) { EmployeeSalary empSal = SalaryService.GetAll().First(item => item.EmployeeId == Id); SalaryRank salaryRank = SalaryRankService.Get(SalaryRankId); empSal.SalaryRankId = salaryRank.SalaryRankId; empSal.BasicSalary = salaryRank.RankValue; try { SalaryService.Update(empSal, empSal.EmployeeSalaryId); } catch (Exception e) { Output.Write(e); } return(RedirectToAction("Index")); }