Example #1
0
        public void ShowMeResult_And_Fill_DataGrids(ItemsControl dg_lastnotes, ItemsControl dg_scannotes, string barcode)
        {
            var barcodeEntities = new BarcodeReaderEntities1();
            var bcs             = barcodeEntities.BarGoodsInfoes.Where(x => x.Barcode == barcode);

            foreach (var barGoodsInfo in bcs)
            {
                if (_str.Dismantling == _str.ResCallByName("Dismantle"))
                {
                    var goods = new GoodsEntities();
                    _log.Log_For_Database(barGoodsInfo.Name, barGoodsInfo.Type, barGoodsInfo.Barcode);
                    goods.SaveChanges();
                    UiInvoke((() =>
                    {
                        dg_lastnotes.ItemsSource =
                            _log.GetGoodsList(goods)
                            .OrderByDescending((x => x.Date))
                            .Take(Settings.Default.HowMany_Strings_ToShow1);
                        dg_scannotes.ItemsSource =
                            _log.GetGoodsList(goods)
                            .OrderByDescending((x => x.Date))
                            .Take(Settings.Default.HowMany_Strings_ToShow2)
                            .Where(x => x.Barcode == barcode);
                    }))
                    ;

                    if (_str.KeepSilence == _str.ResCallByName("ScanFinished"))
                    {
                        var quant = _log.GetGoodsList(goods).Count();
                        CheckTheDate(_log.GetGoodsList(goods), quant);
                    }
                }
            }
        }
Example #2
0
 private void FillGrid()
 {
     try
     {
         var con  = new BarcodeReaderEntities1();
         var data = con.BarGoodsInfoes.ToList();
         BarcodeData.ItemsSource = data;
     }
     catch (Exception ex)
     {
         _msg.Exception_MessageBox(ex, (_str.ResCallByName("DataGrid_Warning")));
         LetThemChoose((_str.ResCallByName("DataGrid_Error")), _str.ResCallByName("Title3"));
     }
 }