// // GET: /Department/Create public ActionResult Create() { Department model =new Department(); model.ActionOperationType = EActionOperationType.Create; this.LoadCreateViewBag(); return View("Create",model); }
public ActionResult Edit(Department model) { model.ActionOperationType = EActionOperationType.Edit; if (ModelState.IsValid) { DepartmentService service = new DepartmentService(); service.Update(model); return RedirectToAction("Index"); } this.LoadEditViewBag(model); return View("Create",model); }
private void LoadEditViewBag(Department model) { OrgChartService orgchartService = new OrgChartService(); ViewBag.OrgChartId = new SelectList(orgchartService.Query(p => p.IsActive=="1"), "Id", "Name",model.OrgChartId); }