protected void Page_Load(object sender, EventArgs e) { bool _IsLogin = EyouSoft.Security.Membership.UserProvider.IsLogin(out SiteUserInfo); if (SiteUserInfo == null) { EyouSoft.Model.SysStructure.MSysDomain sysDomain = EyouSoft.Security.Membership.UserProvider.GetDomain(); if (sysDomain != null) { EyouSoft.BLL.SysStructure.BSys Customer = new EyouSoft.BLL.SysStructure.BSys(); CustomerConfig = new EyouSoft.BLL.CrmStructure.BCrm().GetInfo(sysDomain.CompanyId); if (CustomerConfig != null) { DepartStamp = "http://" + Request.Url.Authority + CustomerConfig.Seal; PageHeadFile = "http://" + Request.Url.Authority + CustomerConfig.PrintHeader; PageFootFile = "http://" + Request.Url.Authority + CustomerConfig.PrintFooter; } } } else { CustomerConfig = new EyouSoft.BLL.CrmStructure.BCrm().GetInfo(SiteUserInfo.TourCompanyInfo.CompanyId); if (CustomerConfig != null) { DepartStamp = "http://" + Request.Url.Authority + CustomerConfig.Seal; PageHeadFile = "http://" + Request.Url.Authority + CustomerConfig.PrintHeader; PageFootFile = "http://" + Request.Url.Authority + CustomerConfig.PrintFooter; } } this.ibtnWord.Attributes.Add("onclick", "ReplaceInput();"); }
protected void Page_Load(object sender, EventArgs e) { bool _IsLogin = EyouSoft.Security.Membership.UserProvider.IsLogin(out SiteUserInfo); if (SiteUserInfo == null) { EyouSoft.Model.SysStructure.MSysDomain sysDomain = EyouSoft.Security.Membership.UserProvider.GetDomain(); if (sysDomain != null) { EyouSoft.BLL.SysStructure.BSys Customer = new EyouSoft.BLL.SysStructure.BSys(); CustomerConfig = new EyouSoft.BLL.ComStructure.BComSetting().GetModel(sysDomain.CompanyId); if (CustomerConfig != null) { DepartStamp = "http://" + Request.Url.Authority + CustomerConfig.CompanyChapter; PageHeadFile = "http://" + Request.Url.Authority + CustomerConfig.PagePath; PageFootFile = "http://" + Request.Url.Authority + CustomerConfig.FooterPath; } } } else { CustomerConfig = new EyouSoft.BLL.ComStructure.BComSetting().GetModel(SiteUserInfo.CompanyId); if (CustomerConfig != null) { DepartStamp = "http://" + Request.Url.Authority + CustomerConfig.CompanyChapter; PageHeadFile = "http://" + Request.Url.Authority + CustomerConfig.PagePath; PageFootFile = "http://" + Request.Url.Authority + CustomerConfig.FooterPath; } } }
/// <summary> /// btnUpdate_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpdate_Click(object sender, EventArgs e) { EyouSoft.Model.SysStructure.MWebmasterInfo webmasterInfo = new EyouSoft.Model.SysStructure.MWebmasterInfo(); EyouSoft.SSOComponent.Entity.MasterUserInfo loginUserInfo = Utils.GetWebmaster(); if (loginUserInfo != null) { webmasterInfo.UserId = loginUserInfo.UserId; webmasterInfo.Username = EyouSoft.Common.Utils.InputText(this.txtUsername.Value); webmasterInfo.Password = new EyouSoft.Model.CompanyStructure.PassWord(); webmasterInfo.Password.NoEncryptPassword = this.txtPassword.Value; if (string.IsNullOrEmpty(webmasterInfo.Username)) { this.RegisterAlertAndRedirectScript("登录账号不能为空", ""); return; } EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); if (bll.UpdateWebmasterInfo(webmasterInfo)) { this.RegisterAlertAndRedirectScript("账号信息更新成功", ""); } else { this.RegisterAlertAndRedirectScript("账号信息更新失败", ""); } } }
/// <summary> /// btnAddFirst_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddFirst_Click(object sender, EventArgs e) { var info = new EyouSoft.Model.SysStructure.MSysMenu1Info(); info.Name = EyouSoft.Common.Utils.GetFormValue("txtFirstName").Trim(); info.ClassName = EyouSoft.Common.Utils.GetFormValue("radClassName").Trim(); if (string.IsNullOrEmpty(info.Name)) { this.RegisterAlertAndReloadScript("一级栏目名称不能为空!"); return; } if (string.IsNullOrEmpty(info.ClassName)) { this.RegisterAlertAndReloadScript("请选择一级栏目小图标!"); return; } int identityId = new EyouSoft.BLL.SysStructure.BSys().InsertFirstMenu(info); if (identityId > 0) { this.RegisterAlertAndReloadScript("一级栏目添加成功!"); return; } else { this.RegisterAlertAndReloadScript("一级栏目添加失败!"); return; } }
/// <summary> /// btnUpdate_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpdate_Click(object sender, EventArgs e) { EyouSoft.Model.SSOStructure.MWebmasterInfo webmasterInfo = EyouSoft.Security.Membership.WebmasterProvider.GetWebmasterInfo(); if (webmasterInfo != null) { EyouSoft.Model.ComStructure.MPasswordInfo pwd = new EyouSoft.Model.ComStructure.MPasswordInfo(); pwd.NoEncryptPassword = EyouSoft.Common.Utils.GetFormValue("t_p"); if (string.IsNullOrEmpty(pwd.NoEncryptPassword)) { this.RegisterAlertAndRedirectScript("登录密码更新成功", ""); return; } EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); if (bll.SetWebmasterPwd(webmasterInfo.UserId, webmasterInfo.Username, pwd)) { this.RegisterAlertAndRedirectScript("登录密码更新成功", ""); } else { this.RegisterAlertAndRedirectScript("登录密码更新失败", ""); } } }
protected void Page_Load(object sender, EventArgs e) { if (Utils.GetQueryStringValue("dotype") == "logout") { Logout(); return; } PageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); int recordCount = 0; IList <EyouSoft.Model.SysStructure.MSysInfo> items = new EyouSoft.BLL.SysStructure.BSys().GetSyss(PageSize, PageIndex, ref recordCount, null); if (items != null && items.Count > 0) { this.rptSys.DataSource = items; this.rptSys.DataBind(); this.phNotFound.Visible = false; RegisterScript(string.Format("pConfig.pageSize={0};pConfig.pageIndex={1};pConfig.recordCount={2};", PageSize, PageIndex, recordCount)); } else { this.phNotFound.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { var info = new EyouSoft.BLL.SysStructure.BSys().GetSysInfo(Utils.GetQueryStringValue("SysId")); var setting = new EyouSoft.BLL.ComStructure.BComSetting().GetModel(Utils.GetQueryStringValue("cid")); if (info != null) { this.ltrSysId.Text = info.SysId; this.ltrCompanyId.Text = info.CompanyId; this.ltrIssueTime.Text = info.IssueTime.ToString(); this.ltrSysName1.Text = this.ltrSysName2.Text = info.SysName; this.ltrFullname.Text = info.FullName; this.ltrTelephone.Text = info.Telephone; this.ltrMobile.Text = info.Mobile; this.ltrUserId.Text = info.UserId; this.ltrUsername.Text = info.Username; this.ltrPassword.Text = info.Password.NoEncryptPassword; } if (setting.SmsConfig == null || !setting.SmsConfig.IsEnabled) { phSms.Visible = false; phSmsCreate.Visible = true; } else { ltrSmsAccount.Text = setting.SmsConfig.Account; ltrSmsAppKey.Text = setting.SmsConfig.AppKey; ltrSmsAppSecret.Text = setting.SmsConfig.AppSecret; phSms.Visible = true; phSmsCreate.Visible = false; } }
/// <summary> /// 初始化栏目、模块、权限信息 /// </summary> private void InitAllPrivs() { System.Text.StringBuilder html = new System.Text.StringBuilder(); EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); var items = bll.GetMenus(); bll = null; if (items != null && items.Count > 0) { foreach (var big in items) { html.AppendFormat("<div class=\"pBig\"><input type=\"checkbox\" id=\"chk_p_big_{1}\" value=\"{1}\" name=\"chk_p_big\" /><label for=\"chk_p_big_{1}\">{0}</label><span class=\"pno\">[{1}]</div></span>", big.Name , big.MenuId); if (big.Menu2s == null || big.Menu2s.Count < 1) { continue; } html.Append("<div>"); int i = 0; foreach (var small in big.Menu2s) { html.Append("<ul class=\"pSmall\">"); html.AppendFormat("<li class=\"pSmallTitle\"><input type=\"checkbox\" id=\"chk_p_small_{1}\" value=\"{1}\" name=\"chk_p_small\" /><label for=\"chk_p_small_{1}\">{0}</label><span class=\"pno\">[{1}]</span></li>", small.Name , small.MenuId); if (small.Privs != null && small.Privs.Count > 0) { foreach (var permission in small.Privs) { html.AppendFormat("<li class=\"pThird\" title=\"{2}\"><input type=\"checkbox\" id=\"chk_p_third_{1}\" value=\"{1}\" name=\"chk_p_third\" /><label for=\"chk_p_third_{1}\">{0}</label><span class=\"pno\">[{1}]</span></li>", permission.Name , permission.PrivsId, permission.Remark); } } html.Append("</ul>"); if (i % 4 == 3) { html.Append("<ul class=\"pSmallSpace\"><li></li></ul>"); } i++; } html.Append("<ul class=\"pSmallSpace\"><li></li></ul>"); html.Append("</div>"); } } this.ltrPermissions.Text = html.ToString(); string script = "var allPrivs={0};"; script = string.Format(script, Newtonsoft.Json.JsonConvert.SerializeObject(items)); this.RegisterScript(script); }
/// <summary> /// btnSave_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { EyouSoft.Model.SysStructure.MComMenu1Info info = new EyouSoft.Model.SysStructure.MComMenu1Info(); info.MenuId = ComMenu1Id; info.Name = Utils.GetFormValue("txtMenu1Name"); info.SysId = SysId; info.ClassName = Utils.GetFormValue("radClassName"); info.Menu2s = new List <EyouSoft.Model.SysStructure.MComMenu2Info>(); info.IsDisplay = Utils.GetFormValue("chkIsDisplay") == "1"; string[] chkSysMenu2Ids = Utils.GetFormValues("chkSysMenu2Id"); foreach (var s in chkSysMenu2Ids) { int sysMenu2Id = Utils.GetInt(s, -1); if (sysMenu2Id <= 0) { continue; } EyouSoft.Model.SysStructure.MComMenu2Info item = new EyouSoft.Model.SysStructure.MComMenu2Info(); item.DefaultMenu2Id = sysMenu2Id; item.MenuId = Utils.GetInt(Utils.GetFormValue("txtComMenu2Id_" + sysMenu2Id)); item.Name = Utils.GetFormValue("txtComMenu2Name_" + sysMenu2Id); item.Url = Utils.GetFormValue("txtSysMenu2Url_" + sysMenu2Id); info.Menu2s.Add(item); } //数据未验证 EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); if (info.MenuId > 0) { if (bll.UpdateSysMenu(info) == 1) { RegisterAlertAndRedirectScript("修改成功", string.Format("menu.aspx?sysid={0}&cid={1}", SysId, CompanyId)); } else { RegisterAlertAndReloadScript("修改失败"); } } else { if (bll.CreateSysMenu(info) == 1) { RegisterAlertAndRedirectScript("添加成功", string.Format("menu.aspx?sysid={0}&cid={1}", SysId, CompanyId)); } else { RegisterAlertAndReloadScript("添加失败"); } } bll = null; }
/// <summary> /// init sys info /// </summary> void InitSysInfo() { var sysInfo = new EyouSoft.BLL.SysStructure.BSys().GetSysInfo(SysId); if (sysInfo == null) { RegisterAlertAndRedirectScript("请求异常。", "systems.aspx"); } ltrSysName.Text = sysInfo.SysName; }
/// <summary> /// btnCreate click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnCreate_Click(object sender, EventArgs e) { EyouSoft.Model.SysStructure.MSysInfo info = new EyouSoft.Model.SysStructure.MSysInfo(); info.Password = new EyouSoft.Model.ComStructure.MPasswordInfo(); #region get form values info.SysName = Utils.GetFormValue("txtSysName"); info.FullName = Utils.GetFormValue("txtFullname"); info.Telephone = Utils.GetFormValue("txtTelephone"); info.Mobile = Utils.GetFormValue("txtMobile"); info.Username = Utils.GetFormValue("txtUsername"); info.Password.NoEncryptPassword = Utils.GetFormValue("txtPassword"); #endregion #region validate form if (string.IsNullOrEmpty(info.SysName)) { RegisterAlertScript("请输入系统名称!"); return; } if (string.IsNullOrEmpty(info.Username)) { RegisterAlertScript("请输入登录账号!"); return; } if (string.IsNullOrEmpty(info.Password.NoEncryptPassword)) { RegisterAlertScript("请输入登录密码!"); return; } #endregion info.SmsConfig = new EyouSoft.BLL.SmsStructure.BSmsAccount().CreateSmsAccount(); if (info.SmsConfig == null) { RegisterAlertScript("开通短信账号时异常!"); return; } int createResult = new EyouSoft.BLL.SysStructure.BSys().CreateSys(info); if (createResult == 1) { this.RegisterAlertAndRedirectScript("子系统添加成功", "systems.aspx"); } else { this.RegisterAlertAndRedirectScript("子系统添加失败", "systemadd.aspx"); } }
/// <summary> /// init sys default menus /// </summary> void InitSysMenus() { EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); var items = bll.GetMenus(); bll = null; if (items != null && items.Count > 0) { this.rptMenus.DataSource = items; this.rptMenus.DataBind(); } }
/// <summary> /// btnSetDefaultMenus_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSetDefaultMenus_Click(object sender, EventArgs e) { EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); if (bll.SetMenuBySys(SysId) == 1) { RegisterAlertAndRedirectScript("设置成功", string.Format("menu.aspx?sysid={0}&cid={1}", SysId, CompanyId)); } else { RegisterAlertAndRedirectScript("设置失败", string.Format("menu.aspx?sysid={0}&cid={1}", SysId, CompanyId)); } bll = null; }
/*/// <summary> * /// btnSetAdminPrivsBySys_Click * /// </summary> * /// <param name="sender"></param> * /// <param name="e"></param> * protected void btnSetAdminPrivsBySys_Click(object sender, EventArgs e) * { * EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); * if (bll.SetUserBySysPrivs(UserId, SysId) == 1) * { * RegisterAlertAndReloadScript("设置管理员账号权限为子系统权限成功"); * } * else * { * RegisterAlertAndReloadScript("设置管理员账号权限为子系统权限失败"); * } * bll = null; * }*/ /// <summary> /// btnSetAdminRoleByAdminRole_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSetAdminRoleByAdminRole_Click(object sender, EventArgs e) { EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); int roleId = bll.GetSysRoleId(CompanyId); if (bll.SetUserRole(UserId, roleId)) { RegisterAlertAndReloadScript("设置管理员为管理员角色成功"); } else { RegisterAlertAndReloadScript("设置管理员为管理员角色成功"); } }
/// <summary> /// delete company menu 1 /// </summary> void DeleteComMenu1() { int menu1Id = Utils.GetInt(Utils.GetQueryStringValue("mid")); EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); if (bll.DeleteSysMenu1(SysId, menu1Id) == 1) { RegisterAlertAndRedirectScript("删除成功", string.Format("menu.aspx?sysid={0}&cid={1}", SysId, CompanyId)); } else { RegisterAlertAndRedirectScript("删除失败", string.Format("menu.aspx?sysid={0}&cid={1}", SysId, CompanyId)); } }
protected void Page_Load(object sender, EventArgs e) { SysId = Utils.GetQueryStringValue("sysid"); var sysInfo = new EyouSoft.BLL.SysStructure.BSys().GetSysInfo(SysId); if (sysInfo == null) { RegisterAlertAndRedirectScript("请求异常。", "systems.aspx"); } ltrSysName.Text = sysInfo.SysName; InitDomains(); }
/// <summary> /// btnSetAdminPrivsBySys_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSetAdminRoleBySys_Click(object sender, EventArgs e) { EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); int roleId = bll.GetSysRoleId(CompanyId); if (bll.SetRoleBySysPrivs(roleId, SysId) == 1) { RegisterAlertAndReloadScript("设置管理员角色权限为子系统权限成功"); } else { RegisterAlertAndReloadScript("设置管理员角色权限为子系统权限失败"); } bll = null; }
protected void Page_Load(object sender, EventArgs e) { //权限判断 PowerControl(); UserId = this.SiteUserInfo.UserId; EyouSoft.BLL.SysStructure.BSys bsys = new EyouSoft.BLL.SysStructure.BSys(); if (bsys.IsExistsMenu2(this.SiteUserInfo.SysId, EyouSoft.Model.EnumType.PrivsStructure.Menu2.资源预控_车辆预控)) { this.SupplierControl1.Flag = 1; } //用车类型 InitCarType(); querenUrl = new EyouSoft.BLL.ComStructure.BComSetting().GetPrintUri(this.SiteUserInfo.CompanyId, EyouSoft.Model.EnumType.ComStructure.PrintTemplateType.用车确认单); #region 处理AJAX请求 //获取ajax请求 string doType = Utils.GetQueryStringValue("action"); if (doType != "") { //存在ajax请求 switch (doType) { case "save": Response.Clear(); Response.Write(PageSave()); Response.End(); break; case "delete": Response.Clear(); Response.Write(DelOperatCar()); Response.End(); break; case "update": GetCarModel(); break; default: break; } } #endregion PageInit(); }
/// <summary> /// btnupdate click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpdate_Click(object sender, EventArgs e) { EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); EyouSoft.Model.SysStructure.MSysInfo sysInfo = new EyouSoft.Model.SysStructure.MSysInfo(); sysInfo.SystemId = this.SysId; sysInfo = bll.GetSysInfo(this.SysId); #region get form values sysInfo.AdminInfo.UserName = EyouSoft.Common.Utils.InputText(this.txtUsername.Value); sysInfo.AdminInfo.PassWordInfo = new EyouSoft.Model.CompanyStructure.PassWord() { NoEncryptPassword = EyouSoft.Common.Utils.InputText(this.txtPassword.Value) }; sysInfo.Domains = this.GetSysDomains(); sysInfo.ModuleIds = this.GetBigPermissions(); sysInfo.PartIds = this.GetSmallPermissions(); sysInfo.PermissionIds = this.GetThirdPermissions(); sysInfo.Setting = this.GetSetting(); #endregion #region validate form string message = string.Empty; bool verifyResult = this.ValidateForm(sysInfo, out message); if (!verifyResult) { this.RegisterAlertAndRedirectScript(message, ""); return; } #endregion int addResult = bll.UpdateSys(sysInfo); if (addResult == 1) { message = "子系统修改成功!"; this.RegisterAlertAndRedirectScript(message, "systems.aspx"); } else { message = "子系统修改失败!"; this.RegisterAlertAndRedirectScript(message, "window.location.href"); } }
/// <summary> /// init systems /// </summary> private void InitSyss() { EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); IList <EyouSoft.Model.SysStructure.MLBSysInfo> items = bll.GetSyss(null); bll = null; if (items != null && items.Count > 0) { this.rptSys.DataSource = items; this.rptSys.DataBind(); this.phNotFound.Visible = false; } else { this.phNotFound.Visible = true; } }
/// <summary> /// 初始化域名信息集合 /// </summary> private void InitDomains() { string script = "var domains={0};"; EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); IList <EyouSoft.Model.SysStructure.MSysDomain> items = bll.GetDomains(SysId); bll = null; if (items == null || items.Count < 1) { RegisterScript(string.Format(script, "[]")); } else { RegisterScript(string.Format(script, Newtonsoft.Json.JsonConvert.SerializeObject(items))); } }
/// <summary> /// 初始化子系统 /// </summary> private void InitSyss() { EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); IList <EyouSoft.Model.SysStructure.MLBSysInfo> items = bll.GetSyss(null); bll = null; ddlSys.Items.Clear(); ddlSys.Items.Add(new ListItem("请选择子系统", "0")); if (items != null && items.Count > 0) { foreach (var item in items) { ddlSys.Items.Add(new ListItem(item.SysName, item.CompanyId.ToString())); } } }
protected void Page_Load(object sender, EventArgs e) { CompanyId = Utils.GetQueryStringValue("cid"); SysId = Utils.GetQueryStringValue("sysid"); if (!IsPostBack) { var sysInfo = new EyouSoft.BLL.SysStructure.BSys().GetSysInfo(SysId); if (sysInfo == null) { RegisterAlertAndRedirectScript("请求异常。", "systems.aspx"); } ltrSysName.Text = sysInfo.SysName; InitChannels(); InitPrices(); } }
protected void Page_Load(object sender, EventArgs e) { CompanyId = Utils.GetQueryStringValue("cid"); SysId = Utils.GetQueryStringValue("sysid"); ComMenu1Id = Utils.GetInt(Utils.GetQueryStringValue("mid")); var sysInfo = new EyouSoft.BLL.SysStructure.BSys().GetSysInfo(SysId); if (sysInfo == null) { RegisterAlertAndRedirectScript("请求异常。", "systems.aspx"); } ltrSysName.Text = sysInfo.SysName; InitSysMenus(); InitComMenus(); RegisterScript(string.Format("var comMenu1Id={0};", ComMenu1Id)); }
/// <summary> /// btnSetAdminPrivsBySys_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSetSysPrivs_Click(object sender, EventArgs e) { IList <EyouSoft.Model.SysStructure.MComMenu2Info> privs = new List <EyouSoft.Model.SysStructure.MComMenu2Info>(); string[] p1s = Utils.GetFormValues("chk_p_1"); foreach (var p1 in p1s) { string[] p2s = Utils.GetFormValues("chk_p_2_p1v_" + p1); foreach (var p2 in p2s) { EyouSoft.Model.SysStructure.MComMenu2Info privs2 = new EyouSoft.Model.SysStructure.MComMenu2Info(); privs2.Privs = new List <EyouSoft.Model.SysStructure.MSysPrivsInfo>(); privs2.MenuId = Utils.GetInt(p2); string[] p3s = Utils.GetFormValues("chk_P_3_p2v_" + p2); foreach (var p3 in p3s) { privs2.Privs.Add(new EyouSoft.Model.SysStructure.MSysPrivsInfo() { PrivsId = Utils.GetInt(p3) }); } privs.Add(privs2); } } EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); if (bll.SetSysPrivs(SysId, privs) == 1) { RegisterAlertAndRedirectScript("设置子系统权限成功", "systems.aspx"); } else { RegisterAlertAndReloadScript("设置子系统权限失败"); } bll = null; }
protected void Page_Load(object sender, EventArgs e) { CompanyId = Utils.GetQueryStringValue("cid"); SysId = Utils.GetQueryStringValue("sysid"); if (Utils.GetInt(Utils.GetQueryStringValue("ot"), 0) == 1)//删除一级栏目 { DeleteComMenu1(); return; } var sysInfo = new EyouSoft.BLL.SysStructure.BSys().GetSysInfo(SysId); if (sysInfo == null) { RegisterAlertAndRedirectScript("请求异常。", "systems.aspx"); } ltrSysName.Text = sysInfo.SysName; InitComMenus(); }
/// <summary> /// btnSubmit click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { IList <EyouSoft.Model.SysStructure.MSysDomain> items = GetDomains(); EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); #region validate form if (items == null || items.Count < 1) { RegisterAlertScript("至少要填写一个域名信息。"); return; } IList <string> existss = new List <string>(); foreach (var item in items) { existss.Add(item.Domain); } existss = bll.IsExistsDomains(SysId, existss); if (existss != null && existss.Count > 0) { RegisterAlertScript(string.Format("域名:{0}已经存在。", existss[0])); return; } #endregion int setResult = bll.SetSysDomains(SysId, items); if (setResult == 1) { this.RegisterAlertAndReloadScript("域名信息保存成功"); } else { this.RegisterAlertScript("域名信息保存失败"); } }
/// <summary> /// btnAddSecond_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddSecond_Click(object sender, EventArgs e) { var info = new EyouSoft.Model.SysStructure.MSysMenu2Info(); info.Name = EyouSoft.Common.Utils.GetFormValue("txtSecondName").Trim(); info.Url = EyouSoft.Common.Utils.GetFormValue("txtSecondUrl").Trim(); info.FirstId = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue("txtSecondFirst"), 0); if (info.FirstId < 1) { this.RegisterAlertAndReloadScript("请选择第一级栏目!"); return; } if (string.IsNullOrEmpty(info.Name)) { this.RegisterAlertAndReloadScript("二级栏目名称不能为空!"); return; } if (string.IsNullOrEmpty(info.Url)) { this.RegisterAlertAndReloadScript("二级栏目链接不能为空!"); return; } int identityId = new EyouSoft.BLL.SysStructure.BSys().InsertSecondMenu(info); if (identityId > 0) { this.RegisterAlertAndReloadScript("二级栏目添加成功!"); return; } else { this.RegisterAlertAndReloadScript("二级栏目添加失败!"); return; } }
/// <summary> /// btnAddThird_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddThird_Click(object sender, EventArgs e) { var info = new EyouSoft.Model.SysStructure.MSysPrivsInfo(); info.Name = EyouSoft.Common.Utils.GetFormValue("txtPrivsName").Trim(); info.SecondId = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue("txtThirdSecond")); int privsType = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue("txtPrivsType"), -1); if (info.SecondId < 1) { this.RegisterAlertAndReloadScript("请选择二级栏目!"); return; } if (string.IsNullOrEmpty(info.Name)) { } if (privsType == -1) { this.RegisterAlertAndReloadScript("请选择权限类别!"); return; } info.PrivsType = (EyouSoft.Model.EnumType.SysStructure.PrivsType)privsType; int identityId = new EyouSoft.BLL.SysStructure.BSys().InsertPrivs(info); if (identityId > 0) { this.RegisterAlertAndReloadScript("权限添加成功!"); return; } else { this.RegisterAlertAndReloadScript("权限添加失败!"); return; } }
/// <summary> /// 初始化系统信息 /// </summary> private void InitSysInfo() { EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); EyouSoft.Model.SysStructure.MSysInfo sysInfo = bll.GetSysInfo(this.SysId); bll = null; if (sysInfo == null) { this.RegisterAlertAndRedirectScript("未找到指定的系统信息", "systems.aspx"); return; } this.ltrSysName.Text = this.ltrTitleSysName.Text = sysInfo.SystemName; if (sysInfo.CompanyInfo != null) { this.ltrCompanyName.Text = sysInfo.CompanyInfo.CompanyName; this.ltrRealname.Text = sysInfo.CompanyInfo.ContactName; this.ltrTelephone.Text = sysInfo.CompanyInfo.ContactTel; this.ltrMobile.Text = sysInfo.CompanyInfo.ContactMobile; this.ltrFax.Text = sysInfo.CompanyInfo.ContactFax; } if (sysInfo.AdminInfo != null) { this.txtUsername.Value = sysInfo.AdminInfo.UserName; this.txtPassword.Value = sysInfo.AdminInfo.PassWordInfo.NoEncryptPassword; this.txtPassword.Attributes.Add("value", sysInfo.AdminInfo.PassWordInfo.NoEncryptPassword); } if (sysInfo.DepartmentInfo != null) { this.ltrHeadOfficeName.Text = sysInfo.DepartmentInfo.DepartName; } this.RegisterPrintDocumentScripts(); this.InitPermissions(); string script = string.Empty; if (sysInfo.Domains != null && sysInfo.Domains.Count > 0) { script = "var sysDomains={0};"; script = string.Format(script, Newtonsoft.Json.JsonConvert.SerializeObject(sysInfo.Domains)); this.RegisterScript(script); } else { this.RegisterScript("var sysDomains=[];"); } if (sysInfo.Setting != null) { script = "var sysSetting={0};"; script = string.Format(script, Newtonsoft.Json.JsonConvert.SerializeObject(sysInfo.Setting)); this.RegisterScript(script); } else { this.RegisterScript("var sysSetting=null;"); } script = "var sysPermissions={{first:{0},second:{1},third:{2}}};"; script = string.Format(script, Newtonsoft.Json.JsonConvert.SerializeObject(sysInfo.ModuleIds) , Newtonsoft.Json.JsonConvert.SerializeObject(sysInfo.PartIds) , Newtonsoft.Json.JsonConvert.SerializeObject(sysInfo.PermissionIds)); this.RegisterScript(script); }