Exemplo n.º 1
0
        /// <summary>
        /// Carga y configuracion del grid Segments
        /// </summary>
        /// <param name="blnSegments"></param>
        /// <param name="blnAllSegments"></param>
        /// <history>
        /// [aalcocer] 09/07/2016 Created
        /// </history>
        private async void LoadSegments(bool blnSegments, bool blnAllSegments)
        {
            if (!blnSegments)
            {
                pnlSegments.Visibility = Visibility.Collapsed;
                return;
            }

            _lstSegmentByAgencies = await BRSegmentsByAgency.GetSegMentsByAgency();

            dtgSegments.ItemsSource = _lstSegmentByAgencies;

            chkAllSegments.IsChecked = blnAllSegments;

            if (!frmPrs._clsFilter.LstSegments.Any())
            {
                return;
            }

            chkAllSegments.IsChecked = frmPrs._clsFilter.BlnAllSegments;
            if (dtgSegments.ItemsSource != null && !frmPrs._clsFilter.BlnAllSegments)
            {
                dtgSegments.SelectedItem = null;
                frmPrs._clsFilter.LstSegments.ForEach(c =>
                {
                    dtgSegments.SelectedItems.Add(_lstSegmentByAgencies.FirstOrDefault(p => p.seID == c));
                });
            }
            else
            {
                dtgSegments.SelectedItem = _lstSegmentByAgencies.FirstOrDefault(c => c.seID == frmPrs._clsFilter.LstSegments.First());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Llena el combobox de segments By agency
        /// </summary>
        /// <history>
        /// [emoguel] created 11/03/2016
        /// </history>
        protected async void LoadSegments()
        {
            try
            {
                List <SegmentByAgency> lstSegmentsByAgencies = await BRSegmentsByAgency.GetSegMentsByAgency(new SegmentByAgency());

                cmbagse.ItemsSource = lstSegmentsByAgencies;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Llena el combobox de segment cuando se abre desde agency
        /// </summary>
        /// <history>
        /// [emoguel] created 14/03/2016
        /// </history>
        protected async void loadSegments()
        {
            try
            {
                List <SegmentByAgency> lstSegmentsByAgency = await BRSegmentsByAgency.GetSegMentsByAgency(new SegmentByAgency());

                lstSegmentsByAgency.Insert(0, new SegmentByAgency {
                    seID = "", seN = "ALL"
                });
                cmbSegment.ItemsSource = lstSegmentsByAgency;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Carga el grid de segmentByAgency
        /// </summary>
        /// <param name="segmentByAgency">objeto a seleccionar</param>
        /// <history>
        /// [emoguel] created 31/05/2016
        /// </history>
        private async void LoadSegmentsByAgency(SegmentByAgency segmentByAgency = null)
        {
            try
            {
                status.Visibility = Visibility.Visible;
                int nIndex = 0;
                List <SegmentByAgency> lstSegmentsByAgency = await BRSegmentsByAgency.GetSegMentsByAgency(_segmentByAgencyFilter, _nStatus);

                dgrSegments.ItemsSource = lstSegmentsByAgency;
                if (lstSegmentsByAgency.Count > 0 && segmentByAgency != null)
                {
                    segmentByAgency = lstSegmentsByAgency.Where(sg => sg.seID == segmentByAgency.seID).FirstOrDefault();
                    nIndex          = lstSegmentsByAgency.IndexOf(segmentByAgency);
                }
                GridHelper.SelectRow(dgrSegments, nIndex);
                StatusBarReg.Content = lstSegmentsByAgency.Count + " Segments.";
                status.Visibility    = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }