Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NabavljacController"/> class.
 /// </summary>
 public NabavljacController()
 {
     this.apotekaContext        = new ApotekaContext();
     this.nabavljacService      = new NabavljacService(apotekaContext);
     this.vmService             = new NabavljacVMService(apotekaContext);
     this.narudzbenicaVMService = new NarudzbenicaVMService(apotekaContext);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="KlijentController"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public KlijentController()
 {
     this.apotekaContext = new ApotekaContext();
     this.klijentService = new KlijentService(apotekaContext);
     this.racunVMService = new RacunVMService(apotekaContext);
     this.vmService      = new KlijentVMService();
 }
Beispiel #3
0
        public TestHelper()
        {
            var options = new DbContextOptionsBuilder <ApotekaContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            this.Context = new ApotekaContext(options);
            this.Context = this.PopulateData(Context);
        }
Beispiel #4
0
        public ApotekaContext PopulateData(ApotekaContext context)
        {
            context.Klijent.Add(new Klijent {
                KlijentId = 1, BrojZdravstveneIskaznice = 268458682, DatumRodjenja = new DateTime(1996, 3, 30), Ime = "Ante", Prezime = "Antic "
            });
            context.Klijent.Add(new Klijent {
                KlijentId = 2, BrojZdravstveneIskaznice = 317452862, DatumRodjenja = new DateTime(1995, 2, 20), Ime = "Ivana", Prezime = "Ivic "
            });

            context.RadnoMjesto.Add(new RadnoMjesto {
                RadnoMjestoId = 1, Naziv = "Blagajnik", OvlastNarucivanja = false
            });
            context.RadnoMjesto.Add(new RadnoMjesto {
                RadnoMjestoId = 2, Naziv = "Vlasnik", OvlastNarucivanja = true
            });

            context.Korisnik.Add(new Korisnik {
                KorisnikId = 1, RadnoMjestoId = 1, Ime = "Mijo", Prezime = "Mijic", DatumRodjenja = new DateTime(1994, 1, 10),
            });
            context.Korisnik.Add(new Korisnik {
                KorisnikId = 2, RadnoMjestoId = 2, Ime = "Pero", Prezime = "Peric", DatumRodjenja = new DateTime(1993, 12, 21),
            });

            context.Proizvodjac.Add(new Proizvodjac {
                ProizvodjacId = 1, Adresa = "Brune Busica 5, Zagreb", Naziv = "Marinini lijekovi"
            });
            context.Proizvodjac.Add(new Proizvodjac {
                ProizvodjacId = 2, Adresa = "Splitska 32", Naziv = "Medica d.o.o."
            });

            context.Lijek.Add(new Lijek {
                LijekId = 1, Cijena = 100, FarmaceutskoIme = "Paracetamol", TrgovackoIme = "Lekadol 500mg", Jacina = "500mg", Kolicina = 25, ReferencaUputa = "https:\\www.gooogle.com", ProizvodjacId = 1
            });
            context.Lijek.Add(new Lijek {
                LijekId = 2, Cijena = 89, FarmaceutskoIme = "Ibuprofen", TrgovackoIme = "Brufen 600mg", Jacina = "600mg", Kolicina = 20, ReferencaUputa = "https:\\www.facebook.com", ProizvodjacId = 2
            });

            context.Nabavljac.Add(new Nabavljac {
                NabavljacId = 1, Adresa = "Nabavljacka 1", Iban = "HR90273488392", Naziv = "Portus nabava d.o.o."
            });
            context.Nabavljac.Add(new Nabavljac {
                NabavljacId = 2, Adresa = "Nabavljacka 87", Iban = "HR90273488334", Naziv = "Hades nabava d.o.o."
            });

            context.Narudzbenica.Add(new Narudzbenica {
                NarudzbenicaId = 1, NabavljacId = 1, KorisnikId = 1, AdresaDostave = "Andrina 1", DatumIvrijemeIzdavanja = new DateTime(2018, 4, 6, 10, 20, 20)
            });
            context.Narudzbenica.Add(new Narudzbenica {
                NarudzbenicaId = 2, NabavljacId = 2, KorisnikId = 2, AdresaDostave = "Grada Meinza 10", DatumIvrijemeIzdavanja = new DateTime(2018, 4, 8, 12, 30, 20)
            });

            context.Racun.Add(new Racun {
                RacunId = 1, DatumIvrijemeIzdavanja = new DateTime(2018, 5, 5, 5, 5, 5), KorisnikId = 1, KlijentId = 1
            });
            context.Racun.Add(new Racun {
                RacunId = 2, DatumIvrijemeIzdavanja = new DateTime(2018, 6, 6, 6, 6, 6), KorisnikId = 2, KlijentId = 2
            });

            context.SaveChanges();
            return(context);
        }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProizvodjacService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public ProizvodjacService(ApotekaContext context)
     : this(context, new ProizvodjacRepository(context))
 {
 }
 public RacunController(ApotekaContext context)
 {
     _context = context;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NarudzbenicaVMService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public NarudzbenicaVMService(ApotekaContext context)
     : this(context, new NarudzbenicaRepository(context))
 {
 }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LijekService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public LijekService(ApotekaContext context, LijekRepository repository)
 {
     this.apotekaContext  = context ?? throw new ArgumentNullException(nameof(context));
     this.lijekRepository = repository ?? throw new ArgumentNullException(nameof(repository));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NabavljacService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public NabavljacService(ApotekaContext context)
     : this(context, new NabavljacRepository(context))
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LijekController"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public LijekController()
 {
     this.apotekaContext = new ApotekaContext();
     this.lijekService   = new LijekService(apotekaContext);
     this.vmService      = new LijekVMService(apotekaContext);
 }
Beispiel #11
0
 public OsiguranikController(ApotekaContext context)
 {
     _context = context;
 }
Beispiel #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KorisnikController"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public KorisnikController()
 {
     this.apotekaContext  = new ApotekaContext();
     this.korisnikService = new KorisnikService(apotekaContext);
     this.vmService       = new KorisnikVMService(apotekaContext);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="KorisnikService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public KorisnikService(ApotekaContext context)
     : this(context, new KorisnikRepository(context))
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="KorisnikService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public KorisnikVMService(ApotekaContext context, KorisnikRepository repository)
 {
     this.apotekaContext     = context ?? throw new ArgumentNullException(nameof(context));
     this.korisnikRepository = repository ?? throw new ArgumentNullException(nameof(repository));
 }
Beispiel #15
0
 public LijekController(ApotekaContext context)
 {
     _context = context;
 }
Beispiel #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RadnoMjestoService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public RadnoMjestoService(ApotekaContext context)
     : this(context, new RadnoMjestoRepository(context))
 {
 }
Beispiel #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RadnoMjestoService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public RadnoMjestoService(ApotekaContext context, RadnoMjestoRepository repository)
 {
     this.apotekaContext        = context ?? throw new ArgumentNullException(nameof(context));
     this.radnoMjestoRepository = repository ?? throw new ArgumentNullException(nameof(repository));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RadnoMjestoController"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public RadnoMjestoController()
 {
     this.apotekaContext     = new ApotekaContext();
     this.radnoMjestoService = new RadnoMjestoService(apotekaContext);
     this.vmService          = new RadnoMjestoVMService(apotekaContext);
 }
Beispiel #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LijekService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public LijekService(ApotekaContext context)
     : this(context, new LijekRepository(context))
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProizvodjacController"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public ProizvodjacController()
 {
     this.apotekaContext     = new ApotekaContext();
     this.proizvodjacService = new ProizvodjacService(apotekaContext);
     this.vmService          = new ProizvodjacVMService(apotekaContext);
 }
Beispiel #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RacunController"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public RacunController()
 {
     this.apotekaContext = new ApotekaContext();
     this.racunService   = new RacunService(apotekaContext);
     this.vmService      = new RacunVMService(apotekaContext);
 }
 public KupovinaController(ApotekaContext context)
 {
     _context = context;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NarudzbenicaVMService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public NarudzbenicaVMService(ApotekaContext context, NarudzbenicaRepository repository)
 {
     this.apotekaContext         = context ?? throw new ArgumentNullException(nameof(context));
     this.narudzbenicaRepository = repository ?? throw new ArgumentNullException(nameof(repository));
 }
Beispiel #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KlijentService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public KlijentService(ApotekaContext context)
     : this(context, new KlijentRepository(context))
 {
 }
 public DrzavaController(ApotekaContext context)
 {
     _context = context;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NabavljacRepository"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public NabavljacRepository(ApotekaContext context)
 {
     this.apotekaContext = context ?? throw new ArgumentNullException(nameof(context));
 }
 public GradController(ApotekaContext context)
 {
     _context = context;
 }
Beispiel #28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RacunService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public RacunService(ApotekaContext context)
     : this(context, new RacunRepository(context))
 {
 }
Beispiel #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProizvodjacService"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="repository">The repository.</param>
 public ProizvodjacService(ApotekaContext context, ProizvodjacRepository repository)
 {
     this.apotekaContext        = context ?? throw new ArgumentNullException(nameof(context));
     this.proizvodjacRepository = repository ?? throw new ArgumentNullException(nameof(repository));
 }
 public DobavljacController(ApotekaContext context)
 {
     _context = context;
 }