예제 #1
0
        private void bbiSua_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var ma = gbList.GetRowCellValue(gbList.FocusedRowHandle, colMa);
            if (ma == null)
                return;

            var loai = gbList.GetRowCellValue(gbList.FocusedRowHandle, colLoai);
            if (loai == null)
                return;

            if (loai.ToString() == "Thu")
            {
                var frm = new PhieuThu(ma.ToString());
                frm.Reload += (sx) =>
                {
                    bbiXem_ItemClick(this, null);
                };
                frm.ShowDialog();
            }
            else
            {
                var frm = new PhieuChi(ma.ToString());
                frm.Reload += (sx) =>
                {
                    bbiXem_ItemClick(this, null);
                };
                frm.ShowDialog();
            }
        }
예제 #2
0
 private void bbiLapPhieuThu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     var frm = new PhieuThu();
     frm.Reload += (sx) =>
     {
         bbiXem_ItemClick(this, null);
     };
     frm.ShowDialog();
 }
예제 #3
0
        private void Phieu_Thu(int loai)
        {
            var ma_chung_tu = gbList.GetRowCellValue(gbList.FocusedRowHandle, colMa_Chung_Tu);
            if (ma_chung_tu == null)
                return;

            string ten_khach_hang = gbList.GetRowCellValue(gbList.FocusedRowHandle, colTen_Khach_Hang) == null ? "" : gbList.GetRowCellValue(gbList.FocusedRowHandle, colTen_Khach_Hang).ToString();
            string so = gbList.GetRowCellValue(gbList.FocusedRowHandle, colSo) == null ? "" : gbList.GetRowCellValue(gbList.FocusedRowHandle, colSo).ToString();
            string so_cmnd = gbList.GetRowCellValue(gbList.FocusedRowHandle, colSo_CMND) == null ? "" : gbList.GetRowCellValue(gbList.FocusedRowHandle, colSo_CMND).ToString();
            if (!KiemTraPhieuDaChuoc(ma_chung_tu.ToString()))
            {
                return;
            }

            var so_tien = gbList.GetRowCellValue(gbList.FocusedRowHandle, colSo_Tien);
            var lai_suat_thang = gbList.GetRowCellValue(gbList.FocusedRowHandle, colLai_Suat_Thang);
            var ngay_ghi_so = gbList.GetRowCellValue(gbList.FocusedRowHandle, colNgay_Ghi_So);

            var frm = new PhieuThu();
            frm.Thiet_Lap(ma_chung_tu.ToString(), so, ten_khach_hang, so_cmnd, Convert.ToDecimal(so_tien), Convert.ToDecimal(lai_suat_thang), Convert.ToDateTime(ngay_ghi_so), loai);
            frm.Reload += (e) =>
            {
                bbiXem_ItemClick(this, null);
            };
            frm.ShowDialog();
        }