public IEnumerable<TempBuffer> GetSequencingBuffer(SequencingStation station)
        {
            PartSequencingDataContext dbSeq = new PartSequencingDataContext();
            MesDataContext dbMes = new MesDataContext();
            SequencingDatabase db = new SequencingDatabase();

            List<TempBuffer> lineBuffer = null;

            string groupLine = station.SequencingLocation.LineGroup.Trim();
            int lineId = station.Line.Id;
            int locationId = station.SequencingLocation.Id;
            if (station.SequencingLocation.ParentId == null)
            {
                lineBuffer = (from s in dbMes.IWS_SP_GetSequencingBufferByLineId(station.Line.Id)
                              select new TempBuffer
                              {
                                  Group = groupLine,
                                  ItemNumber = s.ItemNumber.Trim(),
                                  ItemType = s.ItemType.Trim(),
                                  JobId = (int)s.JobId,
                                  OrderId = (int)s.OrderId,
                                  OrderStatus = (int)s.OrderStatus,
                                  Region = s.Region.Trim(),
                                  LineId = (int)s.LineId,
                                  OrderNumber = s.OrderNumber,
                                  BuildDTM = s.BuildDTM == null ? "" : s.BuildDTM.Value.ToString("mm/dd/yyyy hh:mm:ss tt")
                              }).ToList();

            }
            else
            {

                lineBuffer = (from s in dbSeq.IWS_GetSequencingStationQueueByLocationId(locationId)
                              select new TempBuffer
                              {
                                  ScheduleNum = (int)s.ScheduleNum,
                                  BoxNum = (int)s.BoxNum,
                                  OrderNumber = s.OrderNumber == null ? "" : s.OrderNumber.Trim(),
                                  Group = groupLine,
                                  ItemNumber = s.ItemNumber.Trim(),
                                  ItemType = s.ItemType.Trim(),
                                  JobId = (int)s.JobId,
                                  OrderId = (int)s.OrderId,
                                  OrderStatus = (int)s.OrderStatus,
                                  Region = s.Region.Trim(),
                                  LineId = lineId
                              }).ToList();

            }

            return lineBuffer;
        }
Пример #2
0
 public void DeleteMessageToken(int id)
 {
     SequencingDatabase db = new SequencingDatabase();
     db.DeleteMessageTokenById(id);
 }
Пример #3
0
 public IEnumerable<SideBySide> SequencingTracking2StationsByLineId(int lineId, int seqId1, int seqId2)
 {
     SequencingDatabase db = new SequencingDatabase();
     return db.GetSequencingTracking2StationsByLineId(lineId, seqId1, seqId2);
 }
Пример #4
0
 public void UpdateMessageToken([FromBody]MessageToken token)
 {
     SequencingDatabase db = new SequencingDatabase();
     db.UpdateMessageToken(token);
 }
Пример #5
0
 public IEnumerable<MessageToken> MessageTokensByLineId(int id)
 {
     SequencingDatabase db = new SequencingDatabase();
     var tokens = db.GetMessageTokensByLineId(id);
     return tokens;
 }
Пример #6
0
 public IEnumerable<SequencingLocation> SequencingLocations()
 {
     SequencingDatabase db = new SequencingDatabase();
     return db.GetSequencingLocations();
 }
Пример #7
0
 public IEnumerable<SequencingLocation> SequencingLocationsByType(string type)
 {
     SequencingDatabase db = new SequencingDatabase();
     return db.GetSequencingLocationsByType(type);
 }
Пример #8
0
 public IEnumerable<Line> Lines()
 {
     SequencingDatabase db = new SequencingDatabase();
     var lines = db.GetLines();
     return lines;
 }