Exemplo n.º 1
0
Arquivo: Class1.cs Projeto: 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());
        }
Exemplo n.º 2
0
Arquivo: Class1.cs Projeto: 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);
        }
Exemplo n.º 3
0
Arquivo: Class1.cs Projeto: 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();
        }