示例#1
0
 /// <summary>
 /// Create a new Material object.
 /// </summary>
 /// <param name="materialId">Initial value of the MaterialId property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 /// <param name="quantity">Initial value of the Quantity property.</param>
 public static Material CreateMaterial(global::System.Int32 materialId, global::System.String name, global::System.String description, global::System.Int32 quantity)
 {
     Material material = new Material();
     material.MaterialId = materialId;
     material.Name = name;
     material.Description = description;
     material.Quantity = quantity;
     return material;
 }
示例#2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Materials EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMaterials(Material material)
 {
     base.AddObject("Materials", 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");
        }