Exemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnAddChannel_Click(object sender, EventArgs e)
 {
     ChannelClass newChannel = new ChannelClass();
     newChannel.ChannelName = "new channel";
     this.UCChannel1.Bind(newChannel);
     //SessionManager.ChannelSession.
 }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        static public ChannelCollection CreateChannelCollection()
        {
            ChannelCollection cc  = new ChannelCollection();
            DataTable         tbl = ChannelDBI.GetChannelDataTable();

            foreach (DataRow row in tbl.Rows)
            {
                ChannelClass c = CreateChannel(row);
                cc.Add(c);
            }
            return(cc);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        static public ChannelClass CreateChannel(int id)
        {
            ChannelClass cc  = null;
            DataTable    tbl = ChannelDBI.GetChannelDataTable(id);

            if (tbl.Rows.Count > 0)
            {
                DataRow row = tbl.Rows[0];
                cc = CreateChannel(row);
            }
            return(cc);
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <param name="row"></param>
        /// <returns></returns>
        private static ChannelClass CreateChannel(DataRow row)
        {
            int    id = Convert.ToInt32(row["ChannelID"]);
            string n  = row["ChannelName"].ToString();
            string r  = row["remark"].ToString();

            ChannelClass cc = new ChannelClass();

            cc.ChannelID     = id;
            cc.ChannelName   = n;
            cc.ChannelRemark = r;
            return(cc);
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="waterUserDI"></param>
        /// <returns></returns>
        static public ChannelCollection CreateChannelCollection(int waterUserID)
        {
            // waterUserID -> channelID[] -> channelCollection
            //
            ChannelCollection ccs = new ChannelCollection();

            int[] channelIDs = WaterUserChannelMapDBI.GetChannelIDs(waterUserID);
            if (channelIDs.Length > 0)
            {
                DataTable tbl = ChannelDBI.GetChannelDataTable(channelIDs);
                foreach (DataRow row in tbl.Rows)
                {
                    ChannelClass cc = CreateChannel(row);
                    ccs.Add(cc);
                }
            }
            return(ccs);
        }
Exemplo n.º 6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="c"></param>
 /// <returns></returns>
 private TreeNode CreateChannelTreeNode(ChannelClass c)
 {
     string channelvalue = "c" + c.ChannelID;
     TreeNode n = new TreeNode(c.ChannelName);
     n.Value = channelvalue;
     return n;
 }