Ejemplo n.º 1
0
 public KlijentHomeController(OOADContext context)
 {
     _klijenti               = new KlijentiProxy(context);
     _oglasnaPloca           = new OglasnaPlocaProxy(context);
     _filijaleBankomatiProxy = new FilijaleBankomatiProxy(context);
     Context = context;
 }
Ejemplo n.º 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            /* services.AddDbContext<ApplicationDbContext>(options =>
             *   options.UseSqlServer(
             *       Configuration.GetConnectionString("DefaultConnection")));*/
            services.AddDbContext <OOADContext>(options =>
                                                options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
            services.AddDefaultIdentity <IdentityUser>()
            .AddDefaultUI(UIFramework.Bootstrap4)
            .AddEntityFrameworkStores <ApplicationDbContext>();

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            var conString      = Configuration.GetConnectionString("DefaultConnection");
            var optionsBuilder = new DbContextOptionsBuilder <OOADContext>();

            optionsBuilder.UseSqlServer(conString);
            OOADContext baza = new OOADContext(optionsBuilder.Options);
        }
 public BankarKlijentController(OOADContext context)
 {
     _klijenti    = new KlijentiProxy(context);
     Context      = context;
     _transakcije = new TransakcijeProxy(context);
     _racuni      = new RacuniProxy(context);
 }
Ejemplo n.º 4
0
        public static async Task <Korisnik> Authenticate(HttpRequest Request, OOADContext Context, Controller Controller)
        {
            IAdministratori _administratori = new Administratori(Context);
            IBankari        _bankari        = new Bankari(Context);
            IKlijenti       _klijenti       = new Klijenti(Context);

            if (Request.Cookies["userId"] == null || Request.Cookies["userId"].Equals(""))
            {
                return(null);
            }


            var userId = int.Parse(Request.Cookies["userId"]);
            var role   = Request.Cookies["role"];

            if (role == "Administrator")
            {
                return(await _administratori.DajAdministratora(userId));
            }
            else if (role == "Bankar")
            {
                return(await _bankari.DajBankara(userId));
            }
            else if (role == "Klijent")
            {
                return(await _klijenti.DajKlijenta(userId));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 5
0
 public KlijentProfilController(OOADContext context)
 {
     _klijenti    = new KlijentiProxy(context);
     Context      = context;
     _transakcije = new TransakcijeProxy(context);
     _racuni      = new RacuniProxy(context);
     _krediti     = new KreditiProxy(context);
 }
Ejemplo n.º 6
0
        public ActionResult Login(string Username, string Sifra)
        {
            OOADContext      db         = new OOADContext();
            List <Korisnik>  korisnici  = new List <Korisnik>();
            List <AutoSalon> autosaloni = new List <AutoSalon>();

            korisnici  = db.Korisnik.ToList <Korisnik>();
            autosaloni = db.AutoSalon.ToList <AutoSalon>();

            for (int i = 0; i < korisnici.Count; i++)
            {
                if (korisnici[i].Username.Equals(Username) && korisnici[i].Password.Equals(Sifra))
                {
                    Session["User"]   = korisnici[i];
                    Session["UserId"] = korisnici[i].Id;
                    return(RedirectToAction("Index", "Home"));
                }
            }

            return(View());
        }
Ejemplo n.º 7
0
 public TastaturaController(OOADContext context)
 {
     _context = context;
 }
Ejemplo n.º 8
0
 public MonitorController(OOADContext context)
 {
     _context = context;
 }
Ejemplo n.º 9
0
 public ProizvodController(OOADContext context)
 {
     _context = context;
 }
Ejemplo n.º 10
0
 public ProcesorController(OOADContext context)
 {
     _context = context;
 }
 public ZvucnaKarticaController(OOADContext context)
 {
     _context = context;
 }
Ejemplo n.º 12
0
 public KupacController(OOADContext context)
 {
     _context = context;
 }
Ejemplo n.º 13
0
 public PredmetController(OOADContext context)
 {
     _context = context;
 }
Ejemplo n.º 14
0
 public FilijaleBankomati(OOADContext context)
 {
     this._context = context;
 }
Ejemplo n.º 15
0
 public UposlenikController(OOADContext context)
 {
     _context = context;
 }
 public BankarRacunController(OOADContext context)
 {
     _racuni   = new RacuniProxy(context);
     _klijenti = new KlijentiProxy(context);
     Context   = context;
 }
Ejemplo n.º 17
0
 public GrafickaKarticaController(OOADContext context)
 {
     _context = context;
 }
 public AdministratoriProxy(OOADContext context)
 {
     administratori = new Administratori(context);
 }
Ejemplo n.º 19
0
 public MemorijaController(OOADContext context)
 {
     _context = context;
 }
Ejemplo n.º 20
0
 public KlijentZahtjevZaKreditController(OOADContext context)
 {
     _zahtjevi = new ZahtjeviZaKreditProxy(context);
     _racuni   = new RacuniProxy(context);
     Context   = context;
 }
Ejemplo n.º 21
0
 public StudentController(OOADContext context)
 {
     _context = context;
 }
Ejemplo n.º 22
0
 public AdministratorNovostiController(OOADContext context)
 {
     Context  = context;
     _novosti = new OglasnaPlocaProxy(context);
 }
Ejemplo n.º 23
0
 public KreditiProxy(OOADContext context)
 {
     krediti = new Krediti(context);
 }
Ejemplo n.º 24
0
 public KupovinaController(OOADContext context)
 {
     _context = context;
 }
Ejemplo n.º 25
0
 public ZahtjeviZaKredit(OOADContext context)
 {
     _context        = context;
     zahtjevObserver = new Krediti(context);
 }
Ejemplo n.º 26
0
 public ZahtjeviZaKreditProxy(OOADContext context)
 {
     zahtjevi = new ZahtjeviZaKredit(context);
 }
 public AdministratorController(OOADContext context)
 {
     _context = context;
 }
Ejemplo n.º 28
0
 public OglasnaPlocaProxy(OOADContext context)
 {
     OglasnaPloca = new OglasnaPloca(context);
 }
 public KlijentTransakcijaController(OOADContext context)
 {
     _transakcije = new TransakcijeProxy(context);
     _racuni      = new RacuniProxy(context);
     Context      = context;
 }
 public BankarKreditController(OOADContext context)
 {
     _krediti = new KreditiProxy(context);
     Context  = context;
 }