public static int AddProductToFavorite(int productId, int userId, int storeId = 0) { FavoriteDao favoriteDao = new FavoriteDao(); if (favoriteDao.ExistsProduct(productId, userId, storeId)) { return((favoriteDao.DeleteFavorite(userId, productId, storeId) > 0) ? 1 : 0); } return((ProductBrowser.AddProduct(productId, userId, storeId) > 0) ? 2 : 0); }
public static int AddProduct(int productId, int userId, int storeId = 0) { FavoriteDao favoriteDao = new FavoriteDao(); if (favoriteDao.ExistsProduct(productId, userId, storeId)) { return(1); } FavoriteInfo model = new FavoriteInfo { ProductId = productId, UserId = userId, StoreId = storeId, Tags = "" }; return((int)favoriteDao.Add(model, null)); }
public static bool AddProductToFavorite(int productId, int userId) { FavoriteDao dao = new FavoriteDao(); return(dao.ExistsProduct(productId, userId) || dao.AddProductToFavorite(productId, userId)); }
public static bool AddProductToFavorite(int productId, int userId) { FavoriteDao dao = new FavoriteDao(); return (dao.ExistsProduct(productId, userId) || dao.AddProductToFavorite(productId, userId)); }
public static bool AddProductToFavorite(int productId, int userId, string tags, string remark) { FavoriteDao favoriteDao = new FavoriteDao(); return(favoriteDao.ExistsProduct(productId, userId) || favoriteDao.AddProductToFavorite(productId, userId, tags, remark)); }