Ejemplo n.º 1
0
        private void btnLapPhieu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int      rowIndex     = gvMain.FocusedRowHandle;
            string   _MaBH        = ((DataTable)gcMain.DataSource).Rows[rowIndex]["MaBH"].ToString();
            DateTime _NgayLap     = DateTime.Parse(((DataTable)gcMain.DataSource).Rows[rowIndex]["NgayLap"].ToString());
            string   _MaKH        = CNThu == true ?((DataTable)gcMain.DataSource).Rows[rowIndex]["MaKH"].ToString(): ((DataTable)gcMain.DataSource).Rows[rowIndex]["MaNCC"].ToString();
            string   _TenKH       = CNThu == true ? ((DataTable)gcMain.DataSource).Rows[rowIndex]["TenKH"].ToString() : ((DataTable)gcMain.DataSource).Rows[rowIndex]["TenNCC"].ToString();
            decimal  _SoTien      = decimal.Parse(((DataTable)gcMain.DataSource).Rows[rowIndex]["SoTienNo"].ToString());
            decimal  _SoTienTra   = decimal.Parse(((DataTable)gcMain.DataSource).Rows[rowIndex]["SoTienTra"].ToString());
            decimal  _SoTienConNo = decimal.Parse(((DataTable)gcMain.DataSource).Rows[rowIndex]["SoTienConNo"].ToString());
            string   _GhiChu      = ((DataTable)gcMain.DataSource).Rows[rowIndex]["GhiChu"].ToString();

            CCongNo phieu = new CCongNo
            {
                MaBH        = _MaBH,
                NgayLap     = _NgayLap,
                MaKH        = _MaKH,
                TenKH       = _TenKH,
                SoTien      = _SoTien,
                SoTienTra   = _SoTienTra,
                SoTienConNo = _SoTienConNo,
                GhiChu      = _GhiChu
            };

            if (CNThu == true)
            {
                fPhieuTraTien pt = new fPhieuTraTien(true, phieu);
                pt.ShowDialog();
            }
            else
            {
                fPhieuTraTien pt = new fPhieuTraTien(false, phieu);
                pt.ShowDialog();
            }
        }
Ejemplo n.º 2
0
        private void btnLapPhieu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int      rowIndex = gvMain.FocusedRowHandle;
            string   _MaBH    = gvMain.GetRowCellValue(rowIndex, "MaBH").ToString();
            DateTime _NgayLap = DateTime.Parse(gvMain.GetRowCellValue(rowIndex, "NgayLap").ToString());
            string   _MaKH    = CNThu == true?gvMain.GetRowCellValue(rowIndex, "MaKH").ToString() : gvMain.GetRowCellValue(rowIndex, "MaNCC").ToString();

            string _TenKH = CNThu == true?gvMain.GetRowCellValue(rowIndex, "TenKH").ToString() : gvMain.GetRowCellValue(rowIndex, "TenNCC").ToString();

            decimal _SoTien      = decimal.Parse(gvMain.GetRowCellValue(rowIndex, "SoTienNo").ToString());
            decimal _SoTienTra   = decimal.Parse(gvMain.GetRowCellValue(rowIndex, "SoTienTra").ToString());
            decimal _SoTienConNo = decimal.Parse(gvMain.GetRowCellValue(rowIndex, "SoTienConNo").ToString());
            string  _GhiChu      = gvMain.GetRowCellValue(rowIndex, "GhiChu").ToString();
            CCongNo phieu        = new CCongNo
            {
                MaBH        = _MaBH,
                NgayLap     = _NgayLap,
                MaKH        = _MaKH,
                TenKH       = _TenKH,
                SoTien      = _SoTien,
                SoTienTra   = _SoTienTra,
                SoTienConNo = _SoTienConNo,
                GhiChu      = _GhiChu
            };

            if (CNThu == true)
            {
                fPhieuTraTien pt = new fPhieuTraTien(true, phieu);
                pt.ShowDialog();
            }
            else
            {
                fPhieuTraTien pt = new fPhieuTraTien(false, phieu);
                pt.ShowDialog();
            }
        }