コード例 #1
0
        private void timer_Tick(object sender, EventArgs e)
        {
            string qrdecode = "";

            if (BitImage is null)
            {
                return;
            }
            Bitmap        bit      = BitmapImageToBitmap(BitImage);
            BarcodeReader Reader   = new BarcodeReader();
            Result        qrResult = Reader.Decode(bit);

            try
            {
                qrdecode = qrResult?.Text.Trim();
            }
            catch (Exception ex)
            {
                qrdecode = "error";
            }
            QRString = qrdecode;
            if (!string.IsNullOrEmpty(qrdecode))
            {
                CloseQRDialog();
                if (_ActionCode == 1)
                {
                    AddToBorrow(QRString);
                }
                else
                {
                    CTPTS t = MyList.FirstOrDefault(x => x.MACTS.ToString() == QRString);
                    if (t is null)
                    {
                        this.eventAggregator.PublishOnCurrentThread(new Models.Message("Thông báo", "Không tìm thấy"));
                        return;
                    }
                    ReturnBookBill.Add(t);
                    MyList.Remove(t);
                    SumMoney += t.TIENPHAT ?? 0;
                }
            }
        }
コード例 #2
0
 public void Remove(CTPTS t)
 {
     MyList.Add(t);
     ReturnBookBill.Remove(t);
     SumMoney -= t.TIENPHAT ?? 0;
 }
コード例 #3
0
 public void Add(CTPTS t)
 {
     ReturnBookBill.Add(t);
     MyList.Remove(t);
     SumMoney += t.TIENPHAT ?? 0;
 }