public ActionResult Edit(tblBuilding tblbuilding) { if (ModelState.IsValid) { db.tblBuildings.Attach(tblbuilding); db.ObjectStateManager.ChangeObjectState(tblbuilding, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(tblbuilding); }
/// <summary> /// Create a new tblBuilding object. /// </summary> /// <param name="buildingID">Initial value of the BuildingID property.</param> /// <param name="buildingCode">Initial value of the BuildingCode property.</param> /// <param name="buildingName">Initial value of the BuildingName property.</param> /// <param name="siteID">Initial value of the SiteID property.</param> /// <param name="energyStarBldgTF">Initial value of the EnergyStarBldgTF property.</param> /// <param name="energyStarSchemaStatus">Initial value of the EnergyStarSchemaStatus property.</param> public static tblBuilding CreatetblBuilding(global::System.Int32 buildingID, global::System.String buildingCode, global::System.String buildingName, global::System.Int32 siteID, global::System.Byte energyStarBldgTF, global::System.Int32 energyStarSchemaStatus) { tblBuilding tblBuilding = new tblBuilding(); tblBuilding.BuildingID = buildingID; tblBuilding.BuildingCode = buildingCode; tblBuilding.BuildingName = buildingName; tblBuilding.SiteID = siteID; tblBuilding.EnergyStarBldgTF = energyStarBldgTF; tblBuilding.EnergyStarSchemaStatus = energyStarSchemaStatus; return tblBuilding; }
/// <summary> /// Deprecated Method for adding a new object to the tblBuildings EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotblBuildings(tblBuilding tblBuilding) { base.AddObject("tblBuildings", tblBuilding); }