예제 #1
0
 public ActionResult Edit(Theme theme)
 {
     if (ModelState.IsValid)
     {
         db.Themes.Attach(theme);
         db.ObjectStateManager.ChangeObjectState(theme, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(theme);
 }
예제 #2
0
    public ActionResult Create(Theme theme)
    {
        if (ModelState.IsValid)
        {
            db.Themes.AddObject(theme);
            db.SaveChanges();
            return RedirectToAction("Index");
        }

        return View(theme);
    }
예제 #3
0
 /// <summary>
 /// Create a new Theme object.
 /// </summary>
 /// <param name="themeID">Initial value of the ThemeID property.</param>
 public static Theme CreateTheme(global::System.Int64 themeID)
 {
     Theme theme = new Theme();
     theme.ThemeID = themeID;
     return theme;
 }
예제 #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Themes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToThemes(Theme theme)
 {
     base.AddObject("Themes", theme);
 }