Admin auth functionally complete

This commit is contained in:
2012-12-31 14:49:41 -05:00
parent 8739251066
commit 2ec2a752cd
30 changed files with 260 additions and 79 deletions
+11 -2
View File
@@ -45,7 +45,7 @@ namespace MileageTraker.Web.Controllers
[HttpParamAction]
[HttpPost]
[ActionLog]
public ViewResult Confirm(CreateLogViewModel model)
public ActionResult Confirm(CreateLogViewModel model)
{
if (ModelState.IsValid)
{
@@ -59,7 +59,16 @@ namespace MileageTraker.Web.Controllers
log.UserHostAddress = HttpContext.Request.UserHostAddress;
log.UserAgent = HttpContext.Request.UserAgent;
DataService.AddLog(log);
return View("Success", model);
TempData["StatusMessage-Type"] = "alert-success";
TempData["StatusMessage"] =
@"You've successfully created an entry
for <strong>" + model.EmployeeName + @"</strong>
traveling to <strong>" + model.CityName + @"</strong>
on <strong>" + model.Date.ToShortDateString() + @"</strong>
in Vehicle Id <strong>" + model.VehicleId + @"</strong>
ending in <strong>" + model.EndOdometer + @"</strong>
miles on the odometer.";
return RedirectToAction("Index");
}
return View("Index", model);