Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 2
0
        protected virtual void DoDeleteEntity(EmployeeWeekTimePlanning entity)
        {
            if (entity.IsNew) return;

            ServerEnvironment.EmployeeWeekTimePlanningService.Delete(entity);
        }
Ejemplo n.º 3
0
 protected virtual void DoUpdateEntity(EmployeeWeekTimePlanning entity)
 {
     if (entity.IsNew)
         ServerEnvironment.EmployeeWeekTimePlanningService.Save(entity);
     else
         ServerEnvironment.EmployeeWeekTimePlanningService.Update(entity);
     //ServerEnvironment.EmployeeWeekTimePlanningService.SaveOrUpdate(entity);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
 public void UpdateEntity(EmployeeWeekTimePlanning entity)
 {
     DoUpdateEntity(entity);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }