public JsonResult AjaxGetProductSalesAreaInfo()
        {
            var queryFilter = SerializationUtility.JsonDeserialize2 <ProductQueryFilter>(this.Request["queryfilter[]"]);
            var data        = ProductMaintainService.GetProductSalesAreaInfoBySysNo(queryFilter);

            return(AjaxGridJson(data));
        }
        public JsonResult AjaxSaveProductBasicInfo()
        {
            string dataString = Request.Form["Data"];

            dataString = HttpUtility.UrlDecode(dataString);
            ProductMaintainBasicInfo data = ECommerce.Utility.SerializationUtility.JsonDeserialize2 <ProductMaintainBasicInfo>(dataString);

            SetBizEntityUserInfo(data, data.ProductGroupSysNo.HasValue && data.ProductGroupSysNo > 0 ? false : true);
            foreach (var item in data.SelectNormalProperties)
            {
                SetBizEntityUserInfo(item, true);
            }
            if (data.ProductGroupSysNo.HasValue && data.ProductGroupSysNo > 0)
            {
                ProductMaintainService.UpdateProductBasicInfoByProductGroupSysNo(data);
                return(new JsonResult()
                {
                    Data = data.ProductGroupSysNo.Value
                });
            }
            else
            {
                return(new JsonResult()
                {
                    Data = ProductMaintainService.CreateProductBasicInfo(data).ProductGroupSysNo.Value
                });
            }
        }
Esempio n. 3
0
        public ActionResult Query()
        {
            int currentSellerSysNo = ECommerce.Web.UserAuthHelper.GetCurrentUser().SellerSysNo;

            ViewBag.RootFrontProductCategory = ProductMaintainService.GetParentFrontProductCategory(currentSellerSysNo);

            return(View());
        }
        /// <summary>
        /// 获取商品备案信息
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxGetProductEntryInfo()
        {
            string sysNo = Request.Params["sysno"].Trim();

            return(new JsonResult()
            {
                Data = ProductMaintainService.GetProductEntryInfoByProductSysNo(int.Parse(sysNo))
            });
        }
        /// <summary>
        /// 获取末级分类
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxLoadLeafCategory()
        {
            string categoryCode = Request.Params["code"].Trim();

            return(new JsonResult()
            {
                Data = ProductMaintainService.GetFrontProductCategoryByParentCode(categoryCode)
            });
        }
        /// <summary>
        /// 获取所有C3
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxAllCategory3List()
        {
            string sysNo = Request.Params["sysno"].Trim();

            return(new JsonResult()
            {
                Data = ProductMaintainService.GetAllCategory3List(int.Parse(sysNo))
            });
        }
        /// <summary>
        /// 获取C3
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxCategory3List()
        {
            string sysNo = Request.Params["sysno"].Trim();
            var    user  = UserAuthHelper.GetCurrentUser();

            return(new JsonResult()
            {
                Data = ProductMaintainService.GetCategory3List(user.SellerSysNo, int.Parse(sysNo))
            });
        }
        /// <summary>
        /// 获取商品批号信息
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxGetBatchManagementInfo()
        {
            string sysNo = Request.Params["sysno"].Trim();
            var    data  = ProductMaintainService.GetProductBatchManagementInfo(int.Parse(sysNo));

            return(new JsonResult()
            {
                Data = data
            });
        }
        /// <summary>
        /// 查询备案信息
        /// </summary>
        /// <returns></returns>
        public ActionResult QueryProductEntryInfo()
        {
            ProductEntryInfoQueryFilter filter = BuildQueryFilterEntity <ProductEntryInfoQueryFilter>();
            var user = UserAuthHelper.GetCurrentUser();

            filter.SellerSysNo = user != null ? user.SellerSysNo : 0;
            var result = ProductMaintainService.QueryProductEntryInfo(filter);

            return(AjaxGridJson(result));
        }
Esempio n. 10
0
        /// <summary>
        /// 保存备案信息
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxSaveEntryInfo()
        {
            string dataString = Request.Form["Data"];

            dataString = HttpUtility.UrlDecode(dataString);
            ProductEntryInfo data = ECommerce.Utility.SerializationUtility.JsonDeserialize2 <ProductEntryInfo>(dataString);

            return(new JsonResult()
            {
                Data = ProductMaintainService.MaintainProductEntryInfo(data)
            });
        }
Esempio n. 11
0
        /// <summary>
        /// 批量作废商品
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxProductBatchAbandon()
        {
            string dataString = Request.Form["Data"];

            dataString = HttpUtility.UrlDecode(dataString);
            List <int> data = ECommerce.Utility.SerializationUtility.JsonDeserialize2 <List <int> >(dataString);

            return(new JsonResult()
            {
                Data = ProductMaintainService.ProductBatchAbandon(data)
            });
        }
Esempio n. 12
0
        /// <summary>
        /// 删除指定商品图片
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxDeleteProductImageBySysNo()
        {
            string dataString = Request.Form["Data"];

            dataString = HttpUtility.UrlDecode(dataString);
            List <int> data = ECommerce.Utility.SerializationUtility.JsonDeserialize2 <List <int> >(dataString);

            return(new JsonResult()
            {
                Data = ProductMaintainService.DeleteProductImageBySysNo(data)
            });
        }
Esempio n. 13
0
        static void Main(string[] args)
        {
            //初始化商家代理商品的数据,商家编号在appsetting的配置中
            //所有的代理级别都是原厂
            //init c3
            Console.WriteLine("init c3...");
            List <Nesoft.SellerPortal.Entity.Product.CategoryInfo> c1 = ProductMaintainService.GetAllCategory1List();
            List <Nesoft.SellerPortal.Entity.Product.CategoryInfo> c2 = new List <Nesoft.SellerPortal.Entity.Product.CategoryInfo>();
            List <Nesoft.SellerPortal.Entity.Product.CategoryInfo> c3 = new List <Nesoft.SellerPortal.Entity.Product.CategoryInfo>();

            c1.ForEach(p => c2.AddRange(ProductMaintainService.GetAllCategory2List(p.SysNo)));
            c2.ForEach(p => c3.AddRange(ProductMaintainService.GetAllCategory3List(p.SysNo)));
            Console.WriteLine("C3 total is : {0}", c3.Count);

            //init brand

            Console.WriteLine("init brand...");
            BrandQueryFilter filter = new BrandQueryFilter();

            filter.Status    = ValidStatus.Active;
            filter.PageIndex = 0;
            filter.PageSize  = 100000;

            var brands = CommonService.QueryBrandList(filter);

            Console.WriteLine("brand total is : {0}", brands.ResultList.Count);

            brands.ResultList.ForEach(b =>
            {
                c3.ForEach(c =>
                {
                    VendorAgentInfo agent = new VendorAgentInfo();
                    agent.C3SysNo         = c.SysNo;
                    agent.C3Name          = c.CategoryName;
                    //agent.C2SysNo = 10;
                    agent.AgentLevel = "原厂";
                    agent.BrandInfo  = new BrandInfo
                    {
                        SysNo          = b.SysNo,
                        BrandNameLocal = b.BrandNameLocal
                    };
                    agent.Status      = VendorAgentStatus.Draft;
                    agent.CompanyCode = "8601";

                    AppendToSeller(new List <VendorAgentInfo> {
                        agent
                    });
                });
            });

            Console.ReadKey();
        }
Esempio n. 14
0
        public JsonResult AjaxLoadLeafCategory()
        {
            List <FrontProductCategoryInfo> categories = new List <FrontProductCategoryInfo>();;

            string categoryCode = Request.Form["categoryCode"];

            if (categoryCode != null && categoryCode.Trim() != "0")
            {
                categories = ProductMaintainService.GetFrontProductCategoryByParentCode(categoryCode.Trim());
            }

            return(Json(categories));
        }
Esempio n. 15
0
        /// <summary>
        /// 获取单个商品维护信息
        /// </summary>
        /// <returns></returns>
        public PartialViewResult AjaxLoadEditProduct()
        {
            int productSysNo = 0;

            int.TryParse(Request["ProductSysNo"], out productSysNo);
            if (productSysNo == 0)
            {
                throw new ECommerce.Utility.BusinessException(LanguageHelper.GetText("请选择商品!"));
            }
            var user = UserAuthHelper.GetCurrentUser();

            return(PartialView("_ProductEdit", ProductMaintainService.GetSingleProductMaintainInfo(productSysNo, user.SellerSysNo)));
        }
Esempio n. 16
0
        /// <summary>
        /// 保存单个商品信息
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxSaveSingleProductInfo()
        {
            string dataString = Request.Form["Data"];

            dataString = HttpUtility.UrlDecode(dataString);
            ProductMaintainInfo data = ECommerce.Utility.SerializationUtility.JsonDeserialize2 <ProductMaintainInfo>(dataString);

            SetBizEntityUserInfo(data, true);

            return(new JsonResult()
            {
                Data = ProductMaintainService.UpdateSingleProductMaintainInfo(data)
            });
        }
Esempio n. 17
0
        /// <summary>
        /// 新增商品销售区域
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxSaveProductSalesAreaInfo()
        {
            string dataString = Request.Form["Data"];

            dataString = HttpUtility.UrlDecode(dataString);
            if (string.IsNullOrEmpty(dataString))
            {
                return(Json(new { Error = true, Message = LanguageHelper.GetText("Excel没有数据") }));
            }
            else
            {
                var              user         = UserAuthHelper.GetCurrentUser();
                string           ProductSysNo = Request.QueryString["ProductSysNo"];
                ProductQueryInfo productInfo  = ProductMaintainService.GetProductTitleByProductSysNo(Int32.Parse(ProductSysNo));

                List <AreaInfo>             data          = ECommerce.Utility.SerializationUtility.JsonDeserialize2 <List <AreaInfo> >(dataString);
                List <ProductSalesAreaInfo> SalesAreaList = new List <ProductSalesAreaInfo>();
                foreach (var item in data)
                {
                    if (!string.IsNullOrEmpty(item.CityName) && item.CitySysNo.HasValue && !string.IsNullOrEmpty(item.ProvinceName) && item.ProvinceSysNo.HasValue)
                    {
                        ProductSalesAreaInfo productSalesAreaInfo = new ProductSalesAreaInfo();
                        UserInfo             userInfo             = new UserInfo();
                        //仓库信息
                        StockInfo stock = new StockInfo();
                        stock.Status        = StockStatus.Actived;
                        stock.StockName     = item.StockName;
                        stock.SysNo         = item.SysNo;
                        stock.StockType     = TradeType.DirectMail;
                        stock.MerchantSysNo = 0;
                        //销售区域
                        productSalesAreaInfo.Stock    = stock;
                        productSalesAreaInfo.Province = item;
                        //商家信息
                        productSalesAreaInfo.CompanyCode  = user.CompanyCode;
                        productSalesAreaInfo.LanguageCode = user.LanguageCode;
                        userInfo.UserName = user.UserDisplayName;
                        productSalesAreaInfo.OperationUser = userInfo;
                        SalesAreaList.Add(productSalesAreaInfo);
                    }
                }

                ProductMaintainService.InsertProductSalesArea(productInfo, SalesAreaList);
                return(new JsonResult()
                {
                    Data = true
                });
            }
        }
Esempio n. 18
0
        /// <summary>
        /// 保存商品批号信息
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxSaveBatchManagementInfo()
        {
            string dataString = Request.Form["Data"];
            var    user       = UserAuthHelper.GetCurrentUser();

            dataString = HttpUtility.UrlDecode(dataString);
            List <ProductBatchManagementInfo> data = ECommerce.Utility.SerializationUtility.JsonDeserialize2 <List <ProductBatchManagementInfo> >(dataString);

            data[0].EidtUser = user.UserDisplayName;
            var Result = ProductMaintainService.UpdateIsBatch(data[0]);

            return(new JsonResult()
            {
                Data = Result
            });
        }
Esempio n. 19
0
        /// <summary>
        /// 保存价格信息
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxSavePriceInfo()
        {
            string dataString = Request.Form["Data"];

            dataString = HttpUtility.UrlDecode(dataString);
            List <ProductPriceInfo> data = ECommerce.Utility.SerializationUtility.JsonDeserialize2 <List <ProductPriceInfo> >(dataString);

            foreach (var item in data)
            {
                SetBizEntityUserInfo(item, true);
            }

            return(new JsonResult()
            {
                Data = ProductMaintainService.MaintainProductPriceInfo(data)
            });
        }
Esempio n. 20
0
        /// <summary>
        /// 提交备案申请
        /// </summary>
        /// <returns></returns>
        public JsonResult AjaxSubmitProductEntryAudit()
        {
            string dataString = Request.Form["Data"];

            dataString = HttpUtility.UrlDecode(dataString);
            ProductEntryInfo data = ECommerce.Utility.SerializationUtility.JsonDeserialize2 <ProductEntryInfo>(dataString);

            ProductMaintainService.MaintainProductEntryInfo(data);
            List <int> productSysNoList = new List <int>();

            productSysNoList.Add(data.ProductSysNo);

            return(new JsonResult()
            {
                Data = ProductMaintainService.BatchSubmitProductEntryAudit(productSysNoList)
            });
        }
Esempio n. 21
0
        public JsonResult AjaxBatchStatusChange()
        {
            List <int> sysNoList = new List <int>();

            string sysNoText  = Request.Form["SysNo"];
            string statusText = Request.Form["Status"];

            string[] array = sysNoText.Split(',');

            foreach (var item in array)
            {
                int sysNo = 0;
                if (int.TryParse(item, out sysNo))
                {
                    sysNoList.Add(sysNo);
                }
            }

            if (sysNoList.Count > 0)
            {
                if (statusText == "Offline")
                {
                    ProductMaintainService.ProductBatchOffline(sysNoList);
                }
                else if (statusText == "Online")
                {
                    ProductMaintainService.ProductBatchOnline(sysNoList);
                }
                else if (statusText == "Void")
                {
                    ProductMaintainService.ProductBatchAbandon(sysNoList);
                }
                else if (statusText == "OnlineNotShow")
                {
                    ProductMaintainService.ProductBatchOnlineNotShow(sysNoList);
                }
            }

            return(Json(1));
        }
Esempio n. 22
0
        public ActionResult AjaxQuery()
        {
            ProductQueryFilter queryFilter = BuildQueryFilterEntity <ProductQueryFilter>();

            int currentSellerSysNoValue = UserAuthHelper.GetCurrentUser().SellerSysNo;

            if (currentSellerSysNoValue > 0)
            {
                queryFilter.VendorSysNo = currentSellerSysNoValue.ToString();
            }

            if (queryFilter.CategorySysNo == "0")
            {
                queryFilter.CategorySysNo = string.Empty;
            }

            if (queryFilter.StatusCondition == -1)
            {
                queryFilter.StatusCondition = 0;
                queryFilter.Status          = string.Empty;
            }
            //假设我拿到的是类别的CategoryCode,我需要根据他的值“CategoryCode-层级数-CategorySysNo” 拿到对应的三级CategorySysNo字符列表
            if ((!string.IsNullOrWhiteSpace(queryFilter.CategoryCode)) && queryFilter.CategoryCode != "0")
            {
                string CategoryCode  = queryFilter.CategoryCode.Split('-')[0].Trim();
                string CategorySysNo = queryFilter.CategoryCode.Split('-')[2];
                string IsLeaf        = queryFilter.CategoryCode.Split('-')[3];
                switch (queryFilter.CategoryCode.Split('-')[1])
                {
                case "1":
                    if (IsLeaf == "0")
                    {
                        var CateGory2List_One = ProductMaintainService.GetFrontProductCategoryByParentCode(CategoryCode);
                        foreach (var CateGory2 in CateGory2List_One)
                        {
                            if (CateGory2.IsLeaf == CommonYesOrNo.Yes)
                            {
                                queryFilter.CategorySysNo += CateGory2.SysNo + ",";
                            }
                            var Category3List_One = ProductMaintainService.GetFrontProductCategoryByParentCode(CateGory2.CategoryCode);
                            foreach (var item in Category3List_One)
                            {
                                queryFilter.CategorySysNo += item.SysNo + ",";
                            }
                        }
                        //去掉最后余出来的“,”
                        if (!string.IsNullOrWhiteSpace(queryFilter.CategorySysNo))
                        {
                            int RemoveIndex_One = queryFilter.CategorySysNo.Length - 1;
                            queryFilter.CategorySysNo = queryFilter.CategorySysNo.Remove(RemoveIndex_One);
                        }
                        else
                        {
                            queryFilter.CategorySysNo = CategorySysNo;
                        }
                    }
                    else
                    {
                        queryFilter.CategorySysNo = CategorySysNo;
                    }

                    break;

                case "2":
                    if (IsLeaf == "0")
                    {
                        var Category3List_Two = ProductMaintainService.GetFrontProductCategoryByParentCode(CategoryCode);
                        foreach (var item in Category3List_Two)
                        {
                            queryFilter.CategorySysNo += item.SysNo + ",";
                        }
                        //去掉最后余出来的“,”
                        if (!string.IsNullOrWhiteSpace(queryFilter.CategorySysNo))
                        {
                            int RemoveIndex_One = queryFilter.CategorySysNo.Length - 1;
                            queryFilter.CategorySysNo = queryFilter.CategorySysNo.Remove(RemoveIndex_One);
                        }
                        else
                        {
                            queryFilter.CategorySysNo = CategorySysNo;
                        }
                    }
                    else
                    {
                        queryFilter.CategorySysNo = CategorySysNo;
                    }

                    break;

                case "3":
                    queryFilter.CategorySysNo = CategorySysNo;
                    break;

                default:
                    queryFilter.CategorySysNo = string.Empty;
                    break;
                }
            }


            QueryResult <ProductQueryInfo>
            result = ProductService.QueryProduct(queryFilter);

            return(AjaxGridJson(result));
        }
Esempio n. 23
0
        //[ValidateInput(false)]
        public ActionResult AjaxSaveStoreAgentProduct()
        {
            List <VendorAgentInfo> agent = new List <VendorAgentInfo>();
            var data      = SerializationUtility.JsonDeserialize2 <List <VendorAgentInfo> >(Request.Form["data"]);
            var isRequest = bool.Parse(Request.Form["isRequest"]);

            data.ForEach(p =>
            {
                p.CompanyCode = CurrUser.CompanyCode;
                //p.Status = VendorAgentStatus.Draft;
            });
            var sellerSysNo = CurrUser.SellerSysNo;
            var sellerName  = CurrUser.SellerName;

            if (data[0].C3SysNo.HasValue && data[0].C3SysNo.Value != 0)
            {
                agent = data;
            }
            else if (data[0].C2SysNo.HasValue && data[0].C2SysNo.Value != 0)
            {
                var c3 = ProductMaintainService.GetAllCategory3List(data[0].C2SysNo.Value);
                c3.ForEach(p =>
                {
                    VendorAgentInfo temp = new VendorAgentInfo();
                    temp.AgentLevel      = data[0].AgentLevel;
                    temp.BrandInfo       = new BrandInfo
                    {
                        SysNo          = data[0].BrandInfo.SysNo,
                        BrandNameLocal = data[0].BrandInfo.BrandNameLocal
                    };
                    temp.Status      = data[0].Status;
                    temp.C2SysNo     = data[0].C2SysNo;
                    temp.C2Name      = data[0].C2Name;
                    temp.C3SysNo     = p.SysNo;
                    temp.C3Name      = p.CategoryName;
                    temp.CompanyCode = data[0].CompanyCode;
                    agent.Add(temp);
                });
                var originAgentInfo = StoreService.QueryStoreAgentInfos(sellerSysNo);
                agent.RemoveAll(p => originAgentInfo.Any(q => q.C3Name == p.C3Name &&
                                                         q.BrandInfo.SysNo == p.BrandInfo.SysNo));
            }
            else if (data[0].C1SysNo.HasValue && data[0].C1SysNo.Value != 0)
            {
                List <ECommerce.Entity.Product.CategoryInfo> c2list = ProductMaintainService.GetAllCategory2List(data[0].C1SysNo.Value);
                for (int n = 0; n < c2list.Count; n++)
                {
                    List <ECommerce.Entity.Product.CategoryInfo> c3list = ProductMaintainService.GetAllCategory3List(c2list[n].SysNo);
                    for (int i = 0; i < c3list.Count; i++)
                    {
                        VendorAgentInfo temp = new VendorAgentInfo();
                        temp.AgentLevel = data[0].AgentLevel;
                        temp.BrandInfo  = new BrandInfo {
                            SysNo = data[0].BrandInfo.SysNo, BrandNameLocal = data[0].BrandInfo.BrandNameLocal
                        };
                        temp.Status      = data[0].Status;
                        temp.C2SysNo     = data[0].C2SysNo;
                        temp.C2Name      = data[0].C2Name;
                        temp.C3SysNo     = c3list[i].SysNo;
                        temp.C3Name      = c3list[i].CategoryName;
                        temp.CompanyCode = data[0].CompanyCode;
                        agent.Add(temp);
                    }
                }

                var originAgentInfo = StoreService.QueryStoreAgentInfos(sellerSysNo);
                agent.RemoveAll(p => originAgentInfo.Any(q => q.C3Name == p.C3Name &&
                                                         q.BrandInfo.SysNo == p.BrandInfo.SysNo));
            }

            StoreService.SaveStoreAgentProduct(agent, sellerSysNo, sellerName, isRequest);
            return(Json(new { Success = true, Message = LanguageHelper.GetText("操作成功"), Data = StoreService.QueryStoreAgentInfos(CurrUser.SellerSysNo) }));
        }