protected override IStationSource[] OnGetStationSources() { DataTable tbl = DBI.Instance.ExecuteStationDataTable(); List <StationSource> list = new List <StationSource>(); foreach (DataRow row in tbl.Rows) { StationSource source = new StationSource(row); list.Add(source); } return(list.ToArray()); }
/// <summary> /// /// </summary> /// <param name="stationSource"></param> /// <returns></returns> protected override IStation OnCreate(IStationSource stationSource) { StationSource source = stationSource as StationSource; DataRow row = source.DataRow; string stationName = row["StationName"].ToString(); string xml = row["StationCPConfig"].ToString().Trim(); int stationID = (int)row["StationID"]; int ordinal = Convert.ToInt32(row["StationOrdinal"]); string street = row["Street"].ToString().Trim(); Station st = new Station(); st.Name = stationName; st.Ordinal = ordinal; st.Street = street; st.Guid = GuidHelper.Create((uint)stationID); st.Spu = this.Spu; st.StationSource = stationSource; st.StationType = this.Spu.StationType; st.CommuniPortConfig = CommuniPortConfigSerializer.Deserialize(xml); return(st); }
protected override IStationSource[] OnGetStationSources() { DataTable tbl = DBI.Instance.ExecuteStationDataTable(); List<StationSource> list = new List<StationSource>(); foreach (DataRow row in tbl.Rows) { StationSource source = new StationSource(row); list.Add(source); } return list.ToArray(); }