コード例 #1
0
        //
        // GET: /Profil/
        public ActionResult Index()
        {
            UserManager <ApplicationUser> manager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(new ApplicationDbContext()));
            StomatologContext             context = new StomatologContext();
            var user   = manager.FindById(User.Identity.GetUserId());
            var result = (from e in context.Stomatolozi
                          where e.IDClanaKomore == user.UserName
                          select e.IDClanaKomore).First();
            UrediProfilViewModel model = new UrediProfilViewModel();

            model.IDClanaKomore = result;
            model.UcitajImeIPrezime();
            return(View(model));
        }
コード例 #2
0
        public ActionResult ProcitajPoruku(string IDClanaKomore1, string IDClanaKomore2)
        {
            string               trenutni  = User.Identity.GetUserName();
            string               ID        = IDClanaKomore1 == trenutni ? IDClanaKomore2 : IDClanaKomore1;
            StomatologContext    context   = new StomatologContext();
            string               ulogovani = User.Identity.GetUserName();
            ICollection <Poruka> lista_poruka_primljene = context.Poruke.Where(m => m.Salje.IDClanaKomore == ID).Where(m => m.Primalac.IDClanaKomore == ulogovani).ToList();
            ICollection <Poruka> lista_poruka_poslate   = context.Poruke.Where(m => m.Primalac.IDClanaKomore == ID).Where(m => m.Salje.IDClanaKomore == ulogovani).ToList();


            var pom = lista_poruka_poslate.Concat(lista_poruka_primljene);

            ViewBag.IDClana = trenutni;
            return(View(pom.OrderBy(m => m.DatumVreme).ToList()));
        }
コード例 #3
0
        public ActionResult IndexForUsers()
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Login", "Account"));
            }
            UserManager <ApplicationUser> manager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(new ApplicationDbContext()));
            StomatologContext             context = new StomatologContext();
            var user   = manager.FindById(User.Identity.GetUserId());
            var result = from e in context.Stomatolozi
                         where e.IDClanaKomore == user.UserName
                         select e.Ime + " " + e.Prezime;

            if (result.Any())
            {
                ViewBag.Ime = result.First();
            }
            else
            {
                ViewBag.Ime = "unknown";
            }

            return(View());
        }
コード例 #4
0
        public List <Pregled> vratiPreglede()
        {
            StomatologContext context = new StomatologContext();

            return(context.Pregledi.ToList());
        }
コード例 #5
0
        public List <ObavljenaPoseta> vratiObavljenePosete()
        {
            StomatologContext context = new StomatologContext();

            return(context.ObavljenePosete.ToList());
        }
コード例 #6
0
        public List <ZakazanaPoseta> vratiZakazanePosete()
        {
            StomatologContext context = new StomatologContext();

            return(context.ZakazanePosete.ToList());
        }
コード例 #7
0
        public List <OdgovorNaPoruku> vratiOdgovoreNaPoruke()
        {
            StomatologContext context = new StomatologContext();

            return(context.OdgovoriNaPoruke.ToList());
        }
コード例 #8
0
        public List <Poruka> vratiPoruke()
        {
            StomatologContext context = new StomatologContext();

            return(context.Poruke.ToList());
        }
コード例 #9
0
        public List <KomentarNaObjavu> vratiKomentareNaObjave()
        {
            StomatologContext context = new StomatologContext();

            return(context.KomentariNaObjave.ToList());
        }
コード例 #10
0
        public List <Objava> vratiObjave()
        {
            StomatologContext context = new StomatologContext();

            return(context.Objave.ToList());
        }
コード例 #11
0
        public List <Pacijent> vratiPacijente()
        {
            StomatologContext context = new StomatologContext();

            return(context.Pacijenti.ToList());
        }
コード例 #12
0
        public List <Ordinacija> vratiOrdinacije()
        {
            StomatologContext context = new StomatologContext();

            return(context.Ordinacije.ToList());
        }
コード例 #13
0
        public List <Stomatolog> vratiStomatologe()
        {
            StomatologContext context = new StomatologContext();

            return(context.Stomatolozi.ToList());
        }