Exemplo n.º 1
0
        public void Load(string key)
        {
            if (! _isLoaded){
                _key = key;
                Connection connection;
                _qed = new Connection(new ConnectionString(ConfigurationSettings.AppSettings["QED_DB"].Trim()));
                _qed.BusinessCollection = this;
                _qed.Protocol = Protocol.MYSQL;	_qed.Port = 3306; _qed.Transport = Transport.TCP; _qed.SystemName = "QED_DB";
                _qed.PrivateDB = true;

                using(MySqlConnection conn = _qed.MySqlConnection){
                    using(MySqlDataReader dr = MySqlDBLayer.LoadAll(conn, _table)){
                        while(dr.Read()) {
                            connection = new Connection();
                            connection.BusinessCollection = this;
                            connection	.Load(dr);
                            List.Add(connection);
                        }
                        conn.Close();
                    }
                }
                _isLoaded = true;
            }
        }
Exemplo n.º 2
0
 public bool Contains(Connection obj)
 {
     foreach(Connection child in List) {
         if (obj.Equals(child)){
             return true;
         }
     }
     return false;
 }
Exemplo n.º 3
0
Arquivo: ConMan.cs Projeto: jhogan/qed
 private void mnuItemGenListBoxAdd_Click(object sender, System.EventArgs e)
 {
     InputModal im = new InputModal("", "Connection Name");
     if (im.ShowDialog(this) == DialogResult.OK) {
         _conn = new Connection();
         _conn.SystemName = im.Answer("Connection Name");
         _conns.Add(_conn);
         this.lstConns.Items.Add(_conn);
         this.UpdateScreen();
         this.lstConns.SelectedItem = _conn;
     }
 }
Exemplo n.º 4
0
 public Connection Add(Connection obj)
 {
     obj.BusinessCollection = this;
     List.Add(obj); return obj;
 }
Exemplo n.º 5
0
Arquivo: ConMan.cs Projeto: jhogan/qed
 private void lstConns_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     Connection conn = (Connection)this.lstConns.SelectedItem;
     if (conn != null){
         _conn = conn;
         this.UpdateScreen();
     }
 }