Example #1
0
        private void tabControl1_Selected(object sender, TabControlEventArgs e)
        {
            if (e.TabPage == tabPageAttributes)
            {
                FormWaiting frmWatting = new FormWaiting();
                frmWatting.Show();

                try
                {
                    QueryResult qResult = DataAccess.Excute("exec SP_GetTableAttributes {0}", TableName);
                    ShowTableAttributes(qResult.DataSet.Tables[0]);
                    frmWatting.Close();
                }
                catch (Exception e1)
                {
                    MessageBox.Show(e1.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    frmWatting.Close();

                    this.Close();
                }
            }
        }
Example #2
0
        private void FormRebuildTable_Load(object sender, EventArgs e)
        {
            FormWaiting frmWatting = new FormWaiting();

            frmWatting.Show();

            try
            {
                QueryResult result = DataAccess.Excute("exec SP_GetTableAttributes {0}", TableName);

                foreach (Hubble.Framework.Data.DataRow row in result.DataSet.Tables[0].Rows)
                {
                    if (row["Attribute"].ToString() == "IndexOnly")
                    {
                        _IndexOnly          = bool.Parse(row["Value"].ToString());
                        labelIndexOnly.Text = _IndexOnly.ToString();
                    }
                    else if (row["Attribute"].ToString() == "DBTableName")
                    {
                        _DBTableName = row["Value"].ToString();
                    }
                    else if (row["Attribute"].ToString() == "DBAdapter")
                    {
                        _DBAdapterName          = row["Value"].ToString();
                        labelDbAdapterName.Text = _DBAdapterName;
                    }
                    else if (row["Attribute"].ToString() == "LastDocId")
                    {
                        numericUpDownDocIdFrom.Minimum = long.Parse(row["Value"].ToString());
                        numericUpDownDocIdFrom.Value   = numericUpDownDocIdFrom.Minimum;
                        _LastDocId = (long)numericUpDownDocIdFrom.Value;
                    }
                    else if (row["Attribute"].ToString() == "DocId")
                    {
                        if (row["Value"] != DBNull.Value)
                        {
                            _DocIdReplaceField = row["Value"].ToString();
                        }
                    }
                    else if (row["Attribute"].ToString() == "TableSynchronization")
                    {
                        _TableSynchronization = bool.Parse(row["Value"].ToString());
                    }
                }

                if (InitError)
                {
                    checkBoxRebuildWholeTable.Checked = true;
                    checkBoxRebuildWholeTable.Enabled = false;
                }

                labelOptimizeProgress.Visible = false;
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }
            finally
            {
                frmWatting.Close();
            }
        }