private void txtwlbh_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
if (this.txtwlbh.EditValue != null && this.txtwlbh.EditValue.ToString().Length > 3)
{
try
{
var bck = _commonClient.findWlxxList(new WlxxView() { wlbh = txtwlbh.Text });
if (bck.flag)
{
if (bck.obj.Count > 0)
{
var dt = new List<CodeName>();
bck.obj.ForEach(a => dt.Add(new CodeName() { code = a.wlxxid, name = a.wlbh }));
new FrmFastSearch(this.txtwlxxid, this.txtwlbh, dt).ShowDialog();
//txtwlxxid.EditValue = bck.obj[0].wlxxid;
}
}
else
{
MyMsg.ShowError(bck.message);
}
}
catch (Exception ex)
{
MyMsg.Warning(ex.Message);
}
}
}
}
private void txtmc_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
if (this.txtmc.EditValue != null && this.txtmc.EditValue.ToString().Length > 3)
{
try
{
var bck = _commonClient.findWlxxList(new WlxxView() { wlmc = txtmc.Text });
if (bck.flag)
{
if (bck.obj.Count > 0)
{
var dt = new List<CodeName>();
//dt.Add(new CodeName() { code = "", name = "" });
bck.obj.ForEach(a => { dt.Add(new CodeName() { code = a.wlxxid, name = a.wlmc }); });
new FrmFastSearch(this.txtwlxxid,this.txtmc, dt).ShowDialog();
}
}
else
{
MyMsg.ShowError(bck.message);
}
}
catch (Exception ex)
{
MyMsg.Warning(ex.Message);
}
}
}
}
private void txtwlxxid_EditValueChanged(object sender, EventArgs e)
{
try
{
if (txtwlxxid.EditValue!=null)
{
if (txtwlxxid.EditValue.ToString().Length > 4)
{
var bck = _commonClient.findWlxxList(new WlxxView()
{
wlxxid = txtwlxxid.EditValue.ToString()
});
if (bck.flag)
{
if (bck.obj.Count > 0)
{
txtwlbh.EditValue = bck.obj[0].wlbh;
txtmc.EditValue = bck.obj[0].wlmc;
}
}
else
{
MyMsg.ShowError(bck.message);
return;
}
}
}
}
catch (Exception ex)
{
MyMsg.ShowError(ex.Message);
return;
}
}