Exemplo n.º 1
0
        protected static void InsertRecordAsync(DbObserverForm form, DbClientFileInfo info)
        {
            if (form.IsDisposed)
            {
                return;
            }

            form.InvokeSafe(new Action <DbClientFileInfo>((i) =>
            {
                Image voucher = i.VoucherImage.ToImage();
                Image barcode = i.BarCodeImage.ToImage();

                form.dgvData.Rows.Insert(0, i.RetailerID, i.RetailerID, i.VoucherID);
                form.dgvData.Rows[0].Tag = i;
                form.SetCurrent(0);
            }), info);
        }
Exemplo n.º 2
0
        private void SetCurrent(int index)
        {
            if (0 > index || index >= dgvData.Rows.Count)
            {
                return;
            }

            DbClientFileInfo info = (DbClientFileInfo)dgvData.Rows[index].Tag;

            if (info == null)
            {
                return;
            }

            pbBarCode.Picture            = (Image)info.BarCodeImage.Clone();
            pbVoucher.Picture            = (Image)info.VoucherImage.Clone();
            dgvData.Rows[index].Selected = true;
            Invalidate(true);
        }