public ActionResult Create(ReportViewModel reportViewModel)
        {
            if (!ModelState.IsValid)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;

                return PartialView("_ValidationSummary", reportViewModel);
            }

            var report = Mapper.Map<Report>(reportViewModel);
            var savedRecords = _reportsContext.SaveChanges();
            EnsureThereIsOnlyOneDefaultReport(report);

            return View("ReportTableItem", Mapper.Map<ReportViewModel>(report));
        }
        public ActionResult Update(int id, ReportViewModel reportViewModel)
        {
            var report = Mapper.Map<Report>(reportViewModel);
            var savedItems = _reportsContext.SaveChanges();
            EnsureThereIsOnlyOneDefaultReport(report);
            if (User.IsInRole("Administrator"))
            {
                ViewBag.CanAddReports = true;
            }

            return View(
                savedItems != 0
                ? "ReportTableItem"
                : "Edit",
                Mapper.Map<ReportViewModel>(report));
        }