public override void SetData(object i_Data) { //base.SetData (i_Data); DBSourceConfig config = i_Data as DBSourceConfig; this._ConnType = config.DBConnType; this._WebbDBType = config.WebbDBType; //Scott@2007-11-30 12:48 modified some of the following code. //this.C_SelectedFile.Clear(); if (this._ConnType == Webb.Data.DBConnTypes.OleDB) { this.WizardTitle = "Step 2: Select an Access file."; this.C_AccessGroup.Text = "Select Access data source file"; this.C_TitleMsg.Text = "Please select a Database to open."; this.C_OpenFileDialog.DefaultExt = "mdb"; this.C_OpenFileDialog.DereferenceLinks = false; this.C_OpenFileDialog.FileName = ".mdb"; this.C_OpenFileDialog.Filter = "Access database file(*.mdb)|*.mdb"; this.C_OpenFileDialog.RestoreDirectory = true; this.C_OpenFileDialog.Title = "Choose Database file to open"; } else if (this._ConnType == Webb.Data.DBConnTypes.XMLFile) { this.WizardTitle = "Step 2: Select an XML file."; this.C_AccessGroup.Text = "Select Xml data source file"; this.C_TitleMsg.Text = "Please select a XML file to open."; this.C_OpenFileDialog.DefaultExt = "xml"; this.C_OpenFileDialog.DereferenceLinks = false; this.C_OpenFileDialog.FileName = ".xml"; this.C_OpenFileDialog.Filter = "XML file(*.xml)|*.xml"; this.C_OpenFileDialog.RestoreDirectory = true; this.C_OpenFileDialog.Title = "Choose Xml file to open"; } else /*never*/ } {
public override void SetData(object i_Data) { //base.SetData (i_Data); DBSourceConfig m_config = i_Data as DBSourceConfig; //set members this._ConnType = m_config.DBConnType; this._WebbDBType = m_config.WebbDBType; //set data base type this.C_SQLType.Checked = this._ConnType == DBConnTypes.SQLDB; this.C_TypeOLE.Checked = this._ConnType == DBConnTypes.OleDB; this.C_XMLType.Checked = this._ConnType == DBConnTypes.XMLFile; this.C_FileType.Checked = this._ConnType == DBConnTypes.File; //set data source type this.C_WebbFootball.Checked = this._WebbDBType == WebbDBTypes.WebbAdvantageFootball; this.C_WebbVictory.Checked = (int)this._WebbDBType >= 100 && (int)this._WebbDBType <= 105; //football, basketball, volleyball, hockey if (this.C_WebbVictory.Checked) { this.C_CBVictoryType.Enabled = true; this.C_CBVictoryType.SelectedIndex = (int)this._WebbDBType - 100; } this.C_WebbCoachCRM.Checked = this._WebbDBType == WebbDBTypes.CoachCRM; this.C_WebbPlayBook.Checked = this._WebbDBType == WebbDBTypes.WebbPlaybook; this.C_CommonDataSource.Checked = this._WebbDBType == WebbDBTypes.Others; }
public static IDbDataParameter NewParam(string i_paraName, object i_value, DBConnTypes i_type) { switch (i_type) { default: case DBConnTypes.OleDB: return(new OleDbParameter(i_paraName, i_value) as IDbDataParameter); case DBConnTypes.SQLDB: return(new SqlParameter(i_paraName, i_value) as IDbDataParameter); } }
public static IDBManager NewDBManager(DBConnTypes i_type, string i_ConnString) { if (i_type == DBConnTypes.OleDB) { return(new OleDBManager(i_ConnString)); } else if (i_type == DBConnTypes.SQLDB) { return(new SQLDBManager(i_ConnString)); } else { return(null); } }
private void C_ConfigDBTypeCheckedChanged(object sender, System.EventArgs e) { if (this.C_SQLType.Checked) { this._ConnType = DBConnTypes.SQLDB; } else if (this.C_TypeOLE.Checked) { this._ConnType = DBConnTypes.OleDB; } else if (this.C_XMLType.Checked) { this._ConnType = DBConnTypes.XMLFile; } else if (this.C_FileType.Checked) { this._ConnType = DBConnTypes.File; } }