Example #1
0
        public ActionResult GetReturnExchangeList()
        {
            if (!AppData.IsManagerLogin)
            {
                return(Json(new { success = false, msg = "您未登录后台或会话已过期" }));
            }
            if (PrivilegeBLL.HasNotPrivilege(AppData.SessionUserID, 13))
            {
                return(Json(new { success = false, msg = "您没有执行该操作的权限" }));
            }

            Validation validation = new Validation();
            int        page       = validation.GetInt("page", defaultValue: 1);
            int        pageSize   = validation.GetInt("pageSize", defaultValue: 10);
            string     orderCode  = validation.Get("orderCode");
            string     userName   = validation.Get("userName");
            DateTime   dtFrom     = validation.GetDateTime("dtFrom");
            DateTime   dtTo       = validation.GetDateTime("dtTo");

            DateTime?addTimeFrom = dtFrom == DateTime.MinValue ? null : (DateTime?)dtFrom;
            DateTime?addTimeTo   = dtFrom == DateTime.MinValue ? null : (DateTime?)dtTo;

            ExchangeBLL exchangeBLL = new ExchangeBLL();

            int total;
            var data = exchangeBLL.GetExchange(page, pageSize, out total, orderCode: orderCode, userName: userName, addTimeFrom: addTimeFrom, addTimeTo: addTimeTo);

            return(Json(new
            {
                success = true,
                data = data,
                total = total
            }));
        }
Example #2
0
        public ActionResult GetExchange(int page, int pageSize)
        {
            UserObj user = AppData.SessionUser;

            if (user == null)
            {
                return(Json(new { success = false, msg = "您还未登录" }));
            }

            ExchangeBLL exchangeBLL = new ExchangeBLL();

            int total;

            var data = exchangeBLL.GetExchange(page, pageSize, out total, user.UserID);

            return(Json(new { success = true, total = total, data = data }));
        }
Example #3
0
        public ActionResult DeleteReturnExchange(int id)
        {
            if (!AppData.IsManagerLogin)
            {
                return(Json(new { success = false, msg = "您未登录后台或会话已过期" }));
            }
            if (PrivilegeBLL.HasNotPrivilege(AppData.SessionUserID, 2001))
            {
                return(Json(new { success = false, msg = "您没有执行该操作的权限" }));
            }

            ExchangeBLL exchangeBLL = new ExchangeBLL();

            exchangeBLL.DeleteExchange(id);
            exchangeBLL.SubmitChanges();

            return(Json(new { success = true }));
        }
Example #4
0
        public ActionResult UserExchange(int id)
        {
            UserObj user = AppData.SessionUser;

            if (user == null)
            {
                return(Redirect("/Login.html"));
            }

            ExchangeBLL exchangeBLL  = new ExchangeBLL();
            var         exchangeInfo = exchangeBLL.GetExchangeByID(id);

            if (exchangeInfo == null)
            {
                return(Redirect("/Error/2.html"));
            }

            OrderBLL   orderBLL   = new OrderBLL();
            ProductBLL productBLL = new ProductBLL();
            AreaBLL    areaBLL    = new AreaBLL();

            OrderObj orderObj = orderBLL.GetOrderByID(exchangeInfo.OrderID);

            if (orderObj == null || user.UserID != orderObj.UserID)
            {
                return(Redirect("/Error/2.html"));
            }

            ViewBag.returnProduct = productBLL.GetProduct(exchangeInfo.ReturnProductID);


            if (exchangeInfo.ExchangeProductID != 0)
            {
                ViewBag.exchangeProduct = productBLL.GetProduct(exchangeInfo.ExchangeProductID);
            }

            ViewBag.exchangeInfo = exchangeInfo;
            ViewBag.order        = orderObj;
            ViewBag.area         = areaBLL.GetAreaByRetionID(exchangeInfo.RegionID);

            return(View());
        }
Example #5
0
        public ActionResult ViewReturnExchange(int id)
        {
            if (!AppData.IsManagerLogin)
            {
                return(Redirect("/Manage/Error/1.html"));
            }
            if (PrivilegeBLL.HasNotPrivilege(AppData.SessionUserID, 20))
            {
                return(Redirect("/Manage/Error/2.html"));
            }

            ExchangeBLL exchangeBLL  = new ExchangeBLL();
            var         exchangeInfo = exchangeBLL.GetExchangeByID(id);

            UserBLL    userBLL    = new UserBLL();
            OrderBLL   orderBLL   = new OrderBLL();
            ProductBLL productBLL = new ProductBLL();
            AreaBLL    areaBLL    = new AreaBLL();
            OrderObj   orderObj   = orderBLL.GetOrderByID(exchangeInfo.OrderID);

            ViewBag.returnProduct = productBLL.GetProduct(exchangeInfo.ReturnProductID);


            if (exchangeInfo.ExchangeProductID != 0)
            {
                ViewBag.exchangeProduct = productBLL.GetProduct(exchangeInfo.ExchangeProductID);
            }

            ViewBag.exchangeInfo = exchangeInfo;
            ViewBag.order        = orderObj;
            ViewBag.userInfo     = userBLL.GetUserByID(orderObj.UserID);
            ViewBag.userInfo     = userBLL.GetUserByID(orderObj.UserID);
            ViewBag.area         = areaBLL.GetAreaByRetionID(exchangeInfo.RegionID);

            return(View());
        }