Exemple #1
0
 public ActionResult AddThemes(ThemesPost themes)
 {
     using (DataContext db = new DataContext())
     {
         Theme theme = new Theme();
         theme.themeName   = themes.tenTV;
         theme.description = themes.description;
         db.Themes.Add(theme);
         db.SaveChanges();
         return(Json(new { mess_ = 1 }));
     }
 }
Exemple #2
0
 public ActionResult UpdateThemes(ThemesPost themes)
 {
     using (DataContext db = new DataContext())
     {
         Theme theme = db.Themes.Where(x => x.Theme_ID == themes.theme_id).FirstOrDefault();
         if (theme != null)
         {
             theme.themeName   = themes.tenTV;
             theme.description = themes.description;
             db.SaveChanges();
             return(Json(new { mess_ = 1 }));
         }
         return(Json(new { mess_ = 0 }));
     }
 }