public ActionResult DeleteConfirmed(int id) { if (Session["type"] == null || Session["type"].ToString() == "") { Session["DefaultView"] = "Delete"; Session["DefaultControll"] = "EmployeeSalary"; return(RedirectToAction("Login", "Employee")); } EpmloyeeSalary epmloyeeSalary = db.EpmloyeeSalaries.Find(id); db.EpmloyeeSalaries.Remove(epmloyeeSalary); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,EmployeeID,EmployeeSalary,SalaryMonth,SalaryReciveDate")] EpmloyeeSalary epmloyeeSalary) { if (Session["type"] == null || Session["type"].ToString() == "") { Session["DefaultView"] = "Edit"; Session["DefaultControll"] = "EmployeeSalary"; return(RedirectToAction("Login", "Employee")); } if (ModelState.IsValid) { db.Entry(epmloyeeSalary).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "EmployeeName", epmloyeeSalary.EmployeeID); return(View(epmloyeeSalary)); }
// GET: EmployeeSalary/Details/5 public ActionResult Details(int?id) { if (Session["type"] == null || Session["type"].ToString() == "") { Session["DefaultView"] = "Details"; Session["DefaultControll"] = "EmployeeSalary"; return(RedirectToAction("Login", "Employee")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EpmloyeeSalary epmloyeeSalary = db.EpmloyeeSalaries.Find(id); if (epmloyeeSalary == null) { return(HttpNotFound()); } return(View(epmloyeeSalary)); }
// GET: EmployeeSalary/Edit/5 public ActionResult Edit(int?id) { if (Session["type"] == null || Session["type"].ToString() == "") { Session["DefaultView"] = "Edit"; Session["DefaultControll"] = "EmployeeSalary"; return(RedirectToAction("Login", "Employee")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EpmloyeeSalary epmloyeeSalary = db.EpmloyeeSalaries.Find(id); if (epmloyeeSalary == null) { return(HttpNotFound()); } ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "EmployeeName", epmloyeeSalary.EmployeeID); return(View(epmloyeeSalary)); }