protected void Page_Load(object sender, EventArgs e) { this.att.Columns.Add("typeid"); this.att.Columns.Add("typename"); this.att.Columns.Add("extname"); XmlDocumentExtender xmlDocumentExtender = new XmlDocumentExtender(); xmlDocumentExtender.Load(base.Server.MapPath(BaseConfigs.GetForumPath + "config/myattachment.config")); XmlNodeList xmlNodeList = xmlDocumentExtender.SelectNodes("/MyAttachmentsTypeConfigInfo/attachtypes/AttachmentType"); foreach (XmlNode xmlNode in xmlNodeList) { DataRow dataRow = this.att.NewRow(); dataRow["typeid"] = xmlNode["TypeId"].InnerText; dataRow["typename"] = xmlNode["TypeName"].InnerText; dataRow["extname"] = ((xmlNode["ExtName"].InnerText != "") ? xmlNode["ExtName"].InnerText : "无绑定类型"); this.att.Rows.Add(dataRow); } //this.dt = Attachments.GetAttachmentType(); //Request["typeid"]; if (!this.Page.IsPostBack) { this.BindData(); string text = ""; if (this.att != null) { foreach (DataRow dataRow2 in this.att.Rows) { text = text + dataRow2["extname"].ToString() + ","; } text = text.TrimEnd(','); } this.attachextensions.AddTableData(AttachType.FindAllWithCache()); string[] array = text.Split(','); for (int i = 0; i < array.Length; i++) { string a = array[i]; for (int j = 0; j < this.attachextensions.Items.Count; j++) { if (a == this.attachextensions.Items[j].Text) { this.attachextensions.Items[j].Enabled = false; break; } } } string text2 = "var atttype = \r\n{"; if (this.att != null) { foreach (DataRow dataRow3 in this.att.Rows) { string text3 = text2; text2 = text3 + "\r\n\ttype" + dataRow3["typeid"].ToString() + ":{typename:'" + dataRow3["typename"].ToString() + "',extname:'" + dataRow3["extname"].ToString() + "'},"; } text2 = text2.TrimEnd(','); } text2 += "\r\n};"; base.RegisterStartupScript("", "<script type='text/javascript'>\r\n" + text2 + "\r\n</script>"); } }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.AddUserGroupInf.Click += new EventHandler(this.AddUserGroupInf_Click); //DataTable attachmentType = Attachments.GetAttachmentType(); this.attachextensions.AddTableData(AttachType.FindAllWithCache()); }
private void radminid_SelectedIndexChanged(object sender, EventArgs e) { UserGroup userGroupInfo = UserGroup.FindByID(int.Parse(this.radminid.SelectedValue)); if (userGroupInfo != null) { this.creditshigher.Text = userGroupInfo.Creditslower.ToString(); this.creditslower.Text = userGroupInfo.Creditslower.ToString(); this.stars.Text = userGroupInfo.Stars.ToString(); this.color.Text = userGroupInfo.Color; this.groupavatar.Text = userGroupInfo.Groupavatar; this.readaccess.Text = userGroupInfo.Readaccess.ToString(); this.maxprice.Text = userGroupInfo.MaxPrice.ToString(); this.maxpmnum.Text = userGroupInfo.MaxPmNum.ToString(); this.maxsigsize.Text = userGroupInfo.MaxSigSize.ToString(); this.maxattachsize.Text = userGroupInfo.MaxAttachSize.ToString(); this.maxsizeperday.Text = userGroupInfo.MaxSizeperday.ToString(); DataTable attachmentType = AttachType.FindAllWithCache().ToDataTable(false); this.attachextensions.AddTableData(attachmentType, userGroupInfo.AttachExtensions); } AdminGroup adminGroupInfo = AdminGroup.FindByID(int.Parse(this.radminid.SelectedValue)); if (adminGroupInfo != null) { //admingroupright.SelectedIndex = -1; //admingroupright.Items[0].Selected = adminGroupInfo.AllowEditPost; //admingroupright.Items[1].Selected = adminGroupInfo.AllowEditpoll; //admingroupright.Items[2].Selected = adminGroupInfo.AllowDelPost; //admingroupright.Items[3].Selected = adminGroupInfo.AllowMassprune; //admingroupright.Items[4].Selected = adminGroupInfo.AllowViewIP; //admingroupright.Items[5].Selected = adminGroupInfo.AllowEditUser; //admingroupright.Items[6].Selected = adminGroupInfo.AllowViewLog; //admingroupright.Items[7].Selected = adminGroupInfo.DisablePostctrl; } }
private void AddNewRec_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(this.extension.Text)) { base.RegisterStartupScript("", "<script>alert('要添加的附件扩展名不能为空');window.location.href='forum_attachtypesgrid.aspx';</script>"); return; } if (String.IsNullOrEmpty(this.maxsize.Text) || this.maxsize.Text.ToInt() <= 0) { base.RegisterStartupScript("", "<script>alert('要添加的附件最大尺寸不能为空且要大于0');window.location.href='forum_attachtypesgrid.aspx';</script>"); return; } foreach (var at in AttachType.FindAllWithCache()) { if (at.Extension.EqualIgnoreCase(this.extension.Text)) { base.RegisterStartupScript("", "<script>alert('数据库中已存在相同的附件扩展名');window.location.href='forum_attachtypesgrid.aspx';</script>"); return; } } AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "添加附件类型", "添加附件类型,扩展名为:" + this.extension.Text); try { //Attachments.AddAttchType(this.extension.Text, this.maxsize.Text); AttachType.Add(extension.Text, maxsize.Text.ToInt()); base.RegisterStartupScript("PAGE", "window.location.href='forum_attachtypesgrid.aspx';"); } catch { base.RegisterStartupScript("", "<script>alert('无法更新数据库.');window.location.href='forum_attachtypesgrid.aspx';</script>"); } }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.UpdateUserGroupInf.Click += new EventHandler(this.UpdateUserGroupInf_Click); this.DeleteUserGroupInf.Click += new EventHandler(this.DeleteUserGroupInf_Click); this.attachextensions.AddTableData(AttachType.FindAllWithCache(), null, null); if (Request["groupid"] != "") { this.LoadUserGroupInf(DNTRequest.GetInt("groupid", -1)); return; } base.Response.Redirect("usergroupgrid.aspx"); }
public void SetGroupRights(string groupid) { var userGroupInfo = UserGroup.FindByID(groupid.ToInt()); this.creditshigher.Text = userGroupInfo.Creditshigher.ToString(); this.creditslower.Text = userGroupInfo.Creditslower.ToString(); this.stars.Text = userGroupInfo.Stars.ToString(); this.color.Text = userGroupInfo.Color; this.groupavatar.Text = userGroupInfo.Groupavatar; this.readaccess.Text = userGroupInfo.Readaccess.ToString(); this.maxprice.Text = userGroupInfo.MaxPrice.ToString(); this.maxpmnum.Text = userGroupInfo.MaxPmNum.ToString(); this.maxsigsize.Text = userGroupInfo.MaxSigSize.ToString(); this.maxattachsize.Text = userGroupInfo.MaxAttachSize.ToString(); this.maxsizeperday.Text = userGroupInfo.MaxSizeperday.ToString(); this.radminid.SelectedValue = userGroupInfo.RadminID.ToString(); var attachmentType = AttachType.FindAllWithCache().ToDataTable(false); this.attachextensions.AddTableData(attachmentType, userGroupInfo.AttachExtensions); this.usergrouppowersetting.Bind(userGroupInfo); var adminGroupInfo = AdminGroup.FindByID(groupid.ToInt()); if (adminGroupInfo != null) { this.admingroupright.Items[0].Selected = adminGroupInfo.AllowEditPost; this.admingroupright.Items[1].Selected = adminGroupInfo.AllowEditpoll; this.admingroupright.Items[2].Selected = adminGroupInfo.AllowDelPost; this.admingroupright.Items[3].Selected = adminGroupInfo.AllowMassprune; this.admingroupright.Items[4].Selected = adminGroupInfo.AllowViewIP; this.admingroupright.Items[5].Selected = adminGroupInfo.AllowEditUser; this.admingroupright.Items[6].Selected = adminGroupInfo.AllowViewLog; this.admingroupright.Items[7].Selected = adminGroupInfo.DisablePostctrl; this.admingroupright.Items[8].Selected = adminGroupInfo.AllowViewrealName; this.admingroupright.Items[9].Selected = adminGroupInfo.AllowBanUser; this.admingroupright.Items[10].Selected = adminGroupInfo.AllowBanIP; this.admingroupright.Items[11].Selected = adminGroupInfo.AllowModPost; this.admingroupright.Items[12].Selected = adminGroupInfo.AllowPostannounce; var config = GeneralConfigInfo.Current; this.admingroupright.Items[13].Selected = (("," + config.Reportusergroup + ",").IndexOf("," + groupid + ",") != -1); this.admingroupright.Items[14].Selected = (("," + config.Photomangegroups + ",").IndexOf("," + groupid + ",") != -1); } if (this.radminid.SelectedValue == "1") { this.allowstickthread.Enabled = false; this.allowstickthread.SelectedValue = "3"; return; } this.allowstickthread.Enabled = true; }
private void InitializeComponent() { this.SubmitBatchSet.Click += new EventHandler(this.SubmitBatchSet_Click); //DataTable userGroupForDataTable = UserGroups.GetUserGroupForDataTable(); var userGroupForDataTable = UserGroup.GetAll(); this.viewperm.AddTableData(userGroupForDataTable, "grouptitle", "id"); this.postperm.AddTableData(userGroupForDataTable, "grouptitle", "id"); this.replyperm.AddTableData(userGroupForDataTable, "grouptitle", "id"); this.getattachperm.AddTableData(userGroupForDataTable, "grouptitle", "id"); this.postattachperm.AddTableData(userGroupForDataTable, "grouptitle", "id"); this.attachextensions.AddTableData(AttachType.FindAllWithCache()); this.LoadCurrentForumInfo(DNTRequest.GetInt("fid", -1)); }
public void InitInfo() { this.targetforumid.BuildTree(XForum.Root, "name", "fid"); this.templateid.AddTableData(Template.GetValids(), "name", "id"); //DataTable dataTable = UserGroups.GetUserGroupForDataTable(); int num = 1; foreach (var ug in UserGroup.GetAll()) { HtmlTableRow htmlTableRow = new HtmlTableRow(); HtmlTableCell htmlTableCell = new HtmlTableCell("td"); if (num % 2 == 1) { htmlTableCell.Attributes.Add("class", "td_alternating_item1"); } else { htmlTableCell.Attributes.Add("class", "td_alternating_item2"); } htmlTableCell.Controls.Add(new LiteralControl("<input type='checkbox' id='r" + num + "' onclick='selectRow(" + num + ",this.checked)'><label for='r" + num + "'>" + ug.GroupTitle + "</lable>")); htmlTableRow.Cells.Add(htmlTableCell); htmlTableRow.Cells.Add(this.GetTD("viewperm", ug.ID, num)); htmlTableRow.Cells.Add(this.GetTD("postperm", ug.ID, num)); htmlTableRow.Cells.Add(this.GetTD("replyperm", ug.ID, num)); htmlTableRow.Cells.Add(this.GetTD("getattachperm", ug.ID, num)); htmlTableRow.Cells.Add(this.GetTD("postattachperm", ug.ID, num)); this.powerset.Rows.Add(htmlTableRow); num++; } //var dataTable = Attachments.GetAttachmentType(); this.attachextensions.AddTableData(AttachType.FindAllWithCache()); if (Request["fid"] != "") { this.targetforumid.SelectedValue = Request["fid"]; this.addtype.SelectedValue = "1"; this.targetforumid.Visible = true; } this.showcolnum.Attributes.Add("style", "display:none"); this.colcount.SelectedIndex = 0; this.colcount.Attributes.Add("onclick", "javascript:document.getElementById('" + this.showcolnum.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage51_colcount_0').checked ? 'none' : 'block');"); this.showclose.Attributes.Add("style", "display:none"); this.autocloseoption.SelectedIndex = 0; this.showtargetforum.Attributes.Add("style", "display:block"); this.addtype.Attributes.Add("onclick", "javascript:document.getElementById('" + this.showtargetforum.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage51_addtype_0').checked ? 'none' : 'block');setColDisplayer(document.getElementById('TabControl1_tabPage51_addtype_0').checked);"); this.autocloseoption.Attributes.Add("onclick", "javascript:document.getElementById('" + this.showclose.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage22_autocloseoption_0').checked ? 'none' : 'block');"); }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.radminid.SelectedIndexChanged += new EventHandler(this.radminid_SelectedIndexChanged); this.UpdateUserGroupInf.Click += new EventHandler(this.UpdateUserGroupInf_Click); this.DeleteUserGroupInf.Click += new EventHandler(this.DeleteUserGroupInf_Click); this.radminid.Items.Add(new ListItem("请选择 ", "0")); foreach (UserGroup current in UserGroup.FindAll管理组()) { if (current.ID > 0 && current.ID <= 3) { this.radminid.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); } } //DataTable attachmentType = Attachments.GetAttachmentType(); this.attachextensions.AddTableData(AttachType.FindAllWithCache(), null, null); }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.UpdateUserGroupInf.Click += new EventHandler(this.UpdateUserGroupInf_Click); this.radminid.Items.Add(new ListItem("请选择 ", "0")); foreach (UserGroup current in UserGroup.FindAll管理组()) { this.radminid.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); } //DataTable attachmentType = Attachments.GetAttachmentType(); this.attachextensions.AddTableData(AttachType.FindAllWithCache(), null, null); string @string = Request["groupid"]; if (@string != "") { this.LoadUserGroupInf(DNTRequest.GetInt("groupid", -1)); return; } base.Response.Redirect("sysglobal_sysadminusergroupgrid.aspx"); }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.TabControl1.SelectedIndex = DNTRequest.GetInt("tabindex", 0); this.SpecialUserList.PageIndexChanged += new DataGridPageChangedEventHandler(this.DataGrid_PageIndexChanged); this.TopicTypeDataGrid.ItemDataBound += new DataGridItemEventHandler(this.TopicTypeDataGrid_ItemDataBound); this.TopicTypeDataGrid.SortCommand += new DataGridSortCommandEventHandler(this.Sort_Grid); this.TopicTypeDataGrid.PageIndexChanged += new DataGridPageChangedEventHandler(this.TopicTypeDataGrid_PageIndexChanged); this.TopicTypeDataGrid.AllowCustomPaging = false; this.TopicTypeDataGrid.DataKeyField = "id"; this.TopicTypeDataGrid.ColumnSpan = 6; this.SubmitInfo.Click += new EventHandler(this.SubmitInfo_Click); this.RunForumStatic.Click += new EventHandler(this.RunForumStatic_Click); this.BindPower.Click += new EventHandler(this.BindPower_Click); this.DelButton.Click += new EventHandler(this.DelButton_Click); this.templateid.AddTableData(Template.GetValids(), "name", "id"); this.attachextensions.AddTableData(AttachType.FindAllWithCache(), null, null); this.LoadCurrentForumInfo(DNTRequest.GetInt("fid", -1)); this.SpecialUserList.AllowPaging = true; this.SpecialUserList.DataKeyField = "id"; }
private void InitializeComponent() { this.TabControl1.InitTabPage(); this.AddUserGroupInf.Click += new EventHandler(this.AddUserGroupInf_Click); this.radminid.SelectedIndexChanged += new EventHandler(this.radminid_SelectedIndexChanged); //DataTable attachmentType = Attachments.GetAttachmentType(); this.attachextensions.AddTableData(AttachType.FindAllWithCache()); this.radminid.Items.Add(new ListItem("请选择", "0")); var adminUserGroup = UserGroup.FindAll管理组(); foreach (var current in adminUserGroup) { if (current.ID > 0 && current.ID <= 3) { this.radminid.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); } } if (Request["groupid"] != "") { this.SetGroupRights(Request["groupid"]); } }
public void BindData() { this.DataGrid1.AllowCustomPaging = false; this.DataGrid1.TableHeaderName = "上传附件类型列表"; this.DataGrid1.BindData(AttachType.FindAllWithCache()); }