// 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 }));
        }
Пример #2
0
 // GET: User
 public ActionResult Index()
 {
     return(View(dao.ListAll().OrderBy(x => x.FullName).ToList()));
 }
Пример #3
0
 // GET: Build
 public ActionResult Index()
 {
     return(View(buildDAO.ListAll().OrderByDescending(item => item.CreateTime).ToList()));
 }
Пример #4
0
        public IEnumerable <T> ListAll()
        {
            List <T> list = new List <T>();

            return(list = dao.ListAll().ToList());
        }