// GET: ModulPacijent/ZakaziTermin public ActionResult Index(int?page, DateTime?from, DateTime?to) { Korisnik k = Autentifikacija.GetLogiraniKorisnik(HttpContext); int o = k.Pacijent.Id; IPagedList <Termin> op; if (from != null && to != null) { op = ctx.Termins.Where(c => c.PacijentId == o && c.Datum >= from && c.Datum <= to).ToList().ToPagedList(page ?? 1, 3); } else if (from != null || to != null) { op = ctx.Termins.Where(c => c.PacijentId == o && (c.Datum >= from || c.Datum <= to)).ToList().ToPagedList(page ?? 1, 3); } else { op = ctx.Termins.Where(c => c.PacijentId == o).ToList().ToPagedList(page ?? 1, 3); } TerminListaVM model = new TerminListaVM { }; model.TerminList = op; return(View(model)); }
public ActionResult ZauzetiTermini(int?page) { IPagedList <Termin> op; op = ctx.Termins.Where(c => c.Odobren == true && c.Datum >= DateTime.Today).ToList().ToPagedList(page ?? 1, 3); TerminListaVM model = new TerminListaVM { }; model.TerminList = op; return(View(model)); }