protected void uiButtonSave_Click(object sender, EventArgs e) { AircraftManualCategory cat = new AircraftManualCategory(); if (CurrentCat != null) cat = CurrentCat; else cat.AddNew(); cat.Title = uiTextBoxTitle.Text; if (currentParentCat != 0) cat.ParentCategoryID = currentParentCat; cat.Save(); LoadCats(); LoadSubCats(); uiTextBoxTitle.Text = ""; uiPanelEdit.Visible = false; uiPanelViewAll.Visible = true; }
protected void uiRadGridSubCats_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "EditCat") { AircraftManualCategory objData = new AircraftManualCategory(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxTitle.Text = objData.Title; CurrentCat = objData; uiPanelEdit.Visible = true; uiPanelViewAll.Visible = false; } else if (e.CommandName == "DeleteCat") { AircraftManualCategory objData = new AircraftManualCategory(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); LoadSubCats(); } }