public void EnsureSeedOfferData(string filePath) { OfferContext offerContext = new OfferContext(); if (!offerContext.Offers.Any()) { dynamic jsonData = ReadJsonFile(filePath); if (jsonData != null) { foreach (dynamic d in jsonData) { offerContext.Offers.Add(new OfferEntity() { ClientId = d.ClientId, WalletId = d.WalletId, DefaultCurrencyId = d.DefaultCurrencyId, DateCreated = d.DateCreated, ExpiryDate = d.ExpiryDate, Name = d.Name, Detail = d.Detail }); } offerContext.SaveChanges(); } } }
// GET: Login public ActionResult Index() { //Con esta condicion llamamos al sp de activar ofertas 1 vez al dia, si ya fue llamado hace nada. if (Request.Cookies["verifyOffer"] == null) { HttpCookie galleta = new HttpCookie("verifyOffer"); OfferContext data = new OfferContext(); data.callForCheckOffer(this.conn); galleta["checked"] = "y"; galleta.Expires = DateTime.Now.AddDays(1); Response.Cookies.Add(galleta); } return(View()); }
public OffersController(OfferContext context) { _context = context; }
public OrderProductRepository(OfferContext offerContext) : base(offerContext) { }
public RepositoryWrapper(OfferContext repositoryContext) { _repoContext = repositoryContext; }
public CategoryRepository(OfferContext offerContext) : base(offerContext) { }
public TagRepository(OfferContext offerContext) : base(offerContext) { }
public AddressRepository(OfferContext offerContext) : base(offerContext) { }
public FavoriteListItemRepository(OfferContext offerContext) : base(offerContext) { }
public OfferRepository(OfferContext context) => _context = context;
public CommentRepository(OfferContext offerContext) : base(offerContext) { }
public ProductTagRepository(OfferContext offerContext) : base(offerContext) { }
public UserRepository(OfferContext repositoryContext) : base(repositoryContext) { }
protected RepositoryBase(OfferContext offerContext) { this.OfferContext = offerContext; }
public BrandRepository(OfferContext offerContext) : base(offerContext) { }
public OfferRepository(OfferContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); }