public WishlistDetails <AddWishlistItem> GetWishlistDetailsForCouple(int coupleId) { WishlistDetails <AddWishlistItem> wishlist = new WishlistDetails <AddWishlistItem>(); sql = "READ_RECORD_LIST_COUPLE"; parameters = new Dictionary <string, object> { { "@couple", coupleId } }; List <Dictionary <string, object> > result = ExecuteReadSQLCommand(); if (result.Count > 0) { wishlist.FirstName = (string)result.First().GetValueOrDefault <string, object>("FirstName"); wishlist.SecondName = (string)result.First().GetValueOrDefault <string, object>("SecondName"); wishlist.WishListID = (int)result.First().GetValueOrDefault <string, object>("WishListID"); } wishlist.WishlistItems = GetListItemsForCouple(wishlist.WishListID); return(wishlist); }
public string AddAllwishlist(WishlistDetails wishlists, Userwishlistdetails userwishlists) { string response; DateTime updateddate = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, INDIAN_ZONE); wishlists.UpdatedDate = userwishlists.WhishListedDate = updateddate; try { WishlistDetails w1 = whishListRepository.AddUserwishlist(wishlists); //userwishlists.wishlistId = w1.wishlistId; userwishlists.UserId = w1.UserId; Userwishlistdetails w2 = whishListRepository.AddUserwishlistitem(userwishlists); response = "success"; } catch (Exception ex) { response = "failure"; } return(response); }
public WishlistDetails <GuestWishListItem> GetWishlistDetailsForGuest(int listID) { sql = "READ_RECORD_LIST_GUEST"; parameters = new Dictionary <string, object> { { "@list", listID } }; var result = ExecuteReadSQLCommand(); if (result.Count > 0) { WishlistDetails <GuestWishListItem> wishlist = new WishlistDetails <GuestWishListItem> { WishListID = listID, FirstName = (string)result.First().GetValueOrDefault("FirstName"), SecondName = (string)result.First().GetValueOrDefault("SecondName") }; wishlist.WishlistItems = GetGuestWishListItems(listID); return(wishlist); } return(null); }
public WishlistDetails AddUserwishlist(WishlistDetails wishlists) { _dbContext.WishlistDetails.Add(wishlists); _dbContext.SaveChanges(); return(wishlists); }
public WishlistDetails AddUserwishlist(WishlistDetails wishlists) { return(whishListRepository.AddUserwishlist(wishlists)); }