Пример #1
0
 public static HourInfoList HourFetchInfoList(ITask[] task)
 {
     return(HourService.HourFetchInfoList(
                new HourCriteria
     {
         TaskId = task.Select(row => row.TaskId).ToArray()
     }));
 }
Пример #2
0
 public static HourInfoList HourFetchInfoList(ITask task)
 {
     return(HourService.HourFetchInfoList(
                new HourCriteria
     {
         TaskId = new[] { task.TaskId }
     }));
 }
Пример #3
0
 public static HourInfoList HourFetchInfoList(DateTime startDate, DateTime endDate)
 {
     return(HourService.HourFetchInfoList(
                new HourCriteria
     {
         Date = new DateRangeCriteria(startDate, endDate)
     }));
 }
Пример #4
0
 public static HourInfoList HourFetchInfoList(DateTime startDate, DateTime endDate)
 {
     return(HourService.HourFetchInfoList(
                new HourCriteria
     {
         UserId = new[] { BusinessPrincipal.GetCurrentIdentity().UserId },
         Date = new DateRangeCriteria(startDate, endDate)
     }));
 }
Пример #5
0
        public static Hour HourArchive(int hourId)
        {
            var hour = HourService.HourFetch(hourId);

            if (hour.IsArchived)
            {
                return(hour);
            }

            hour.IsArchived = true;

            hour = HourService.HourSave(hour);

            return(hour);
        }
Пример #6
0
        public static Hour HourSave(Hour hour)
        {
            if (!hour.IsValid)
            {
                return(hour);
            }

            Hour result;

            if (hour.IsNew)
            {
                result = HourService.HourInsert(hour);
            }
            else
            {
                result = HourService.HourUpdate(hour);
            }

            return(result);
        }
Пример #7
0
 public static HourInfoList HourFetchInfoList()
 {
     return(HourService.HourFetchInfoList(
                new HourCriteria()));
 }
Пример #8
0
 public static bool HourDelete(int hourId)
 {
     return(HourService.HourDelete(
                HourService.HourFetch(hourId)));
 }