public ActionResult AddWishlistItem(AddWishlistItem model) { State.Instance.Wishlists[new User("James")].Add(new WishedItem { Name = model.Name, Link = model.Link, Price = model.Price, Contributors = new Dictionary <User, decimal>() }); return(RedirectToAction("Wishlist")); }
public ActionResult AddWishlistItem(AddWishlistItem model) { State.Instance.Wishlists[new User("James")].Add(new WishedItem { Name = model.Name, Link = model.Link, Price = model.Price, Contributors = new Dictionary<User, decimal>() }); return RedirectToAction("Wishlist"); }
public bool AddNewItem(AddWishlistItem item) { int listId = GetWishListIDByCoupleID(item.CoupleID); sql = "CREATE_RECORD_LISTITEM"; parameters = new Dictionary <string, object> { { "@desc", item.Description }, { "@price", item.Price }, { "@pos", item.Position }, { "@list", listId } }; ExecuteWriteSQLCommand(); return(true); }
public List <AddWishlistItem> GetListItemsForCouple(int listID) { sql = "READ_RECORD_LIST_ITEM_COUPLE"; parameters = new Dictionary <string, object> { { "@list", listID } }; var result = ExecuteReadSQLCommand(); List <AddWishlistItem> wishlist = new List <AddWishlistItem>(); if (result.Count > 0) { foreach (var item in result) { AddWishlistItem listItem = new AddWishlistItem { Description = (string)item.GetValueOrDefault("Description"), Price = (decimal)item.GetValueOrDefault("Price"), Position = (int)item.GetValueOrDefault("Position") }; wishlist.Add(listItem); } } return(wishlist); }
public ActionResult <bool> AddNewListItem([FromBody] AddWishlistItem newItem) { return(ListItem.AddNewItem(newItem)); }