Пример #1
0
        public UCSearchAuction(string pStrText, List<Auction> pLstObjAuctions, FilterEnum pEnmFilter, AuctionSearchModeEnum pEnmSearchMode)
        {
            InitializeComponent();
            mObjAuctionServiceFactory = new AuctionsServicesFactory();

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

            mLcvListData = new ListCollectionView(pLstObjAuctions);
            dgDataGrid.ItemsSource = null;
            dgDataGrid.ItemsSource = mLcvListData;
            mEnmFilter = pEnmFilter;
            mEnmSearchMode = pEnmSearchMode;
        }
Пример #2
0
        //public List<Auction> SearchAuctions(string pStrAuction, FilterEnum pEnmFilter)
        //{
        //    return GetBestAuctionSearch(pStrAuction, GetAuctionByFilter(pEnmFilter).Where(x => x.Category == AuctionCategoryEnum.AUCTION));
        //}

        //public List<Auction> SearchDirectTradeAndSheep(string pStrAuction, FilterEnum pEnmFilter)
        //{
        //    return GetBestAuctionSearch(pStrAuction, GetAuctionByFilter(pEnmFilter).Where(x => x.Category == AuctionCategoryEnum.DIRECT_TRADE || x.Category == AuctionCategoryEnum.SHEEP));
        //}

        //public List<Auction> SearchDirectTrade(string pStrAuction, FilterEnum pEnmFilter)
        //{
        //    return GetBestAuctionSearch(pStrAuction, GetAuctionByFilter(pEnmFilter).Where(x => x.Category == AuctionCategoryEnum.DIRECT_TRADE));
        //}

        //public List<Auction> SearchSheep(string pStrAuction, FilterEnum pEnmFilter)
        //{
        //    return GetBestAuctionSearch(pStrAuction, GetAuctionByFilter(pEnmFilter).Where(x => x.Category == AuctionCategoryEnum.SHEEP));
        //}

        public List <Auction> SearchAuctions(string pStrAuction, FilterEnum pEnmFilter, AuctionSearchModeEnum pEnmSearchMode = 0)
        {
            return(GetBestAuctionSearch
                   (
                       pStrAuction,
                       GetAuctionByFilter(pEnmFilter).Where(x => pEnmSearchMode != 0 ?
                                                            (
                                                                pEnmSearchMode == AuctionSearchModeEnum.AUCTION ?
                                                                x.Category == AuctionCategoryEnum.AUCTION :
                                                                pEnmSearchMode == AuctionSearchModeEnum.DIRECT_TRADE ?
                                                                x.Category == AuctionCategoryEnum.DIRECT_TRADE : true
                                                            ) : true)
                   ));
        }
Пример #3
0
        public static Auction ShowAuctionChooseDialog(this UserControl pObjUserControl, object pObjSender, KeyEventArgs pObjArgs, FilterEnum pEnmFilter, AuctionSearchModeEnum pEnmSearchMode)
        {
            Auction        lObjAuction     = null;
            TextBox        lObjTextBox     = (pObjSender as TextBox);
            List <Auction> lLstObjAuctions = new AuctionsServicesFactory().GetAuctionService().SearchAuctions(lObjTextBox.Text, pEnmFilter, pEnmSearchMode);

            if (lLstObjAuctions.Count == 1)
            {
                lObjAuction = lLstObjAuctions[0];
            }
            else
            {
                lObjTextBox.Focusable = false;
                UserControl lUCAuction = new UCSearchAuction(lObjTextBox.Text, lLstObjAuctions, pEnmFilter, pEnmSearchMode);
                lObjAuction           = FunctionsUI.ShowWindowDialog(lUCAuction, Window.GetWindow(pObjUserControl)) as Auction;
                lObjTextBox.Focusable = true;
            }
            lObjTextBox.Focus();

            if (lObjAuction == null)
            {
                return(null);
            }

            MoveToNextUIElement(pObjArgs);
            return(lObjAuction);
        }