private void OnButtonSearch() { MakeEmptyDetail(); if (chk_DoanKhach.Checked == true) { Form_TimKiemVaChonDoanKhach frm = new Form_TimKiemVaChonDoanKhach(); dtRowTemp = frm.ShowModal(); if (dtRowTemp != null) { txt_MaDoanKhach.Properties.Mask.UseMaskAsDisplayFormat = true; txt_MaDoanKhach.Text = dtRowTemp["Ma_DOAN_KHACH"].ToString(); cbo_CongTy.SelectedValue = dtRowTemp["Ma_CONG_TY"].ToString(); LoadGridByDoanKhach(int.Parse(txt_MaDoanKhach.EditValue.ToString())); } } else { Form_TimKiemVaChonKhachHang frm = new Form_TimKiemVaChonKhachHang(); dtRowTemp = frm.ShowModal(); if (dtRowTemp != null) { txt_MaKhachHang.Properties.Mask.UseMaskAsDisplayFormat = true; txt_MaKhachHang.Text = dtRowTemp["Ma_KHACH_HANG"].ToString(); txt_TenKhachHang.Text = dtRowTemp["TEN_KHACH_HANG"].ToString(); LoadGridByKhachHang(int.Parse(txt_MaKhachHang.EditValue.ToString())); } } }
private void OnButtonSearch() { MakeEmptyDetail(); if (chk_DoanKhach.Checked == true) { Form_TimKiemVaChonDoanKhach frm = new Form_TimKiemVaChonDoanKhach(); dtRowTemp = frm.ShowModal(); if (dtRowTemp != null) { txt_MaDoanKhach.Text = dtRowTemp["MaDK"].ToString(); cbo_CongTy.SelectedValue = dtRowTemp["MaCT"].ToString(); LoadGridByDoanKhach(int.Parse(txt_MaDoanKhach.Text.Substring(2))); } } else { Form_TimKiemVaChonKhachHang frm = new Form_TimKiemVaChonKhachHang(); dtRowTemp = frm.ShowModal(); if (dtRowTemp != null) { txt_MaKhachHang.Text = dtRowTemp["MaKH"].ToString(); txt_TenKhachHang.Text = dtRowTemp["TEN_KHACH_HANG"].ToString(); LoadGridByKhachHang(int.Parse(txt_MaKhachHang.Text.Substring(2))); } } }