Ejemplo n.º 1
0
 private void 备份数据库toolStripMenuItem3_Click(object sender, EventArgs e)
 {
     if (isGlobeContainsDataSource() == false)
     {
         FrmMessageBox frmMessage = new FrmMessageBox();
         DialogResult result = frmMessage.ShowDialog();
         if (result == DialogResult.OK)
         {
             连接数据库ToolStripMenuItem_Click(sender, e);
         }
         else if (result == DialogResult.No)
         {
             连接Oracle数据库toolStripMenuItem6_Click(sender, e);
         }
         else
         {
             return;
         }
     }
     if (isGlobeContainsDataSource() == false)
     {
         return;
     }
     FrmBackupDatabase frm = new FrmBackupDatabase(globeControl1);
     frm.Show(this);
 }
Ejemplo n.º 2
0
 //判断球中是否已经添加过数据源
 private bool isGlobeContainsDataSource()
 {
     bool isGlobeContainsDataSource = false;
     for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++)
     {
         if (globeControl1.Globe.DataManager.GetDataSourceAt(i).Type == EnumDataSourceType.SqlServer
             || globeControl1.Globe.DataManager.GetDataSourceAt(i).Type == EnumDataSourceType.Oracle)
         {
             isGlobeContainsDataSource = true;
             break;
         }
     }
     if (isGlobeContainsDataSource == false)
     {
         FrmMessageBox frmMessage = new FrmMessageBox();
         DialogResult result = frmMessage.ShowDialog();
         if (result == DialogResult.OK)
         {
             连接数据库ToolStripMenuItem_Click("", null);
         }
         else if (result == DialogResult.No)
         {
             连接Oracle数据库toolStripMenuItem6_Click("", null);
         }
         else
         {
             return isGlobeContainsDataSource;
         }
     }
     for (int i = 0; i < globeControl1.Globe.DataManager.DataSourceCount; i++)
     {
         if (globeControl1.Globe.DataManager.GetDataSourceAt(i).Type == EnumDataSourceType.SqlServer
             || globeControl1.Globe.DataManager.GetDataSourceAt(i).Type == EnumDataSourceType.Oracle)
         {
             isGlobeContainsDataSource = true;
             break;
         }
     }
     return isGlobeContainsDataSource;
 }