コード例 #1
0
        public ActionResult Company_Case(int Id = 0)
        {
            OpenShopPhoto Photo = new OpenShopPhoto();

            Photo.OpenShopId = Id;
            return(View(Photo));
        }
コード例 #2
0
        public ActionResult OpenShop_add2(int Id = 0)
        {
            OpenShopPhoto Photo = new OpenShopPhoto();

            Photo.OpenShopId = Id;
            return(View(Photo));
        }
コード例 #3
0
        public ActionResult EditPhoto(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("Company_Case", moudel));
        }
コード例 #4
0
        public ActionResult PhotoEditPost(OpenShopPhoto Photo)
        {
            var entity   = this._iOpenShopService.GetPhotoById(Photo.Id);
            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))
            {
                entity.Photo          = CommonContorllers.FileUploadOpenShopImgPath + fileName;
                entity.PhotoSmall     = CommonContorllers.FileUploadOpenShopSmallImgPath + fileName;
                entity.PhotoSquare    = CommonContorllers.FileUploadOpenShopSquareImgPath + fileName;
                entity.PhotoRectangle = CommonContorllers.FileUploadOpenShopRectangleImgPath + fileName;
            }
            this._iOpenShopService.UpdatePhoto(entity);

            return(Redirect("~/Merchant/OpenShopPhoto?Id=" + _openShopId));
        }
コード例 #5
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));
        }
コード例 #6
0
        public ActionResult Company_Caseimg(OpenShopPhoto OPPhoto)
        {
            if (OPPhoto.Id == 0)
            {
                this._iOpenShopService.InsertPhoto(OPPhoto);
            }
            else
            {
                OpenShopPhoto model = this._iOpenShopService.GetPhotoById(OPPhoto.Id);
                model.Id             = OPPhoto.Id;
                model.title          = OPPhoto.title != null ? OPPhoto.title : model.title;
                model.Rmark          = OPPhoto.Rmark != null ? OPPhoto.Rmark : model.Rmark;
                model.Photo          = OPPhoto.Photo != null ? OPPhoto.Photo : model.Photo;
                model.PhotoSmall     = OPPhoto.PhotoSmall != null ? OPPhoto.PhotoSmall : model.PhotoSmall;
                model.PhotoSquare    = OPPhoto.PhotoSquare != null ? OPPhoto.PhotoSquare : model.PhotoSquare;
                model.PhotoRectangle = OPPhoto.PhotoRectangle != null ? OPPhoto.PhotoRectangle : model.PhotoRectangle;
                this._iOpenShopService.UpdatePhoto(model);
            }

            return(RedirectToAction("Company_Case/" + OPPhoto.OpenShopId));
        }