コード例 #1
0
        //Submit-Button-Click Handler
        private void Submit_btn_Click(object sender, RoutedEventArgs e)
        {
            switch (Functionalitie)
            {
            case CRUDFunctionalitie.Add:
                DatabaseInfo = new DatabaseInfo(0, DataSource_txt.Text, Username_txt.Text, Password_txt.Text, DatabasName_txt.Text);
                GetDbInfo.AddNewDatabase(DatabaseInfo);
                this.Close();
                break;

            case CRUDFunctionalitie.Update:
                if (DatabaseInfo != null)
                {
                    DatabaseInfo = new DatabaseInfo(0, DataSource_txt.Text, Username_txt.Text, Password_txt.Text, DatabasName_txt.Text);
                    GetDbInfo.UpdateDatabase(DatabaseInfo);
                    this.Close();
                }
                break;

            case CRUDFunctionalitie.Delete:
                if (DatabaseInfo != null)
                {
                    GetDbInfo.DeleteDatabase(DatabaseInfo.ID);
                    this.Close();
                }
                break;
            }
        }
コード例 #2
0
ファイル: SetUI.cs プロジェクト: Jeremie-de-Vos/CodeSnippet
        //Set Databases to CMB
        public void DatabasesToCombobox(ComboBox comboBox)
        {
            //Clear cmb
            comboBox.Items.Clear();
            List <string> temp = GetDbInfo.GetAllDatabases();


            if (temp.Count > 0)
            {
                temp.Insert(0, "All Databases");
            }
            else
            {
                temp.Add("No Db Found");
            }

            //Add all items
            foreach (string i in temp)
            {
                comboBox.Items.Add(i);
            }

            //Set selected item
            comboBox.SelectedIndex = 0;
        }
コード例 #3
0
ファイル: SetUI.cs プロジェクト: Jeremie-de-Vos/CodeSnippet
        //-------------------------Database------------------------------
        //Set Database Tables to CMB
        public void TablesToCombobox(ComboBox comboBox, string DbName)
        {
            comboBox.Items.Clear();
            comboBox.Items.Add("All Tables");

            foreach (string i in GetDbInfo.GetTableNames(DbName))
            {
                comboBox.Items.Add(i);
            }
            comboBox.SelectedIndex = 0;
        }
コード例 #4
0
ファイル: BuildUI.cs プロジェクト: Jeremie-de-Vos/CodeSnippet
 //Get database Status
 public static void Status(StackPanel container)
 {
     container.Children.Clear();
     foreach (string i in GetDbInfo.GetAllDatabases())
     {
         if (GetDbInfo.CreateDBConnection(i) == null)
         {
             StatusItem(i, DBStatus.Error, container);
         }
         else
         {
             StatusItem(i, DBStatus.Oke, container);
         }
     }
 }
コード例 #5
0
        public AppInfo GetApplicationInfo()
        {
            var getDbInfo = new GetDbInfo(Client.Ticket, Token, Client.AccountDomain, ApplicationId);
            var xml       = getDbInfo.Post().CreateNavigator();

            var dbName           = xml.SelectSingleNode("/qdbapi/dbname").Value;
            var lastRecModTime   = long.Parse(xml.SelectSingleNode("/qdbapi/lastRecModTime").Value);
            var lastModifiedTime = long.Parse(xml.SelectSingleNode("/qdbapi/lastModifiedTime").Value);
            var createTime       = long.Parse(xml.SelectSingleNode("/qdbapi/createdTime").Value);
            var numRecords       = int.Parse(xml.SelectSingleNode("/qdbapi/numRecords").Value);
            var mgrId            = xml.SelectSingleNode("/qdbapi/mgrID").Value;
            var mgrName          = xml.SelectSingleNode("/qdbapi/mgrName").Value;
            var version          = xml.SelectSingleNode("/qdbapi/version").Value;

            return(new AppInfo(dbName, lastRecModTime, lastModifiedTime, createTime, numRecords, mgrId, mgrName,
                               version));
        }
コード例 #6
0
        public AppInfo GetApplicationInfo()
        {
            var getDbInfo = new GetDbInfo(Client.Ticket, Token, Client.AccountDomain, ApplicationId);
            var xml       = getDbInfo.Post();

            var dbName           = xml.Element("dbname").Value;
            var lastRecModTime   = long.Parse(xml.Element("lastRecModTime").Value);
            var lastModifiedTime = long.Parse(xml.Element("lastModifiedTime").Value);
            var createTime       = long.Parse(xml.Element("createdTime").Value);
            var numRecords       = int.Parse(xml.Element("numRecords").Value);
            var mgrId            = xml.Element("mgrID").Value;
            var mgrName          = xml.Element("mgrName").Value;
            var version          = xml.Element("version").Value;

            return(new AppInfo(dbName, lastRecModTime, lastModifiedTime, createTime, numRecords, mgrId, mgrName,
                               version));
        }