public void InitControl() { if (this._DBSourceConfig == null) { _DBSourceConfig = new DBSourceConfig(); } this._DBSourceConfig.ConnString = string.Empty; _DBSourceConfig.WebbDBType = WebbDBTypes.WebbAdvantageFootball; _DBSourceConfig.DBConnType = DBConnTypes.File; if (this.Step_ConfigAdvFile == null) { this.Step_ConfigAdvFile = new ConfigAdvFile(); } this.Step_ConfigAdvFile.SetData(this._DBSourceConfig); this.LoadControl(this.Step_ConfigAdvFile); this.HideNextAndBack(); }
// public override void OnCancel() // { // //base.OnCancel (); // return DialogResult.Cancel; // } #region load controls private void LoadNextControl() { Webb.Utilities.WaitingForm.ShowWaitingForm(); WinzardControlBase m_TempControl = this._CurrentControl; #region go to Step 2 //Step 1, to load step 2 config Access or config SQL DB catalog. if (this._CurrentControl is ConfigDBTypes) { //All if (this._DBSourceConfig.DBConnType == DBConnTypes.OleDB || this._DBSourceConfig.DBConnType == DBConnTypes.XMLFile) { //DBFile if (this._DBSourceConfig.WebbDBType == WebbDBTypes.CoachCRM) { ConfigStepCCRMData Step_ConfigCCRM = new ConfigStepCCRMData(); this.C_SelectAll.Enabled = false; this.LoadControl(Step_ConfigCCRM); Step_ConfigCCRM.SetData(this._DBSourceConfig); } else { if (this.Step_ConfigDBFile == null) { this.Step_ConfigDBFile = new ConfigDBFile(); } this.Step_ConfigDBFile.SetData(this.DBSourceConfig); this.LoadControl(this.Step_ConfigDBFile); } } else if (this._DBSourceConfig.DBConnType == DBConnTypes.File) { //File this._DBSourceConfig.ConnString = string.Empty; if (this._DBSourceConfig.WebbDBType == WebbDBTypes.WebbAdvantageFootball) { if (this.Step_ConfigAdvFile == null) { this.Step_ConfigAdvFile = new ConfigAdvFile(); } this.Step_ConfigAdvFile.SetData(this._DBSourceConfig); this.LoadControl(this.Step_ConfigAdvFile); } else if (this._DBSourceConfig.WebbDBType == WebbDBTypes.WebbPlaybook) { ConfigPlayBookData Step_ConfigPlayBook = new ConfigPlayBookData(); Step_ConfigPlayBook.SetData(this._DBSourceConfig); this.LoadControl(Step_ConfigPlayBook); } else { MessageBox.Show("The product didn't have file version yet."); } } else { //SQL if (this._DBSourceConfig.WebbDBType == WebbDBTypes.WebbAdvantageFootball) { //choose advantage DB //Modified at 2008-10-10 10:15:39@Scott if (this.Step_ConfigAdvDB == null) { this.Step_ConfigAdvDB = new ConfigAdvDB(); } this.LoadControl(this.Step_ConfigAdvDB); } else if (this._DBSourceConfig.WebbDBType == WebbDBTypes.Others) { if (Step_ConfigCommonSQL == null) { Step_ConfigCommonSQL = new ConfigCommonSQL(); } this.C_SelectAll.Enabled = false; this.LoadControl(Step_ConfigCommonSQL); Step_ConfigCommonSQL.SetData(this._DBSourceConfig); } else if (this._DBSourceConfig.WebbDBType == WebbDBTypes.CoachCRM) { ConfigStepCCRMData Step_ConfigCCRM = new ConfigStepCCRMData(); this.C_SelectAll.Enabled = false; this.LoadControl(Step_ConfigCCRM); Step_ConfigCCRM.SetData(this._DBSourceConfig); } else { if (this.Step_ConfigDBCatalog == null) { this.Step_ConfigDBCatalog = new ConfigDBCatalog(); } this.Step_ConfigDBCatalog.SetDatabases(); this.LoadControl(this.Step_ConfigDBCatalog); } } goto EXIT; } #endregion #region go to step 3 //Step 2, to load games or to load tables. if (this._CurrentControl is ConfigDBFile) { //File this._DBSourceConfig.ConnString = string.Empty; this.DataProvider.InitializeDBManager(this._DBSourceConfig); if (this._DBSourceConfig.DBConnType == DBConnTypes.OleDB) { //Access if (this._DBSourceConfig.WebbDBType != WebbDBTypes.Others) { DataTable m_Games = this.DataProvider.LoadWebbGames(); if (this.Step_ConfigGames == null) { this.Step_ConfigGames = new ConfigGames(); } this.Step_ConfigGames.SetGames(m_Games); DataTable m_Edls = this.DataProvider.LoadWebbEdls(); this.Step_ConfigGames.SetEdls(m_Edls); this.LoadControl(this.Step_ConfigGames); this.SelectStep = true; } else { if (this.Step_ConfigCommonAccess == null) { this.Step_ConfigCommonAccess = new ConfigCommonAccess(); } if (Step_ConfigCommonAccess.SetConfig(this._DBSourceConfig)) { this.C_SelectAll.Enabled = false; this.LoadControl(Step_ConfigCommonAccess); } else { Webb.Utilities.WaitingForm.CloseWaitingForm(); return; } } } else if (this._DBSourceConfig.DBConnType == DBConnTypes.XMLFile) { //XML DataSet m_DataSet = this.DataProvider.LoadXmlDataSet(); if (this.Step_ConfigTable == null) { this.Step_ConfigTable = new ConfigTables(); } this.Step_ConfigTable.SetTables(m_DataSet); this.LoadControl(this.Step_ConfigTable); } else { //never Webb.Utilities.WaitingForm.CloseWaitingForm(); return; } goto EXIT; } if (this._CurrentControl is ConfigCommonSQL) { bool Connected = (_CurrentControl as ConfigCommonSQL).UpdateConfig(this._DBSourceConfig); if (Connected) { if (this.Step_ConfigCommontable == null) { this.Step_ConfigCommontable = new ConfigComonTable(); } if (Step_ConfigCommontable.SetConfig(this._DBSourceConfig)) { this.C_SelectAll.Enabled = false; this.LoadControl(Step_ConfigCommontable); } else { Webb.Utilities.WaitingForm.CloseWaitingForm(); return; } } goto EXIT; } if (this._CurrentControl is ConfigDBCatalog || this._CurrentControl is ConfigAdvDB) { //SQL this.DataProvider.InitializeDBManager(this._DBSourceConfig); if (this._DBSourceConfig.WebbDBType != WebbDBTypes.Others) { DataTable m_Games = this.DataProvider.LoadWebbGames(); if (this.Step_ConfigGames == null) { this.Step_ConfigGames = new ConfigGames(); } this.Step_ConfigGames.SetGames(m_Games); this.LoadControl(this.Step_ConfigGames); // if(this.Step_ConfigTable==null) this.Step_ConfigTable = new ConfigTables(); // this.Step_ConfigTable.SetTables(m_Games); // this.LoadControl(this.Step_ConfigTable); } else { //Common //DataTable m_Tables = this.DataProvider.LoadTables(); if (this.Step_ConfigTable == null) { this.Step_ConfigTable = new ConfigTables(); } //this.Step_ConfigTable.SetTables(m_Tables); this.LoadControl(this.Step_ConfigTable); } goto EXIT; } #endregion //11-12-2007@Scott #region go to setup4 if (this._CurrentControl is ConfigGames) { //Access & File if ((int)this._DBSourceConfig.WebbDBType >= 100 && (int)this._DBSourceConfig.WebbDBType <= 105) { //Victory DataTable m_Filters = this.DataProvider.LoadWebbFilters(); if (this.Step_ConfigFilters == null) { this.Step_ConfigFilters = new ConfigFilters(); } this.Step_ConfigFilters.SetFilters(m_Filters); this.LoadControl(this.Step_ConfigFilters); } else { //Advantage Webb.Utilities.WaitingForm.CloseWaitingForm(); return; } goto EXIT; } #endregion Webb.Utilities.WaitingForm.CloseWaitingForm(); return; EXIT: this._CurrentControl.PreControl = m_TempControl; UpdateWizardStatus(); Webb.Utilities.WaitingForm.CloseWaitingForm(); }