private void saveForm() { newForm = new SchoolForm() { FormID = Convert.ToInt32(sFormIDTB.Text), FormName = ValidateName(sFormTB.Text) }; db.SchoolForms.Add(newForm); db.SaveChanges(); }
/// <summary> /// saves a new form for a school if the /// form is not available from the list /// </summary> private void saveForm() { SchoolForm newForm = new SchoolForm() { FormID = db.SchoolForms.Max(v => v.FormID) + 1, FormName = ValidateName(FormCB.Text) }; db.SchoolForms.Add(newForm); db.SaveChanges(); }