示例#1
0
        private void CmdOK_Click(object sender, System.EventArgs e)
        {
            if (m_Action == "AddBoard" )
                //�������
            {
                BBSClass BBS = new BBSClass();
                BBSBoard Board = new BBSBoard();
                HttpCookie UserCookie = Request.Cookies["Username"];
                String Username = UserCookie.Value.ToString();

                try
                {
                    Board.CatalogID = Int32.Parse (m_CatalogID);
                    Board.BoardName = this.TxtBoardName.Text;
                    Board.BoardDescription  = this.TxtBoardDescription.Text;
                    if ( this.RdPublic.Checked  == true )
                    {
                        Board.BoardType = 1;
                    }
                    else
                    {
                        Board.BoardType = 0;
                    }
                    BBS.BBSAddBoard(Board);
                    //Response.Write("<script language=javascript>alert('��ӳɹ�!');parent.location.reload();</script>");
                }
                catch (Exception ex)
                {
                    UDS.Components.Error.Log(ex.ToString());
                    Server.Transfer("../../Error.aspx");
                }
                finally
                {
                    BBS = null;
                    Board = null;
                    Server.Transfer("Catalog.aspx?classID="+classid);
                }
            }
            else if ( m_Action == "ModifyBoard")
            {
                //�༩���
                BBSClass BBS = new BBSClass();
                BBSBoard Board = new BBSBoard();
                HttpCookie UserCookie = Request.Cookies["Username"];
                String Username = UserCookie.Value.ToString();

                //try
                {
                    Board.BoardID = Int32.Parse (m_BoardID);
                    Board.BoardName = this.TxtBoardName.Text;
                    Board.BoardDescription  = this.TxtBoardDescription.Text;
                    if ( this.RdPublic.Checked  == true )
                    {
                        Board.BoardType = 1;
                    }
                    else
                    {
                        Board.BoardType = 0;
                    }
                    BBS.EditBBSBoard (Board);
                    Server.Transfer("Catalog.aspx?classID="+classid);
                }
                //catch (Exception ex)
                {
                //	UDS.Components.Error.Log(ex.ToString());
                //	Server.Transfer("../../Error.aspx");
                }
                //finally
                {
                    BBS = null;
                    Board = null;
                }
            }
        }