Methodize status message handling
This commit is contained in:
@@ -17,7 +17,7 @@ namespace MileageTraker.Web.Controllers
|
||||
var purposetype = DataService.FindPurposeType(id);
|
||||
if (purposetype == null)
|
||||
{
|
||||
TempData["StatusMessage"] = "Purpose " + id + " not found";
|
||||
SetStatusMessage("Purpose " + id + " not found");
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(purposetype);
|
||||
@@ -37,7 +37,7 @@ namespace MileageTraker.Web.Controllers
|
||||
{
|
||||
DataService.AddPurposeType(purposetype);
|
||||
|
||||
TempData["StatusMessage"] = "Purpose " + purposetype.Purpose + " created";
|
||||
SetStatusMessage("Purpose " + purposetype.Purpose + " created");
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace MileageTraker.Web.Controllers
|
||||
var purposeType = DataService.FindPurposeType(id);
|
||||
if (purposeType == null)
|
||||
{
|
||||
TempData["StatusMessage"] = "Purpose " + id + " not found";
|
||||
SetStatusMessage("Purpose " + id + " not found");
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(purposeType);
|
||||
@@ -62,7 +62,7 @@ namespace MileageTraker.Web.Controllers
|
||||
{
|
||||
DataService.UpdatePurposeType(purposeType);
|
||||
|
||||
TempData["StatusMessage"] = "Changes to Purpose " + purposeType.Purpose + " saved";
|
||||
SetStatusMessage("Changes to Purpose " + purposeType.Purpose + " saved");
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(purposeType);
|
||||
|
||||
Reference in New Issue
Block a user