/// <summary> /// 根据stage,customer获取对应的PdLine信息列表 /// </summary> /// <param name="stage">Stage</param> /// <param name="customerId">customer</param> /// <returns>PdLine信息列表</returns> public IList<PdLineInfo> GetPdLineListByStageAndCustomer(string stage, string customerId) { IList<PdLineInfo> retLst = new List<PdLineInfo>(); DataTable dtLine = new DataTable(); PdLineInfo ret = new PdLineInfo(); try { if (!String.IsNullOrEmpty(stage) && !String.IsNullOrEmpty(customerId)) { ILineRepository lineRepository = RepositoryFactory.GetInstance().GetRepository<ILineRepository, Line>(); dtLine = lineRepository.GetLineByCustomerAndStage(customerId, stage); foreach (DataRow row in dtLine.Rows) { ret.friendlyName = row["Descr"].ToString(); ret.id = row["Line"].ToString(); retLst.Add(ret); } } return retLst; } catch (Exception) { throw; } }
/// <summary> /// 根据PdLine获取对应的PdLine详细信息 /// </summary> /// <param name="id">PdLineID</param> /// <returns>PdLine详细信息</returns> public PdLineInfo GetPdLine(string id) { ILineRepository lineRepository = RepositoryFactory.GetInstance().GetRepository<ILineRepository, Line>(); PdLineInfo ret = new PdLineInfo(); ret.id = id; ret.friendlyName = lineRepository.Find(id).Descr; return ret; }
/// <summary> /// 根据station,customer获取对应的PdLine信息列表 /// </summary> /// <param name="stationId">Station Identifier</param> /// <param name="customerId">customer</param> /// <returns>PdLine信息列表</returns> public IList<PdLineInfo> GetPdLineList(string stationId, string customerId) { IList<PdLineInfo> retLst = new List<PdLineInfo>(); IList<LineInfo> linelst = new List<LineInfo>(); PdLineInfo ret = new PdLineInfo(); try { if (!String.IsNullOrEmpty(stationId) && !String.IsNullOrEmpty(customerId)) { ILineRepository lineRepository = RepositoryFactory.GetInstance().GetRepository<ILineRepository, Line>(); //---------------------------------------------------------------- //Modify 2012/01/13 common rule UC change: //SELECT a.[Line] AS Code, [Descr] as Line //FROM IMES_GetData..Line_Station a, IMES_GetData..Line b //WHERE a.Station = @Station //and a.Line = b.Line //and CustomerID = @Customer //ORDER BY [Descr] //------------------------------------------------------------------ //retLst = lineRepository.GetPdLineList(customerId, stationId); //GetLineListByStationAndCustomer linelst = lineRepository.GetLineListByStationAndCustomer(stationId, customerId); foreach (var lineitem in linelst) { ret.friendlyName = lineitem.descr; ret.id = lineitem.line; retLst.Add(ret); } } return retLst; } catch (Exception) { throw; } }