public ActionResult EditAnnualAgreement(SchoolAnnualAgreementRequest request) { var actionParam = Request["actionParam"]; if (ModelState.IsValid) { if (request.SchoolAnnualAgreement.Id > 0) { if (actionParam == "S") { var updateResponse = SchoolService.UpdateSchoolAnnualAgreement(request); if (updateResponse.Result == Result.Failed) { ErrorMessage = updateResponse.Message; } } else { var deleteResponse = SchoolService.DeleteSchoolAnnualAgreement(request); if (deleteResponse.Result == Result.Failed) { ErrorMessage = deleteResponse.Message; } } } else { var createResponse = SchoolService.CreateSchoolAnnualAgreement(request); if (createResponse.Result == Result.Failed) { ErrorMessage = createResponse.Message; } } } return(RedirectToAction("Edit", "School", new { id = request.SchoolId })); }