示例#1
0
        void txtMa_Vt_Validating(object sender, CancelEventArgs e)
        {
            string strValue = txtMa_Vt.Text.Trim();
            bool   bRequire = false;

            frmVatTu frmLookup = new frmVatTu();
            DataRow  drLookup  = Lookup.ShowLookup(frmLookup, "LIVATTU", "Ma_Vt", strValue, bRequire, "", "");

            if (bRequire && drLookup == null)
            {
                e.Cancel = true;
            }

            if (drLookup == null)
            {
                txtMa_Vt.Text  = string.Empty;
                lbtTen_Vt.Text = string.Empty;
            }
            else
            {
                txtMa_Vt.Text  = ((string)drLookup["Ma_Vt"]).Trim();
                lbtTen_Vt.Text = ((string)drLookup["Ten_Vt"]).Trim();
                txtDvt.Text    = ((string)drLookup["Dvt"]).Trim();
            }

            dicName.SetValue(lbtTen_Vt.Name, lbtTen_Vt.Text);

            if ((((txtTextLookup)sender).AutoFilter != null) && ((txtTextLookup)sender).AutoFilter.Visible)
            {
                ((txtTextLookup)sender).AutoFilter.Visible = false;
                this.SelectNextControl(this.ActiveControl, true, true, true, true);
            }
        }
示例#2
0
        private void btnVatTu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmVatTu frm = new frmVatTu();

            OpenForm(frm, tabControl);
        }
示例#3
0
        private void btnThemVatTuMoi_Click(object sender, EventArgs e)
        {
            frmVatTu frm = new frmVatTu();

            frm.ShowDialog();
        }