/// <summary> /// Carga y configuracion del grid de LeadSources /// </summary> /// <param name="blnOnlyOneRegister"></param> /// <param name="blnLeadSources"></param> /// <param name="blnAllLeadSources"></param> /// <param name="program"></param> /// <param name="blnLsHotelNotNull"></param> /// <history> /// [aalcocer] 26/May/2016 Created /// </history> private async void LoadLeadSources(bool blnOnlyOneRegister, bool blnLeadSources, bool blnAllLeadSources, EnumProgram program, bool blnLsHotelNotNull) { if (!blnLeadSources) { pnlLeadSource.Visibility = Visibility.Collapsed; return; } grdLeadSources.SelectionMode = (blnOnlyOneRegister) ? DataGridSelectionMode.Single : DataGridSelectionMode.Extended; _lstLeadSources = await BRLeadSources.GetLeadSourcesByUser(Context.User.User.peID, program); if (blnLsHotelNotNull) { List <string> lstLsIDHotelNotNull = (await BRLeadSources.GetLeadSources(1, EnumProgram.All)).Where(x => x.lsHotel != null).Select(x => x.lsID).ToList(); _lstLeadSources = _lstLeadSources.Where(x => lstLsIDHotelNotNull.Contains(x.lsID)).ToList(); } grdLeadSources.ItemsSource = _lstLeadSources; chkAllLeadSources.IsChecked = blnAllLeadSources; chkAllLeadSources.IsEnabled = !blnOnlyOneRegister; if (!_frmIh._clsFilter.LstLeadSources.Any()) { return; } chkAllLeadSources.IsChecked = false; _frmIh._clsFilter.LstLeadSources.ForEach(c => grdLeadSources.SelectedItems.Add(_lstLeadSources.SingleOrDefault(x => x.lsID == c))); if (grdLeadSources.SelectedItems.Count == grdLeadSources.Items.Count) { chkAllLeadSources.IsChecked = true; } }
/// <summary> /// Cargamos los LeadSources lgados al notice /// </summary> /// <history> /// [emoguel] created 26/07/2016 /// </history> private async void LoadLeadSources() { try { cmbLeadSources.ItemsSource = await BRLeadSources.GetLeadSources(-1, -1, -1); if (enumMode != EnumMode.Add) { List <LeadSource> lstLeadSources = await BRLeadSources.GetLeadsourcesByNotice(notice.noID); dgrLeadSources.ItemsSource = lstLeadSources; _lstOldLeadSources = lstLeadSources.Select(ls => { LeadSource lss = new LeadSource(); ObjectHelper.CopyProperties(lss, ls); return(lss); }).ToList(); cmbLeadSources.Header = "Lead Sources (" + lstLeadSources.Count + ")"; } skpStatus.Visibility = Visibility.Collapsed; btnAccept.Visibility = Visibility.Visible; GridHelper.SelectRow(dgrLeadSources, 0); } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
public async Task <int> GetLeadSources() { Cursor = Cursors.Wait; _leadsources = await BRLeadSources.GetLeadSources(1, Model.Enums.EnumProgram.All); cmbPlace.ItemsSource = _leadsources; Cursor = null; return(1); }
/// <summary> /// Llena el combobox de LeadSource /// </summary> /// <history> /// [emoguel] created 01/04/2016 /// </history> private async void LoadLeadSource() { try { List <LeadSource> lstLeadSource = await BRLeadSources.GetLeadSources(1, EnumProgram.All); cmblols.ItemsSource = lstLeadSource; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga el combobox de LeadSources /// </summary> /// <history> /// [emoguel] created 10/05/2016 /// [emoguel] modified 25/05/2016 se volvio Asyncrono el método /// </history> private async void LoadLeadSources() { try { List <LeadSource> lstLeadSources = await BRLeadSources.GetLeadSources(1, -1); cmbLoc.ItemsSource = lstLeadSources; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Llena el combobox de LeadSource /// </summary> /// <history> /// [emoguel] created 27/05/2016 /// </history> private async void LoadLeadSources() { try { List <LeadSource> lstLeadSources = await BRLeadSources.GetLeadSources(1, -1, -1); cmbsbID.ItemsSource = lstLeadSources; skpStatus.Visibility = Visibility.Collapsed; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Llena el grid de LeadSources /// </summary> /// <history> /// [emoguel] created 25/05/2016 /// </history> private async void LoadLeadSources() { try { List <LeadSource> lstAllLeadSources = await BRLeadSources.GetLeadSources(-1, -1); cmbLeadSources.ItemsSource = lstAllLeadSources; List <LeadSource> lstLeadSources = lstAllLeadSources.Where(ls => ls.lspg == program.pgID).ToList(); dgrLeadSources.ItemsSource = lstLeadSources; _oldList = lstLeadSources.ToList(); cmbLeadSources.Header = "Lead Source (" + lstLeadSources.Count + ")"; skpStatus.Visibility = Visibility.Collapsed; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga la informacion del formulario /// </summary> /// <history> /// [aalcocer] 05/03/2016 Created /// </history> private async void Window_ContentRendered(object sender, EventArgs e) { DateTime serverDate = BRHelpers.GetServerDate(); // Fecha inicial dtpStartDate.Value = new DateTime(serverDate.Year, serverDate.Month, 1); //Fecha final dtpEndDate.Value = serverDate; LoadFromFile(); // Lead Source cmbLS.ItemsSource = await BRLeadSources.GetLeadSources(1, Model.Enums.EnumProgram.All); cmbLS.SelectedValue = _leadsource.lsID; // Realiza la gráfica DoGraph(Convert.ToDateTime(dtpStartDate.Value), Convert.ToDateTime(dtpEndDate.Value), cmbLS.SelectedValue.ToString()); }
/// <summary> /// Llena el grid y el comobobox de LeadSource /// </summary> /// <history> /// [emoguel] created 09/06/2016 /// </history> private async void LoadLeadSources() { try { List <LeadSource> lstAllLeadSoources = await BRLeadSources.GetLeadSources(-1, -1, -1); cmbLeadSources.ItemsSource = lstAllLeadSoources; List <LeadSource> lstLeadSources = (!string.IsNullOrWhiteSpace(zone.znID)) ? lstAllLeadSoources.Where(ls => ls.lszn == zone.znID).ToList() : new List <LeadSource>(); dgrLeadSources.ItemsSource = lstLeadSources; _lstOldLeadSources = lstLeadSources.ToList(); cmbLeadSources.Header = "Lead Source (" + lstLeadSources.Count + ")"; if (enumMode != EnumMode.ReadOnly) { btnAccept.Visibility = Visibility.Visible; } skpStatus.Visibility = Visibility.Collapsed; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Llena el grid de LeadSources /// </summary> /// <param name="leadSources">Objeto a seleccionar</param> /// <history> /// [emoguel] created 13/05/2016 /// [emoguel] modified 25/05/2016 se volvio async el método /// </history> private async void loadLeadSources(LeadSource leadSources = null) { try { status.Visibility = Visibility.Visible; int nIndex = 0; List <LeadSource> lstLeadSource = await BRLeadSources.GetLeadSources(_nStatus, _nRegen, _nAnimation, _leadSourceFilter, true); if (lstLeadSource.Count > 0 && leadSources != null) { leadSources = lstLeadSource.Where(ls => ls.lsID == leadSources.lsID).FirstOrDefault(); nIndex = lstLeadSource.IndexOf(leadSources); } dgrLeadSources.ItemsSource = lstLeadSource; GridHelper.SelectRow(dgrLeadSources, nIndex); StatusBarReg.Content = lstLeadSource.Count + " Lead Sources."; status.Visibility = Visibility.Collapsed; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }