Methodize status message handling
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user