public ActionResult EditMaintenanceGroup(string submitButton, MaintenanceGroupIdentificationModel model) { // Was action RETURN? var mainFactory = new MaintenanceGroupFactory(); var auditFactory = new AuditFactory(); if (submitButton.Equals("RETURN")) { return(RedirectToAction("Index", new { rtn = "true" })); } if (submitButton.Equals("ACTIVATE")) { mainFactory.Activate(model.CustomerId); auditFactory.ModifiedBy("CustomerProfile", model.CustomerId, WebSecurity.CurrentUserId); return(RedirectToAction("EditMaintenanceGroup", new { customerId = model.CustomerId })); } if (submitButton.Equals("INACTIVATE")) { mainFactory.Inactivate(model.CustomerId); auditFactory.ModifiedBy("CustomerProfile", model.CustomerId, WebSecurity.CurrentUserId); return(RedirectToAction("EditMaintenanceGroup", new { customerId = model.CustomerId })); } // Save values if (!ModelState.IsValid) { model = mainFactory.GetIdentificationModel(model.CustomerId, model); return(View(model)); } mainFactory.SetIdentificationModel(model.CustomerId, model); auditFactory.ModifiedBy("CustomerProfile", model.CustomerId, WebSecurity.CurrentUserId); model = mainFactory.GetIdentificationModel(model.CustomerId, model); if (submitButton.Equals("SAVE")) { // Saved and stay on same page. return(View(model)); } // Saved but move to next page. return(RedirectToAction("EditMaintenanceGroupCustomers", new { customerId = model.CustomerId })); }