public JsonResult GetWeekend()
        {
            IEnumerable <Weekend>     Weekends = WeekendRepository.Get();
            List <DateForVacationAll> dates    = new List <DateForVacationAll>();

            foreach (Weekend weekend in Weekends)
            {
                for (DateTime date = weekend.startDate; date <= weekend.EndDate;)
                {
                    dates.Add(new DateForVacationAll
                    {
                        Id   = Guid.NewGuid(),
                        Date = date.ToString("yyyy-MM-dd")
                    });
                    date = date.AddDays(1);
                }
            }

            return(Json(dates.ToArray()));
        }
        public IActionResult NextYear()
        {
            List <Person>     people            = PersonRepository.IncludeGet(p => p.Team).ToList();
            HistoryAddingDays historyAddingDays = new HistoryAddingDays();

            if (people[0] == null)
            {
                return(Redirect("/Home/Workers/Home/Workers"));
            }
            historyAddingDays.Year          = people[0].Year;
            historyAddingDays.NumberAddDays = 17;
            historyAddingDays.Id            = Guid.NewGuid();
            historyAddingDays.CheckAddDays  = true;
            HistoryAddingDaysRepository.Create(historyAddingDays);
            foreach (Person person in people)
            {
                Person newperson = person;
                person.Year++;
                newperson.Days += 18;
                PersonRepository.Update(newperson);
            }
            IEnumerable <Weekend> weekends    = WeekendRepository.Get(p => p.startDate.Year == DateTime.Now.Year);
            List <Weekend>        NewWeekends = new List <Weekend>();
            Weekend Updateweekend             = new Weekend();

            foreach (Weekend weekend in weekends)
            {
                Updateweekend.Id        = Guid.NewGuid();
                Updateweekend.Name      = weekend.Name;
                Updateweekend.startDate = weekend.startDate.AddYears(1);
                Updateweekend.EndDate   = weekend.EndDate.AddYears(1);
                WeekendRepository.Create(Updateweekend);
                NewWeekends.Add(weekend);
            }

            return(View(NewWeekends));
        }