コード例 #1
0
ファイル: Section.aspx.cs プロジェクト: dalinhuang/labms
        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);
            }
        }
コード例 #2
0
ファイル: Plate.aspx.cs プロジェクト: dalinhuang/labms
        /// <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("你所访问的页面不存在!");
            }
        }
コード例 #3
0
ファイル: Moderators.aspx.cs プロジェクト: dalinhuang/labms
        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("�������ʵ�ҳ�治����!");
                }
            }
        }
コード例 #4
0
ファイル: Index.aspx.cs プロジェクト: dalinhuang/labms
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate();
         sections = pp.GetSections();
     }
 }
コード例 #5
0
ファイル: Index.aspx.cs プロジェクト: dalinhuang/labms
        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();
            }
        }
コード例 #6
0
ファイル: List.aspx.cs プロジェクト: dalinhuang/labms
 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())
         );
     }
 }
コード例 #7
0
        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 { }
        }
コード例 #8
0
ファイル: AddPlate.aspx.cs プロジェクト: dalinhuang/labms
        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())
                        );
                }

            }
        }
コード例 #9
0
ファイル: List.aspx.cs プロジェクト: dalinhuang/labms
        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())
                    );
                }
            }
        }