コード例 #1
0
 public TrimScheduleInfo TrimNextScheduleDetail(int locationId)
 {
     TrimScheduleFactory trimFactory = new TrimScheduleFactory();
     var nextSchedule = trimFactory.GetNextTrimSchedule(locationId);
     if (nextSchedule == null)
     {
         throw new HttpResponseException(
                   HttpErrorResponse.GetHttpErrorResponse(
                   HttpStatusCode.NotFound, "Trim Next Schedule Not Available", string.Format("Trim Next Schedule With Aisle ID = {0} does not exist", locationId)));
     }
     return nextSchedule;
 }
コード例 #2
0
 public TrimSchedule TrimSchedule(int id)
 {
     TrimScheduleFactory factory = new TrimScheduleFactory();
     var schedule = factory.GetTrimSchedule(id);
     if (schedule == null)
     {
         throw new HttpResponseException(
                   HttpErrorResponse.GetHttpErrorResponse(
                   HttpStatusCode.NotFound, "Trim Schedule Not Available", string.Format("Trim Schedule With Aisle ID = {0} does not exist", id)));
     }
     return schedule;
 }
コード例 #3
0
        public TrimScheduleInfo TrimPreviousScheduleHistoryDetail(int locationId)
        {
            SequencingFactory factory = new SequencingFactory();
            TrimScheduleFactory trimFactory = new TrimScheduleFactory();
            var histories = factory.GetScheduleHistory(locationId);
            var lastHistory = histories.FirstOrDefault();
            if (lastHistory != null)
            {
                var schedule = trimFactory.GetTrimScheduleHistoryDetail(locationId, (int)lastHistory.ScheduleNum);
                if (schedule == null)
                {
                    throw new HttpResponseException(
                          HttpErrorResponse.GetHttpErrorResponse(
                          HttpStatusCode.NotFound, "Trim Previous Schedule Not Available", string.Format("Trim Previous Schedule With Aisle ID = {0} does not exist", locationId)));
                }
                return schedule;
            
            }

            throw new HttpResponseException(
                          HttpErrorResponse.GetHttpErrorResponse(
                          HttpStatusCode.NotFound, "Trim Previous Schedule Not Available", string.Format("Trim Previous Schedule With Aisle ID = {0} does not exist", locationId)));
        }
コード例 #4
0
        public HttpResponseException TrimScheduleReady(int id)
        {
            SequencingFactory seqFactory = new SequencingFactory();
            TrimScheduleFactory trimFactory = new TrimScheduleFactory();
            var ready = trimFactory.IsScheduleReadyBySequencingStationId(id);
            if (ready)
            {
                return new HttpResponseException(HttpStatusCode.OK);
            }
            else
            {
                throw new HttpResponseException(
                          HttpErrorResponse.GetHttpErrorResponse(
                          HttpStatusCode.NotFound, "Trim Schedule Not Available", string.Format("Trim Schedule With Aisle ID = {0} does not exist", id)));
            }

        }
コード例 #5
0
 public TrimScheduleInfo TrimScheduleHistoryDetail(int locationId, int scheduleNum)
 {
     TrimScheduleFactory factory = new TrimScheduleFactory();
     var schedule = factory.GetTrimScheduleHistoryDetail(locationId, scheduleNum);
     return schedule;
 }
コード例 #6
0
 public HttpResponseMessage TrimScheduleComplete([FromBody]TrimScheduleInfo schedule, int id, int employeeId) 
 {
     TrimScheduleFactory factory = new TrimScheduleFactory();
     factory.CompleteTrimSchedule(schedule, id, employeeId);
     return new HttpResponseMessage(HttpStatusCode.OK);
 }