// event row click private void gridView_SoTietKiem_Click(object sender, EventArgs e) { if (gridView_SoTietKiem.GetFocusedRowCellValue("MaSTK") != null) { var _maSoTietKiem = int.Parse(gridView_SoTietKiem.GetFocusedRowCellValue("MaSTK").ToString()); SoTietKiem_DTO _soTietKiem = SoTietKiemBus.GetById(_maSoTietKiem); textBox_masotk.Text = _soTietKiem.MaSTK.ToString(); dateEditCreate.DateTime = _soTietKiem.NgayHieuLuc; dateEditDaoHan.DateTime = _soTietKiem.NgayDenHan; txtTienGui.Text = _soTietKiem.SoTienGui.ToString(); grid_khachhang.EditValue = _soTietKiem.MaKh; var kyhan = KyHanVayBus.GetById(_soTietKiem.MaKyHan); gridLookUpEditKyhan.EditValue = kyhan.MaKyHan; textBox_LaiXuat.Text = kyhan.LaiSuat.ToString(); var tienTe = LoaiTienBus.GetById(_soTietKiem.TienTe); gridLookUpEditLoaiTien.EditValue = tienTe.MaLoaiTien; } }
//Load private void MoSoTietKiemControl_Load(object sender, EventArgs e) { /* Load ds kỳ hạn */ gridLookUpEditKyhan.Properties.DataSource = KyHanVayBus.GetKyHanActive(); gridLookUpEditKyhan.Properties.DisplayMember = "SoThang"; gridLookUpEditKyhan.Properties.ValueMember = "MaKyHan"; /* Load ds khách hàng */ grid_khachhang.Properties.DataSource = KhachHangBus.GetAll(); grid_khachhang.Properties.DisplayMember = "Hoten"; grid_khachhang.Properties.ValueMember = "MaKh"; /* Load ds Loại tiền */ gridLookUpEditLoaiTien.Properties.DataSource = LoaiTienBus.GetAll(); gridLookUpEditLoaiTien.Properties.DisplayMember = "LoaiTien"; gridLookUpEditLoaiTien.Properties.ValueMember = "MaLoaiTien"; /*Load ds sổ tiết kiệm*/ gridControl_SoTietKiem.DataSource = SoTietKiemBus.GetAll(); // scroll gridView_SoTietKiem.ScrollStyle = ScrollStyleFlags.LiveHorzScroll; gridView_SoTietKiem.HorzScrollVisibility = ScrollVisibility.Always; }