/// <summary> /// Create a new Equipment object. /// </summary> /// <param name="equipmentId">Initial value of the EquipmentId property.</param> /// <param name="make">Initial value of the Make property.</param> /// <param name="description">Initial value of the Description property.</param> /// <param name="location">Initial value of the Location property.</param> /// <param name="serialNumber">Initial value of the SerialNumber property.</param> /// <param name="barcode">Initial value of the Barcode property.</param> /// <param name="status">Initial value of the Status property.</param> /// <param name="dateReceived">Initial value of the DateReceived property.</param> /// <param name="lifeExpectancy">Initial value of the LifeExpectancy property.</param> public static Equipment CreateEquipment(global::System.Int32 equipmentId, global::System.String make, global::System.String description, global::System.String location, global::System.String serialNumber, global::System.String barcode, global::System.String status, global::System.DateTime dateReceived, global::System.String lifeExpectancy) { Equipment equipment = new Equipment(); equipment.EquipmentId = equipmentId; equipment.Make = make; equipment.Description = description; equipment.Location = location; equipment.SerialNumber = serialNumber; equipment.Barcode = barcode; equipment.Status = status; equipment.DateReceived = dateReceived; equipment.LifeExpectancy = lifeExpectancy; return equipment; }
/// <summary> /// Deprecated Method for adding a new object to the Equipments EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToEquipments(Equipment equipment) { base.AddObject("Equipments", equipment); }
public ActionResult Equipment(itmmAdminEquipment model) { Equipment e = new Equipment(); e.Make = model.make; e.Description = model.description; e.Location = model.location; e.SerialNumber = model.serial; e.Barcode = model.barcode; e.Status = model.status; e.LifeExpectancy = model.life; e.DateReceived = DateTime.Now; con.AddToEquipments(e); //Laboratory_Equipment Laboratory_Equipment le = new Laboratory_Equipment(); le.EquipmentId = e.EquipmentId; le.LaboratoryId = getLabId(); con.AddToLaboratory_Equipment(le); con.SaveChanges(); return RedirectToAction("Equipment", "Head"); }