// GET: BusinessAreas/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BusinessAreaViewModel businessArea = Mapper.Map <BusinessAreaViewModel>(businessAreaService.Get(id.Value)); if (businessArea == null) { return(HttpNotFound()); } return(View(businessArea)); }
// GET: BusinessAreas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BusinessAreaViewModel businessArea = Mapper.Map <BusinessAreaViewModel>(businessAreaService.Get(id.Value)); if (businessArea == null) { return(HttpNotFound()); } ViewBag.MainAreaId = new SelectList(businessAreaService.GetAll(), "Id", "Name", businessArea.MainAreaId); return(View(businessArea)); }