public static void RefreshSequencingStationSettings()
        {
            SequencingDatabase db = new SequencingDatabase();
            var settings = db.GetSequenctionStationSettings();

            CacheItemPolicy cacheItemPolicy = new CacheItemPolicy();
            cacheItemPolicy.AbsoluteExpiration = DateTime.Now.AddDays(1);
            cache.Set("SequencingStationSettings", settings, cacheItemPolicy);
        }
        public static void RefreshBaseSequencingStationOffsets()
        {
            SequencingDatabase db = new SequencingDatabase();
            var stations = db.GetBaseSequencingStationOffsets();

            CacheItemPolicy cacheItemPolicy = new CacheItemPolicy();
            cacheItemPolicy.AbsoluteExpiration = DateTime.Now.AddDays(1);
            cache.Set("BaseSequencingStationOffsets", stations, cacheItemPolicy);
        }
Ejemplo n.º 3
0
        public IEnumerable<TempBuffer> GetSequencingBuffer(SequencingStation station)
        {
            PartSequencingDataContext dbSeq = new PartSequencingDataContext();
            HP_MESDataContext dbMes = new HP_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 dbSeq.SEQ_SP_GetSequencingBufferBySeqId(station.Id)
                              select new TempBuffer
                              {
                                  Group = groupLine,
                                  //ItemNumber = "1800VR",
                                  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 = "1420CF",
                                  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;
        }
Ejemplo n.º 4
0
 public dynamic GetScheduleNumByLocationId(int id)
 {
     PartSequencingDataContext dbSeq = new PartSequencingDataContext();
     SequencingDatabase db = new SequencingDatabase();
     var seqSettings = SequencingSettingsCacheManager.SequencingStationSettings;
     if (seqSettings.Any())
     {
         var station = seqSettings.Where(s => s.SequencingLocationId == id && s.Obsolete == false).FirstOrDefault();
         if (station != null)
         {
             var lookup = dbSeq.SequencingStationLookups.Where(s => s.SequenceStationSettingsId == station.Id).FirstOrDefault();
             if (lookup != null)
                 return new { ScheduleNum = lookup.NextScheduleNum };
         }
     }
     return new { ScheduleNum = 0 };
 }
Ejemplo n.º 5
0
 public IEnumerable<SideBySide> SequencingTracking2StationsByLineId(int lineId, int seqId1, int seqId2)
 {
     SequencingDatabase db = new SequencingDatabase();
     return db.GetSequencingTracking2StationsByLineId(lineId, seqId1, seqId2);
 }
Ejemplo n.º 6
0
 public void UpdateMessageToken([FromBody]MessageToken token)
 {
     SequencingDatabase db = new SequencingDatabase();
     db.UpdateMessageToken(token);
 }
Ejemplo n.º 7
0
 public IEnumerable<MessageToken> MessageTokensByLineId(int id)
 {
     SequencingDatabase db = new SequencingDatabase();
     var tokens = db.GetMessageTokensByLineId(id);
     return tokens;
 }
Ejemplo n.º 8
0
 public IEnumerable<SequencingLocation> SequencingLocations()
 {
     SequencingDatabase db = new SequencingDatabase();
     return db.GetSequencingLocations();
 }
Ejemplo n.º 9
0
 public IEnumerable<SequencingLocation> SequencingLocationsByType(string type)
 {
     SequencingDatabase db = new SequencingDatabase();
     return db.GetSequencingLocationsByType(type);
 }
Ejemplo n.º 10
0
 public IEnumerable<Line> Lines()
 {
     SequencingDatabase db = new SequencingDatabase();
     var lines = db.GetLines();
     return lines;
 }
Ejemplo n.º 11
0
 public void DeleteMessageToken(int id)
 {
     SequencingDatabase db = new SequencingDatabase();
     db.DeleteMessageTokenById(id);
 }