/// <summary> /// Deprecated Method for adding a new object to the Laboratories EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToLaboratories(Laboratory laboratory) { base.AddObject("Laboratories", laboratory); }
public ActionResult Index(string LabName, string LabDesc, int[] room,string LabNum) { Laboratory f = new Laboratory(); f.LaboratoryName = LabName; f.LaboratoryDesc = LabDesc; f.LaboratoryContact = LabNum; con.AddToLaboratories(f); con.SaveChanges(); if (room != null) { foreach (var Room in room) { Laboratory_Room a = new Laboratory_Room(); a.LaboratoryId = f.LaboratoryId; var x = (from y in con.Rooms where y.RoomId == Room select y.RoomId).FirstOrDefault(); a.RoomId = x; con.AddToLaboratory_Room(a); con.SaveChanges(); } } return RedirectToAction("Index", "Admin"); }
/// <summary> /// Create a new Laboratory object. /// </summary> /// <param name="laboratoryId">Initial value of the LaboratoryId property.</param> /// <param name="laboratoryName">Initial value of the LaboratoryName property.</param> public static Laboratory CreateLaboratory(global::System.Int32 laboratoryId, global::System.String laboratoryName) { Laboratory laboratory = new Laboratory(); laboratory.LaboratoryId = laboratoryId; laboratory.LaboratoryName = laboratoryName; return laboratory; }