Exemplo n.º 1
0
        private void PopulateRoomNoDropDown()
        {
            List <Model.RoomDropDownView> rooms = new RoomsLogic().GetRoomsForDropDownList(Global.CurrentApartment.ApartmentId);

            cbbRoomNo.ItemsSource       = rooms;
            cbbRoomNo.DisplayMemberPath = "RoomNo";
            cbbRoomNo.SelectedValuePath = "RoomId";
        }
Exemplo n.º 2
0
 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>();
 }
Exemplo n.º 3
0
 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>();
 }
Exemplo n.º 4
0
 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);
     }
 }