Esempio n. 1
0
        public static (bool currentHasChanged, Employee currentEmployee) SaveEmployeeValues
            (List <Employee> employeeValues, IsoWeek currentIsoWeek)
        {
            var changedEvs        = employeeValues.Where(ev => ev.HasChanges).ToList();
            var currentHasChanged = false;
            var currentEmployee   = new Employee();

            Parallel.ForEach(changedEvs, employee =>
            {
                SaveEmployeeValues(employee);
                if (employee.IsoWeek.Equals(currentIsoWeek))
                {
                    currentEmployee   = employee;
                    currentHasChanged = true;
                }
            });
            return(currentHasChanged, currentEmployee);
        }
Esempio n. 2
0
 public CustomerSalesForecastedBuilder InWeek(IsoWeek week)
 {
     Week = week.ToString();
     return this;
 }