private void btnSelect_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { MenusBO aMenusBO = new MenusBO(); int IDMenu = Convert.ToInt32(grvMenus.GetFocusedRowCellValue("ID")); Menus aMenu = aMenusBO.Select_ByID(IDMenu); aMenu.Status = 0; aMenusBO.Update(aMenu); MessageBox.Show("Lựa chọn thực đơn chính thức thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); if (afrmTsk_CheckMenus != null) { afrmTsk_CheckMenus.Reload(); } this.Close(); }
//hiennv public void UpdateMenus(MenusEN aMenusEN) { try { Menus_FoodsBO aMenus_FoodsBO = new Menus_FoodsBO(); MenusBO aMenusBO = new MenusBO(); Menus aMenus = aMenusBO.Select_ByID(aMenusEN.ID); aMenus.Name = aMenusEN.Name; aMenus.Info = aMenusEN.Info; aMenus.IDBookingHall = aMenusEN.IDBookingHall; aMenus.IDSystemUser = aMenusEN.IDSystemUser; aMenusBO.Update(aMenus); aMenus_FoodsBO.Delete_ByIDMenu(aMenusEN.ID); foreach (Foods item in aMenusEN.aListFoods) { Menus_Foods aMenus_Foods = new Menus_Foods(); aMenus_Foods.IDMenu = aMenusEN.ID; aMenus_Foods.IDFood = item.ID; aMenus_FoodsBO.Insert(aMenus_Foods); } } catch (Exception ex) { throw new Exception(string.Format("ReceptionTaskBO.UpdateMenus:" + ex.Message)); } }