public ServerNode(DbServerModel server) { this.server = server; this.Text = server.Name; this.Name = server.Name; this.ImageIndex = 0; this.SelectedImageIndex = 0; InitDatabases(); }
public void Refresh() { //using (var serverManager = new DbServerManager(ConnectionString)) //{ // this.Nodes.Clear(); // server = serverManager.Connect(); // InitDatabases(); //} this.Nodes.Clear(); server = DbServerManagerSingleton.GetInstance().Connect(); InitDatabases(); }
public ActionResult AddServer(DbServerModel model) { //DbServerModel if (!ModelState.IsValid) { return(View()); } T_Database dbServer = new T_Database(); dbServer.Server = model.Server; dbServer.Admin = model.Admin; dbServer.Password = model.Password; dbServer.DbType = (int)model.DbType; dataLogic.AddDbServer(dbServer); return(RedirectToAction("AddServer")); }
public void AddNewServer(DbServerModel server) { var serverNode = new ServerNode(server); Form.TreeView.Nodes.Add(serverNode); }