public ActionResult DeleteConfirmed(int id)
        {
            ReportingGroup reportinggroup = db.ReportingGroups.Find(id);

            db.ReportingGroups.Remove(reportinggroup);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //
        // GET: /ReportingGroup/Delete/5

        public ActionResult Delete(int id = 0)
        {
            ReportingGroup reportinggroup = db.ReportingGroups.Find(id);

            if (reportinggroup == null)
            {
                return(HttpNotFound());
            }
            return(View(reportinggroup));
        }
 public ActionResult Edit(ReportingGroup reportinggroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(reportinggroup).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(reportinggroup));
 }
        public ActionResult Create(ReportingGroup reportinggroup)
        {
            if (ModelState.IsValid)
            {
                db.ReportingGroups.Add(reportinggroup);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(reportinggroup));
        }
Example #5
0
 /// <summary>
 /// Adds the Report-To header to each response.
 /// </summary>
 public static IServiceCollection AddReportTo(this IServiceCollection services, ReportingGroup group) => services.AddReportTo(new[] { group });