public ActionResult UpdateStatusDepartment(int n_id, string s_status) { var model = new DepartmentDBModel(); s_status = s_status.Equals("Active") ? "InActive" : "Active"; model.updateStatusDepartment(n_id, s_status); return(RedirectToAction("List", "Department")); }
public ActionResult List() { InfoSession modelSession = new InfoSession(); modelSession = SessionHelper.GetInfoSession(); Session["infoSession"] = modelSession; var model = new DepartmentDBModel(); var list = model.getListDepartment(); return(View(list)); }
// GET: Admin/Store/Edit/5 public ActionResult Edit(int n_id) { var model = new DepartmentDBModel(); var departmentModel = new DepartmentModel(); var store = model.getDepartmentById(n_id); departmentModel.id = store.N_ID; departmentModel.departmentName = store.S_NAME; departmentModel.contact = store.S_CONTACT; departmentModel.status = store.S_STATUS; return(View(departmentModel)); }
public ActionResult Create(DepartmentModel departmentModel) { try { var model = new DepartmentDBModel(); TB_DEPARTMENT department = new TB_DEPARTMENT(); department.S_NAME = departmentModel.departmentName; department.S_CONTACT = departmentModel.contact; model.createDepartment(department); return(RedirectToAction("List")); } catch { return(View()); } }