public ActionResult Index() { var currentUser = UserAccountHelper.GetUser(HttpContext.User.Identity.Name); ViewBag.HubName = currentUser.DefaultHub != null?_hubService.FindById(currentUser.DefaultHub ?? 1).Name : ""; ViewBag.HubID = currentUser.DefaultHub ?? 0; return(View()); }
public JsonResult RecentDispatchAllocation() { var currentUser = UserAccountHelper.GetUser(HttpContext.User.Identity.Name); if (currentUser.DefaultHub != null) { var result = _dispatchAllocationService.FindBy(m => m.HubID == currentUser.DefaultHub).OrderByDescending(m => m.DispatchAllocationID); var dispached = GetDispatchAllocation(result); return(Json(dispached, JsonRequestBehavior.AllowGet)); } return(Json(null, JsonRequestBehavior.AllowGet)); }