void txtMa_Nh_Dt_Cha_Validating(object sender, CancelEventArgs e) { string strValue = txtMa_Nh_Dt_Cha.Text.Trim(); bool bRequire = false; frmDoiTuongNh frmLookup = new frmDoiTuongNh(); DataRow drLookup = Lookup.ShowLookup(frmLookup, "LIDOITUONGNH", "Ma_Nh_Dt", strValue, bRequire, "Nh_Cuoi = 0"); if (bRequire && drLookup == null) { e.Cancel = true; } if (drLookup == null) { txtMa_Nh_Dt_Cha.Text = string.Empty; lbtTen_Nh_Dt_Cha.Text = string.Empty; } else { txtMa_Nh_Dt_Cha.Text = ((string)drLookup["Ma_Nh_Dt"]).Trim(); lbtTen_Nh_Dt_Cha.Text = ((string)drLookup["Ten_Nh_Dt"]).Trim(); } dicName.SetValue(lbtTen_Nh_Dt_Cha.Name, lbtTen_Nh_Dt_Cha.Text); }
private void LoadLookupByGroup() { //Lookup danh muc doi tuong theo nhom string strValue = string.Empty; bool bRequire = this.bLookupRequire; string strKeyFilter = this.strLookupKeyFilter; frmDoiTuongNh frm = new frmDoiTuongNh(); frm.bEnterFinish = false; Lookup.ShowLookup(frm, "LIDOITUONGNH", "Ma_Nh_Dt", strValue, bRequire, "", "Nh_Cuoi = 1"); this.bIsEnter = frm.bIsEnter; this.drLookup = frm.drLookup; this.Close(); }