using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WeiSha.Common; using Song.ServiceInterfaces; using Song.Entities; namespace Song.Site.Manage.Content { public partial class VideoSetup : Extend.CustomPage { private string _uppath = "Video"; protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { fill(); } } private void fill() { try { //图片最大置顶数 tbMaxTop.Text = Business.Do()["Video_MaxTop"].String; //图片最大推荐数 tbMaxRec.Text = Business.Do()["Video_MaxRec"].String; // //水印尺寸 //是否强制约束大小,以及约束的宽高值 cbIsWH.Checked = Business.Do()["Video_IsCompelSize"].Boolean ?? false; tbCompelWd.Text = Business.Do()["Video_CompelWidth"].String; tbCompelHg.Text = Business.Do()["Video_CompelHeight"].String; //图片默认缩短图宽高 tbWidth.Text = Business.Do()["Video_ThumbnailWidth"].String; tbHeight.Text = Business.Do()["Video_ThumbnailHeight"].String; // // //水印图片 string imgFile = Business.Do()["Video_Watermark"].String; imgShow.Src = Upload.Get[_uppath].Virtual + imgFile; //水印图片透明度 tbOpacity.Text = Business.Do()["Video_Watermark_Opacity"].String; //水印图片位置 tbLocal.Text = Business.Do()["Video_Watermark_Local"].String; //是否添加水印 cbIsAddWater.Checked = Business.Do()["Video_Watermark_IsAdd"].Boolean ?? false; } catch (Exception ex) { Message.ExceptionShow(ex); } } /// /// 修改 /// /// /// protected void btnEnter_Click(object sender, EventArgs e) { try { //图片最大置顶数 Business.Do().Save("Video_MaxTop", tbMaxTop.Text.Trim()); //图片最大推荐数 Business.Do().Save("Video_MaxRec", tbMaxRec.Text.Trim()); // //图片尺寸 //是否强制约束大小,以及约束的宽高值 Business.Do().Save("Video_IsCompelSize", cbIsWH.Checked.ToString()); Business.Do().Save("Video_CompelWidth", tbCompelWd.Text.Trim()); Business.Do().Save("Video_CompelHeight", tbCompelHg.Text.Trim()); //图片默认缩短图宽高 Business.Do().Save("Video_ThumbnailWidth", tbWidth.Text.Trim()); Business.Do().Save("Video_ThumbnailHeight", tbHeight.Text.Trim()); //水印图片透明度 Business.Do().Save("Video_Watermark_Opacity", tbOpacity.Text.Trim()); Business.Do().Save("Video_Watermark_Local", tbLocal.Text.Trim()); //是否添加水印 Business.Do().Save("Video_Watermark_IsAdd", cbIsAddWater.Checked.ToString()); //水印图片 if (fuLoad.PostedFile.FileName != "") { try { fuLoad.UpPath = _uppath; fuLoad.NewName = "Watermark"; fuLoad.IsMakeSmall = false; fuLoad.SaveAndDeleteOld(Business.Do()["Video_Watermark"].String); Business.Do().Save("Video_Watermark", fuLoad.File.Server.FileName); // imgShow.Src = fuLoad.File.Server.VirtualPath; } catch (Exception ex) { this.Alert(ex.Message); } } //刷新全局参数 Business.Do().Refresh(); } catch (Exception ex) { Message.ExceptionShow(ex); } } } }