protected void btnOk_ServerClick1(object sender, EventArgs e) { XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); XYECOM.Model.AdminInfo ea = new XYECOM.Model.AdminInfo(); XYECOM.Business.Admin ad = new XYECOM.Business.Admin(); ea.UM_Name = this.txtName.Text; ea.UM_Pwd = XYECOM.Core.SecurityUtil.MD5(this.txtPwd.Text.Trim(), XYECOM.Configuration.Security.Instance.Md5value); ea.UR_ID = Convert.ToInt32(this.ddlRose.SelectedValue.ToString()); int i = 0; i = ad.Insert(ea); if (i == 1) { el.L_Title = "管理员管理"; el.L_Content = "添加管理员信息成功"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Reload(); //string url = "Administrator.aspx"; //this.ClientScript.RegisterClientScriptBlock(GetType(), "01", "<script>alertmsg(\"添加成功!\",\"" + url + "\")</script>"); } else if (i == -1) { el.L_Title = "管理员管理"; el.L_Content = "该记录已经存在,请重新输入"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("该记录已经存在,请重新输入!", url); } else { el.L_Title = "管理员管理"; el.L_Content = "添加管理员信息"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("添加失败!", url); } }
protected void btnOk_ServerClick(object sender, EventArgs e) { XYECOM.Model.FiltrateKeyWordInfo efkw = new XYECOM.Model.FiltrateKeyWordInfo(); XYECOM.Business.FiltrateKeyWord fkw = new XYECOM.Business.FiltrateKeyWord(); XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); efkw.FKW_Name = this.txtName.Text; XYECOM.Model.AdminInfo ea = new XYECOM.Model.AdminInfo(); XYECOM.Business.Admin ad = new XYECOM.Business.Admin(); int err = 0; string str = this.txtName.Text.Trim(); string[] st = str.Split(','); for (int i = 0; i < st.Length; i++) { efkw.FKW_Name = st[i].ToString(); err = fkw.Insert(efkw); } if (err == -1) { el.L_Title = "过滤字管理"; el.L_Content = "添加过滤字信息"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("该记录已存在!请重新输入信息!", url); } else if (err == -2) { el.L_Title = "过滤字管理"; el.L_Content = "该记录已存在!请重新输入信息"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } Alert("添加失败!", url); } else { el.L_Title = "过滤字管理"; el.L_Content = "添加过滤字信息成功"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("添加成功!", url); } }
protected void btok_Click(object sender, EventArgs e) { //商业信息审核方式 if (this.autoadtms.Checked == true) webInfo.InsertInfoAuditingType = true; else webInfo.InsertInfoAuditingType = false; //修改后审核方式 if (this.autonewadt.Checked == true) webInfo.EditInfoAuditingType = true; else webInfo.EditInfoAuditingType = false; //发布信息奖励 if (this.tbuseraddinfo.Text != "") webInfo.IssueInfoAddWebMoney = Convert.ToInt32(this.tbuseraddinfo.Text); else webInfo.IssueInfoAddWebMoney = 0; //刷新一次信息奖励 if (this.tbrefurbishinfo.Text != "") webInfo.RefreshInfoAddWebMoney = Convert.ToInt32(this.tbrefurbishinfo.Text); else webInfo.RefreshInfoAddWebMoney = 0; //热门关键字显示数目 //if (string.IsNullOrEmpty(this.tbsearchkey.Text.Trim())) // webInfo.HotKeyNumber = 0; //else // webInfo.HotKeyNumber = Convert.ToInt32(this.tbsearchkey.Text.Trim()); //有效期选择方式 if (this.enddate.Checked == true) webInfo.InfoEndTimeType = true; else webInfo.InfoEndTimeType = false; //商业信息审核邮件提示 webInfo.IsAuditingInfoEmail = false; if (this.AuditIsEmailYes.Checked == true) webInfo.IsAuditingInfoEmail = true; //商业信息审核短信提示 webInfo.IsAuditingInfoMessage = false; if (this.AuditIsMessageYes.Checked == true) webInfo.IsAuditingInfoMessage = true; //商业信息审核短信标题 webInfo.AuditingInfoMessageTitle = this.tbsentmessagetitle.Text; //商业信息审核短信内容 webInfo.AuditingUserMessageContent = this.tbsentmessagecontent.Text; webInfo.AboutInfoNum = XYECOM.Core.MyConvert.GetInt32(txtAboutInfoNum.Text.Trim()); webInfo.SystemMessageNumber = XYECOM.Core.MyConvert.GetInt32(this.txtSysMessageNum.Text); //竞价邮件提示 webInfo.IsBidEmail = false; if (this.BidIsEmailYes.Checked == true) webInfo.IsBidEmail = true; //竞价短信提示 webInfo.IsBidMessage = false; if (this.BidIsMessageYes.Checked == true) webInfo.IsBidMessage = true; //竞价短信标题 webInfo.BidMessageTitle = this.jinjiatitle.Text; //竞价短信内容 webInfo.BidMessageContent = this.jinjiacontent.Text; //推荐好友邮件提示 webInfo.IsJobEmail = false; if (this.JobIsEmailYes.Checked == true) webInfo.IsJobEmail = true; //招聘求职短信提示 webInfo.IsJobMessage = false; if (this.JobIsMessageYes.Checked == true) webInfo.IsJobMessage = true; //订单邮件提示 webInfo.IsOrderEmail = false; if (this.OrderIsEmailYes.Checked == true) webInfo.IsOrderEmail = true; //订单短信提示 webInfo.IsOrderMessage = false; if (this.OrderIsMessageYes.Checked == true) webInfo.IsOrderMessage = true; //订单短信标题 webInfo.OrderMessageTitle = this.ordermessagetitle.Text; //订单短信内容 webInfo.OrderMessageContent = this.ordermessagecontent.Text; //招聘求职短信标题 webInfo.JobMessageTitle = this.jobtitle.Text; //招聘求职短信内容 webInfo.JobMessageContent = this.jobcontent.Text; //实例化网站设置方法类以及登录日志类 XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); bool result = webInfo.Update(); //根据添加或修改的结果判断是否成功 el.L_Title = "网站设置模块"; el.L_MF = "系统信息设置"; el.L_Content = "设置商业信息设置成功"; string url = "BussinessInfoSet.aspx"; { el.UM_ID = AdminId; } if (result) { //XYECOM.Core.Config.WebConfig.instance.UpdateNode("datetype", webInfo.InfoEndTimeType.ToString()); Alert("商业基本信息设置成功!", url); } else { el.L_Content = "设置商业信息设置失败"; Alert("商业基本信息设置失败,可重新设置!", url); } l.Insert(el); }
protected void btok_Click(object sender, EventArgs e) { if (this.isusert.Checked == true) webInfo.IsRegister = true; else if (this.isuserf.Checked == true) webInfo.IsRegister = false; webInfo.RegisterMode = this.RegisterModeList.SelectedValue; if (this.atuoadtuser.Checked == true) webInfo.UserRegisterAuditingType = true; else webInfo.UserRegisterAuditingType = false; webInfo.ForbidName = this.tbforbidname.Text; if (this.tbuserhortation.Text != "") webInfo.UserDefaultWebMoney = XYECOM.Core.MyConvert.GetInt32(this.tbuserhortation.Text); else webInfo.UserDefaultWebMoney = 0; webInfo.CanChooseTradeNumber = XYECOM.Core.MyConvert.GetInt32(this.txtCanChooseTradeNumber.Text.Trim()); if (this.tbloginhortation.Text != "") webInfo.LoginAddWebMoney = XYECOM.Core.MyConvert.GetInt32(this.tbloginhortation.Text); else webInfo.LoginAddWebMoney = 0; if (this.rbresteisemailyes.Checked==true) { webInfo.IsRegisterEmail = true; } else if (this.rbresteisemailno.Checked==true) { webInfo.IsRegisterEmail = false; } if (this.auditinguseryes.Checked == true) { webInfo.IsAuditingUserEmail = true; } else { webInfo.IsAuditingUserEmail = false; } if (this.yk.Checked == true) webInfo.IsGuestLookLinkInfo = false; else if (this.yke.Checked == true) webInfo.IsGuestLookLinkInfo = true; if (this.webnotet.Checked == true) { webInfo.IsRegisterMessage = true; } else if (this.webnotef.Checked == true) { webInfo.IsRegisterMessage = false; } webInfo.RegisterMessageTitle = this.tbnotetitle.Text; webInfo.RegisterMessageContent = this.tbnotetext.Text; // 资料完善度开始 if (this.tbregist.Text.Trim() != "") webInfo.RegisterPercent = XYECOM.Core.MyConvert.GetInt32(this.tbregist.Text.Trim()); else webInfo.RegisterPercent = 0; if (this.tbbase.Text.Trim() != "") webInfo.BaseDatumPercent = XYECOM.Core.MyConvert.GetInt32(this.tbbase.Text.Trim()); else webInfo.BaseDatumPercent = 0; if (this.tbmobile.Text.Trim() != "") webInfo.MobilePercent = XYECOM.Core.MyConvert.GetInt32(this.tbmobile.Text.Trim()); else webInfo.MobilePercent = 0; if (this.tbbranch.Text.Trim() != "") webInfo.DepartmentPercent = XYECOM.Core.MyConvert.GetInt32(this.tbbranch.Text.Trim()); else webInfo.DepartmentPercent = 0; if (this.tbcomple.Text.Trim() != "") webInfo.AdvancedDatumPercent = XYECOM.Core.MyConvert.GetInt32(this.tbcomple.Text.Trim()); else webInfo.AdvancedDatumPercent = 0; if (this.tbcapital.Text.Trim() != "") webInfo.CapitalPercent = XYECOM.Core.MyConvert.GetInt32(this.tbcapital.Text.Trim()); else webInfo.CapitalPercent = 0; if (this.tblicence.Text.Trim() != "") webInfo.LicencePercent = XYECOM.Core.MyConvert.GetInt32(this.tblicence.Text.Trim()); else webInfo.LicencePercent = 0; if (this.tbcertificate.Text.Trim() != "") webInfo.CertificatePercent = XYECOM.Core.MyConvert.GetInt32(this.tbcertificate.Text.Trim()); else webInfo.CertificatePercent = 0; // 资料完善度结束 if (this.rbauditmessageyes.Checked == true) { webInfo.IsAuditingUserMessage = true; } else if(this.rbauditmessageno.Checked == true) { webInfo.IsAuditingUserMessage = false; } if (this.addmoneyyes.Checked) { webInfo.IsAddMoneyEmail = true; } else if (this.addmoneyno.Checked) { webInfo.IsAddMoneyEmail = false; } if (this.txtScores.Text != "") webInfo.LoginAddScore = XYECOM.Core.MyConvert.GetInt32(this.txtScores.Text.Trim()); else webInfo.LoginAddScore = 0; if (this.useraddmoneymessageyes.Checked == true) { webInfo.IsAddMoneyMessage = true; } else if (this.useraddmoneymessageno.Checked == true) { webInfo.IsAddMoneyMessage = false; } webInfo.AddMoneyMessageTitle = this.addmoneytitle.Text; webInfo.AddMoneyMessageContent = this.addmoneycontent.Text; webInfo.AuditingUserMessageTitle = this.lbsentmessasgetitle.Text; webInfo.AuditingUserMessageContent = this.lbusersentmessagecontent.Text; //实例化网站设置方法类以及登录日志类 XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); bool resule = webInfo.Update(); string url = "UserInfoSet.aspx"; //根据添加或修改的结果判断是否成功 if (resule) { el.L_Title = "网站设置"; el.L_Content = "设置网站信息成功"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("设置成功!", url); } else { el.L_Title = "网站设置"; el.L_Content = "设置网站信息失败"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("设置失败,请检查/config/目录写权限!", url); } }
protected void btnok_Click(object sender, EventArgs e) { string str = ""; XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); XYECOM.Model.LabelTypeInfo elt = new XYECOM.Model.LabelTypeInfo(); XYECOM.Business.LabelType lt = new XYECOM.Business.LabelType(); elt.LT_Name = this.tbName.Text; elt.LT_Remark = this.tbRemark.Text; int err = 0; if (LT_ID == 0) { err = lt.Insert(elt); if (err > 0) { el.L_Title = "标签管理"; el.L_Content = "标签类别添加成功"; el.L_MF = "模板标签"; el.UM_ID = AdminId; l.Insert(el); Alert("标签类别添加成功!", "LabelTypeList.aspx" + str); } else if (err == -1) { el.L_Title = "标签管理"; el.L_Content = "该标签已存在"; el.L_MF = "模板标签"; el.UM_ID = AdminId; l.Insert(el); Alert("该标签已存在!"); } else { el.L_Title = "标签管理"; el.L_Content = "标签类别添加失败!请稍后再试!"; el.L_MF = "模板标签"; { el.UM_ID = AdminId; } l.Insert(el); Alert("标签类别添加失败!请稍后再试!", "LabelTypeList.aspx" + str); } } else { elt.LT_ID = LT_ID; err = lt.Update(elt); if (err > 0) { el.L_Title = "标签管理"; el.L_Content = "标签类别修改成功"; el.L_MF = "模板标签"; { el.UM_ID = AdminId; } l.Insert(el); Alert("标签类别修改成功!", "LabelTypeList.aspx" + str); } else { el.L_Title = "标签管理"; el.L_Content = "标签类别修改!请稍后再试!"; el.L_MF = "模板标签"; { el.UM_ID = AdminId; } l.Insert(el); Alert("标签类别修改!请稍后再试!", "LabelTypeList.aspx" + str); } } }
protected void Button1_Click(object sender, EventArgs e) { XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); XYECOM.Model.UserGradeInfo eu = new XYECOM.Model.UserGradeInfo(); XYECOM.Business.UserGrade ug = new XYECOM.Business.UserGrade(); eu.GradeId = Convert.ToInt16(this.UG_ID.Value); eu.GradeName = this.txtname1.Text; eu.MonthlyRent = Convert.ToDecimal(this.mmoney1.Text); eu.AnnualRent = Convert.ToDecimal(this.ymoney1.Text); eu.SmallIconName = this.tbsmall.Text.Trim(); eu.BigIconName = this.tbbig.Text.Trim(); int i = 0; i = ug.Update(eu); string url = "UserGrade.aspx"; if (i >= 0) { el.L_Title = "用户等级管理"; el.L_Content = "修改用户等级成功"; el.L_MF = "财务管理"; el.UM_ID = AdminId; l.Insert(el); Response.Redirect(url); this.key.Value = "2"; } else { el.L_Title = "用户等级管理"; el.L_Content = "修改用户等级失败"; el.L_MF = "财务管理"; el.UM_ID = AdminId; l.Insert(el); Alert("修改失败!", url); } }
protected void gvlist_RowCommand(object sender, GridViewCommandEventArgs e) { XYECOM.Business.UserGrade ug = new XYECOM.Business.UserGrade(); if (e.CommandName == "up") { this.key.Value = "2"; XYECOM.Model.UserGradeInfo eu = new XYECOM.Model.UserGradeInfo(); this.UG_ID.Value = gvlist.DataKeys[Convert.ToInt16(e.CommandArgument)].Value.ToString(); eu = ug.GetItem(Convert.ToInt16(gvlist.DataKeys[Convert.ToInt16(e.CommandArgument)].Value.ToString())); this.txtname1.Text = eu.GradeName.ToString(); this.ymoney1.Text = XYECOM.Core.Utils.GetMoney(eu.AnnualRent.ToString()); this.mmoney1.Text = XYECOM.Core.Utils.GetMoney(eu.MonthlyRent.ToString()); this.tbsmall.Text = eu.SmallIconName; this.tbbig.Text = eu.BigIconName; } else if (e.CommandName == "del") { if (new XYECOM.Business.UserGrade().HasSubUser(gvlist.DataKeys[Convert.ToInt16(e.CommandArgument)].Value.ToString())) { Alert("该等级下已有用户信息,故不能删除!", "UserGrade.aspx"); } else { int i = 0; XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); i = ug.Delete(Convert.ToInt16(gvlist.DataKeys[Convert.ToInt16(e.CommandArgument)].Value.ToString())); if (i >= 0) { el.L_Title = "用户等级管理"; el.L_Content = "删除用户等级成功"; el.L_MF = "用户等级"; { el.UM_ID = AdminId; } l.Insert(el); string url = "UserGrade.aspx"; this.key.Value = "3"; Response.Redirect(url); } else { el.L_Title = "用户等级管理"; el.L_Content = "删除用户等级失败"; el.L_MF = "用户等级"; { el.UM_ID = AdminId; } l.Insert(el); string url = "UserGrade.aspx"; Alert("删除失败!", url); } } } }
protected void btnBackUpDatabase_Click(object sender, EventArgs e) { string prefix = DateTime.Now.ToString("yyyyMMddhhssmm"); string UserFileName = prefix + GenerateCheckCode(); database = GetSystemDatabaseName(); string path = Server.MapPath("/_BackUp/"); if (!Directory.Exists(path)) Directory.CreateDirectory(path); path += UserFileName + ".bak"; if (!File.Exists(path)) { try { StreamWriter stream = new StreamWriter(path); stream.Flush(); stream.Close(); } catch (Exception ex) { WriteLog("�������ݿ�ʧ��", ex); } } try { string backupSql = "use master;"; backupSql += "backup database @databse to disk =@path"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@databse",database), new SqlParameter("@path",path), }; XYECOM.Core.Data.SqlHelper.ExecuteNonQuery(CommandType.Text, backupSql, param); XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); el.L_Title = "���ݿ�ά��"; el.L_Content = "�������ݿ�"; el.L_MF = "ϵͳ����"; { el.UM_ID = AdminId; } l.Insert(el); Alert("���ݳɹ���"); ReadBackFile(); } catch (Exception ex) { string url = "DataList.aspx"; Alert("����ʧ�ܣ�<br/>(Ŀǰ��֧�ֳ�������������ݷ�����Ϊͬһ�������ı��ݲ�����", url); WriteLog("�������ݿ�ʧ�ܣ�", ex); } }
protected void btnok_Click(object sender, EventArgs e) { string oldSuffix = webInfo.WebSuffix; webInfo.WebName = this.tbwebname.Text.Trim(); webInfo.WebLogo = this.txtWebLogo.Text.Trim(); webInfo.WebDomain = this.tbweburl.Text.Trim(); webInfo.WebSuffix = this.tbwebsuffix.Text.Trim(); webInfo.StaticPageSuffix = this.ddlstaticpagesuffix.SelectedValue; webInfo.IsBogusStatic = XYECOM.Core.MyConvert.GetBoolean(rbbogusstatic.Text.Trim()); webInfo.WebMoneyName = this.webmoney.Text.Trim(); //是否启用二级域名 webInfo.IsDomain = rbdomain.Checked; webInfo.IsNewsDomain = rbnewsdomain.Checked; webInfo.IsTradeDomain = rdoTradeDomain.Checked; webInfo.IsAreaDomain = rdoAreaDomain.Checked; webInfo.IsTopicDomain = rdoTopicDomain.Checked; webInfo.IsProTypeDomain = rdoProtypeDomain.Checked; webInfo.CookieDomain = CookieDomain.Text.Trim(); if (rdoSiteStateOpen.Checked) webInfo.IsRun = true; else webInfo.IsRun = false; webInfo.SiteCloseTip = this.txtSiteCloseTips.Text.Trim(); //实例化网站设置方法类以及登录日志类 XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); bool result = webInfo.Update(); string url = "WebInfo.aspx"; if (result) { el.L_Title = "网站设置"; el.L_Content = "设置网站信息成功"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("设置成功!", url); } else { el.L_Title = "网站设置"; el.L_Content = "设置网站信息失败"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("设置失败!请检查/Config/目录写权限!", url); } string suffix = this.tbwebsuffix.Text.Trim(); if (!suffix.Equals(oldSuffix)) { ///Update web.config file XYECOM.Configuration.WebConfig.UpdateWebConfigForSuffix(suffix); //根据伪后缀名生成栏目目录的文件 string strfolderNames = "job,company,brand,news,user,person,shop,exhibition,trade,area"; foreach (XYECOM.Configuration.ModuleInfo info in XYECOM.Configuration.Module.Instance.ModuleItems) { strfolderNames += "," + info.SEName; } if (!oldSuffix.Equals("aspx")) { try { File.Delete(Server.MapPath("/Index." + oldSuffix)); } catch { } } string[] folderNames = strfolderNames.Split(','); for (int i = 0; i < folderNames.Length; i++) { try { File.Delete(Server.MapPath("/" + folderNames[i] + "/Index." + oldSuffix)); } catch { } } string message = ""; bool ok = false; if (!suffix.Equals("aspx")) { ok = CreateIndexPage("/"); if (ok == false) message += "目录写权限不足,生成自定义后缀系统首页文件(/index." + suffix + ")失败!可以手动拷贝/index.aspx 为 /index." + suffix + "<br/>"; } for (int i = 0; i < folderNames.Length; i++) { ok = CreateIndexPage("/" + folderNames[i] + "/"); if (ok == false) message += "目录写权限不足,生成自定义后缀频道首页(/" + folderNames[i] + "/index." + suffix + ")失败!可以手动拷贝/index.aspx 为 /" + folderNames[i] + "/index." + suffix + "<br/>"; } if (!oldSuffix.Equals("aspx")) { try { File.Delete(Server.MapPath("/UploadImage." + oldSuffix)); } catch { } } if (!suffix.Equals("aspx")) { try { File.Copy(Server.MapPath("/UploadImage.aspx"), Server.MapPath("/UploadImage." + suffix), true); } catch (Exception ex) { WriteLog("xymanage_basic_WebInfo.btnok_Click", ex); message += "目录写权限不足,生成自定义后缀图片上传文件(/UploadImage." + suffix + ")失败!可以手动拷贝/UploadImage.aspx 为 /UploadImage." + suffix + "<br/>"; } } if (!message.Equals("")) throw new Exception(message); } try { //生成对应的js配置信息 using (StreamWriter sw = new StreamWriter(Server.MapPath("/config/js/config.js"), false, System.Text.Encoding.Default)) { FileInfo ff = new FileInfo(Server.MapPath("/config/js/config.js")); ff.Attributes = FileAttributes.Normal; System.Text.StringBuilder strconfig = new System.Text.StringBuilder(); strconfig.AppendLine("function WebConfig() {"); strconfig.AppendLine(" return {"); strconfig.AppendLine(" BogusStatic:" + webInfo.IsBogusStatic.ToString().ToLower() + ","); strconfig.AppendLine(" IsDomain:" + webInfo.IsDomain.ToString().ToLower() + ","); strconfig.AppendLine(" IsNewsDomain:" + webInfo.IsNewsDomain.ToString().ToLower() + ","); strconfig.AppendLine(" Suffix:\"" + webInfo.WebSuffix + "\","); strconfig.AppendLine(" WebName:\"" + webInfo.WebName + "\","); strconfig.AppendLine(" WebURL:\"" + webInfo.WebDomain + "\","); strconfig.AppendLine(" TemplatePath:\"\""); strconfig.AppendLine(" };"); strconfig.AppendLine("}"); strconfig.AppendLine("var config = new WebConfig();"); sw.Write(strconfig.ToString()); sw.Flush(); } } catch (Exception ex) { WriteLog("生成JS配置信息失败!请检查/Config/目录写权限!", ex); } }
protected void btnDelete_Click(object sender, EventArgs e) { XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); XYECOM.Business.UserReg ur = new XYECOM.Business.UserReg(); string ids = ""; foreach (GridViewRow GR in this.gvlist.Rows) { if (((CheckBox)(GR.FindControl("chkExport"))).Checked == true) { ids += "," + this.gvlist.DataKeys[GR.DataItemIndex].Value.ToString(); } } if (ids.IndexOf(",") == 0) { ids = ids.Substring(1); int i = 0; i = ur.Delete(ids); if (i >= 0) { el.L_Title = "用户管理"; el.L_Content = "删除用户信息成功"; el.L_MF = "用户管理"; el.UM_ID = AdminId; l.Insert(el); BindData(); } else { el.L_Title = "用户管理"; el.L_Content = "删除用户信息失败"; el.L_MF = "用户管理"; el.UM_ID = AdminId; l.Insert(el); Alert("删除失败!"); } } }
protected void Button1_Click1(object sender, EventArgs e) { XYECOM.Business.UserPopedom up = new XYECOM.Business.UserPopedom(); XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); int UR_ID = 0; if (Request.QueryString["UR_ID"].ToString() != "") { UR_ID = Convert.ToInt32(Request.QueryString["UR_ID"].ToString()); } up.Delete(UR_ID); string sql = ""; for (int j = 0; j < this.cblbasic.Items.Count; j++) { if (this.cblbasic.Items[j].Selected == true) { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cblbasic.Items[j].Value + "',1,'" + UR_ID + "')"; } else { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cblbasic.Items[j].Value + "',0,'" + UR_ID + "')"; } } for (int t = 0; t < this.cblbusiness.Items.Count; t++) { if (this.cblbusiness.Items[t].Selected == true) { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cblbusiness.Items[t].Value + "',1,'" + UR_ID + "')"; } else { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cblbusiness.Items[t].Value + "',0,'" + UR_ID + "')"; } } for (int y = 0; y < this.cblnews.Items.Count; y++) { if (this.cblnews.Items[y].Selected == true) { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cblnews.Items[y].Value + "',1,'" + UR_ID + "')"; } else { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cblnews.Items[y].Value + "',0,'" + UR_ID + "')"; } } for (int n = 0; n < this.cbluser.Items.Count; n++) { if (this.cbluser.Items[n].Selected == true) { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cbluser.Items[n].Value + "',1,'" + UR_ID + "')"; } else { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cbluser.Items[n].Value + "',0,'" + UR_ID + "')"; } } for (int m = 0; m < this.cbllable.Items.Count; m++) { if (this.cbllable.Items[m].Selected == true) { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cbllable.Items[m].Value + "',1,'" + UR_ID + "')"; } else { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cbllable.Items[m].Value + "',0,'" + UR_ID + "')"; } } for (int w = 0; w < this.cblsystem.Items.Count; w++) { if (this.cblsystem.Items[w].Selected == true) { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cblsystem.Items[w].Value + "',1,'" + UR_ID + "')"; } else { sql += "insert into b_PopedomSet(P_TableName,P_IsPopedom,UR_ID) values('" + this.cblsystem.Items[w].Value + "',0,'" + UR_ID + "')"; } } int i = 0; string url = "Role.aspx"; i = XYECOM.Core.Data.SqlHelper.ExecuteNonQuery(sql); if (i >= 0) { el.L_Title = "权限管理"; el.L_Content = "设置权限信息成功"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("设置成功!", url); } else { el.L_Title = "权限管理"; el.L_Content = "设置权限信息失败"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("设置失败!", url); } }
protected void gvlist_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "del") { XYECOM.Model.AdminInfo ea = new XYECOM.Model.AdminInfo(); XYECOM.Business.Admin ad = new XYECOM.Business.Admin(); XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); int i = 0; int id = Int32.Parse(gvlist.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString()); if (id == AdminId) { string url = "Administrator.aspx"; this.ClientScript.RegisterClientScriptBlock(GetType(), "01", "<script>alertmsg(\"您不能删除自己!\",\"" + url + "\")</script>"); } else { el.L_Title = "管理员管理"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } this.key.Value = "3"; i = ad.Delete(id); if (i == 1) { el.L_Content = "删除管理员信息成功"; Response.Redirect(url); } else { el.L_Content = "删除管理员信息失败"; Alert("删除失败!", url); } l.Insert(el); } } else if (e.CommandName == "up") { this.key.Value = "2"; XYECOM.Business.Admin ad = new XYECOM.Business.Admin(); XYECOM.Model.AdminInfo ea = new XYECOM.Model.AdminInfo(); ea = ad.GetItem(Int32.Parse(gvlist.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString())); this.value.Value = gvlist.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString(); this.txtName1.Text = ea.UM_Name; this.ddlUpdate.SelectedValue = ea.UR_ID.ToString(); } }
protected void Submit1_ServerClick(object sender, EventArgs e) { this.key.Value = "2"; XYECOM.Business.Admin adminBLL = new XYECOM.Business.Admin(); XYECOM.Model.AdminInfo adminInfo = new XYECOM.Model.AdminInfo(); XYECOM.Business.Log l = new XYECOM.Business.Log(); XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo(); adminInfo = adminBLL.GetItem(Convert.ToInt32(this.value.Value)); adminInfo.UR_ID = Convert.ToInt32(this.ddlUpdate.SelectedValue.ToString()); adminInfo.UM_ID = Convert.ToInt32(this.value.Value); if (adminInfo.UM_Pwd != XYECOM.Core.SecurityUtil.MD5(this.txtYuanPwd.Text.Trim(), XYECOM.Configuration.Security.Instance.Md5value)) { Alert("原密码不正确!", url); return; } if (this.txtNewPwd.Text.Trim() != this.txtOKpwd.Text.Trim()) { Alert("两次密码输入不一致!", url); return; } adminInfo.UM_Pwd = XYECOM.Core.SecurityUtil.MD5(this.txtNewPwd.Text.Trim(), XYECOM.Configuration.Security.Instance.Md5value); int i = adminBLL.Update(adminInfo); if (i == 1) { el.L_Title = "管理员管理"; el.L_Content = "修改管理员信息成功"; el.L_MF = "系统信息设置"; { el.UM_ID = AdminId; } l.Insert(el); Alert("修改成功!", url); } else { Alert("修改失败!", url); } }