120
EPSetError(btSdal, (i == 1 || (Id_Sdal > 0 && Id_Fr > 0)) ? "" :
Properties.Resources.ResourceManager.GetString("zEdit_EPReq"));
EPSetError(btPrin, (i == 2 || (Id_Prin > 0 && Id_MH > 0)) ? "" :
Properties.Resources.ResourceManager.GetString("zEdit_EPReq"));
if ((EPNeeded) && (string.IsNullOrEmpty(EP.GetError(EPL))))
EP.SetError(EPL, EPL.Text);
}
return RetValue;
}
private void EName_TextChanged(object sender, EventArgs e)
{
btSave.Enabled = this.CanSave();
}
private void EName_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13) this.Enter2Tab(sender, e);
}
private void btSdal_Click(object sender, EventArgs e)
{
NameValue[] NVFind = new NameValue[] { new NameValue("Id_MH",
Id_Sdal) };
NameValue[] NVReturn = new NameValue[] { new NameValue("Id_MH", 0),
new NameValue("MHName", ""), new NameValue("Id_US", 0), new
NameValue("USName", "") };
using (gMH F = new gMH(ZGridPanelStyle.ZSAll, ZGridPanelAlign.Top, "",
"Id_MH", true, NVFind, ref NVReturn, Program.FndList))
{
DialogResult DR = F.ShowDialog(this);
if ((DR == DialogResult.OK) || (DR == DialogResult.Yes))
{
Id_Fr = (int)NVReturn[0].Value;
EFr.Text = string.Format("[{0}]{1}", Id_Fr, NVReturn[1].Value);
Id_Sdal = (int)NVReturn[2].Value;
ESdal.Text = string.Format("[{0}]{1}", Id_Sdal, NVReturn[3].Value);
this.SelectNextControl(btSdal, true, true, true, true);
btSave.Enabled = this.CanSave();
}
}
}
private void btPrin_Click(object sender, EventArgs e)
{
NameValue[] NVFind = new NameValue[] { new NameValue("Id_MH",
Id_Prin) };