//protected void BindMenuItems() //{ // //List<hccMenuItem> items = hccMenuItem.GetAll((HealthyChef.Common.Enums.MealTypes)CurrentMenuItem.MealType).Where(a => a.MenuItemID != CurrentMenuItem.MenuItemID).ToList(); // List<hccMenuItem> items = hccMenuItem.GetAll().Where(a => a.MenuItemID != CurrentMenuItem.MenuItemID).ToList(); // List<hccMenuItem> selected = CurrentMenuItem.GetChildren(); // lstMenuItems.DataBind<hccMenuItem>(items, selected); //} protected void btnDeactivate_Click(object sender, EventArgs e) { try { CurrentMenuItem = hccMenuItem.GetById(PrimaryKeyIndex); CurrentMenuItem.Retire(CurrentMenuItem.IsRetired); SetButtons(); OnSaved(new ControlSavedEventArgs(CurrentMenuItem.MenuItemID)); } catch (Exception) { throw; } }
void gvwRetiredMenuItems_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { int menuItemId = int.Parse(e.Keys[0].ToString()); hccMenuItem delItem = hccMenuItem.GetById(menuItemId); if (delItem != null) { delItem.Retire(true); BindBothLists(); } } catch (Exception) { throw; } }