/// <summary>
        /// 加载OptionalAccessories所有信息
        /// </summary>
        /// <param name="sysNo"></param>
        /// <returns></returns>
        public OptionalAccessoriesInfo Load(int?sysNo)
        {
            OptionalAccessoriesInfo info = _processor.Load(sysNo);

            if (info != null && info.Items != null && info.Items.Count > 0)
            {
                foreach (OptionalAccessoriesItem item in info.Items)
                {
                    ProductInfo product = ExternalDomainBroker.GetProductInfo(item.ProductSysNo.Value);

                    VendorBasicInfo vendor = new VendorBasicInfo();
                    if (product != null && product.Merchant != null)
                    {
                        vendor
                            = ExternalDomainBroker.GetVendorBasicInfoBySysNo(product.Merchant.SysNo.Value);
                    }

                    item.MerchantName = vendor != null && !string.IsNullOrEmpty(vendor.VendorID)
                        ? (vendor.VendorType == VendorType.IPP
                        ? ResouceManager.GetMessageString("MKT.Promotion.Combo", "Combo_NeweggMerchant")
                        : product.Merchant.MerchantName)
                        : "";
                    item.MerchantSysNo       = product.Merchant != null ? product.Merchant.MerchantID : null;
                    item.ProductID           = product.ProductID;
                    item.ProductName         = product.ProductName;
                    item.ProductPoint        = product.ProductPriceInfo.Point;
                    item.ProductCurrentPrice = product.ProductPriceInfo.CurrentPrice;
                    item.ProductUnitCost     = product.ProductPriceInfo.UnitCost;
                }
            }
            return(info);
        }
예제 #2
0
파일: StoreDA.cs 프로젝트: sanlonezhang/ql
        /// <summary>
        /// 创建商家
        /// </summary>
        /// <param name="vendorBasicInfo">商家基本信息</param>
        public static void CreateVendor(VendorBasicInfo vendorBasicInfo)
        {
            var cmd = DataCommandManager.CreateCustomDataCommandFromConfig("CreateVendor");

            cmd.SetParameterValue <VendorBasicInfo>(vendorBasicInfo);
            cmd.ExecuteNonQuery();
        }
예제 #3
0
        public static VendorBasicInfo ConvertStoreBasicToIPP3Vendor(StoreBasicInfo info)
        {
            var vendorBasicInfo = new VendorBasicInfo();

            //vendorBasicInfo.VendorID = info.SellerSysNo.Value.ToString();
            vendorBasicInfo.SellerID          = info.SellerSysNo.Value.ToString();
            vendorBasicInfo.VendorNameLocal   = info.Name;
            vendorBasicInfo.VendorStatus      = VendorStatus.Available;
            vendorBasicInfo.VendorType        = VendorType.VendorPortal;
            vendorBasicInfo.ConsignFlag       = VendorConsignFlag.Sell;
            vendorBasicInfo.VendorIsCooperate = VendorIsCooperate.No;
            return(vendorBasicInfo);
        }
예제 #4
0
        public ActionResult AjaxSellerRegister()
        {
            var vendorBasicInfo = new VendorBasicInfo();

            this.TryUpdateModel <VendorBasicInfo>(vendorBasicInfo);
            if (CookieHelper.GetCookie <String>("VerifyCode").ToLower() == vendorBasicInfo.ValidatedCode.ToLower())
            {
                if (string.IsNullOrEmpty(vendorBasicInfo.VendorName))
                {
                    return(Json(new JsonResult()
                    {
                        ContentType = "f", Data = "商家名称不能为空"
                    }, JsonRequestBehavior.AllowGet));
                }
                if (vendorBasicInfo.VendorName.Trim().Length > 100)
                {
                    return(Json(new JsonResult()
                    {
                        ContentType = "f", Data = "商家名称长度不能超过100"
                    }, JsonRequestBehavior.AllowGet));
                }
                if (vendorBasicInfo.EnglishName.Trim().Length > 100)
                {
                    return(Json(new JsonResult()
                    {
                        ContentType = "f", Data = "商家英文名称长度不能超过100"
                    }, JsonRequestBehavior.AllowGet));
                }
                if (StoreFacade.CheckExistsVendor(vendorBasicInfo.VendorName))
                {
                    return(Json(new JsonResult()
                    {
                        ContentType = "f", Data = "该商家名称已存在,如果您已经申请,请耐心等待,我们将尽快与您联系"
                    }, JsonRequestBehavior.AllowGet));
                }
                StoreFacade.CreateVendor(vendorBasicInfo);
                return(Json(new JsonResult()
                {
                    ContentType = "s", Data = "申请成功,请耐心等待,我们将尽快与您联系"
                }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new JsonResult()
            {
                ContentType = "y", Data = "验证码不正确"
            }, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
        public static VendorBasicInfo LoadVendorInfo(int vendorSysNo)
        {
            VendorBasicInfo vendorInfo = null;
            DataCommand     cmd        = DataCommandManager.GetDataCommand("LoadVendorInfo");

            cmd.SetParameterValue("@VendorSysNo", vendorSysNo);
            DataSet ds = cmd.ExecuteDataSet();

            if (ds != null && ds.Tables != null)
            {
                if (ds.Tables.Count > 0)
                {
                    vendorInfo = DataMapper.GetEntity <VendorBasicInfo>(ds.Tables[0].Rows[0]);
                }
                if (vendorInfo != null && ds.Tables.Count > 1)
                {
                    vendorInfo.ExtendedInfo = DataMapper.GetEntity <VendorExtendInfo>(ds.Tables[1].Rows[0]);
                }
            }
            return(vendorInfo);
        }
예제 #6
0
        private static void PreCheckCreatePO(PurchaseOrderInfo poInfo)
        {
            if (poInfo == null)
            {
                throw new BusinessException(L("采购单不能为空!"));
            }
            if (poInfo.VendorInfo == null || string.IsNullOrWhiteSpace(poInfo.VendorInfo.VendorID))
            {
                throw new BusinessException(L("采购单商家信息不能为空!"));
            }
            if (poInfo.POItems == null || poInfo.POItems.Count <= 0)
            {
                throw new BusinessException(L("请添加需要采购的商品!"));
            }
            if (poInfo.PurchaseOrderBasicInfo.ETATimeInfo == null || !poInfo.PurchaseOrderBasicInfo.ETATimeInfo.ETATime.HasValue &&
                poInfo.PurchaseOrderBasicInfo.ETATimeInfo.ETATime.Value.CompareTo(DateTime.Today) < 0)
            {
                throw new BusinessException(L("预计到货时间不能小于当前时间 !"));
            }

            var repeatItem = from i in poInfo.POItems
                             group i by new
            {
                i.ProductSysNo,
                i.ProductID
            } into g
            where g.Count() > 1
            select g;

            if (repeatItem.Count() > 0)
            {
                string result = string.Empty;
                foreach (var item in repeatItem)
                {
                    result += item.Key.ProductID + ",";
                }
                result = result.TrimEnd(',');
                throw new BusinessException(L("采购单中有重复的商品,商品的ID是:{0} !", result));
            }

            if (!poInfo.PurchaseOrderBasicInfo.StockInfo.SysNo.HasValue)
            {
                throw new BusinessException(L("入库仓库不能为空!"));
            }

            if (!poInfo.PurchaseOrderBasicInfo.PurchaseOrderType.HasValue)
            {
                throw new BusinessException(L("必须选择采购单的类型!"));
            }

            if (poInfo.PurchaseOrderBasicInfo.MemoInfo != null &&
                !string.IsNullOrWhiteSpace(poInfo.PurchaseOrderBasicInfo.MemoInfo.Memo))
            {
                if (poInfo.PurchaseOrderBasicInfo.MemoInfo.Memo.Length > 200)
                {
                    throw new BusinessException(L("备忘录的输入数据不能超过200个字符!"));
                }
            }
            if (poInfo.PurchaseOrderBasicInfo.MemoInfo != null &&
                !string.IsNullOrWhiteSpace(poInfo.PurchaseOrderBasicInfo.MemoInfo.InStockMemo))
            {
                if (poInfo.PurchaseOrderBasicInfo.MemoInfo.InStockMemo.Length > 200)
                {
                    throw new BusinessException(L("入库备注输入数据不能超过200个字符!"));
                }
            }
            poInfo.POItems.ForEach(x =>
            {
                if (poInfo.PurchaseOrderBasicInfo.PurchaseOrderType == PurchaseOrderType.Normal && x.PurchaseQty <= 0)
                {
                    throw new BusinessException(L("正常采购单的采购数量要大于0!"));
                }
                if (poInfo.PurchaseOrderBasicInfo.PurchaseOrderType == PurchaseOrderType.Negative && x.PurchaseQty >= 0)
                {
                    throw new BusinessException(L("负采购单的采购数量要小于0!"));
                }
            });

            // 如果供应商是Invalid状态,不允许新建PO单
            VendorBasicInfo getVendorInfo = StoreService.LoadVendorInfo(int.Parse(poInfo.VendorInfo.VendorID));

            if (null != getVendorInfo)
            {
                if (getVendorInfo.HoldMark.HasValue && getVendorInfo.HoldMark.Value)
                {
                    throw new BusinessException(L("商家已经被锁定,不允许创建采购单!"));
                }
                // 如果供应商是Invalid状态,不允许新建PO单
                if (getVendorInfo.VendorStatus != VendorStatus.Available)
                {
                    throw new BusinessException(L("商家是不可用状态,不允许创建采购单!"));
                }
                //采购单代销属性从供应商上取得
                poInfo.PurchaseOrderBasicInfo.ConsignFlag = (PurchaseOrderConsignFlag)((int)getVendorInfo.ConsignFlag.Value);
                //if ((int)getVendorInfo.ConsignFlag != (int)poInfo.PurchaseOrderBasicInfo.ConsignFlag)
                //{
                //    throw new BusinessException(L("非代销属性的商家不允许创建采购单!"));
                //}
            }
        }
예제 #7
0
 /// <summary>
 /// 创建商家
 /// </summary>
 /// <param name="vendorBasicInfo">商家基本信息</param>
 public static void CreateVendor(VendorBasicInfo vendorBasicInfo)
 {
     StoreDA.CreateVendor(vendorBasicInfo);
 }