protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int id = 0; if (string.IsNullOrEmpty(Request.QueryString["id"])) { WriteBackScript("alert('指定版块分区不存在');window.location.href='Index.aspx';"); return; } if (!int.TryParse(Request.QueryString["id"], out id)) { WriteBackScript("alert('指定版块分区不存在');window.location.href='Index.aspx';"); return; } ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); ppInfo = pp.GetModel(id); if (ppInfo == null) { WriteBackScript("alert('指定版块分区不存在');window.location.href='Index.aspx';"); return; } dsPlates = pp.GetSubPlates(id, true); } }
/// <summary> /// 绑定数据 /// </summary> protected void BindData() { if (!string.IsNullOrEmpty(Request.QueryString["plateID"])) { int id = 0; if (!int.TryParse(Request.QueryString["plateID"], out id)) { throw new Exception("你所访问的页面不存在!"); } ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); LabMS.Model.PostPlate ppInfo = pp.GetModel(id); if (ppInfo == null) { throw new Exception("当前版块已经在另一处被删除!"); } ExtendBLL.Post post = new ExtendBLL.Post(); DataSet dsWholePosts = post.GetAllWithFullInfo(ppInfo.ID); AspNetPager.RecordCount = dsWholePosts.Tables[0].Rows.Count; HandleData(dsWholePosts); } else { throw new Exception("你所访问的页面不存在!"); } }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("BKGL"); strPageUserType.Add("mana"); if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["plateID"])) { int id = 0; if (!int.TryParse(Request.QueryString["plateID"], out id)) { throw new Exception("�������ʵ�ҳ�治����!"); } ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); LabMS.Model.PostPlate ppInfo = pp.GetModel(id); if (ppInfo == null) { throw new Exception("��ǰ���������һ����ɾ��!"); } PlateTitle.Text = ppInfo.Name; dsModerators = pp.GetAllModerators(id); } else { throw new Exception("�������ʵ�ҳ�治����!"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); sections = pp.GetSections(); } }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("BKGL"); strPageUserType.Add("mana"); if (!Page.IsPostBack) { ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); sections = pp.GetSections(); } }
protected void BindSections() { ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); DataSet ds = pp.GetSections(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DropDownListSections.Items.Add( new ListItem(ds.Tables[0].Rows[i]["Name"].ToString(), ds.Tables[0].Rows[i]["ID"].ToString()) ); } }
public void ProcessRequest(HttpContext context) { try { string strJson = System.Web.HttpContext.Current.Server.UrlDecode(context.Request.Form.ToString()); LabMS.Model.PostPlateJson ppj = (LabMS.Model.PostPlateJson)Newtonsoft.Json.JavaScriptConvert.DeserializeObject(strJson, typeof(LabMS.Model.PostPlateJson)); ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); pp.UpdateModerators(ppj); context.Response.ContentType = "application/json"; context.Response.Write("{success: true}"); } catch { } }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("BKGL"); strPageUserType.Add("mana"); if (!Page.IsPostBack) { int id = 0; if (!string.IsNullOrEmpty(Request.QueryString["sectionID"])) { int.TryParse(Request.QueryString["sectionID"], out id); } ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); if (id != 0) { LabMS.Model.PostPlate ppInfo = pp.GetModel(id); if (ppInfo != null) { SectionName.Text = ppInfo.Name; SectionList.Visible = false; SectionName.Visible = true; return; } } DataSet ds = pp.GetSections(); foreach (DataRow row in ds.Tables[0].Rows) { SectionList.Items.Add( new ListItem(row["Name"].ToString(), row["ID"].ToString()) ); } } }
protected void BindPlates() { DropDownListPlates.Items.Clear(); DropDownListPlates.Items.Add(new ListItem("ȫ��", "-1")); if (DropDownListSections.SelectedValue == "-1") // ȫ�� { return; } else { ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); DataSet ds = pp.GetSubPlates(int.Parse(DropDownListSections.SelectedValue)); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DropDownListPlates.Items.Add( new ListItem(ds.Tables[0].Rows[i]["Name"].ToString(), ds.Tables[0].Rows[i]["ID"].ToString()) ); } } }