public BizInfo SetBizInfoRating(int vBizInfoID, int vRating) { BizInfo bi = new BizInfo(); bi = Shoppingctx.BizInfos.FirstOrDefault(b => b.BizInfoId == vBizInfoID); bi.RatingVotes++; bi.TotalRating = bi.TotalRating + vRating; switch (vRating) { case 1: bi.OneStarVotes++; break; case 2: bi.TwoStarVotes++; break; case 3: bi.ThreeStarVotes++; break; case 4: bi.FourStarVotes++; break; case 5: bi.FiveStarVotes++; break; default: break; } bi.UpdatedDate = DateTime.Now; return(Shoppingctx.SaveChanges() > 0 ? bi : null); }
public UserDetail UpdateUserDetailPsw(string vUserId, string vNewPassword, string vUpdatedBy) { UserDetail ud = new UserDetail(); ud = Shoppingctx.UserDetails.FirstOrDefault(u => u.UserId == vUserId); if (ud != null) { ud.Password = vNewPassword; ud.UpdatedDate = DateTime.Now; ud.UpdatedBy = vUpdatedBy; return(Shoppingctx.SaveChanges() > 0 ? ud : null); } return(null); }
public Product AddProduct(Product vProduct) { try { Shoppingctx.Products.Add(vProduct); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vProduct : null); } catch (Exception ex) { return(null); } }
public ConvertedPoint AddConvertedPoint(ConvertedPoint vConvertedPoint) { try { Shoppingctx.ConvertedPoints.Add(vConvertedPoint); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vConvertedPoint : null); } catch { return(null); } }
public Driver AddDriver(Driver vDriver) { try { Shoppingctx.Drivers.Add(vDriver); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vDriver : null); } catch { return(null); } }
public HotelType AddHotelType(HotelType vHotelType) { try { Shoppingctx.HotelTypes.Add(vHotelType); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vHotelType : null); } catch { return(null); } }
public Address AddAddress(Address vAddress) { try { Shoppingctx.Addresses.Add(vAddress); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vAddress : null); } catch { return(null); } }
public BizInfo AddBizInfo(BizInfo vBizInfo) { try { Shoppingctx.BizInfos.Add(vBizInfo); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vBizInfo : null); } catch { return(null); } }
public AddSide AddAddSide(AddSide vAddSide) { try { Shoppingctx.AddSides.Add(vAddSide); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vAddSide : null); } catch { return(null); } }
public Category AddCategory(Category vCategory) { try { Shoppingctx.Categories.Add(vCategory); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vCategory : null); } catch { return(null); } }
public Reservation AddReservation(Reservation vReservation) { try { Shoppingctx.Reservations.Add(vReservation); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vReservation : null); } catch { return(null); } }
public RewardVoucher AddRewardVoucher(RewardVoucher vRewardVoucher) { try { Shoppingctx.RewardVouchers.Add(vRewardVoucher); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vRewardVoucher : null); } catch (Exception ex) { return(null); } }
public ProductDressing AddProductDressing(ProductDressing vProductDressing) { try { Shoppingctx.ProductDressings.Add(vProductDressing); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vProductDressing : null); } catch { return(null); } }
public CheeseAmount AddCheeseAmount(CheeseAmount vCheeseAmount) { try { Shoppingctx.CheeseAmounts.Add(vCheeseAmount); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vCheeseAmount : null); } catch { return(null); } }
public CookMethod AddCookMethod(CookMethod vCookMethod) { try { Shoppingctx.CookMethods.Add(vCookMethod); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vCookMethod : null); } catch { return(null); } }
public CrustChoice AddCrustChoice(CrustChoice vCrustChoice) { try { Shoppingctx.CrustChoices.Add(vCrustChoice); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vCrustChoice : null); } catch { return(null); } }
public Vote AddVote(Vote vVote) { try { Shoppingctx.Votes.Add(vVote); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vVote : null); } catch (Exception ex) { return(null); } }
public DiscountCoupon AddDiscountCoupon(DiscountCoupon vDiscountCoupon) { try { Shoppingctx.DiscountCoupons.Add(vDiscountCoupon); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vDiscountCoupon : null); } catch { return(null); } }
public FavorRestaurant AddFavorRestaurant(FavorRestaurant vFavorRestaurant) { try { Shoppingctx.FavorRestaurants.Add(vFavorRestaurant); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vFavorRestaurant : null); } catch { return(null); } }
public CreditCard AddCreditCard(CreditCard vCreditCard) { try { Shoppingctx.CreditCards.Add(vCreditCard); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vCreditCard : null); } catch { return(null); } }
public SideChoice AddSideChoice(SideChoice vSideChoice) { try { Shoppingctx.SideChoices.Add(vSideChoice); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vSideChoice : null); } catch { return(null); } }
public Hotel AddHotel(Hotel vHotel) { try { Shoppingctx.Hotels.Add(vHotel); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vHotel : null); } catch { return(null); } }
public ZoneName AddZoneName(ZoneName vZoneName) { try { Shoppingctx.ZoneNames.Add(vZoneName); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vZoneName : null); } catch (Exception ex) { return(null); } }
public ContactInfo AddContactInfo(ContactInfo vContactInfo) { try { Shoppingctx.ContactInfos.Add(vContactInfo); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vContactInfo : null); } catch { return(null); } }
public BizHour AddBizHour(BizHour vBizHour) { try { Shoppingctx.BizHours.Add(vBizHour); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vBizHour : null); } catch { return(null); } }
public Order AddOrder(Order vOrder) { try { Shoppingctx.Orders.Add(vOrder); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vOrder : null); } catch { return(null); } }
public BizCuisine AddBizCuisine(BizCuisine vBizCuisine) { try { Shoppingctx.BizCuisines.Add(vBizCuisine); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vBizCuisine : null); } catch { return(null); } }
public GiftCard AddGiftCard(GiftCard vGiftCard) { try { Shoppingctx.GiftCards.Add(vGiftCard); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vGiftCard : null); } catch { return(null); } }
public FreeItemCoupon AddFreeItemCoupon(FreeItemCoupon vFreeItemCoupon) { try { Shoppingctx.FreeItemCoupons.Add(vFreeItemCoupon); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vFreeItemCoupon : null); } catch { return(null); } }
public UserDetail AddUserDetail(UserDetail vUserDetail) { try { Shoppingctx.UserDetails.Add(vUserDetail); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vUserDetail : null); } catch (Exception ex) { return(null); } }