public frmWizEntity_1(CnnString cnn) { this.Cnn = cnn; InitializeComponent(); this.wizDBSelect1.LoadCnn(cnn); }
/// <summary> /// Carga las bses de datos del server /// </summary> /// <param name="pCnnString"></param> void FillDatabaseCombo(CnnString pCnnString) { if (onInitServerCollection) { return; } SqlConnection sqlConnection = new SqlConnection(pCnnString.ToString()); ServerConnection serverConnection = new ServerConnection(sqlConnection); try { _Server = new Server(serverConnection); cmbDataBases.Items.Clear(); foreach (Database db in _Server.Databases) { cmbDataBases.Items.Add(db.Name); } cmbDataBases.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show(HelperFunctions.GetAllMessageException(ex)); } }
/// <summary> /// Metodo que permite cargar las tablas en el arbol. /// </summary> public void Populate(CnnString pCnn) { if (_Tables == null) LoadTables(pCnn); if (_Tables == null) { this.tvwChilds.Nodes.Clear(); return; } if (_Tables.Count == 0) { this.tvwChilds.Nodes.Clear(); return; } TreeViewHelper.LoadTreeView(this.tvwChilds, _Tables); _SelectedTable = _Tables[0]; lblTreeViewSelected.Text = String.Empty; }
/// <summary> /// Metodo que permite cargar las tablas en el arbol. /// </summary> public void Populate(CnnString pCnn) { if (_Tables == null) { LoadTables(pCnn); } if (_Tables == null) { this.tvwChilds.Nodes.Clear(); return; } if (_Tables.Count == 0) { this.tvwChilds.Nodes.Clear(); return; } TreeViewHelper.LoadTreeView(this.tvwChilds, _Tables); _SelectedTable = _Tables[0]; lblTreeViewSelected.Text = String.Empty; }
/// <summary> /// Constructor /// </summary> /// <param name="pCnnString"></param> public UserDefinedTypesBack(CnnString pCnnString) { _CnnString = pCnnString; _GetUserDefinedTypesQuery = GetQuery(); _UserDefinedTypes = LoadUserDefinedTypes(); }
private void btnNext_Click(object sender, EventArgs e) { _cnn = GetAuxiliarCnnString(); UserDefinedTypesBack wUserDefinedTypesBack = new UserDefinedTypesBack(_cnn); FwkGeneratorHelper.UserDefinedTypes = wUserDefinedTypesBack.UserDefinedTypes; base.DoEvent(null, WizardButton.Next); }
private void btnAceptar_Click(object sender, EventArgs e) { UserDefinedTypesBack wUserDefinedTypesBack = new UserDefinedTypesBack(_cnn); FwkGeneratorHelper.UserDefinedTypes = wUserDefinedTypesBack.UserDefinedTypes; _cnn = GetAuxiliarCnnString(); base.DoEvent(_cnn, WizardButton.Ok); }
/// <summary> /// Serializa en binario el diccionario /// </summary> /// <param name="fs"></param> /// <param name="dict"></param> private static void SerializeDictionary(FileStream fs, CnnString dict) { // Create a BinaryFormatter object to perform the serialization BinaryFormatter bf = new BinaryFormatter(); // Use the BinaryFormatter object to serialize the data to the file bf.Serialize(fs, dict); // Close the file fs.Close(); }
private void cmbDataBases_Click(object sender, EventArgs e) { if (_cnn == null) { _cnn = GetAuxiliarCnnString(); } if (!_cnn.DataSource.Equals(cmbServer.Text.Trim()) || cmbDataBases.Items.Count == 0) { _cnn.DataSource = cmbServer.Text.Trim(); FillDatabaseCombo(_cnn); } }
private void btnTestConnection_Click(object sender, EventArgs e) { _cnn = GetAuxiliarCnnString(); if (string.IsNullOrEmpty(_cnn.DataSource)) { MessageBox.Show("Ingrese servidor de SQL.-", "Fwk wizard"); cmbServer.Focus(); return; } if (string.IsNullOrEmpty(_cnn.InitialCatalog)) { MessageBox.Show("Seleccione o ingrese una base de datos.-", "Fwk wizard"); cmbDataBases.Focus(); return; } if (!_cnn.WindowsAutentification) { if (string.IsNullOrEmpty(_cnn.User)) { MessageBox.Show("Ingrese usuario.-", "Fwk wizard"); txtUserName.Focus(); return; } } SqlConnection sqlConnection = new SqlConnection(_cnn.ToString()); Microsoft.SqlServer.Management.Common.ServerConnection serverConnection = new Microsoft.SqlServer.Management.Common.ServerConnection(sqlConnection); try { _Server = new Server(serverConnection); ////iterate over all Databases foreach (Database db in _Server.Databases) { MessageBox.Show("Coneccion exitosa.-", "Fwk wizard"); return; } } catch (Exception ex) { MessageBox.Show(HelperFunctions.GetAllMessageException(ex), "Fwk wizard"); } }
/// <summary> /// Obtiene un diccionario ConfigManager con la deserializacion en binario del IsolatedStorageFile /// Este diccionario contiene el par [NombreArchivo,Ruta] /// </summary> void Load() { IsolatedStorageFile userStore = IsolatedStorageFile.GetUserStoreForAssembly(); //If No data saved for this user if (userStore.GetFileNames(EnvDTESetting).Length == 0) { _CnnString = new CnnString(); return; } IsolatedStorageFileStream userStream = new IsolatedStorageFileStream(EnvDTESetting, FileMode.Open, userStore); _CnnString = DeSerializeDictionary(userStream); }
private void LoadTables(CnnString cnn) { SqlConnection sqlConnection = new SqlConnection(cnn.ToString()); ServerConnection serverConnection = new ServerConnection(sqlConnection); try { Server wServer = new Server(serverConnection); Database db = new Database(wServer, cnn.InitialCatalog); db.Tables.Refresh(); _Tables = db.Tables; } catch (Exception ex) { MessageBox.Show(HelperFunctions.GetAllMessageException(ex)); } }
/// <summary> /// Deserializa en binario el diccionario /// </summary> /// <param name="fs"></param> /// <param name="dict"></param> private static CnnString DeSerializeDictionary(FileStream fs) { CnnString dict; // Create a BinaryFormatter object to perform the serialization BinaryFormatter bf = new BinaryFormatter(); try { // Use the BinaryFormatter object to serialize the data to the file dict = (CnnString)bf.Deserialize(fs); } catch (System.Runtime.Serialization.SerializationException) { dict = new CnnString(); } finally { // Close the file fs.Close(); } return(dict); }
private CnnString GetAuxiliarCnnString() { CnnString wCnnString = new CnnString(); wCnnString.InitialCatalog = cmbDataBases.Text.Trim(); wCnnString.DataSource = cmbServer.Text.Trim(); if (WindowsAutentificaction.Checked) { wCnnString.User = String.Empty; wCnnString.Password = String.Empty; } else { wCnnString.User = txtUserName.Text.Trim(); wCnnString.Password = txtPassword.Text.Trim(); } wCnnString.WindowsAutentification = WindowsAutentificaction.Checked; return(wCnnString); }
/// <summary> /// Carga las bses de datos del server /// </summary> /// <param name="pCnnString"></param> void FillDatabaseCombo(CnnString pCnnString) { if (onInitServerCollection) return; SqlConnection sqlConnection = new SqlConnection(pCnnString.ToString()); ServerConnection serverConnection = new ServerConnection(sqlConnection); try { _Server = new Server(serverConnection); cmbDataBases.Items.Clear(); foreach (Database db in _Server.Databases) { cmbDataBases.Items.Add(db.Name); } cmbDataBases.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show(HelperFunctions.GetAllMessageException(ex)); } }
private CnnString GetAuxiliarCnnString() { CnnString wCnnString = new CnnString(); wCnnString.InitialCatalog = cmbDataBases.Text.Trim(); wCnnString.DataSource = cmbServer.Text.Trim(); if (WindowsAutentificaction.Checked) { wCnnString.User = String.Empty; wCnnString.Password = String.Empty; } else { wCnnString.User = txtUserName.Text.Trim(); wCnnString.Password = txtPassword.Text.Trim(); } wCnnString.WindowsAutentification = WindowsAutentificaction.Checked; return wCnnString; }
public void Populate(CnnString pCnn) { this.ctrlTreeViewTables1.Populate(pCnn); }
public frmWizDAC_2(CnnString Cnn) { InitializeComponent(); wizTablesTreeSelector1.Populate(Cnn); wizTablesTreeSelector1.CheckBoxes = false; }
internal void LoadCnn(CnnString cnn) { cmbDataBases.Text = cnn.InitialCatalog; cmbServer.Text = cnn.DataSource; WindowsAutentificaction.Checked = cnn.WindowsAutentification; }
public Storage() { _CnnString = new CnnString(); }
/// <summary> /// Deserializa en binario el diccionario /// </summary> /// <param name="fs"></param> /// <param name="dict"></param> private static CnnString DeSerializeDictionary(FileStream fs) { CnnString dict; // Create a BinaryFormatter object to perform the serialization BinaryFormatter bf = new BinaryFormatter(); try { // Use the BinaryFormatter object to serialize the data to the file dict = (CnnString) bf.Deserialize(fs); } catch(System.Runtime.Serialization.SerializationException) { dict = new CnnString(); } finally { // Close the file fs.Close(); } return dict; }
private void btnTestConnection_Click(object sender, EventArgs e) { _cnn = GetAuxiliarCnnString(); if (string.IsNullOrEmpty(_cnn.DataSource)) { MessageBox.Show("Ingrese servidor de SQL.-", "Fwk wizard"); cmbServer.Focus(); return; } if (string.IsNullOrEmpty(_cnn.InitialCatalog)) { MessageBox.Show("Seleccione o ingrese una base de datos.-","Fwk wizard"); cmbDataBases.Focus(); return; } if (!_cnn.WindowsAutentification) { if (string.IsNullOrEmpty(_cnn.User)) { MessageBox.Show("Ingrese usuario.-", "Fwk wizard"); txtUserName.Focus(); return; } } SqlConnection sqlConnection = new SqlConnection(_cnn.ToString()); Microsoft.SqlServer.Management.Common.ServerConnection serverConnection = new Microsoft.SqlServer.Management.Common.ServerConnection(sqlConnection); try { _Server = new Server(serverConnection); ////iterate over all Databases foreach (Database db in _Server.Databases) { MessageBox.Show("Coneccion exitosa.-", "Fwk wizard"); return; } } catch (Exception ex) { MessageBox.Show(HelperFunctions.GetAllMessageException(ex), "Fwk wizard"); } }
public frmWizEntity_2(CnnString Cnn) { InitializeComponent(); wizTablesTreeSelector1.Populate(Cnn); wizTablesTreeSelector1.AfterCheckEvent += new AfterCheckHandler(wizTablesTreeSelector1_AfterCheckEvent); }
internal void LoadCnn(CnnString cnn) { cmbDataBases.Text = cnn.InitialCatalog; cmbServer.Text = cnn.DataSource ; WindowsAutentificaction.Checked = cnn.WindowsAutentification; }
private void cmbDataBases_Click(object sender, EventArgs e) { if (_cnn == null) _cnn = GetAuxiliarCnnString(); if (!_cnn.DataSource.Equals(cmbServer.Text.Trim()) || cmbDataBases.Items.Count == 0) { _cnn.DataSource = cmbServer.Text.Trim(); FillDatabaseCombo(_cnn); } }