public ActionResult EditProfile() { WorkWithUsers WWU = new WorkWithUsers(); Users ActiveUser = WWU.GetUserByName(User.Identity.Name); return(View(ActiveUser)); }
public ActionResult ShowOrders(string UserID) { OrdersDataModel ViewData = (OrdersDataModel)Session["ViewData"]; if (UserID == null) { WorkWithUsers WWU = new WorkWithUsers(); UserID = WWU.GetUserByName(User.Identity.Name).UserID; } if (ViewData == null) { ViewData = new OrdersDataModel(UserID); ViewData.SetActiveOrders(); } if (ViewData.ActiveUserID == null) { ViewData.ActiveUserID = UserID; } if (ViewData.DataToShow == "ActiveOrders") { ViewData.SetActiveOrders(); } if (ViewData.DataToShow == "OrdersHistory") { ViewData.SetOrdersHistory(); } if (ViewData.DataToShow == "IncomingOrders") { ViewData.SetUserIncomingOrders(); } Session["ViewData"] = ViewData; return(View(ViewData)); }
public ActionResult TabClick(int TabID) { WorkWithOrders WWOR = new WorkWithOrders(); WorkWithUsers WWU = new WorkWithUsers(); string ActiveUserID = WWU.GetUserByName(User.Identity.Name).UserID; OrdersDataModel ViewData = new OrdersDataModel(ActiveUserID); switch (TabID) { case 1: ViewData.SetOrdersHistory(); break; case 2: ViewData.SetActiveOrders(); break; case 3: ViewData.SetUserIncomingOrders(); break; } Session["ViewData"] = ViewData; return(RedirectToAction("ShowOrders", "Order", new { UserID = ActiveUserID })); }