private void PopulateRoomNoDropDown() { List <Model.RoomDropDownView> rooms = new RoomsLogic().GetRoomsForDropDownList(Global.CurrentApartment.ApartmentId); cbbRoomNo.ItemsSource = rooms; cbbRoomNo.DisplayMemberPath = "RoomNo"; cbbRoomNo.SelectedValuePath = "RoomId"; }
void Awake() { lockUnlock = GameObject.FindWithTag("LockUnlock"); economy_ui = GameObject.FindWithTag("ECONOMY_UI"); buttonShop = GameObject.FindWithTag("ButtonShop"); shop = GameObject.FindWithTag("SHOP"); roomsLogic = GameObject.FindWithTag("ROOMS_LOGIC").GetComponent <RoomsLogic>(); shopLogic = GameObject.FindWithTag("SHOP_LOGIC").GetComponent <ShopLogic>(); }
void Awake() { index = -1; PARENT = transform.parent.gameObject; lockUnlock = GameObject.FindWithTag("LockUnlock"); economy_ui = GameObject.FindWithTag("ECONOMY_UI"); buttonShop = GameObject.FindWithTag("ButtonShop"); shop = GameObject.FindWithTag("SHOP"); roomsLogic = GameObject.FindWithTag("ROOMS_LOGIC").GetComponent <RoomsLogic>(); shopLogic = GameObject.FindWithTag("SHOP_LOGIC").GetComponent <ShopLogic>(); }
private void btnDelete_Click(object sender, RoutedEventArgs e) { try { var selectedRoom = dgRooms.SelectedItem != null ? dgRooms.SelectedItem as Model.Room : null; if (selectedRoom != null) { if (MessageBox.Show("ยืนยันที่จะลบข้อมูลห้องพัก เลขที่ห้อง " + selectedRoom.RoomNo, "ยืนยันการลบข้อมูล", MessageBoxButton.OKCancel, MessageBoxImage.Warning) == MessageBoxResult.OK) { RoomsLogic r = new RoomsLogic(); r.DeleteRoom(selectedRoom); dgRooms.ItemsSource = new RoomsLogic().GetRooms(Global.CurrentApartment.ApartmentId); } } else { MessageBox.Show("กรุณาเลือกข้อมูลที่จะลบ", "เกิดข้อผิดพลาด", MessageBoxButton.OK, MessageBoxImage.Error); } } catch (Exception ex) { MessageBox.Show(ex.Message, "เกิดข้อผิดพลาด", MessageBoxButton.OK, MessageBoxImage.Error); } }