Example #1
0
        //---------------------------------------------------------------------------
        private void TfrmDBStatus_FormCreate(object sender, EventArgs e)
        {
            TGnuGettextInstance.TranslateComponent(this);
            string sql = "select alb.cnt as alb, hib.cnt as hib, mid.cnt as mid, arte.cnt as arte, alle.cnt as alle";

            sql = sql + " from (select count(*) as cnt from items where realm = 1) as alb,";
            sql = sql + " (select count(*) as cnt from items where realm = 2) as hib,";
            sql = sql + " (select count(*) as cnt from items where realm = 4) as mid,";
            sql = sql + " (select count(*) as cnt from items where maxlevel > 0) as arte,";
            sql = sql + " (select count(*) as cnt from items) as alle";
            ZQuery.CommandText = sql;
            ZQuery.Open();
            lbAlbion.Text    = ZQuery.FieldByName("alb").AsString;
            lbHibernia.Text  = ZQuery.FieldByName("hib").AsString;
            lbMidgard.Text   = ZQuery.FieldByName("mid").AsString;
            lbArtifacts.Text = ZQuery.FieldByName("arte").AsString;
            lbSum.Text       = ZQuery.FieldByName("alle").AsString;
            ZQuery.Close();

            lbDBVersion.Text = SQLiteUtils.SQLiteDBVersion(ZQuery).ToString();
            lbDBVersion.SetHint(ZQuery.Connection.GetDataSource());
            int size = (int)(new FileInfo(ZQuery.Connection.GetDataSource()).Length / 1024.0);

            lbDBSize.Text  = string.Format("{0:N0} KByte", size);
            lbSysLang.Text = Unit.xml_config.sysLanguage;
        }
Example #2
0
        //---------------------------------------------------------------------------
        private void FillOnlineDB()
        {
            string sql = "select provider from items group by provider";

            ZQuery.CommandText = sql;
            ZQuery.Open();
            cbOnlineDB.Items.Clear();
            cbOnlineDB.Items.Add(_("<Alle>"));
            string provider = "";

            while (!ZQuery.GetEof())
            {
                provider = ZQuery.FieldByName("provider").AsString;
                cbOnlineDB.Items.Add(provider);
                ZQuery.Next();
            }
            ZQuery.Close();
            cbOnlineDB.SelectedIndex = 0;
        }