Exemple #1
0
        public PartialViewResult AddWish(WishFormModel wishFormModel)
        {
            if (ModelState.IsValid)
            {
                using (var context = new ShopContainer())
                {
                    var wish = new Wish();
                    TryUpdateModel(wish, new[] { "UserName", "Category", "Brand", "Title", "Size", "Color", "Phone", "Email" });
                    context.AddToWish(wish);
                    //context.SaveChanges();
                }
                return PartialView("Success");

            }
            else
            {
                return PartialView("_WishForm", wishFormModel);
            }
        }
Exemple #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Wish EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToWish(Wish wish)
 {
     base.AddObject("Wish", wish);
 }
Exemple #3
0
 /// <summary>
 /// Create a new Wish object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 public static Wish CreateWish(global::System.Int32 id)
 {
     Wish wish = new Wish();
     wish.Id = id;
     return wish;
 }