// GET: Admin/Report/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ReportViewModel model = new ReportViewModel(); model.ReportID = id ?? 0; model = model.GetReport(model); if (model == null) { return(HttpNotFound()); } model.RolesList = model.GetEditRoles(id ?? 0); model.ParamList = model.GetReportParams(id ?? 0); return(View(model)); }