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); }
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; }
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 }; }
public IEnumerable<SideBySide> SequencingTracking2StationsByLineId(int lineId, int seqId1, int seqId2) { SequencingDatabase db = new SequencingDatabase(); return db.GetSequencingTracking2StationsByLineId(lineId, seqId1, seqId2); }
public void UpdateMessageToken([FromBody]MessageToken token) { SequencingDatabase db = new SequencingDatabase(); db.UpdateMessageToken(token); }
public IEnumerable<MessageToken> MessageTokensByLineId(int id) { SequencingDatabase db = new SequencingDatabase(); var tokens = db.GetMessageTokensByLineId(id); return tokens; }
public IEnumerable<SequencingLocation> SequencingLocations() { SequencingDatabase db = new SequencingDatabase(); return db.GetSequencingLocations(); }
public IEnumerable<SequencingLocation> SequencingLocationsByType(string type) { SequencingDatabase db = new SequencingDatabase(); return db.GetSequencingLocationsByType(type); }
public IEnumerable<Line> Lines() { SequencingDatabase db = new SequencingDatabase(); var lines = db.GetLines(); return lines; }
public void DeleteMessageToken(int id) { SequencingDatabase db = new SequencingDatabase(); db.DeleteMessageTokenById(id); }