// GET: DailyReport/CreateAll/?userId=&date public ActionResult CreateAll(string userId, string date) { DateTime theDate = DateTime.Parse(date); var users = userDAO.ListAll(); var reports = dao.FindReports(null, theDate); foreach (var user in users) { if (user.Location == "SH") { if (!reports.Any(x => x.UserId == user.Id)) { var dailyReport = new DailyReport { UserId = user.Id, ReportDate = theDate, ReportDetails = new List <ReportDetail>() }; dao.Save(dailyReport); } } } return(RedirectToAction("Index", new { date = date })); }
// GET: User public ActionResult Index() { return(View(dao.ListAll().OrderBy(x => x.FullName).ToList())); }
// GET: Build public ActionResult Index() { return(View(buildDAO.ListAll().OrderByDescending(item => item.CreateTime).ToList())); }
public IEnumerable <T> ListAll() { List <T> list = new List <T>(); return(list = dao.ListAll().ToList()); }