Beispiel #1
0
        protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "AddNew":
                pnlAddCategory.Visible = true;
                //LanguageControl.Bind();
                BindCategory();
                break;

            case "Cancel":
                pnlAddCategory.Visible = false;
                txtCategory.Text       = "";
                break;

            case "Add":
                if (Page.IsValid)
                {
                    int orderno = 0;
                    if (!string.IsNullOrEmpty(txtorder.Text))
                    {
                        orderno = Convert.ToInt32(txtorder.Text);
                    }
                    CSFactory.SaveCategoy(txtCategory.Text, orderno);
                }


                pnlAddCategory.Visible = false;
                txtCategory.Text       = "";
                BindCategory();
                break;

            case "Back":
                Response.Redirect("Main.aspx");
                break;
            }
        }