Exemplo n.º 1
0
        private void txtBuyer_KeyDown(object pObjSender, KeyEventArgs pObjArgs)
        {
            try
            {
                if (pObjArgs.Key == Key.Enter & ((pObjSender as TextBox).AcceptsReturn == false) && (pObjSender as TextBox).Focus())
                {
                    string lStrText = (pObjSender as TextBox).Text;
                    List <PartnerClassification> lLstObjClassifications = mObjBusinessFactory.GetPartnerClassificationService()
                                                                          .SearchPartner(lStrText, FilterEnum.ACTIVE).Where(x => mObjBuyerClassification != null ? x.Id != mObjBuyerClassification.Id : true).ToList();

                    if (lLstObjClassifications.Count == 1)
                    {
                        SetBuyerClassificationObject(lLstObjClassifications[0], pObjSender as TextBox);
                    }
                    else
                    {
                        (pObjSender as TextBox).Focusable = false;
                        UserControl lUCPartner = new UCSearchBusinessPartnerClassification(lStrText, lLstObjClassifications, FilterEnum.ACTIVE);
                        SetBuyerClassificationObject
                        (
                            mObjBusinessFactory.GetPartnerClassificationService().GetClassification
                            (
                                FunctionsUI.ShowWindowDialog(lUCPartner, this.GetParent()) as PartnerClassificationDTO
                            ),
                            pObjSender as TextBox
                        );
                        (pObjSender as TextBox).Focusable = true;
                    }
                }
            }
            catch (Exception lObjException)
            {
                CustomMessageBox.Show("Error", lObjException.Message, this.GetParent());
            }
        }
Exemplo n.º 2
0
        private void Search(string pStrText)
        {
            grdSearch.BlockUI();

            try
            {
                List <PartnerClassification> lLstObjBatchesList = mObjBusinessServicesFactory.GetPartnerClassificationService().SearchPartner(pStrText, mEnmFilter);

                this.Dispatcher.Invoke(() =>
                {
                    dgDataGrid.ItemsSource = null;
                    mLcvListData           = new ListCollectionView(mObjBusinessServicesFactory.GetPartnerClassificationService().ParseToDto(lLstObjBatchesList));
                    dgDataGrid.ItemsSource = mLcvListData;
                });
            }
            catch (Exception lObjException)
            {
                ShowMessage("Error", lObjException.Message);
            }
            finally
            {
                grdSearch.UnblockUI();
            }
        }
Exemplo n.º 3
0
        public UCSearchBusinessPartnerClassification(string pStrText, List <PartnerClassification> pLstObjClassifications, FilterEnum pEnmFilter)
        {
            InitializeComponent();
            mObjBusinessServicesFactory = new BusinessServicesFactory();

            if (!string.IsNullOrEmpty(pStrText))
            {
                txtSearch.Text = pStrText;
                txtSearch.Focus();
            }
            else
            {
                dgDataGrid.Focus();
            }

            mLcvListData           = new ListCollectionView(mObjBusinessServicesFactory.GetPartnerClassificationService().ParseToDto(pLstObjClassifications));
            dgDataGrid.ItemsSource = null;
            dgDataGrid.ItemsSource = mLcvListData;
            mEnmFilter             = pEnmFilter;
        }
Exemplo n.º 4
0
 private string GetCustomerClassificationCode(long pLonCustomerId)
 {
     return(mObjBusinessFactory.GetPartnerClassificationService().GetList().Where(x => x.Id == pLonCustomerId).Count() > 0 ?
            mObjBusinessFactory.GetPartnerClassificationService().GetList().Where(x => x.Id == pLonCustomerId).Select(y => y.Number).FirstOrDefault().ToString() : string.Empty);
 }
Exemplo n.º 5
0
 private void ReloadPagedList()
 {
     mLstObjQuery = mObjBusinessFactory.GetPartnerClassificationService().GetList().OrderBy(x => x.Name);
     UpdateCurrentPage(1, mIntRowsPerPage);
 }