예제 #1
0
        public int Save(ILeavePeriod leavePeriod)
        {
            exp_Data = new DataAccess.ExceptionLeavePeriod(Connection);
            var ExceptionLeavePeriod = (ExceptionalLeavePeriod)leavePeriod;

            leavePeriod.LeavePeriodID = exp_Data.Save(ExceptionLeavePeriod.ClientID,
                                                      ExceptionLeavePeriod.UserID,
                                                      (int)ExceptionLeavePeriod.Type,
                                                      ExceptionLeavePeriod.StartDate,
                                                      ExceptionLeavePeriod.EndDate,
                                                      ExceptionLeavePeriod.IsCurrentPeriod,
                                                      ExceptionLeavePeriod.IsNextPeriod,
                                                      ExceptionLeavePeriod.PreviousLeave,
                                                      ExceptionLeavePeriod.ActionBy,
                                                      ExceptionLeavePeriod.LeaveType
                                                      );
            if (leavePeriod.LeavePeriodID > 0)
            {
                return(leavePeriod.LeavePeriodID);
            }
            else
            {
                return(-1);
            }
        }
예제 #2
0
        public bool Update(ILeavePeriod leavePeriod)
        {
            exp_Data = new DataAccess.ExceptionLeavePeriod(Connection);
            var ExceptionLeavePeriod = (ExceptionalLeavePeriod)leavePeriod;
            var result = exp_Data.Update(ExceptionLeavePeriod.LeavePeriodID, ExceptionLeavePeriod.ClientID,
                                         ExceptionLeavePeriod.UserID,
                                         (int)ExceptionLeavePeriod.Type,
                                         ExceptionLeavePeriod.StartDate,
                                         ExceptionLeavePeriod.EndDate,
                                         ExceptionLeavePeriod.IsCurrentPeriod,
                                         ExceptionLeavePeriod.IsNextPeriod,
                                         ExceptionLeavePeriod.PreviousLeave,
                                         ExceptionLeavePeriod.ActionBy,
                                         ExceptionLeavePeriod.LeaveType
                                         );

            return(result);
        }
예제 #3
0
 public bool Delete(int clientID, int leavePeriodID)
 {
     exp_Data = new DataAccess.ExceptionLeavePeriod(Connection);
     return(exp_Data.Delete(clientID, leavePeriodID));
 }