예제 #1
0
 private void saveForm()
 {
     newForm = new SchoolForm()
     {
         FormID   = Convert.ToInt32(sFormIDTB.Text),
         FormName = ValidateName(sFormTB.Text)
     };
     db.SchoolForms.Add(newForm);
     db.SaveChanges();
 }
예제 #2
0
        /// <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();
        }