示例#1
0
        public ActionResult EditProfile()
        {
            WorkWithUsers WWU        = new WorkWithUsers();
            Users         ActiveUser = WWU.GetUserByName(User.Identity.Name);

            return(View(ActiveUser));
        }
示例#2
0
        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));
        }
示例#3
0
        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 }));
        }