protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "AddNew": pnlAddCategory.Visible = true; BindVersionCategory(); BindVersion(); break; case "Cancel": pnlAddCategory.Visible = false; txtTitle.Text = ""; ddlCategory.SelectedValue = ""; break; case "Add": if (Page.IsValid) { CSFactory.SaveVersion(CommonHelper.fixquotesAccents(txtTitle.Text), CommonHelper.fixquotesAccents(txtShortName.Text), cbVisible.Checked, Convert.ToInt32(ddlCategory.SelectedValue)); } pnlAddCategory.Visible = false; txtTitle.Text = ""; ddlCategory.SelectedValue = ""; BindVersion(); break; case "Back": Response.Redirect("Main.aspx"); break; } }
protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e) { switch (e.CommandName) { case "AddNew": pnlAddCategory.Visible = true; BindVersionCategory(); BindVersion(); BindModelVersions("", null); ActivateVersionDropDown(false); rbDesktop1.Checked = false; rbMobile1.Checked = false; rbTablet1.Checked = false; txtShortName.Text = string.Empty; txtTitle.Text = string.Empty; cbDynamic.Checked = false; cbVisible.Checked = true; break; case "Cancel": pnlAddCategory.Visible = false; txtTitle.Text = ""; ddlCategory.SelectedValue = ""; break; case "Add": if (Page.IsValid) { CSFactory.SaveVersion(CommonHelper.fixquotesAccents(txtTitle.Text), CommonHelper.fixquotesAccents(txtShortName.Text), cbVisible.Checked, Convert.ToInt32(ddlCategory.SelectedValue) , cbDynamic.Checked, Convert.ToInt32(ddlModel.SelectedValue) , rbDesktop1.Checked, rbTablet1.Checked, rbMobile1.Checked); } VersionManager.LoadVersions(); pnlAddCategory.Visible = false; txtTitle.Text = ""; ddlCategory.SelectedValue = ""; BindVersion(); break; case "Back": Response.Redirect("Main.aspx"); break; } }