Esempio n. 1
0
        public ActionResult Company_Case(int Id = 0)
        {
            ShopBrandPhoto Photo = new ShopBrandPhoto();

            Photo.BrandId = Id;
            return(View(Photo));
        }
Esempio n. 2
0
        public ActionResult Brand_add2(int Id = 0)
        {
            ShopBrandPhoto Photo = new ShopBrandPhoto();

            Photo.BrandId = Id;
            return(View(Photo));
        }
Esempio 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));
        }
Esempio n. 4
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));
        }
Esempio n. 5
0
        public ActionResult PhotoAddPost(ShopBrandPhoto Photo)
        {
            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))
            {
                Photo.Photo          = CommonContorllers.FileUploadBrandImgPath + fileName;
                Photo.PhotoSmall     = CommonContorllers.FileUploadBrandSmallImgPath + fileName;
                Photo.PhotoSquare    = CommonContorllers.FileUploadBrandSquareImgPath + fileName;
                Photo.PhotoRectangle = CommonContorllers.FileUploadBrandRectangleImgPath + fileName;
            }
            Photo.BrandId = _brandId;
            Photo.Recsts  = 1;
            this._IShopBrandService.InsertPhoto(Photo);

            return(Redirect("~/Customer/OpenShopPhoto?Id=" + _brandId));
        }
Esempio n. 6
0
 public ActionResult Brand_add2img(ShopBrandPhoto BPhoto)
 {
     if (BPhoto.Id == 0)
     {
         BPhoto.Recsts = 1;
         this._shopBrandService.InsertPhoto(BPhoto);
     }
     else
     {
         ShopBrandPhoto model = this._shopBrandService.GetPhotoById(BPhoto.Id);
         model.Id             = BPhoto.Id;
         model.title          = BPhoto.title != null ? BPhoto.title : model.title;
         model.Rmark          = BPhoto.Rmark != null ? BPhoto.Rmark : model.Rmark;
         model.Photo          = BPhoto.Photo != null ? BPhoto.Photo : model.Photo;
         model.PhotoSmall     = BPhoto.PhotoSmall != null ? BPhoto.PhotoSmall : model.PhotoSmall;
         model.PhotoSquare    = BPhoto.PhotoSquare != null ? BPhoto.PhotoSquare : model.PhotoSquare;
         model.PhotoRectangle = BPhoto.PhotoRectangle != null ? BPhoto.PhotoRectangle : model.PhotoRectangle;
         model.Recsts         = 1;
         this._shopBrandService.UpdatePhoto(model);
     }
     return(RedirectToAction("Brand_add2/" + BPhoto.BrandId));
 }
Esempio n. 7
0
 public ActionResult PhotoAdd(ShopBrandPhoto shopBrand)
 {
     return(View());
 }