private void DeleteButton_Click(object sender, RoutedEventArgs e) { var icuId = IcuId; var bedId = BedId; var result = new BedApiCalls().RemoveBed(icuId, bedId); MessageBox.Show(result); Application.Current.MainWindow.Content = new MainPage(); }
public ObservableCollection <string> RetrieveBeds() { this.BedList.Clear(); var beds = new BedApiCalls().GetAllBedsFromAnIcu(this.icuList.SelectedItem.ToString()); foreach (var bed in beds) { this.BedList.Add(bed.BedId); } return(this.BedList); }
public void UpdateIcuDetails(IcuModel icu) { if (icu != null) { this.IcuId = icu.IcuId; this.Layout = icu.Layout; this.MaxBeds = icu.MaxBeds; this.NoOfBeds = icu.NoOfBeds; List <Backend.Models.BedModel> beds = new BedApiCalls().GetAllBedsFromAnIcu(icu.IcuId).ToList(); this.FreeBeds = beds.FindAll(bed => bed.BedOccupancyStatus == "Free").Count; } }
public void RetrieveBeds() { this._patient.BedIdList.Clear(); var bedsInIcu = new BedApiCalls().GetAllBedsFromAnIcu(icuIdList.SelectedItem.ToString()).ToList(); foreach (var bed in bedsInIcu) { if (bed.BedOccupancyStatus == "Free") { this._patient.BedIdList.Add(bed.BedId); } } }
private void IcuIDList_Selected(object sender, RoutedEventArgs e) { int pos = IcuIDListView.Items.IndexOf(IcuIDListView.SelectedItem.ToString()); var icu = icuList[pos]; this.icuId.Text = icu.IcuId; this.layout.Text = icu.Layout; this.maxBeds.Text = icu.MaxBeds.ToString(); this.bedsPresent.Text = icu.NoOfBeds.ToString(); List <Backend.Models.BedModel> beds = new BedApiCalls().GetAllBedsFromAnIcu(icu.IcuId).ToList(); this.freeBeds.Text = beds.FindAll(bed => bed.BedOccupancyStatus == "Free").Count.ToString(); }