public ActionResult Orders(int permissionLevel = 0)
        {
            AllOrdersModel orders = new AllOrdersModel();
            OrdersDAL      dal    = new OrdersDAL();

            orders.User = Session["User"] as UserInfoModel;

            //admin
            if (permissionLevel == 1 || orders.User.IsAdmin)
            {
                orders.DeliOrders   = dal.GetAllDeliOrders();
                orders.BakeryOrders = dal.GetAllBakeryOrders();
            }
            //bakery
            else if (permissionLevel == 2 || orders.User.IsBakery)
            {
                orders.BakeryOrders = dal.GetAllBakeryOrders();
            }
            //deli
            else if (permissionLevel == 3 || orders.User.IsDeli)
            {
                orders.DeliOrders = dal.GetAllDeliOrders();
            }
            return(View("Orders", orders));
        }
示例#2
0
        public IActionResult ViewOrders()
        {
            AllOrdersModel allOrdersModel = new AllOrdersModel();

            //to do
            //get all orders from order service

            return(View(allOrdersModel));
        }