public float yesterdayImmigration() { string franchid = help.Permission(); // DateTime today = System.DateTime.Now; if (franchid == "Admin") { ApplicationRecipt ee2 = db.ApplicationRecipts.FirstOrDefault(x => x.Date == yesterday); if (ee2 != null) { return((db.ApplicationRecipts.Where(x => x.Date == yesterday)).Sum(x => x.Amount)); } else { return(0); } } ApplicationRecipt ee = db.ApplicationRecipts.FirstOrDefault(x => x.Date == yesterday); if (ee != null) { return((db.ApplicationRecipts.Where(x => x.Date == yesterday)).Sum(x => x.Amount)); } else { return(0); } }
public float TodayImmigration() { string franchid = help.Permission(); if (franchid == "Admin") { return((db.ApplicationRecipts.Where(x => x.Date == today)).Select(x => x.Amount).DefaultIfEmpty(0).Sum()); } // DateTime today = System.DateTime.Now; ApplicationRecipt ee = db.ApplicationRecipts.FirstOrDefault(x => x.Date == today); if (ee != null) { return((db.ApplicationRecipts.Where(x => x.Date == today)).Sum(x => x.Amount)); } else { return(0); } }