Exemplo n.º 1
0
        private void SearchOrderBackgroud(OrdersArgs oa)
        {
            entity.CainzOrder o = oa.OrderForSearch;
            using (var db = PublicDB.getDB(60))
            {
                if (o == null)
                {
                    oa.Orders = (from a in db.CainzOrder
                                 where a.IsDelete == 0 && (a.Status == 0 || a.Status == 1)
                                 orderby a.OrderNo descending
                                 select a).ToList();
                }
                else
                {

                    oa.Orders = (from a in db.CainzOrder
                                 where a.IsDelete == 0 && (a.Status == 0 || a.Status == 1) && (a.OrderExNo.Contains(o.OrderExNo) || a.OrderNo.Contains(o.OrderExNo)) && a.TraderName.Contains(o.TraderName)
                                 orderby a.OrderNo descending
                                 select a).ToList();
                }
            }
        }
Exemplo n.º 2
0
        private void SearchForMain()
        {
            Frozen(true);
            entity.CainzOrder _orderForSearch = new entity.CainzOrder();
            _orderForSearch.OrderExNo = txbSearch.Text.Trim();
            _orderForSearch.TraderName = txbTraderForSearch.Text.Trim();

            BackgroundWorker work = new BackgroundWorker();
            work.DoWork += Work_DoWork;
            work.RunWorkerCompleted += Work_RunWorkerCompleted;
            OrdersArgs oa = new OrdersArgs();
            oa.OrderForSearch = _orderForSearch;
            work.RunWorkerAsync(oa);
        }