Esempio n. 1
0
File: Class1.cs Progetto: wpmyj/c3
        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());
        }
Esempio n. 2
0
File: Class1.cs Progetto: wpmyj/c3
        /// <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);
        }
Esempio n. 3
0
File: Class1.cs Progetto: hkiaipc/C3
        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();
        }