Beispiel #1
0
        /// <summary>
        ///  Carga y configuración del grid LeadSourcesPaymentCoom
        /// </summary>
        /// <param name="blnOnlyOneRegister"></param>
        /// <param name="blnLeadSourcesPaymentComm"></param>
        /// <param name="blnAllLeadSourcesPaymentComm"></param>
        /// <history>
        ///   [vku] 25/May/2016 Created
        /// </history>
        private void LoadLeadSourcesPaymentCoom(bool blnOnlyOneRegister, bool blnLeadSourcesPaymentComm, bool blnAllLeadSourcesPaymentComm)
        {
            if (!blnLeadSourcesPaymentComm)
            {
                return;
            }

            grdLeadSourcesPaymentComm.SelectionMode = (blnOnlyOneRegister) ? DataGridSelectionMode.Single : DataGridSelectionMode.Extended;
            pnlLeadSourcesPaymentComm.Visibility    = Visibility.Visible;
            List <string> _paymentComm = GetSettings.PRPaymentCommissions();

            _lstLeadSourcesPaymentComm            = BRLeadSources.GetLeadSourceById(_paymentComm);
            grdLeadSourcesPaymentComm.ItemsSource = _lstLeadSourcesPaymentComm;

            chkAllLeadSourcesPaymentComm.IsChecked = blnAllLeadSourcesPaymentComm;
            chkAllLeadSourcesPaymentComm.IsEnabled = !blnOnlyOneRegister;

            if (!frmPO._clsFilter._lstLeadSourcesPaymentComm.Any())
            {
                return;
            }

            chkAllLeadSourcesPaymentComm.IsChecked = (grdLeadSourcesPaymentComm.SelectionMode == DataGridSelectionMode.Extended) && frmPO._clsFilter.AllLeadSourcesPaymentComm;

            if (grdLeadSourcesPaymentComm.ItemsSource != null && !frmPO._clsFilter.AllLeadSourcesPaymentComm && !blnOnlyOneRegister)
            {
                grdLeadSourcesPaymentComm.SelectedItem = null;
                frmPO._clsFilter._lstLeadSourcesPaymentComm.ForEach(c =>
                {
                    grdLeadSourcesPaymentComm.SelectedItems.Add(_lstLeadSourcesPaymentComm.FirstOrDefault(l => l.lsID == c));
                });
            }
            else
            {
                grdLeadSourcesPaymentComm.SelectedItem = _lstLeadSourcesPaymentComm.FirstOrDefault(c => c.lsID == frmPO._clsFilter._lstLeadSourcesPaymentComm[0]);
            }
        }