예제 #1
0
        void ucSitePicker_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ucSitePicker.SiteId > 0)
            {
                string roomStatusId = ((int)RoomStatus.Available).ToString();

                DataServiceHelper.ListRoomAsync(Globals.UserLogin.UserOrganisationId, ucSitePicker.SiteId, null, null,
                                                roomStatusId, null, null, false, ListRoomCompleted);
            }
        }
예제 #2
0
        private void RebindRoomData()
        {
            int    siteId = ucSitePicker.SiteId;
            string name   = txtName.Text;

            if (!string.IsNullOrEmpty(name))
            {
                name = name.Trim();
            }
            else
            {
                name = null;
            }

            int floor = -1000;

            if (!string.IsNullOrEmpty(txtFloor.Text))
            {
                if (!int.TryParse(txtFloor.Text, out floor))
                {
                    floor = 0;
                }
            }
            int?realFloor = null;

            if (floor != -1000)
            {
                realFloor = floor;
            }
            string statusIds = string.Empty;

            if (chkAvailable.IsChecked == true)
            {
                statusIds += ((int)RoomStatus.Available).ToString() + ",";
            }
            if (chkOccupied.IsChecked == true)
            {
                statusIds += ((int)RoomStatus.Occupied).ToString() + ",";
            }
            if (!string.IsNullOrEmpty(statusIds))
            {
                statusIds = statusIds.Substring(0, statusIds.Length - 1);
            }
            else
            {
                statusIds = null;
            }

            string roomTypeIDs = ucRoomTypes.SelectedRoomTypeIds;

            if (string.IsNullOrEmpty(roomTypeIDs))
            {
                roomTypeIDs = null;
            }

            bool showLegacy = chkShowLegacy.IsChecked == true;

            Globals.IsBusy = true;
            DataServiceHelper.ListRoomAsync(Globals.UserLogin.UserOrganisationId, siteId, null, name, statusIds, roomTypeIDs, realFloor, showLegacy,
                                            ListRoomCompleted);
        }