예제 #1
0
        public ActionResult Damaged()
        {
            ViewBag.Wares        = SystemBusiness.BaseBusiness.GetWareHouses(CurrentUser.ClientID);
            ViewBag.DamagedCount = ShoppingCartBusiness.GetShoppingCartCount(EnumDocType.BS, CurrentUser.UserID);

            return(View());
        }
예제 #2
0
        public ActionResult CreateDamaged(string id)
        {
            var ware = SystemBusiness.BaseBusiness.GetWareHouses(CurrentUser.ClientID);

            ViewBag.guid  = CurrentUser.UserID;
            ViewBag.Ware  = ware;
            ViewBag.Items = ShoppingCartBusiness.GetShoppingCart(EnumDocType.BS, CurrentUser.UserID, CurrentUser.UserID);
            return(View());
        }
예제 #3
0
        public ActionResult ConfirmPurchase(string id)
        {
            var wares = SystemBusiness.BaseBusiness.GetWareHouses(CurrentUser.ClientID);

            ViewBag.Ware  = wares;
            ViewBag.Items = ShoppingCartBusiness.GetShoppingCart(EnumDocType.RK, CurrentUser.UserID, CurrentUser.UserID);
            ViewBag.guid  = CurrentUser.UserID;
            return(View());
        }
예제 #4
0
        public ActionResult Purchases()
        {
            ViewBag.Title = "采购管理";
            ViewBag.Type  = (int)EnumSearchType.All;
            ViewBag.Wares = SystemBusiness.BaseBusiness.GetWareHouses(CurrentUser.ClientID);
            int purchasesCount = ShoppingCartBusiness.GetShoppingCartCount(EnumDocType.RK, CurrentUser.UserID);

            ViewBag.PurchasesCount = purchasesCount;
            return(View("Purchases"));
        }
예제 #5
0
        public JsonResult UpdateCartBatch(string autoid, string batch)
        {
            var bl = ShoppingCartBusiness.UpdateCartBatch(autoid, batch, CurrentUser.UserID);

            JsonDictionary.Add("status", bl);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
예제 #6
0
        /// <summary>
        /// 加入到购物车
        /// </summary>
        /// <param name="productid"></param>
        /// <param name="detailsid"></param>
        /// <param name="quantity"></param>
        /// <param name="ordertype"></param>
        /// <returns></returns>
        public JsonResult AddShoppingCart(string productid, string detailsid, int quantity, string unitid, int isBigUnit, EnumDocType ordertype, string remark = "", string guid = "")
        {
            var bl = ShoppingCartBusiness.AddShoppingCart(productid, detailsid, quantity, unitid, isBigUnit, ordertype, remark, guid, CurrentUser.UserID, OperateIP);

            JsonDictionary.Add("Status", bl);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
예제 #7
0
        public JsonResult UpdateCartPrice(string autoid, decimal price)
        {
            var bl = ShoppingCartBusiness.UpdateCartPrice(autoid, price, CurrentUser.UserID);

            JsonDictionary.Add("Status", bl);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
예제 #8
0
        /// <summary>
        /// 删除购物车产品
        /// </summary>
        /// <param name="autoid"></param>
        /// <returns></returns>
        public JsonResult DeleteCart(string autoid)
        {
            var bl = ShoppingCartBusiness.DeleteCart(autoid, CurrentUser.UserID);

            JsonDictionary.Add("Status", bl);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
예제 #9
0
        /// <summary>
        /// 编辑购物车产品数量
        /// </summary>
        /// <param name="autoid"></param>
        /// <param name="quantity"></param>
        /// <returns></returns>
        public JsonResult UpdateCartQuantity(string autoid, int quantity)
        {
            var bl = ShoppingCartBusiness.UpdateCartQuantity(autoid, quantity, CurrentUser.UserID);

            JsonDictionary.Add("Status", bl);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        private void Dispose(bool dispose)
        {
            if (dispose)
            {
                if (_userBusiness != null)
                {
                    _userBusiness = null;
                }

                if (_categoryBusiness != null)
                {
                    _categoryBusiness = null;
                }

                if (_imageBusiness != null)
                {
                    _imageBusiness = null;
                }

                if (_orderBusiness != null)
                {
                    _orderBusiness = null;
                }

                if (_orderedProductBusiness != null)
                {
                    _orderedProductBusiness = null;
                }

                if (_productBusiness != null)
                {
                    _productBusiness = null;
                }

                if (_shoppingCartBusiness != null)
                {
                    _shoppingCartBusiness = null;
                }

                if (_repositoryContext != null)
                {
                    _repositoryContext.Dispose();
                    _repositoryContext = null;
                }

                if (_instance != null)
                {
                    _instance = null;
                }
            }
        }
예제 #11
0
        /// <summary>
        /// 编辑购物车产品数量
        /// </summary>
        /// <param name="autoid"></param>
        /// <param name="quantity"></param>
        /// <returns></returns>
        public JsonResult UpdateCartQuantity(string autoid, double quantity, string guid)
        {
            if (string.IsNullOrEmpty(guid))
            {
                guid = CurrentUser.UserID;
            }
            var bl = ShoppingCartBusiness.UpdateCartQuantity(autoid, quantity, CurrentUser.UserID);

            JsonDictionary.Add("Status", bl);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
예제 #12
0
        /// <summary>
        /// 获取购物车产品数
        /// </summary>
        /// <param name="ordertype"></param>
        /// <returns></returns>
        public JsonResult GetShoppingCartCount(EnumDocType ordertype, string guid = "")
        {
            if (string.IsNullOrEmpty(guid))
            {
                guid = CurrentUser.UserID;
            }
            var count = ShoppingCartBusiness.GetShoppingCartCount(ordertype, guid);

            JsonDictionary.Add("Quantity", count);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
예제 #13
0
        public ActionResult CreateDamaged(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(Redirect("/Stock/Damaged"));
            }
            var ware = SystemBusiness.BaseBusiness.GetWareByID(id, CurrentUser.ClientID);

            if (ware == null || string.IsNullOrEmpty(ware.WareID))
            {
                return(Redirect("/Stock/Damaged"));
            }
            ViewBag.Ware  = ware;
            ViewBag.Items = ShoppingCartBusiness.GetShoppingCart(EnumDocType.BS, ware.WareID, CurrentUser.UserID);
            return(View());
        }
예제 #14
0
        /// <summary>
        /// 加入到购物车
        /// </summary>
        /// <param name="productid"></param>
        /// <param name="detailsid"></param>
        /// <param name="quantity"></param>
        /// <param name="ordertype"></param>
        /// <returns></returns>
        public JsonResult AddShoppingCart(EnumDocType ordertype, string productid, string detailsid, decimal quantity, string unitid, string depotid, string taskid, string remark = "", string guid = "", string attrid = "")
        {
            if (string.IsNullOrEmpty(guid))
            {
                guid = CurrentUser.UserID;
            }
            var bl = ShoppingCartBusiness.AddShoppingCart(ordertype, productid, detailsid, quantity, unitid, depotid, taskid,
                                                          remark, guid, attrid, CurrentUser.UserID, OperateIP);

            JsonDictionary.Add("Status", bl);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
예제 #15
0
        /// <summary>
        /// 采购单确认页面
        /// </summary>
        /// <returns></returns>
        public ActionResult ConfirmPurchase(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(Redirect("/Purchase/MyPurchase"));
            }
            var ware = SystemBusiness.BaseBusiness.GetWareByID(id, CurrentUser.ClientID);

            if (ware == null || string.IsNullOrEmpty(ware.WareID))
            {
                return(Redirect("/Purchase/MyPurchase"));
            }
            ViewBag.Providers = StockBusiness.BaseBusiness.GetProviders(CurrentUser.ClientID);
            ViewBag.Ware      = ware;
            ViewBag.Items     = ShoppingCartBusiness.GetShoppingCart(EnumDocType.RK, ware.WareID, CurrentUser.UserID);
            return(View());
        }
예제 #16
0
        public JsonResult AddShoppingCartBatchIn(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            var model = serializer.Deserialize <ShoppingCartProduct>(entity);

            var bl = false;

            foreach (var product in model.Products)
            {
                if (ShoppingCartBusiness.AddShoppingCartBatchIn(product.ProductID, product.ProductDetailID, 1, model.type, product.SaleAttrValueString, model.guid, CurrentUser.UserID, OperateIP))
                {
                    bl = true;
                }
            }
            JsonDictionary.Add("status", bl);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
예제 #17
0
 public ShoppingCartBusinessTest()
 {
     _mockShoppingCartRepository = new Mock <IShoppingCartRepository>();
     _mockCustomerBusiness       = new Mock <ICustormeBusiness>();
     _target = new ShoppingCartBusiness(_mockShoppingCartRepository.Object, _mockCustomerBusiness.Object);
 }
예제 #18
0
 public ShoppingCartController(ShoppingCartBusiness ShoppingCartBusiness)
 {
     this._ShoppingCartBusiness = ShoppingCartBusiness;
 }