private void ViTriBtn_Click(object sender, EventArgs e) { if (Application.OpenForms.OfType <ViTriForm>().Count() == 1) { Application.OpenForms.OfType <ViTriForm>().First().Focus(); } else { var form = new ViTriForm(); form.Show(); } }
public SuaViTri(ViTriForm form, string vt) : this() { try { parentForm = form; Vt = vt; var db = new CkpEntities(); var v = (from d in db.ViTriBom where d.ViTri == vt select d).FirstOrDefault(); ViTriTBox.Text = v.ViTri; } catch (Exception ex) { MessageBox.Show(ex.GetBaseException().Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ThemViTri(ViTriForm form) : this() { parentForm = form; }