public ActionResult Create(AgeGroup agegroup)
        {
            if (ModelState.IsValid)
            {
                db.AgeGroups.AddObject(agegroup);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(agegroup);
        }
 public ActionResult Edit(AgeGroup agegroup)
 {
     if (ModelState.IsValid)
     {
         db.AgeGroups.Attach(agegroup);
         db.ObjectStateManager.ChangeObjectState(agegroup, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(agegroup);
 }
Esempio n. 3
0
 /// <summary>
 /// Create a new AgeGroup object.
 /// </summary>
 /// <param name="ageGroupId">Initial value of the AgeGroupId property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 /// <param name="isSparringGroup">Initial value of the IsSparringGroup property.</param>
 public static AgeGroup CreateAgeGroup(global::System.Int32 ageGroupId, global::System.String description, global::System.Boolean isSparringGroup)
 {
     AgeGroup ageGroup = new AgeGroup();
     ageGroup.AgeGroupId = ageGroupId;
     ageGroup.Description = description;
     ageGroup.IsSparringGroup = isSparringGroup;
     return ageGroup;
 }
Esempio n. 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the AgeGroups EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAgeGroups(AgeGroup ageGroup)
 {
     base.AddObject("AgeGroups", ageGroup);
 }