Пример #1
0
        public ActionResult Create([Bind(Exclude = "id")] Theme_ themeToCreate)
        {
            if (!ModelState.IsValid)
                return View();

            try
            {
                Stat_ s = new Stat_();
                s.theme_id = themeToCreate.id;
                s.nombre_vues = 0;
                _db.AddToStat(s);

                _db.AddToTheme(themeToCreate);
                _db.SaveChanges();

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Пример #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Stat EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStat(Stat_ stat_)
 {
     base.AddObject("Stat", stat_);
 }
Пример #3
0
 /// <summary>
 /// Create a new Stat_ object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 public static Stat_ CreateStat_(global::System.Int32 id)
 {
     Stat_ stat_ = new Stat_();
     stat_.id = id;
     return stat_;
 }