/// <summary> /// Llena el combo de Hotel Group /// </summary> /// <history> /// [emoguel] created 30/03/2016 /// </history> private async void LoadGroups() { try { List <HotelGroup> lstHoGroup = await BRHotelGroups.GetHotelGroups(nStatus : 1); if (enumMode == EnumMode.Search) { lstHoGroup.Insert(0, new HotelGroup { hgID = "", hgN = "ALL" }); } cmbHotelGr.ItemsSource = lstHoGroup; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Llena el grid de Hotel Groups /// </summary> /// <param name="hotelGroup">Objeto a seleccionar</param> /// <history> /// [emoguel] created 12/05/2016 /// </history> private async void LoadHotelGroups(HotelGroup hotelGroup = null) { try { status.Visibility = Visibility.Visible; List <HotelGroup> lstHotelsGroup = await BRHotelGroups.GetHotelGroups(_hotelGroupFilter, _nStatus); dgrHotelGroups.ItemsSource = lstHotelsGroup; int nIndex = 0; if (lstHotelsGroup.Count > 0 && hotelGroup != null) { hotelGroup = lstHotelsGroup.Where(ho => ho.hgID == hotelGroup.hgID).FirstOrDefault(); nIndex = lstHotelsGroup.IndexOf(hotelGroup); } GridHelper.SelectRow(dgrHotelGroups, nIndex); StatusBarReg.Content = lstHotelsGroup.Count + " Hotel Groups"; status.Visibility = Visibility.Collapsed; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }