コード例 #1
0
ファイル: HomeController.cs プロジェクト: fathurxzz/aleqx
        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);
            }
        }
コード例 #2
0
ファイル: Shop.Designer.cs プロジェクト: fathurxzz/aleqx
 /// <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);
 }
コード例 #3
0
ファイル: Shop.Designer.cs プロジェクト: fathurxzz/aleqx
 /// <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;
 }