Exemplo n.º 1
0
        public virtual void Save()
        {
            if (_employeeweeks != null && _employeeweeks.Count > 0)
            {
                long[] ids = EmployeeWeekProcessor.GetEmployeeIds(_employeeweeks);
                // load from BeginDate to 2079 year
                SrvEmployeeWeekPlanningList plan_list = new SrvEmployeeWeekPlanningList(ids, BeginDate);
                SrvEmployeesPlanningDayList day_list  = new SrvEmployeesPlanningDayList(ids, BeginDate);
                foreach (EmployeeWeek w in _employeeweeks)
                {
                    plan_list.UpdateSaldoAfterPlanning(w);
                    foreach (EmployeeDay ed in w.DaysList)
                    {
                        day_list.CompareAndSave(ed);
                    }
                }


                EmployeePlanningWorkingModelHelper wmhelper = new EmployeePlanningWorkingModelHelper(_timeservice.EmployeePlanningWorkingModelService);

                wmhelper.SaveEmployeeWorkingModel(_employeeweeks);
            }
        }