public IActionResult Index()
        {
            var _stat = stat.Get();
            List <StatModel> statModels = new List <StatModel>();

            try
            {
                foreach (Statistics a in _stat)
                {
                    Worker cWorker = workersRepo.Get(a.WorkerID);

                    statModels.Add(new StatModel
                    {
                        WorkerID   = cWorker.id,
                        Name       = cWorker.Name,
                        Surname    = cWorker.Surname,
                        Patronymic = cWorker.Patronymic,
                        StartWork  = a.StartWork,
                        EndWork    = a.EndWork,
                        Late       = a.Late,
                        Latetime   = a.Latetime
                    });;
                }
            }
            catch { }

            if (statModels != null)
            {
                return(View(statModels));
            }
            else
            {
                return(View());
            }
        }
Exemple #2
0
        // GET: WorkersController

        public ActionResult Index()
        {
            return(View(repo.Get()));
        }