public void PopulateViewModel(List <WorkScheduleShift> listOfAllShifts)
        {
            ListForViewModel.Clear();
            DateTime           rightNow  = DateTime.Now;
            DateTimeFormatInfo dfi       = DateTimeFormatInfo.CurrentInfo;
            Calendar           cal       = dfi.Calendar;
            List <Employee>    employees = Controller.GetInstance().Employees;

            for (int i = 0; i < 9; i++)
            {
                DateTime workingtime = rightNow.AddDays(i * 7);
                int      weekNo      = cal.GetWeekOfYear(workingtime, dfi.CalendarWeekRule, dfi.FirstDayOfWeek);
                foreach (Employee employee in employees)
                {
                    WorkScheduleShiftViewModel wssvm = new WorkScheduleShiftViewModel(employee, weekNo, workingtime.Year);
                    ListForViewModel.Add(wssvm);
                }
            }
            foreach (WorkScheduleShift shift in listOfAllShifts)
            {
                WorkScheduleShiftViewModel wssvm = GetWssVM(shift.Employee, shift.WeekNumber, shift.Year);
                if (wssvm == null)
                {
                    wssvm = new WorkScheduleShiftViewModel(shift.Employee, shift.WeekNumber, shift.Year);
                    ListForViewModel.Add(wssvm);
                }
                wssvm.AddShift(shift);
            }
        }
        private WorkScheduleShiftViewModel GetWssVM(Employee employee, int weekNumber, int year)
        {
            WorkScheduleShiftViewModel hest = null;

            foreach (WorkScheduleShiftViewModel wssvm in ListForViewModel)
            {
                if (wssvm.EmployeeName == employee.FullName && wssvm.WeekNumber == weekNumber && wssvm.Year == year)
                {
                    hest = wssvm;
                }
            }
            return(hest);
        }