//启用模板 protected void lbtnStart_Click(object sender, EventArgs e) { ChkAdminLevel("sys_templet", ActionEnum.Add.ToString()); //检查权限 BLL.siteconfig bll = new BLL.siteconfig(); Model.siteconfig model = siteConfig; for (int i = 0; i < rptList.Items.Count; i++) { string skinName = ((HiddenField)rptList.Items[i].FindControl("hideSkinName")).Value; CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { //判是否当前模板 if (skinName.ToLower() == siteConfig.templateskin) { JscriptMsg("该模板已是当前模板啦!", "back", "Warning"); return; } model.templateskin = skinName.ToLower(); //修改配置文件 bll.saveConifg(model, Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING)); //重新生成模板 MarkTemplates(skinName); JscriptMsg("模板启用并全部生成成功啦!", "templet_list.aspx", "Success"); return; } } }
//启用模板 protected void lbtnStart_Click(object sender, EventArgs e) { ChkAdminLevel("sys_templet", DTEnums.ActionEnum.Add.ToString()); //检查权限 BLL.siteconfig bll = new BLL.siteconfig(); Model.siteconfig model = siteConfig; for (int i = 0; i < rptList.Items.Count; i++) { string skinName = ((HiddenField)rptList.Items[i].FindControl("hideSkinName")).Value; CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { //判是否当前模板 if (skinName.ToLower() == siteConfig.templateskin) { JscriptMsg("该模板已是当前模板啦!", "back", "Warning"); return; } model.templateskin = skinName.ToLower(); //修改配置文件 bll.saveConifg(model, Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING)); //重新生成模板 MarkTemplates(skinName); JscriptMsg("模板启用并全部生成成功啦!", "templet_list.aspx", "Success"); return; } } }
/// <summary> /// 保存配置信息 /// </summary> protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("sys_config", PLEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.siteconfig bll = new BLL.siteconfig(); Model.siteconfig model = bll.loadConfig(); try { model.webname = webname.Text; model.weburl = weburl.Text; model.webcompany = webcompany.Text; model.webaddress = webaddress.Text; model.webtel = webtel.Text; model.webfax = webfax.Text; model.webmail = webmail.Text; model.webcrod = webcrod.Text; model.webpath = webpath.Text; model.webmanagepath = webmanagepath.Text; model.staticstatus = Utils.StrToInt(staticstatus.SelectedValue, 0); model.staticextension = staticextension.Text; if (memberstatus.Checked == true) { model.memberstatus = 1; } else { model.memberstatus = 0; } if (commentstatus.Checked == true) { model.commentstatus = 1; } else { model.commentstatus = 0; } if (logstatus.Checked == true) { model.logstatus = 1; } else { model.logstatus = 0; } if (webstatus.Checked == true) { model.webstatus = 1; } else { model.webstatus = 0; } model.webclosereason = webclosereason.Text; model.webcountcode = webcountcode.Text; model.smsapiurl = smsapiurl.Text; model.smsusername = smsusername.Text; //判断密码是否更改 if (smspassword.Text.Trim() != "" && smspassword.Text.Trim() != defaultpassword) { model.smspassword = Utils.MD5(smspassword.Text.Trim()); } model.emailsmtp = emailsmtp.Text; if (emailssl.Checked == true) { model.emailssl = 1; } else { model.emailssl = 0; } model.emailport = Utils.StrToInt(emailport.Text.Trim(), 25); model.emailfrom = emailfrom.Text; model.emailusername = emailusername.Text; //判断密码是否更改 if (emailpassword.Text.Trim() != defaultpassword) { model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring); } model.emailnickname = emailnickname.Text; model.filepath = filepath.Text; model.filesave = Utils.StrToInt(filesave.SelectedValue, 2); model.fileremote = Utils.StrToInt(fileremote.SelectedValue, 0); model.fileextension = fileextension.Text; model.videoextension = videoextension.Text; model.attachsize = Utils.StrToInt(attachsize.Text.Trim(), 0); model.videosize = Utils.StrToInt(videosize.Text.Trim(), 0); model.imgsize = Utils.StrToInt(imgsize.Text.Trim(), 0); model.imgmaxheight = Utils.StrToInt(imgmaxheight.Text.Trim(), 0); model.imgmaxwidth = Utils.StrToInt(imgmaxwidth.Text.Trim(), 0); model.thumbnailheight = Utils.StrToInt(thumbnailheight.Text.Trim(), 0); model.thumbnailwidth = Utils.StrToInt(thumbnailwidth.Text.Trim(), 0); model.thumbnailmode = thumbnailmode.SelectedValue; model.watermarktype = Utils.StrToInt(watermarktype.SelectedValue, 0); model.watermarkposition = Utils.StrToInt(watermarkposition.Text.Trim(), 9); model.watermarkimgquality = Utils.StrToInt(watermarkimgquality.Text.Trim(), 80); model.watermarkpic = watermarkpic.Text; model.watermarktransparency = Utils.StrToInt(watermarktransparency.Text.Trim(), 5); model.watermarktext = watermarktext.Text; model.watermarkfont = watermarkfont.Text; model.watermarkfontsize = Utils.StrToInt(watermarkfontsize.Text.Trim(), 12); bll.saveConifg(model); AddAdminLog(PLEnums.ActionEnum.Edit.ToString(), "修改系统配置信息"); //记录日志 JscriptMsg("修改系统配置成功!", "sys_config.aspx"); } catch { JscriptMsg("文件写入失败,请检查文件夹权限!", ""); } }
string defaultpassword = "******"; //默认显示密码 #endregion Fields #region Methods /// <summary> /// 保存配置信息 /// </summary> protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("sys_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.siteconfig bll = new BLL.siteconfig(); Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING)); try { model.webname = webname.Text; model.webcompany = webcompany.Text; model.weburl = weburl.Text; model.webtel = webtel.Text; model.webfax = webfax.Text; model.webmail = webmail.Text; model.webcrod = webcrod.Text; model.webtitle = webtitle.Text; model.webkeyword = webkeyword.Text; model.webdescription = Utils.DropHTML(webdescription.Text); model.webcopyright = webcopyright.Text; model.webpath = webpath.Text; model.webmanagepath = webmanagepath.Text; model.webstatus = int.Parse(webstatus.Text.Trim()); model.webclosereason = webclosereason.Text; model.webcountcode = webcountcode.Text; model.staticstatus = int.Parse(staticstatus.SelectedValue); model.staticextension = staticextension.Text; model.memberstatus = int.Parse(memberstatus.SelectedValue); model.commentstatus = int.Parse(commentstatus.SelectedValue); model.logstatus = int.Parse(logstatus.SelectedValue); model.emailstmp = emailstmp.Text; model.emailport = int.Parse(emailport.Text.Trim()); model.emailfrom = emailfrom.Text; model.emailusername = emailusername.Text; //判断密码是否更改 if (emailpassword.Text.Trim() != defaultpassword) { model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring); } model.emailnickname = emailnickname.Text; model.attachpath = attachpath.Text; model.attachextension = attachextension.Text; model.attachsave = int.Parse(attachsave.SelectedValue); model.attachfilesize = int.Parse(attachfilesize.Text.Trim()); model.attachimgsize = int.Parse(attachimgsize.Text.Trim()); model.attachimgmaxheight = int.Parse(attachimgmaxheight.Text.Trim()); model.attachimgmaxwidth = int.Parse(attachimgmaxwidth.Text.Trim()); model.thumbnailheight = int.Parse(thumbnailheight.Text.Trim()); model.thumbnailwidth = int.Parse(thumbnailwidth.Text.Trim()); model.watermarktype = int.Parse(watermarktype.SelectedValue); model.watermarkposition = int.Parse(watermarkposition.Text.Trim()); model.watermarkimgquality = int.Parse(watermarkimgquality.Text.Trim()); model.watermarkpic = watermarkpic.Text; model.watermarktransparency = int.Parse(watermarktransparency.Text.Trim()); model.watermarktext = watermarktext.Text; model.watermarkfont = watermarkfont.Text; model.watermarkfontsize = int.Parse(watermarkfontsize.Text.Trim()); bll.saveConifg(model, Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING)); JscriptMsg("修改系统信息成功啦!", "sys_config.aspx", "Success"); } catch { JscriptMsg("文件写入失败,请检查是否有权限!", "", "Error"); } }
/// <summary> /// 保存配置信息 /// </summary> protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("sys_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.siteconfig bll = new BLL.siteconfig(); Model.siteconfig model = bll.loadConfig(); try { model.webname = webname.Text; model.weburl = weburl.Text; model.webcompany = webcompany.Text; model.webaddress = webaddress.Text; model.webtel = webtel.Text; model.webfax = webfax.Text; model.webmail = webmail.Text; model.webcrod = webcrod.Text; model.webpath = webpath.Text; model.webmanagepath = webmanagepath.Text; model.staticstatus = Utils.StrToInt(staticstatus.SelectedValue, 0); model.staticextension = staticextension.Text; if (memberstatus.Checked == true) { model.memberstatus = 1; } else { model.memberstatus = 0; } if (commentstatus.Checked == true) { model.commentstatus = 1; } else { model.commentstatus = 0; } if (logstatus.Checked == true) { model.logstatus = 1; } else { model.logstatus = 0; } if (webstatus.Checked == true) { model.webstatus = 1; } else { model.webstatus = 0; } model.webclosereason = webclosereason.Text; model.webcountcode = webcountcode.Text; model.smsapiurl = smsapiurl.Text; model.smsusername = smsusername.Text; //判断密码是否更改 if (smspassword.Text.Trim() != "" && smspassword.Text.Trim() != defaultpassword) { model.smspassword = Utils.MD5(smspassword.Text.Trim()); } model.emailsmtp = emailsmtp.Text; if (emailssl.Checked == true) { model.emailssl = 1; } else { model.emailssl = 0; } model.emailport = Utils.StrToInt(emailport.Text.Trim(), 25); model.emailfrom = emailfrom.Text; model.emailusername = emailusername.Text; //判断密码是否更改 if (emailpassword.Text.Trim() != defaultpassword) { model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring); } model.emailnickname = emailnickname.Text; model.filepath = filepath.Text; model.filesave = Utils.StrToInt(filesave.SelectedValue, 2); model.fileremote = Utils.StrToInt(fileremote.SelectedValue, 0); model.fileextension = fileextension.Text; model.videoextension = videoextension.Text; model.attachsize = Utils.StrToInt(attachsize.Text.Trim(), 0); model.videosize = Utils.StrToInt(videosize.Text.Trim(), 0); model.imgsize = Utils.StrToInt(imgsize.Text.Trim(), 0); model.imgmaxheight = Utils.StrToInt(imgmaxheight.Text.Trim(), 0); model.imgmaxwidth = Utils.StrToInt(imgmaxwidth.Text.Trim(), 0); model.thumbnailheight = Utils.StrToInt(thumbnailheight.Text.Trim(), 0); model.thumbnailwidth = Utils.StrToInt(thumbnailwidth.Text.Trim(), 0); model.thumbnailmode = thumbnailmode.SelectedValue; model.watermarktype = Utils.StrToInt(watermarktype.SelectedValue, 0); model.watermarkposition = Utils.StrToInt(watermarkposition.Text.Trim(), 9); model.watermarkimgquality = Utils.StrToInt(watermarkimgquality.Text.Trim(), 80); model.watermarkpic = watermarkpic.Text; model.watermarktransparency = Utils.StrToInt(watermarktransparency.Text.Trim(), 5); model.watermarktext = watermarktext.Text; model.watermarkfont = watermarkfont.Text; model.watermarkfontsize = Utils.StrToInt(watermarkfontsize.Text.Trim(), 12); bll.saveConifg(model); AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改系统配置信息"); //记录日志 JscriptMsg("修改系统配置成功!", "sys_config.aspx"); } catch { JscriptMsg("文件写入失败,请检查文件夹权限!", ""); } }
/// <summary> /// 保存配置信息 /// </summary> protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("sys_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.siteconfig bll = new BLL.siteconfig(); Model.siteconfig model = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING)); try { model.webname = webname.Text; model.webcompany = webcompany.Text; model.weburl = weburl.Text; model.webtel = webtel.Text; model.webfax = webfax.Text; model.webmail = webmail.Text; model.webcrod = webcrod.Text; model.webtitle = webtitle.Text; model.webkeyword = webkeyword.Text; model.webdescription = Utils.DropHTML(webdescription.Text); model.webcopyright = webcopyright.Text; model.webpath = webpath.Text; model.webmanagepath = webmanagepath.Text; model.webstatus = int.Parse(webstatus.Text.Trim()); model.webclosereason = webclosereason.Text; model.webcountcode = webcountcode.Text; model.staticstatus = int.Parse(staticstatus.SelectedValue); model.staticextension = staticextension.Text; model.memberstatus = int.Parse(memberstatus.SelectedValue); model.commentstatus = int.Parse(commentstatus.SelectedValue); model.logstatus = int.Parse(logstatus.SelectedValue); model.emailstmp = emailstmp.Text; model.emailport = int.Parse(emailport.Text.Trim()); model.emailfrom = emailfrom.Text; model.emailusername = emailusername.Text; //判断密码是否更改 if (emailpassword.Text.Trim() != defaultpassword) { model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring); } model.emailnickname = emailnickname.Text; model.attachpath = attachpath.Text; model.attachextension = attachextension.Text; model.attachsave = int.Parse(attachsave.SelectedValue); model.attachfilesize = int.Parse(attachfilesize.Text.Trim()); model.attachimgsize = int.Parse(attachimgsize.Text.Trim()); model.attachimgmaxheight = int.Parse(attachimgmaxheight.Text.Trim()); model.attachimgmaxwidth = int.Parse(attachimgmaxwidth.Text.Trim()); model.thumbnailheight = int.Parse(thumbnailheight.Text.Trim()); model.thumbnailwidth = int.Parse(thumbnailwidth.Text.Trim()); model.watermarktype = int.Parse(watermarktype.SelectedValue); model.watermarkposition = int.Parse(watermarkposition.Text.Trim()); model.watermarkimgquality = int.Parse(watermarkimgquality.Text.Trim()); model.watermarkpic = watermarkpic.Text; model.watermarktransparency = int.Parse(watermarktransparency.Text.Trim()); model.watermarktext = watermarktext.Text; model.watermarkfont = watermarkfont.Text; model.watermarkfontsize = int.Parse(watermarkfontsize.Text.Trim()); bll.saveConifg(model, Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING)); JscriptMsg("修改系统信息成功啦!", "sys_config.aspx", "Success"); } catch { JscriptMsg("文件写入失败,请检查是否有权限!", "", "Error"); } }
/// <summary> /// 保存配置信息 /// </summary> protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("site_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.siteconfig bll = new BLL.siteconfig(); Model.siteconfig model = bll.loadConfig(); try { model.webname = webname.Text; model.weburl = weburl.Text; model.weblogo = weblogo.Text; model.webcompany = webcompany.Text; model.webaddress = webaddress.Text; model.webtel = webtel.Text; model.webfax = webfax.Text; model.webmail = webmail.Text; model.webcrod = webcrod.Text; model.webtitle = webtitle.Text; model.webkeyword = webkeyword.Text; model.webdescription = Utils.DropHTML(webdescription.Text); model.webcopyright = webcopyright.Text; model.webpath = webpath.Text; model.webmanagepath = webmanagepath.Text; model.staticstatus = Utils.StrToInt(staticstatus.SelectedValue, 0); model.staticextension = staticextension.Text; if (mobilestatus.Checked == true) { model.mobilestatus = 1; } else { model.mobilestatus = 0; } model.mobiledomain = mobiledomain.Text; if (memberstatus.Checked == true) { model.memberstatus = 1; } else { model.memberstatus = 0; } if (commentstatus.Checked == true) { model.commentstatus = 1; } else { model.commentstatus = 0; } if (logstatus.Checked == true) { model.logstatus = 1; } else { model.logstatus = 0; } if (webstatus.Checked == true) { model.webstatus = 1; } else { model.webstatus = 0; } model.webclosereason = webclosereason.Text; model.webcountcode = webcountcode.Text; model.smsapiurl = smsapiurl.Text; model.smsusername = smsusername.Text; //判断密码是否更改 if (smspassword.Text.Trim() != "" && smspassword.Text.Trim() != defaultpassword) { model.smspassword = Utils.MD5(smspassword.Text.Trim()); } model.emailsmtp = emailsmtp.Text; model.emailport = Utils.StrToInt(emailport.Text.Trim(), 25); model.emailfrom = emailfrom.Text; model.emailusername = emailusername.Text; //判断密码是否更改 if (emailpassword.Text.Trim() != defaultpassword) { model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text); } model.emailnickname = emailnickname.Text; model.filepath = filepath.Text; model.filesave = Utils.StrToInt(filesave.SelectedValue, 2); model.fileremote = Utils.StrToInt(fileremote.SelectedValue, 0); model.fileextension = fileextension.Text; model.attachsize = Utils.StrToInt(attachsize.Text.Trim(), 0); model.imgsize = Utils.StrToInt(imgsize.Text.Trim(), 0); model.imgmaxheight = Utils.StrToInt(imgmaxheight.Text.Trim(), 0); model.imgmaxwidth = Utils.StrToInt(imgmaxwidth.Text.Trim(), 0); model.thumbnailheight = Utils.StrToInt(thumbnailheight.Text.Trim(), 0); model.thumbnailwidth = Utils.StrToInt(thumbnailwidth.Text.Trim(), 0); model.watermarktype = Utils.StrToInt(watermarktype.SelectedValue, 0); model.watermarkposition = Utils.StrToInt(watermarkposition.Text.Trim(), 9); model.watermarkimgquality = Utils.StrToInt(watermarkimgquality.Text.Trim(), 80); model.watermarkpic = watermarkpic.Text; model.watermarktransparency = Utils.StrToInt(watermarktransparency.Text.Trim(), 5); model.watermarktext = watermarktext.Text; model.watermarkfont = watermarkfont.Text; model.watermarkfontsize = Utils.StrToInt(watermarkfontsize.Text.Trim(), 12); // 自动放款设置 ConfigLoader.CleanCache(); model.enableAutoRepay = enableAutoRepay.Checked ? 1 : 0; if (!model.systemTimerTriggerTime.Equals(txtSystemTimerTriggerTime.Text)) { Global.InitDailyTimer(TimerMsg.Type.AutoRepayTimer, txtSystemTimerTriggerTime.Text); } model.systemTimerTriggerTime = txtSystemTimerTriggerTime.Text; if (!model.loanerRepayTime.Equals(txtLoanerRepayTime.Text)) { Global.InitDailyTimer(TimerMsg.Type.LoanerRepayTimer, txtLoanerRepayTime.Text); } model.loanerRepayTime = txtLoanerRepayTime.Text; model.sendShortMsgAfterRepay = sendShortMsgAfterRepay.Checked ? 1 : 0; model.sendRepayAnnounceAfterRepay = sendRepayAnnounceAfterRepay.Checked ? 1 : 0; bll.saveConifg(model); CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN); //更新一下域名缓存 AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改系统配置信息"); //记录日志 JscriptMsg("修改系统配置成功!", "sys_config.aspx", "Success"); } catch { JscriptMsg("文件写入失败,请检查是否有权限!", "", "Error"); } }
/// <summary> /// 保存配置信息 /// </summary> protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("sys_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.siteconfig bll = new BLL.siteconfig(); Model.siteconfig model = bll.loadConfig(); try { model.webname = webname.Text; model.weburl = weburl.Text; model.webcompany = webcompany.Text; model.webaddress = webaddress.Text; model.webtel = webtel.Text; model.webfax = webfax.Text; model.webmail = webmail.Text; model.webcrod = webcrod.Text; model.webpath = webpath.Text; string managepath = webmanagepath.Text; if (model.webmanagepath != managepath) { new BLL.navigation().updateicon(model.webmanagepath, managepath); model.webmanagepath = managepath; } model.staticstatus = Utils.StrToInt(staticstatus.SelectedValue, 0); model.staticextension = staticextension.Text; if (memberstatus.Checked == true) { model.memberstatus = 1; } else { model.memberstatus = 0; } if (commentstatus.Checked == true) { model.commentstatus = 1; } else { model.commentstatus = 0; } if (logstatus.Checked == true) { model.logstatus = 1; } else { model.logstatus = 0; } if (webstatus.Checked == true) { model.webstatus = 1; } else { model.webstatus = 0; } model.webclosereason = webclosereason.Text; model.webcountcode = webcountcode.Text; model.smsapiurl = smsapiurl.Text; model.smsusername = smsusername.Text; //判断密码是否更改 if (smspassword.Text.Trim() != "" && smspassword.Text.Trim() != defaultpassword) { model.smspassword = smspassword.Text.Trim(); } model.smssubmit = smssubmit.Text; model.smssendpara = smssendpara.Text.Trim(); model.smssign = Utils.StrToInt(smssign.SelectedValue, 0); model.smssigntxt = smssigntxt.Text.Trim(); model.smssendanswer = Utils.StrToInt(smssendanswer.SelectedValue, 0); model.smssendcode = smssendcode.Text.Trim(); model.smssendlable = smssendlable.Text.Trim(); model.smsmark = smsmark.Text.Trim(); model.smssendcount = Utils.StrToInt(smssendcount.Text.Trim(), 10); model.smsqueryapiurl = smsqueryapiurl.Text.Trim(); model.smsquerypara = smsquerypara.Text.Trim(); model.smsqueryanswer = Utils.StrToInt(smsqueryanswer.SelectedValue, 0); model.smsquerycode = smsquerycode.Text.Trim(); model.smsqueryformat = smsqueryformat.Text.Trim(); model.smserrorcode = smserrorcode.Text.Trim(); model.emailsmtp = emailsmtp.Text; if (emailssl.Checked == true) { model.emailssl = 1; } else { model.emailssl = 0; } model.emailport = Utils.StrToInt(emailport.Text.Trim(), 25); model.emailfrom = emailfrom.Text; model.emailusername = emailusername.Text; //判断密码是否更改 if (emailpassword.Text.Trim() != defaultpassword) { model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring); } model.emailnickname = emailnickname.Text; model.filepath = filepath.Text; model.filesave = Utils.StrToInt(filesave.SelectedValue, 2); model.fileremote = Utils.StrToInt(fileremote.SelectedValue, 0); model.imgextension = imgextension.Text.Trim(); model.fileextension = fileextension.Text; model.videoextension = videoextension.Text; model.attachsize = Utils.StrToInt(attachsize.Text.Trim(), 0); model.videosize = Utils.StrToInt(videosize.Text.Trim(), 0); model.imgsize = Utils.StrToInt(imgsize.Text.Trim(), 0); model.imgmaxheight = Utils.StrToInt(imgmaxheight.Text.Trim(), 0); model.imgmaxwidth = Utils.StrToInt(imgmaxwidth.Text.Trim(), 0); model.thumbnailheight = Utils.StrToInt(thumbnailheight.Text.Trim(), 0); model.thumbnailwidth = Utils.StrToInt(thumbnailwidth.Text.Trim(), 0); model.thumbnailmode = thumbnailmode.SelectedValue; model.watermarktype = Utils.StrToInt(watermarktype.SelectedValue, 0); model.watermarkposition = Utils.StrToInt(watermarkposition.Text.Trim(), 9); int quality = Utils.StrToInt(watermarkimgquality.Text.Trim(), 80); if (quality < 10) { quality = 10; } else if (quality > 100) { quality = 100; } model.watermarkimgquality = quality; //判断上传图片 if (this.imgUpload.HasFile) { //上传前先删除原图片 if (!string.IsNullOrEmpty(model.watermarkpic)) { Utils.DeleteFile(model.watermarkpic); } Model.upLoad upfile = new Web.UI.UpLoad().fileSaveAs(this.imgUpload.PostedFile, 0, false, false); if (upfile.status > 0) { model.watermarkpic = upfile.path; } } else { //判断是否需要删除原图 if (watermarkpic.Text.Trim() == "" && !string.IsNullOrEmpty(model.watermarkpic)) { Utils.DeleteFile(model.watermarkpic); } model.watermarkpic = watermarkpic.Text.Trim(); } model.watermarktransparency = Utils.StrToInt(watermarktransparency.Text.Trim(), 5); model.watermarktext = watermarktext.Text; model.watermarkfont = watermarkfont.Text; model.watermarkfontsize = Utils.StrToInt(watermarkfontsize.Text.Trim(), 12); if (chbFomatPage.Checked == true) { model.fomatpage = 1; } else { model.fomatpage = 0; } if (chbPageCache.Checked == true) { model.pagecache = 1; } else { model.pagecache = 0; } model.cachetime = Utils.StrToInt(txtCacheTime.Text.Trim(), 30); model.cachefix = txtCacheFix.Text.Trim(); model.deltable = Utils.StrToInt(rblDelTable.SelectedValue, 0); model.author = txtAuthor.Text.Trim(); model.source = txtSource.Text.Trim(); bll.saveConifg(model); AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改系统配置信息"); //记录日志 JscriptMsg("修改系统配置成功!", "sys_config.aspx"); } catch { JscriptMsg("文件写入失败,请检查文件夹权限!", ""); } }