コード例 #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
ファイル: EmployeeWeek.cs プロジェクト: 5509850/baumax
 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);
 }