예제 #1
0
 public ServerNode(DbServerModel server)
 {
     this.server             = server;
     this.Text               = server.Name;
     this.Name               = server.Name;
     this.ImageIndex         = 0;
     this.SelectedImageIndex = 0;
     InitDatabases();
 }
예제 #2
0
        public void Refresh()
        {
            //using (var serverManager = new DbServerManager(ConnectionString))
            //{
            //    this.Nodes.Clear();
            //    server = serverManager.Connect();
            //    InitDatabases();
            //}

            this.Nodes.Clear();
            server = DbServerManagerSingleton.GetInstance().Connect();
            InitDatabases();
        }
예제 #3
0
        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"));
        }
예제 #4
0
        public void AddNewServer(DbServerModel server)
        {
            var serverNode = new ServerNode(server);

            Form.TreeView.Nodes.Add(serverNode);
        }