// // 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)); }
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())); }
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()); }
public List <Pregled> vratiPreglede() { StomatologContext context = new StomatologContext(); return(context.Pregledi.ToList()); }
public List <ObavljenaPoseta> vratiObavljenePosete() { StomatologContext context = new StomatologContext(); return(context.ObavljenePosete.ToList()); }
public List <ZakazanaPoseta> vratiZakazanePosete() { StomatologContext context = new StomatologContext(); return(context.ZakazanePosete.ToList()); }
public List <OdgovorNaPoruku> vratiOdgovoreNaPoruke() { StomatologContext context = new StomatologContext(); return(context.OdgovoriNaPoruke.ToList()); }
public List <Poruka> vratiPoruke() { StomatologContext context = new StomatologContext(); return(context.Poruke.ToList()); }
public List <KomentarNaObjavu> vratiKomentareNaObjave() { StomatologContext context = new StomatologContext(); return(context.KomentariNaObjave.ToList()); }
public List <Objava> vratiObjave() { StomatologContext context = new StomatologContext(); return(context.Objave.ToList()); }
public List <Pacijent> vratiPacijente() { StomatologContext context = new StomatologContext(); return(context.Pacijenti.ToList()); }
public List <Ordinacija> vratiOrdinacije() { StomatologContext context = new StomatologContext(); return(context.Ordinacije.ToList()); }
public List <Stomatolog> vratiStomatologe() { StomatologContext context = new StomatologContext(); return(context.Stomatolozi.ToList()); }