Esempio n. 1
0
        // GET: /Brand/
        public ActionResult StoreList(int brandId = 0, int areaId = 0)
        {
            try
            {
                SupplierBrandBLL supplierBLL = new SupplierBrandBLL();

                var page = new PageDTO()
                {
                    PageIndex = PageNo, PageSize = DefaultPageSize
                };

                var result = supplierBLL.GetStoreListByBrandId(brandId, areaId, LanguageEnum.TraditionalChinese, page);

                ViewBag.Brand = supplierBLL.GetBrandById(brandId);

                ViewBag.ProvinceList = CountryBLL.GetProvinceList(852, LanguageEnum.TraditionalChinese);

                ViewBag.AreaId = areaId;

                return(View(result));
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(View());
        }
Esempio n. 2
0
        public JsonResult SaveBrand(string brand)
        {
            try
            {
                var result = false;
                SupplierBrandBLL brandBLL = new SupplierBrandBLL();

                SupplierBrandModel brandinfo = JsonHelper.ToObject <SupplierBrandModel>(brand);
                brandinfo.SupplierId = CurrentUser.SupplierID;

                if (brandinfo.Id > 0)
                {
                    result = brandBLL.UpdateById(brandinfo);
                }
                else
                {
                    result = brandBLL.Add(brandinfo);
                }
                return(Json(new { result = result, msg = "" }));
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
                return(Json(new { result = false, msg = "" }));
            }
        }
Esempio n. 3
0
 public ActionResult BrandEdit(int brandId = 0)
 {
     try
     {
         SupplierBrandModel model       = new SupplierBrandModel();
         SupplierBrandBLL   supplierBLL = new SupplierBrandBLL();
         if (brandId > 0)
         {
             ViewBag.Operation = "edit";
             model             = supplierBLL.GetBrandById(brandId);
         }
         else
         {
             ViewBag.Operation = "add";
         }
         ViewBag.FirstCategory = CategoryBLL.GetFristLevelCategories(LanguageEnum.TraditionalChinese);
         ViewBag.Country       = CommonBLL.GetDicsInfoByKey("CountryOfManufacture");
         ViewBag.Brand         = model;
         return(View(model));
     }
     catch (Exception ex)
     {
         LogHelper.Error(ex);
     }
     return(View());
 }
Esempio n. 4
0
        public JsonResult DeleteAddress(int id)
        {
            try
            {
                SupplierBrandBLL supplierBLL = new SupplierBrandBLL();
                bool             result      = supplierBLL.DeleteAddress(id);

                return(Json(new { result = result, msg = "" }));
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
                return(Json(new { result = false, msg = "删除失败" }));
            }
        }
Esempio n. 5
0
        public JsonResult ShelfOffBrand(string brandId)
        {
            try
            {
                var result = false;
                SupplierBrandBLL brandBLL = new SupplierBrandBLL();


                result = brandBLL.ShelfOffBrand(brandId);

                return(Json(new { result = result, msg = "" }));
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
                return(Json(new { result = false, msg = "" }));
            }
        }
Esempio n. 6
0
        // GET: /Brand/
        public ActionResult BrandList()
        {
            try
            {
                SupplierBrandBLL supplierBLL = new SupplierBrandBLL();

                var page = new PageDTO()
                {
                    PageIndex = PageNo, PageSize = DefaultPageSize
                };

                var result = supplierBLL.GetBrandBySupplierId(CurrentUser.SupplierID, page);

                return(View(result));
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(View());
        }
Esempio n. 7
0
        public ActionResult AddStore(int brandId = 0, int id = 0)
        {
            try
            {
                SupplierBrandBLL supplierBLL = new SupplierBrandBLL();

                StoreModel model = supplierBLL.GetStoreById(id);

                ViewBag.Brand = supplierBLL.GetBrandById(brandId);

                ViewBag.ProvinceList = CountryBLL.GetProvinceList(852, LanguageEnum.TraditionalChinese);

                ViewBag.Store = model;

                return(View());
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(View());
        }
Esempio n. 8
0
        /// <summary>
        /// 已发布的商品 编辑
        /// </summary>
        /// <param name="categoryId"></param>
        /// <param name="spu"></param>
        /// <returns></returns>
        public ActionResult ProductEdit(int categoryId, string spu)
        {
            var categoryModel = CategoryBLL.GetCategoriesInfoByID(LanguageEnum.SimplifiedChinese, categoryId);

            if (categoryModel == null)
            {
                return(View());
            }

            var categoryAttr = bll.GetCategoryAttrs(categoryId);

            SupplierBrandBLL brand = new SupplierBrandBLL();

            ViewBag.SupplierBrand = brand.GetBrandBySupplierId(CurrentUser.SupplierID, LanguageEnum.SimplifiedChinese);

            ViewBag.CategoryId = categoryId;

            ViewBag.CategoryModel = categoryModel;
            ViewBag.Action        = "edit";
            ProductUpdateBindingModel pmodel = new ProductUpdateBindingModel();

            // 根据spuID 获取相关信息
            if (!string.IsNullOrEmpty(spu))
            {
                pmodel = bll.ReadProductInfo(spu, CurrentUser.SupplierID, 1, true);
                if (pmodel == null || pmodel.ProductInfo_S == null)
                {
                    return(new TransferResult("/Error/PageNotFound"));
                }
                else
                {
                    ViewBag.ProductModel = pmodel;
                }
            }

            return(View("ProductUpload", categoryAttr));
        }
Esempio n. 9
0
        public ActionResult BrandView(int brandId = 0)
        {
            try
            {
                SupplierBrandModel model       = new SupplierBrandModel();
                SupplierBrandBLL   supplierBLL = new SupplierBrandBLL();

                model = supplierBLL.GetBrandById(brandId);
                var page = new PageDTO()
                {
                    PageIndex = PageNo, PageSize = int.MaxValue
                };
                PageOf <StoreModel> storeList = supplierBLL.GetStoreListByBrandId(brandId, 0, LanguageEnum.TraditionalChinese, page);

                ViewBag.Brand     = model;
                ViewBag.StoreList = storeList;
                return(View());
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(View());
        }
Esempio n. 10
0
        public ActionResult SaveAddress(string address)
        {
            try
            {
                var result = false;
                SupplierBrandBLL brandBLL = new SupplierBrandBLL();

                StoreModel store = JsonHelper.ToObject <StoreModel>(address);
                if (store.Id > 0)
                {
                    result = brandBLL.UpdateStoreById(store);
                }
                else
                {
                    result = brandBLL.AddStore(store);
                }
                return(Json(new { result = result, msg = "" }));
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
                return(Json(new { result = false, msg = "" }));
            }
        }