Methodize status message handling

This commit is contained in:
2015-10-10 22:42:38 -04:00
parent 6482955b3c
commit 22e4089fba
10 changed files with 71 additions and 66 deletions
+21
View File
@@ -108,5 +108,26 @@ namespace MileageTraker.Web.Controllers
select msg;
return errorList;
}
protected enum StatusType
{
Info,
Success,
Error
}
protected void SetStatusMessage(string msg, StatusType statusType = StatusType.Info)
{
TempData["StatusMessage"] = msg;
switch (statusType)
{
case StatusType.Success:
TempData["StatusMessage-Type"] = "alert-success";
break;
case StatusType.Error:
TempData["StatusMessage-Type"] = "alert-error";
break;
}
}
}
}