예제 #1
0
        protected override void _UpdateSaldo(EmployeeWeekTimePlanning entity, int lastSaldo, bool allin)
        {
            Debug.Assert(entity != null);
            if (entity != null)
            {
                int oldSaldo = entity.Saldo;
                base._UpdateSaldo(entity, lastSaldo, allin);

                if (oldSaldo != entity.Saldo)
                {
                    UpdateEntity(entity);
                }
            }
        }
예제 #2
0
        protected virtual void DoDeleteEntity(EmployeeWeekTimePlanning entity)
        {
            if (entity.IsNew) return;

            ServerEnvironment.EmployeeWeekTimePlanningService.Delete(entity);
        }
예제 #3
0
 protected virtual void DoUpdateEntity(EmployeeWeekTimePlanning entity)
 {
     if (entity.IsNew)
         ServerEnvironment.EmployeeWeekTimePlanningService.Save(entity);
     else
         ServerEnvironment.EmployeeWeekTimePlanningService.Update(entity);
     //ServerEnvironment.EmployeeWeekTimePlanningService.SaveOrUpdate(entity);
 }
예제 #4
0
        public void UpdateSaldoAfterPlanning(EmployeeWeek week)
        {
            EmployeeWeekTimePlanning entity = GetByDate(week.EmployeeId, week.BeginDate);

            if (entity == null)
            {
                entity = new EmployeeWeekTimePlanning();
                EmployeeWeekProcessor.AssignTo(entity, week);
                UpdateEntity(entity);
            }
            else
            {
                if (EmployeeWeekProcessor.IsModified(entity, week))
                {
                    EmployeeWeekProcessor.AssignTo(entity, week);
                    UpdateEntity(entity);
                }
            }

            UpdateSaldoFrom(week.EmployeeId, DateTimeHelper.GetNextMonday(week.BeginDate), week.Saldo);
        }
예제 #5
0
 public void UpdateEntity(EmployeeWeekTimePlanning entity)
 {
     DoUpdateEntity(entity);
 }
예제 #6
0
        public EmployeeWeekTimePlanning AssignTo(EmployeeWeekTimePlanning weekinfo)
        {
            if (weekinfo == null)
                throw new ArgumentNullException ();
            //weekinfo.ID = ID;
            weekinfo.WorkingHours = CountWeeklyWorkingHours ;
            weekinfo.ContractHours = ContractHoursPerWeek ;
            weekinfo.PlusMinusHours = CountWeeklyPlusMinusHours ;
            weekinfo.PlannedHours = CountWeeklyPlanningWorkingHours ;
            weekinfo.AdditionalCharge = CountWeeklyAdditionalCharges ;
            weekinfo.EmployeeID = EmployeeId;

            weekinfo.Saldo = Saldo;

            weekinfo.WeekBegin = BeginDate;
            weekinfo.WeekEnd = EndDate;
            weekinfo.CustomEdit = _CustomEdit;
            weekinfo.AllIn = AllIn;
            return weekinfo;
        }
예제 #7
0
 public EmployeeWeekTimePlanning Assign(EmployeeWeekTimePlanning weekinfo)
 {
     if (weekinfo == null)
         throw new NullReferenceException();
     ID = weekinfo.ID;
     CountWeeklyWorkingHours = weekinfo.WorkingHours;
     ContractHoursPerWeek = weekinfo.ContractHours;
     CountWeeklyPlusMinusHours = weekinfo.PlusMinusHours;
     CountWeeklyPlanningWorkingHours = weekinfo.PlannedHours;
     CountWeeklyAdditionalCharges = weekinfo.AdditionalCharge;
     Saldo = weekinfo.Saldo;
     _CustomEdit = weekinfo.CustomEdit;
     AllIn = weekinfo.AllIn;
     return weekinfo;
 }
예제 #8
0
 public static bool IsModified(EmployeeWeekTimePlanning entity, EmployeeWeek week)
 {
     return (entity.EmployeeID != week.EmployeeId ||
     entity.Saldo != week.Saldo ||
     entity.WeekBegin != week.BeginDate ||
     entity.WeekEnd != week.EndDate ||
     entity.WeekNumber != DateTimeHelper.GetWeekNumber(week.BeginDate, week.EndDate) ||
     entity.AdditionalCharge != week.CountWeeklyAdditionalCharges ||
     entity.PlannedHours != week.CountWeeklyPlanningWorkingHours ||
     entity.PlusMinusHours != week.CountWeeklyPlusMinusHours ||
     entity.WorkingHours != week.CountWeeklyWorkingHours ||
     entity.ContractHours != week.ContractHoursPerWeek ||
     entity.CustomEdit != week.CustomEdit ||
     entity.AllIn != week.AllIn);
 }