Пример #1
0
        private void cmdOK_ServerClick(object sender, System.EventArgs e)
        {
            if (m_Action == "AddCatalog" )
            {
                //��������
                BBSClass BBS = new BBSClass();
                BBSCatalog Catalog = new BBSCatalog();
                HttpCookie UserCookie = Request.Cookies["Username"];
                String Username = Server.UrlDecode(Request.Cookies["UserName"].Value);

                //try
                {
                    Catalog.CatalogName = TxtCatalogName.Value;
                    Catalog.CatalogDescription = TxtCatalogDescription.Value;
                    BBS.AddBBSCatalog(Catalog);
                    Server.Transfer("Catalog.aspx?classID="+classid);
                }
                //catch (Exception ex)
                {
                //	UDS.Components.Error.Log(ex.ToString());
                //	Server.Transfer("../../Error.aspx");
                }
                //finally
                {
                    BBS = null;
                    Catalog = null;
                }
            }
            else if (m_Action == "ModifyCatalog")
            {
                //�༩���
                BBSClass BBS = new BBSClass();
                BBSCatalog Catalog = new BBSCatalog();
                HttpCookie UserCookie = Request.Cookies["Username"];
                String Username = Server.UrlDecode(Request.Cookies["UserName"].Value);

                //try
                {
                    Catalog.CatalogID = Int32.Parse(m_CatalogID);
                    Catalog.CatalogName = this.TxtCatalogName.Value;
                    Catalog.CatalogDescription = this.TxtCatalogDescription.Value;
                    BBS.EditBBSCatalog (Catalog);
                    Server.Transfer("Catalog.aspx?classID="+classid);

                }
                //catch (Exception ex)
                {
                //	UDS.Components.Error.Log(ex.ToString());
                //	Server.Transfer("../../Error.aspx");
                }
                //finally
                {
                    BBS = null;
                    Catalog = null;
                }
            }
        }