// // GET: /Agent/Edit public ActionResult Edit(int id) { var model = new AgentEditViewModel { existAgent = AgentBUS.GetItem(id), agentStates = AgentStateBUS.GetList() }; return View(model); }
public ActionResult Edit(AgentEditViewModel obj) { bool bSuccess = AgentBUS.Update(obj.existAgent); if (bSuccess == true) { return RedirectToAction("Browse"); } else { ViewData["message"] = "There is an error!..."; obj.agentStates = AgentStateBUS.GetList(); return View(obj); } }