public ActionResult BizUnitEdit(BizUnit bizUnit) { if (ModelState.IsValid) { db.BizUnits.Attach(bizUnit); db.ObjectStateManager.ChangeObjectState(bizUnit, EntityState.Modified); db.SaveChanges(); return RedirectToAction("BizUnitList", new { branchId = bizUnit.BranchId }); } BizUnitViewModel vm = new BizUnitViewModel(); vm.BizUnit = bizUnit; return View(vm); }
/// <summary> /// Create a new BizUnit object. /// </summary> /// <param name="bizUnitId">Initial value of the BizUnitId property.</param> /// <param name="branchId">Initial value of the BranchId property.</param> /// <param name="bizUnitName">Initial value of the BizUnitName property.</param> /// <param name="isSupporting">Initial value of the IsSupporting property.</param> public static BizUnit CreateBizUnit(global::System.Int32 bizUnitId, global::System.Int32 branchId, global::System.String bizUnitName, global::System.Boolean isSupporting) { BizUnit bizUnit = new BizUnit(); bizUnit.BizUnitId = bizUnitId; bizUnit.BranchId = branchId; bizUnit.BizUnitName = bizUnitName; bizUnit.IsSupporting = isSupporting; return bizUnit; }
/// <summary> /// Deprecated Method for adding a new object to the BizUnits EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBizUnits(BizUnit bizUnit) { base.AddObject("BizUnits", bizUnit); }