コード例 #1
0
ファイル: EnsureSeedData.cs プロジェクト: simhaonline/CPM
        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();
                }
            }
        }
コード例 #2
0
        // 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());
        }
コード例 #3
0
 public OffersController(OfferContext context)
 {
     _context = context;
 }
コード例 #4
0
 public OrderProductRepository(OfferContext offerContext)
     : base(offerContext)
 {
 }
コード例 #5
0
ファイル: RepositoryWrapper.cs プロジェクト: KilicYavuz/Offer
 public RepositoryWrapper(OfferContext repositoryContext)
 {
     _repoContext = repositoryContext;
 }
コード例 #6
0
 public CategoryRepository(OfferContext offerContext)
     : base(offerContext)
 {
 }
コード例 #7
0
ファイル: TagRepository.cs プロジェクト: KilicYavuz/Offer
 public TagRepository(OfferContext offerContext)
     : base(offerContext)
 {
 }
コード例 #8
0
 public AddressRepository(OfferContext offerContext)
     : base(offerContext)
 {
 }
コード例 #9
0
 public FavoriteListItemRepository(OfferContext offerContext)
     : base(offerContext)
 {
 }
 public OfferRepository(OfferContext context) => _context = context;
コード例 #11
0
 public CommentRepository(OfferContext offerContext)
     : base(offerContext)
 {
 }
コード例 #12
0
 public ProductTagRepository(OfferContext offerContext)
     : base(offerContext)
 {
 }
コード例 #13
0
ファイル: UserRepository.cs プロジェクト: KilicYavuz/Offer
 public UserRepository(OfferContext repositoryContext)
     : base(repositoryContext)
 {
 }
コード例 #14
0
ファイル: RepositoryBase .cs プロジェクト: KilicYavuz/Offer
 protected RepositoryBase(OfferContext offerContext)
 {
     this.OfferContext = offerContext;
 }
コード例 #15
0
 public BrandRepository(OfferContext offerContext)
     : base(offerContext)
 {
 }
コード例 #16
0
ファイル: OfferRepository.cs プロジェクト: Emad-Sayed/DDD
 public OfferRepository(OfferContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }