public AddPreStuRelVM(int id) { preStuRel = new PreStuRel(); foreach (var presences in entities.Presences) { preNamesList.Add(presences.PresenceID, presences.Name); } foreach (var student in entities.Students) { stuNamesList.Add(student.StudentID, student.Surname); } }
public ActionResult AddPresence(FormCollection collection) { try { PreStuRel preStuRel = new PreStuRel(); if (TryUpdateModel(preStuRel)) { preStuRelRepository.AddPreStuRel(preStuRel); preStuRelRepository.Save(); return RedirectToAction("Presences", new { id = preStuRel.StudentsID }); } return View(preStuRel); } catch { return View(); } }
public void AddPreStuRel(PreStuRel preStuRel) { entities.PreStuRels.AddObject(preStuRel); }
/// <summary> /// Create a new PreStuRel object. /// </summary> /// <param name="preStuRel1">Initial value of the PreStuRel1 property.</param> /// <param name="studentsID">Initial value of the StudentsID property.</param> /// <param name="presencesID">Initial value of the PresencesID property.</param> public static PreStuRel CreatePreStuRel(global::System.Int32 preStuRel1, global::System.Int32 studentsID, global::System.Int32 presencesID) { PreStuRel preStuRel = new PreStuRel(); preStuRel.PreStuRel1 = preStuRel1; preStuRel.StudentsID = studentsID; preStuRel.PresencesID = presencesID; return preStuRel; }
/// <summary> /// Deprecated Method for adding a new object to the PreStuRels EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToPreStuRels(PreStuRel preStuRel) { base.AddObject("PreStuRels", preStuRel); }