public TrimScheduleInfo TrimPreviousScheduleHistoryDetail(int locationId)
        {
            SequencingScheduleFactory factory = new SequencingScheduleFactory();
            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)));
        }
 public IEnumerable<SequencingStationScheduleHistory> SequencingScheduleHistory(int id)
 {
     SequencingScheduleFactory factory = new SequencingScheduleFactory();
     var items = factory.GetScheduleHistory(id);
     return items;
 }