コード例 #1
0
ファイル: News_Detail.aspx.cs プロジェクト: hihua/hihuacode
        protected void Page_Load(object sender, EventArgs e)
        {
            b_News = new BLL.News();

            if (!IsPostBack)
            {
                GetNewsTXT(News_Name);
                SetLanguageControl(News_LanguageID);

                switch (g_Action_ID)
                {
                    case 1:
                        News_AddTime_TD.Visible = false;
                        News_Submit.Text = " 添加 ";
                        break;

                    case 2:
                        if (g_News_ID == 0)
                            ResponseError("参数错误");

                        e_News = b_News.Select_News(g_News_ID);
                        if (e_News != null)
                        {
                            News_LanguageID.SelectedValue = e_News.News_LanguageID.ToString();
                            News_AddTime.Text = e_News.News_AddTime.ToString();
                            News_Intro.Text = e_News.News_Intro;
                            News_Title.Text = e_News.News_Title;
                            News_Content.Value = e_News.News_Content;
                        }

                        News_Submit.Text = " 修改 ";
                        break;

                    case 3:
                        if (g_News_ID == 0)
                            ResponseError("参数错误");

                        b_News.Delete_News(g_News_ID);
                        ResponseClose("删除成功");
                        break;
                }
            }
        }