/// <summary>
 /// Create a new Laboratory_Material object.
 /// </summary>
 /// <param name="laboratory_MaterialId">Initial value of the Laboratory_MaterialId property.</param>
 /// <param name="laboratoryId">Initial value of the LaboratoryId property.</param>
 /// <param name="materialId">Initial value of the MaterialId property.</param>
 public static Laboratory_Material CreateLaboratory_Material(global::System.Int32 laboratory_MaterialId, global::System.Int32 laboratoryId, global::System.Int32 materialId)
 {
     Laboratory_Material laboratory_Material = new Laboratory_Material();
     laboratory_Material.Laboratory_MaterialId = laboratory_MaterialId;
     laboratory_Material.LaboratoryId = laboratoryId;
     laboratory_Material.MaterialId = materialId;
     return laboratory_Material;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Laboratory_Material EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLaboratory_Material(Laboratory_Material laboratory_Material)
 {
     base.AddObject("Laboratory_Material", laboratory_Material);
 }
        public ActionResult Material(itmmMaterial a)
        {
            int labid = getLabId();
            Material b = new Material();
            b.Name = a.Name;
            b.Description = a.Description;
            b.Quantity = a.Quantity;
            b.DateUpdated = DateTime.Now;

            con.AddToMaterials(b);

            Laboratory_Material c = new Laboratory_Material();
            c.LaboratoryId = labid;
            c.MaterialId = b.MaterialId;
            con.AddToLaboratory_Material(c);

            con.SaveChanges();
            return RedirectToAction("Material");
        }