Exemplo n.º 1
0
        public ActionResult Company_infoimg(ShopBrand moudel)
        {
            string viewname     = "";
            var    fileLogoName = UploadImgUtility.UploadImage(Request.Files["Logofile"], Server.MapPath(CommonContorllers.FileUploadBrandLogoImgPath));

            if (!string.IsNullOrEmpty(fileLogoName))
            {
                moudel.Logo = CommonContorllers.FileUploadBrandLogoImgPath + fileLogoName;
                viewname    = "Company_info";
            }
            var fileQRcodeName = UploadImgUtility.UploadImage(Request.Files["QRcodefile"], Server.MapPath(CommonContorllers.FileUploadBrandQRCodeImgPath));

            if (!string.IsNullOrEmpty(fileQRcodeName))
            {
                moudel.QRCode = CommonContorllers.FileUploadBrandQRCodeImgPath + fileQRcodeName;
                viewname      = "Company_info";
            }

            var fileBLSName = UploadImgUtility.UploadImage(Request.Files["BLSfile"], Server.MapPath(CommonContorllers.FileUploadBrandBLSImgPath));

            if (!string.IsNullOrEmpty(fileBLSName))
            {
                moudel.BLS = CommonContorllers.FileUploadBrandBLSImgPath + fileBLSName;
                viewname   = "Company_Qualifications";
            }
            var fileCICName = UploadImgUtility.UploadImage(Request.Files["CICfile"], Server.MapPath(CommonContorllers.FileUploadBrandCICImgPath));

            if (!string.IsNullOrEmpty(fileCICName))
            {
                moudel.CIC = CommonContorllers.FileUploadBrandCICImgPath + fileCICName;
                viewname   = "Company_Qualifications";
            }
            return(View(viewname, moudel));
        }
Exemplo n.º 2
0
        public ActionResult uploadimg(Customer moudel)
        {
            var fileBLSName = UploadImgUtility.UploadImage(Request.Files["portraitfile"], Server.MapPath(CommonContorllers.FileUploadPortraitImgPath));

            if (!string.IsNullOrEmpty(fileBLSName))
            {
                moudel.portrait = CommonContorllers.FileUploadPortraitImgPath + fileBLSName;
            }
            return(View("Userinfo", moudel));
        }
Exemplo n.º 3
0
        public ActionResult EditPhoto(ShopBrandPhoto moudel)
        {
            var fileName = UploadImgUtility.UploadBrangImg(Request.Files["BrandPhoto"], Server.MapPath(CommonContorllers.FileUploadBrandImgPath), Server.MapPath(CommonContorllers.FileUploadBrandSmallImgPath), Server.MapPath(CommonContorllers.FileUploadBrandSquareImgPath), Server.MapPath(CommonContorllers.FileUploadBrandRectangleImgPath));

            if (!string.IsNullOrEmpty(fileName))
            {
                moudel.Photo          = CommonContorllers.FileUploadBrandImgPath + fileName;
                moudel.PhotoSmall     = CommonContorllers.FileUploadBrandSmallImgPath + fileName;
                moudel.PhotoSquare    = CommonContorllers.FileUploadBrandSquareImgPath + fileName;
                moudel.PhotoRectangle = CommonContorllers.FileUploadBrandRectangleImgPath + fileName;
            }
            return(View("Company_Case", moudel));
        }
Exemplo n.º 4
0
        public ActionResult uploadPhoto(OpenShopPhoto moudel)
        {
            var fileName = UploadImgUtility.UploadBrangImg(Request.Files["OpenShopPhoto"], Server.MapPath(CommonContorllers.FileUploadOpenShopImgPath), Server.MapPath(CommonContorllers.FileUploadOpenShopSmallImgPath), Server.MapPath(CommonContorllers.FileUploadOpenShopSquareImgPath), Server.MapPath(CommonContorllers.FileUploadOpenShopRectangleImgPath));

            if (!string.IsNullOrEmpty(fileName))
            {
                moudel.Photo          = CommonContorllers.FileUploadOpenShopImgPath + fileName;
                moudel.PhotoSmall     = CommonContorllers.FileUploadOpenShopSmallImgPath + fileName;
                moudel.PhotoSquare    = CommonContorllers.FileUploadOpenShopSquareImgPath + fileName;
                moudel.PhotoRectangle = CommonContorllers.FileUploadOpenShopRectangleImgPath + fileName;
            }
            return(View("OpenShop_add2", moudel));
        }
Exemplo n.º 5
0
        public ActionResult PhotoEditPost(ShopBrandPhoto Photo)
        {
            var entity   = this._IShopBrandService.GetPhotoById(Photo.Id);
            var fileName = UploadImgUtility.UploadBrangImg(Request.Files["OpenShopPhoto"], Server.MapPath(CommonContorllers.FileUploadBrandImgPath), Server.MapPath(CommonContorllers.FileUploadBrandSmallImgPath), Server.MapPath(CommonContorllers.FileUploadBrandSquareImgPath), Server.MapPath(CommonContorllers.FileUploadBrandRectangleImgPath));

            if (!string.IsNullOrEmpty(fileName))
            {
                entity.Photo          = CommonContorllers.FileUploadBrandImgPath + fileName;
                entity.PhotoSmall     = CommonContorllers.FileUploadBrandSmallImgPath + fileName;
                entity.PhotoSquare    = CommonContorllers.FileUploadBrandSquareImgPath + fileName;
                entity.PhotoRectangle = CommonContorllers.FileUploadBrandRectangleImgPath + fileName;
            }
            this._IShopBrandService.UpdatePhoto(entity);

            return(Redirect("~/Customer/OpenShopPhoto?Id=" + _brandId));
        }
Exemplo n.º 6
0
        public ActionResult PhotoAddPost(OpenShopPhoto Photo)
        {
            var fileName = UploadImgUtility.UploadBrangImg(Request.Files["OpenShopPhoto"], Server.MapPath(CommonContorllers.FileUploadOpenShopImgPath), Server.MapPath(CommonContorllers.FileUploadOpenShopSmallImgPath), Server.MapPath(CommonContorllers.FileUploadOpenShopSquareImgPath), Server.MapPath(CommonContorllers.FileUploadOpenShopRectangleImgPath));

            if (!string.IsNullOrEmpty(fileName))
            {
                Photo.Photo          = CommonContorllers.FileUploadOpenShopImgPath + fileName;
                Photo.PhotoSmall     = CommonContorllers.FileUploadOpenShopSmallImgPath + fileName;
                Photo.PhotoSquare    = CommonContorllers.FileUploadOpenShopSquareImgPath + fileName;
                Photo.PhotoRectangle = CommonContorllers.FileUploadOpenShopRectangleImgPath + fileName;
            }
            Photo.OpenShopId = _openShopId;
            Photo.Recsts     = 1;
            this._iOpenShopService.InsertPhoto(Photo);

            return(Redirect("~/Merchant/OpenShopPhoto?Id=" + _openShopId));
        }
Exemplo n.º 7
0
        public ActionResult EditPost(YG.SC.DataAccess.OpenShop shopBrand)
        {
            var entity = this._iOpenShopService.GetById(shopBrand.Id);

            var fileLogoName = UploadImgUtility.UploadImage(Request.Files["LogoImg"], Server.MapPath(CommonContorllers.FileUploadOpenShopLogoImgPath));

            if (!string.IsNullOrEmpty(fileLogoName))
            {
                entity.Logo = CommonContorllers.FileUploadOpenShopLogoImgPath + fileLogoName;
            }
            entity.Name    = shopBrand.Name;
            entity.Rmark   = shopBrand.Rmark;
            entity.Url     = shopBrand.Url;
            entity.VidoUrl = shopBrand.VidoUrl;
            this._iOpenShopService.Update(entity);
            string msg = "修改完成";

            ViewBag.msg = msg;
            return(Redirect("~/Merchant/Edit?id=" + entity.Id));
        }
Exemplo n.º 8
0
        public ActionResult Company_infoimg(DataAccess.OpenShop moudel)
        {
            string viewname     = "";
            var    fileLogoName = UploadImgUtility.UploadImage(Request.Files["Logofile"], Server.MapPath(CommonContorllers.FileUploadOpenShopLogoImgPath));

            if (!string.IsNullOrEmpty(fileLogoName))
            {
                ViewBag.Range    = Request["Range"];
                ViewBag.ValueStr = Request["ValueStr"];
                ViewBag.District = Request["District"];
                moudel.Logo      = CommonContorllers.FileUploadOpenShopLogoImgPath + fileLogoName;
                viewname         = "Company_info";
            }
            var fileQRcodeName = UploadImgUtility.UploadImage(Request.Files["QRcodefile"], Server.MapPath(CommonContorllers.FileUploadOpenShopQRCodeImgPath));

            if (!string.IsNullOrEmpty(fileQRcodeName))
            {
                ViewBag.Range    = Request["Range"];
                ViewBag.ValueStr = Request["ValueStr"];
                ViewBag.District = Request["District"];
                moudel.QRcode    = CommonContorllers.FileUploadOpenShopQRCodeImgPath + fileQRcodeName;
                viewname         = "Company_info";
            }

            var fileBLSName = UploadImgUtility.UploadImage(Request.Files["BLSfile"], Server.MapPath(CommonContorllers.FileUploadOpenShopBLSImgPath));

            if (!string.IsNullOrEmpty(fileBLSName))
            {
                moudel.BLS = CommonContorllers.FileUploadOpenShopBLSImgPath + fileBLSName;
                viewname   = "Company_Qualifications";
            }
            var fileCICName = UploadImgUtility.UploadImage(Request.Files["CICfile"], Server.MapPath(CommonContorllers.FileUploadOpenShopCICImgPath));

            if (!string.IsNullOrEmpty(fileCICName))
            {
                moudel.CIC = CommonContorllers.FileUploadOpenShopCICImgPath + fileCICName;
                viewname   = "Company_Qualifications";
            }
            return(View(viewname, moudel));
        }
Exemplo n.º 9
0
        public ActionResult uploadimg(ShopBrand moudel)
        {
            string viewname = "";

            if (moudel.Id != 0)
            {
                viewname = "Brand_add3";
                var fileBLSName = UploadImgUtility.UploadImage(Request.Files["BLSfile"], Server.MapPath(CommonContorllers.FileUploadBrandBLSImgPath));
                if (!string.IsNullOrEmpty(fileBLSName))
                {
                    moudel.BLS = CommonContorllers.FileUploadBrandBLSImgPath + fileBLSName;
                }
                var fileCICName = UploadImgUtility.UploadImage(Request.Files["CICfile"], Server.MapPath(CommonContorllers.FileUploadBrandCICImgPath));
                if (!string.IsNullOrEmpty(fileCICName))
                {
                    moudel.CIC = CommonContorllers.FileUploadBrandCICImgPath + fileCICName;
                }
            }
            else
            {
                YG.SC.DataAccess.ShopBrand model = new DataAccess.ShopBrand();
                var attrsTypes = this._iShopAttributesServiceService.GetListByAttributeId(9);
                ViewBag.shopType = attrsTypes;

                var fileLogoName = UploadImgUtility.UploadImage(Request.Files["Logofile"], Server.MapPath(CommonContorllers.FileUploadBrandLogoImgPath));
                if (!string.IsNullOrEmpty(fileLogoName))
                {
                    moudel.Logo = CommonContorllers.FileUploadBrandLogoImgPath + fileLogoName;
                }
                var fileQRcodeName = UploadImgUtility.UploadImage(Request.Files["QRcodefile"], Server.MapPath(CommonContorllers.FileUploadBrandQRCodeImgPath));
                if (!string.IsNullOrEmpty(fileQRcodeName))
                {
                    moudel.QRCode = CommonContorllers.FileUploadBrandQRCodeImgPath + fileQRcodeName;
                }
                ViewBag.attributesvalue = Request["selAttribute"];
                viewname = "Brand_add1";
            }
            return(View(viewname, moudel));
        }
Exemplo n.º 10
0
        public ActionResult Postimg(ProductViewModel moudel)
        {
            string Viewname    = "";
            var    fileCICName = UploadImgUtility.UploadImage(Request.Files["Imagefile"], Server.MapPath(CommonContorllers.FileUploadGoodsImgPath));

            if (!string.IsNullOrEmpty(fileCICName))
            {
                moudel.Image = CommonContorllers.FileUploadGoodsImgPath + fileCICName;
            }
            if (moudel.Id > 0)
            {
                Viewname = "ProductEdit";
            }
            else
            {
                Viewname = "ProductAdd";
            }
            CategorySearchCriteria SearchCriteria = new CategorySearchCriteria();

            SearchCriteria.Type     = (int)CommonEnum.TypeOfDbObject.Classification;
            SearchCriteria.ParentId = -1;
            var attrsTypes = this._ObjectService.SearchCategory(SearchCriteria).Item1;
            var typelist   = (from m in attrsTypes
                              select new SelectListItem
            {
                Text = m.Name,
                Value = m.Id.ToString()
            }).ToList();

            if (typelist.Count == 0)
            {
                typelist.Add(new SelectListItem()
                {
                    Text = "无", Value = "-1"
                });
            }
            ViewBag.shopType = typelist;
            return(View(Viewname, moudel));
        }
Exemplo n.º 11
0
        public ActionResult BrandEdit(Brand model)
        {
            bool     isMember;
            bool     isBrand;
            Customer member = GetCurrentUser(out isMember, out isBrand);

            if (member == null || !isMember)//只有已登录的会员用户才可以管理自己的品牌。
            {
                return(RedirectToAction("Index", "Login"));
            }
            var       fileLogoName   = UploadImgUtility.UploadImage(Request.Files["Logo"], Server.MapPath(CommonContorllers.FileUploadBrandLogoImgPath));
            var       fileQRCodeName = UploadImgUtility.UploadImage(Request.Files["QRCode"], Server.MapPath(CommonContorllers.FileUploadBrandQRCodeImgPath));
            ShopBrand sb             = new ShopBrand();

            if (isBrand)
            {
                sb = _IShopBrandService.GetById(member.Companyid);
            }
            sb.Name = model.Name;
            if (!string.IsNullOrEmpty(fileLogoName))
            {
                sb.Logo = fileLogoName;
            }
            if (!string.IsNullOrEmpty(fileQRCodeName))
            {
                sb.QRCode = fileQRCodeName;
            }
            sb.Url          = model.WebUrl;
            sb.VidoUrl      = model.VideoUrl;
            sb.JoinIn       = model.IsAllowJoin;
            sb.Recsts       = model.IsValid ? 1 : 0;
            sb.Abbreviation = model.Introduce;
            if (isBrand)
            {
                sb.Id = member.Companyid;
                _IShopBrandService.Update(sb);
            }
            else
            {
                _IShopBrandService.Insert(sb);
                Customer c = _iCustomerService.GetEntityById(UserContext.Current.Id);
                c.Companyid = sb.Id;
                _iCustomerService.Update(c);
            }
            //增加业态
            List <ShopBrandAttributeValues> listattr = new List <ShopBrandAttributeValues>();
            var attributesvalue = Request["selAttribute"];

            if (!string.IsNullOrEmpty(attributesvalue))
            {
                foreach (var item in attributesvalue.Split(','))
                {
                    ShopBrandAttributeValues bv = new ShopBrandAttributeValues()
                    {
                        BrandId           = sb.Id,
                        Recsts            = 1,
                        AttributesId      = Convert.ToInt32(item.Split('-')[0]),
                        AttributeValuesId = Convert.ToInt32(item.Split('-')[1]),
                    };
                    listattr.Add(bv);
                }
            }
            this._iShopAttributesServiceService.InsertList(listattr);
            return(RedirectToAction("Brand"));
        }
Exemplo n.º 12
0
        public ActionResult uploadimg(OpenShopViewModel moudel)
        {
            string viewname = "";

            if (moudel.Id != 0)
            {
                viewname = "OpenShop_add3";
                var fileBLSName = UploadImgUtility.UploadImage(Request.Files["BLSfile"], Server.MapPath(CommonContorllers.FileUploadOpenShopBLSImgPath));
                if (!string.IsNullOrEmpty(fileBLSName))
                {
                    moudel.BLS = CommonContorllers.FileUploadOpenShopBLSImgPath + fileBLSName;
                }
                var fileCICName = UploadImgUtility.UploadImage(Request.Files["CICfile"], Server.MapPath(CommonContorllers.FileUploadOpenShopCICImgPath));
                if (!string.IsNullOrEmpty(fileCICName))
                {
                    moudel.CIC = CommonContorllers.FileUploadOpenShopCICImgPath + fileCICName;
                }
            }
            else
            {
                YG.SC.DataAccess.OpenShop model = new DataAccess.OpenShop();
                var attrsTypes = this._iShopAttributesService.GetListByAttributeId(OpenShopAttrId);
                var typelist   = (from m in attrsTypes
                                  select new SelectListItem
                {
                    Text = m.ValueStr,
                    Value = m.Id.ToString()
                }).ToList();
                ViewBag.shopType = typelist;
                CategorySearchCriteria SearchCriteria = new CategorySearchCriteria();
                SearchCriteria.ParentId = -1;
                var rangelist = this._objectService.SearchCategory(SearchCriteria).Item1;
                var range     = (from m in rangelist
                                 select new SelectListItem
                {
                    Text = m.Name,
                    Value = m.Id.ToString()
                }).ToList();
                ViewBag.range = range;
                var Districtlist = this._hotareaService.GetByParentId(1);
                var District     = (from m in Districtlist
                                    select new SelectListItem
                {
                    Text = m.name,
                    Value = m.id.ToString()
                }).ToList();
                ViewBag.District = District;
                var fileLogoName = UploadImgUtility.UploadImage(Request.Files["Logofile"], Server.MapPath(CommonContorllers.FileUploadOpenShopLogoImgPath));
                if (!string.IsNullOrEmpty(fileLogoName))
                {
                    moudel.Logo = CommonContorllers.FileUploadOpenShopLogoImgPath + fileLogoName;
                }
                var fileQRcodeName = UploadImgUtility.UploadImage(Request.Files["QRcodefile"], Server.MapPath(CommonContorllers.FileUploadOpenShopQRCodeImgPath));
                if (!string.IsNullOrEmpty(fileQRcodeName))
                {
                    moudel.QRcode = CommonContorllers.FileUploadOpenShopQRCodeImgPath + fileQRcodeName;
                }
                ViewBag.quyu = Request.Form["District"];
                viewname     = "OpenShop_add1";
            }
            return(View(viewname, moudel));
        }