public int GetAllPositiveTestsByStainOrganTissueForALastYear(string stain, string organ, string tissue) { var _context = new ApplicationDbContext(); var reports = GetAllPositiveReports(); return(_context.Reports.Where(r => r.StainName == stain && r.OrganName == organ && r.TissueName == tissue && r.Creation < EntityFunctions.AddYears(DateTime.Now, -1)).ToList().Count); }
public ActionResult Index() { var liste = db.PERSONELs.Where(a => a.DOGUM_GUNU_TARIHI != null). OrderBy(a => EntityFunctions.DiffDays(DateTime.Today, EntityFunctions.AddYears(a.DOGUM_GUNU_TARIHI, EntityFunctions.DiffYears(a.DOGUM_GUNU_TARIHI, DateTime.Today) + ((a.DOGUM_GUNU_TARIHI.Month < DateTime.Today.Month || (a.DOGUM_GUNU_TARIHI.Day <= DateTime.Today.Day && a.DOGUM_GUNU_TARIHI.Month == DateTime.Today.Month)) ? 1 : 0)))).Take(3).ToList(); ViewData["yuksek"] = db.EGITIMs.Where(s => s.OGRETIM_TIPI == "Yüksek Lisans").Count(); ViewData["lisans"] = db.EGITIMs.Where(s => s.OGRETIM_TIPI == "Lisans").Count(); ViewData["onlisans"] = db.EGITIMs.Where(s => s.OGRETIM_TIPI == "Ön Lisans").Count(); ViewData["duyuru"] = db.DUYURUs.ToList(); return(View(liste)); }
public void DateTimeAddYears() { DateTime date = stored.AddYears(-1); #if !EFOLD var q = this.Entities .Where(x => DbFunctions.AddYears(x.DateTime, -1) == date); #else var q = this.Entities .Where(x => EntityFunctions.AddYears(x.DateTime, -1) == date); #endif q.Should().NotBeEmpty(); }
public void DateTimeOffsetAddYears() { DateTimeOffset offset = stored.AddYears(-1); #if !EFOLD var q = this.Entities .Where(x => DbFunctions.AddYears(x.Offset, -1) == offset); #else var q = this.Entities .Where(x => EntityFunctions.AddYears(x.Offset, -1) == offset); #endif q.Should().NotBeEmpty(); }
public IEnumerable <Report> GetAllReportsLastYear() { var _context = new ApplicationDbContext(); return(_context.Reports.Where(r => r.Creation > EntityFunctions.AddYears(DateTime.Now, -1)).ToList()); }