Ejemplo n.º 1
0
        public ActionResult Upload(UploadModel model)
        {
            if (ModelState.IsValid)
            {
                MallConfigInfo mallConfigInfo = BMAConfig.MallConfig;

                mallConfigInfo.UploadServer = model.UploadServer == null ? "" : model.UploadServer;
                mallConfigInfo.UploadImgType = model.UploadImgType;
                mallConfigInfo.UploadImgSize = model.UploadImgSize * 1000;
                mallConfigInfo.WatermarkType = model.WatermarkType;
                mallConfigInfo.WatermarkQuality = model.WatermarkQuality;
                mallConfigInfo.WatermarkPosition = model.WatermarkPosition;
                mallConfigInfo.WatermarkImg = model.WatermarkImg == null ? "" : model.WatermarkImg;
                mallConfigInfo.WatermarkImgOpacity = model.WatermarkImgOpacity;
                mallConfigInfo.WatermarkText = model.WatermarkText == null ? "" : model.WatermarkText;
                mallConfigInfo.WatermarkTextFont = model.WatermarkTextFont;
                mallConfigInfo.WatermarkTextSize = model.WatermarkTextSize;
                mallConfigInfo.BrandThumbSize = model.BrandThumbSize;
                mallConfigInfo.ProductShowThumbSize = model.ProductShowThumbSize;
                mallConfigInfo.UserAvatarThumbSize = model.UserAvatarThumbSize;
                mallConfigInfo.UserRankAvatarThumbSize = model.UserRankAvatarThumbSize;
                mallConfigInfo.StoreRankAvatarThumbSize = model.StoreRankAvatarThumbSize;
                mallConfigInfo.StoreLogoThumbSize = model.StoreLogoThumbSize;

                BMAConfig.SaveMallConfig(mallConfigInfo);
                Emails.ResetMall();
                SMSes.ResetMall();
                AddMallAdminLog("修改上传设置");
                return PromptView(Url.Action("upload"), "修改上传设置成功");
            }

            LoadFont();
            return View(model);
        }
Ejemplo n.º 2
0
        public ActionResult Upload()
        {
            MallConfigInfo mallConfigInfo = BMAConfig.MallConfig;

            UploadModel model = new UploadModel();
            model.UploadServer = mallConfigInfo.UploadServer;
            model.UploadImgType = mallConfigInfo.UploadImgType;
            model.UploadImgSize = mallConfigInfo.UploadImgSize / 1000;
            model.WatermarkType = mallConfigInfo.WatermarkType;
            model.WatermarkQuality = mallConfigInfo.WatermarkQuality;
            model.WatermarkPosition = mallConfigInfo.WatermarkPosition;
            model.WatermarkImg = mallConfigInfo.WatermarkImg;
            model.WatermarkImgOpacity = mallConfigInfo.WatermarkImgOpacity;
            model.WatermarkText = mallConfigInfo.WatermarkText;
            model.WatermarkTextFont = mallConfigInfo.WatermarkTextFont;
            model.WatermarkTextSize = mallConfigInfo.WatermarkTextSize;
            model.BrandThumbSize = mallConfigInfo.BrandThumbSize;
            model.ProductShowThumbSize = mallConfigInfo.ProductShowThumbSize;
            model.UserAvatarThumbSize = mallConfigInfo.UserAvatarThumbSize;
            model.UserRankAvatarThumbSize = mallConfigInfo.UserRankAvatarThumbSize;
            model.StoreRankAvatarThumbSize = mallConfigInfo.StoreRankAvatarThumbSize;
            model.StoreLogoThumbSize = mallConfigInfo.StoreLogoThumbSize;

            LoadFont();
            return View(model);
        }