コード例 #1
0
ファイル: StationFactory.cs プロジェクト: wwkkww1983/yh
        /// <summary>
        ///
        /// </summary>
        /// <param name="tbl"></param>
        /// <returns></returns>
        static private StationCollection CreateStationCollection(DataTable tbl)
        {
            StationCollection stations = new StationCollection();

            foreach (DataRow row in tbl.Rows)
            {
                StationClass s = CreateStation(row);
                stations.Add(s);
            }
            return(stations);
        }
コード例 #2
0
ファイル: UCStation.ascx.cs プロジェクト: hkiaipc/yh
        /// <summary>
        /// 
        /// </summary>
        /// <param name="s"></param>
        public void Bind(StationClass s)
        {
            this.txtStationName.Text = s.StationName;
            this.txtDeviceType.Text = s.DeviceCollection[0].DeviceType;

            DeviceClass device = s.DeviceCollection[0];
            BindAlarm(device);
            //AddTestFormula(device);
            BindFormula(device);
            SaveDeviceID(device.DeviceID);
        }
コード例 #3
0
ファイル: StationCollection.cs プロジェクト: wwkkww1983/yh
            public int Compare(object x, object y)
            {
                StationClass s1 = x as StationClass;
                StationClass s2 = y as StationClass;

                if (s1 == null || s2 == null)
                {
                    return(0);
                }

                return(s1.StationOrdinal - s2.StationOrdinal);
            }
コード例 #4
0
ファイル: StationFactory.cs プロジェクト: wwkkww1983/yh
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        static public StationCollection CreateStationCollection(int channelID)
        {
            StationCollection stations             = new StationCollection();
            DataTable         channelStationMapTbl = ChannelStationMapDBI.GetChannelStationMapDataTable(channelID);

            //int[] stationIDs = ChannelStationMapDBI.GetStationIDs(channelID);
            int[] stationIDs = DataTableHelper.GetIDs(channelStationMapTbl, "stationid");

            DataTable tbl = StationDBI.GetStationDataTable(stationIDs);

            foreach (DataRow row in tbl.Rows)
            {
                StationClass c = CreateStation(row);
                c.StationOrdinal = GetStationOrdinal(channelStationMapTbl, c.StationID);
                stations.Add(c);
            }

            stations.SortByStationOrdinal();
            return(stations);
        }
コード例 #5
0
ファイル: StationFactory.cs プロジェクト: wwkkww1983/yh
        /// <summary>
        ///
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        private static StationClass CreateStation(DataRow row)
        {
            StationClass s = new StationClass();

            s.StationID = Convert.ToInt32(row["StationID"]);
            //s.StationName = row["Name"].ToString();
            s.StationName = GetStationName(row);

            object colorObject = row["Color"];

            if (colorObject != null && colorObject != DBNull.Value)
            {
                string colorString = colorObject.ToString();
                int    argb        = 0;
                bool   r           = int.TryParse(colorString, out argb);
                if (r)
                {
                    System.Drawing.Color color = System.Drawing.Color.FromArgb(argb);
                    s.Color = color;
                }
            }
            return(s);
        }
コード例 #6
0
ファイル: ChannelSession.cs プロジェクト: hkiaipc/yh
 /// <summary>
 /// 
 /// </summary>
 /// <param name="channelID"></param>
 private StationCollection GetStationList(int channelID)
 {
     StationCollection list = new StationCollection();
     DataTable stationTbl = ChannelDBI.GetStationDataTable(channelID);
     foreach (DataRow row in stationTbl.Rows)
     {
         StationClass sc = new StationClass();
         sc.StationID = Convert.ToInt32(row["StationID"]);
         sc.StationName = row["Name"].ToString();
         //this.StationCollection.Add(sc);
         list.Add(sc);
     }
     return list;
 }
コード例 #7
0
ファイル: ChannelSession.cs プロジェクト: hkiaipc/yh
 /// <summary>
 /// 获取候选站点列表
 /// </summary>
 /// <returns></returns>
 public StationCollection GetCandidateStationList()
 {
     StationCollection list = new StationCollection();
     DataTable tbl =  StationDBI.GetNotAssociateStationDataTable();
     foreach (DataRow row in tbl.Rows)
     {
         int stationID = Convert.ToInt32(row["StationID"]);
         string name = row["Name"].ToString();
         StationClass n = new StationClass();
         n.StationID = stationID;
         n.StationName = name;
         list.Add(n);
     }
     list.Remove(this.StationCollection);
     list.Add(GetDeletedStationCollection());
     return list;
 }
コード例 #8
0
ファイル: StationFactory.cs プロジェクト: hkiaipc/yh
        /// <summary>
        /// 
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        private static StationClass CreateStation(DataRow row)
        {
            StationClass s = new StationClass();
            s.StationID = Convert.ToInt32 (row["StationID"]);
            //s.StationName = row["Name"].ToString();
            s.StationName = GetStationName(row);

            object colorObject = row["Color"];
            if (colorObject != null && colorObject != DBNull.Value)
            {
                string colorString = colorObject.ToString();
                int argb = 0;
                bool r = int.TryParse(colorString, out argb);
                if (r)
                {
                    System.Drawing.Color color = System.Drawing.Color.FromArgb(argb);
                    s.Color = color;
                }
            }
            return s;
        }
コード例 #9
0
ファイル: pProject.aspx.cs プロジェクト: hkiaipc/yh
 /// <summary>
 /// 
 /// </summary>
 /// <param name="s"></param>
 /// <returns></returns>
 private TreeNode CreateStationTreeNode(StationClass s)
 {
     string stationValue = "s" + s.StationID;
     TreeNode n = new TreeNode(s.StationName);
     n.Value = stationValue;
     return n;
 }