public ActionResult Create(Preparation_Article preparation_article)
        {
            if (ModelState.IsValid)
            {
                db.Preparation_Article.AddObject(preparation_article);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(preparation_article);
        }
예제 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Preparation_Article EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPreparation_Article(Preparation_Article preparation_Article)
 {
     base.AddObject("Preparation_Article", preparation_Article);
 }
예제 #3
0
 /// <summary>
 /// Create a new Preparation_Article object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 public static Preparation_Article CreatePreparation_Article(global::System.Int32 id)
 {
     Preparation_Article preparation_Article = new Preparation_Article();
     preparation_Article.id = id;
     return preparation_Article;
 }
 public ActionResult Edit(Preparation_Article preparation_article)
 {
     if (ModelState.IsValid)
     {
         db.Preparation_Article.Attach(preparation_article);
         db.ObjectStateManager.ChangeObjectState(preparation_article, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(preparation_article);
 }