public object GetCustomerWishlist(Wishlist WishlistObj) { try { List <WishlistViewModel> CartList = Mapper.Map <List <Wishlist>, List <WishlistViewModel> >(_cartwishlistBusiness.GetCustomerWishlist(WishlistObj.CustomerID, _commonBusiness.GetCurrentDateTime().ToString())); if (CartList.Count == 0) { throw new Exception(constants.NoItems); } return(JsonConvert.SerializeObject(new { Result = true, Records = CartList })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { Result = false, Message = ex.Message })); } }
public string GetCustomerWishlist(string ID) { try { List <WishlistViewModel> eventsLogList = Mapper.Map <List <Wishlist>, List <WishlistViewModel> >(_cartWishlistBusiness.GetCustomerWishlist(Int32.Parse(ID), null)); return(JsonConvert.SerializeObject(new { Result = "OK", Records = eventsLogList })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = ex.Message })); } }
public string GetCustomerWishList(string customerID) { try { List <WishlistViewModel> wishList = null; if (!string.IsNullOrEmpty(customerID)) { OperationsStatusViewModel operationsStatus = new OperationsStatusViewModel(); wishList = Mapper.Map <List <Wishlist>, List <WishlistViewModel> >(_cart_WishlistBusiness.GetCustomerWishlist(int.Parse(customerID), null)); } return(JsonConvert.SerializeObject(new { Result = "OK", Records = wishList })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = ex.Message })); } }