private void Form1_Load(object sender, EventArgs e) { try { this._consultasFBNegocio = new ConsultasFBNegocio(); this._consultasMySQLNegocio = new ConsultasMySQLNegocio(); this.gcPreciosArt.DataSource = new List <Modelos.Articulos>(); this.gcArticActualizar.DataSource = new List <Modelos.Articulos>(); // Create the ToolTip and associate with the Form container. ToolTip toolTip1 = new ToolTip(); // Set up the delays for the ToolTip. toolTip1.AutoPopDelay = 5000; toolTip1.InitialDelay = 1000; toolTip1.ReshowDelay = 500; // Force the ToolTip text to be displayed whether or not the form is active. toolTip1.ShowAlways = true; // Set up the ToolTip text for the Button and Checkbox. toolTip1.SetToolTip(this.btnCargaArti, "Carga los Artículos con sus precios desde Microsip"); toolTip1.SetToolTip(this.btnAgregarArt, "Agregar los seleccionados a la lista de Artículos a Actualizar"); toolTip1.SetToolTip(this.btnQuitarArt, "Quitar los seleccionados de la lista de Artículos a Actualizar"); toolTip1.SetToolTip(this.btnQuitarTodos, "Limpiar la lista de Artículos a Actualizar"); toolTip1.SetToolTip(this.btnGuarda, "Guarda todos los cambios realizados a los Artículos"); } catch (Exception Ex) { MessageBox.Show(Ex.Message, "Actualizar Precios Carnicerías", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public frmAtlaUsuario() { InitializeComponent(); this.ActiveControl = this.tbNombre; this._consultasMySQLNegocio = new ConsultasMySQLNegocio(); this._consultasFBNegocio = new ConsultasFBNegocio(); }
public frmCambiarClave(string usuario, int idUsuario) { InitializeComponent(); this._usuario = usuario; this._idUsuario = idUsuario; this._consultasMySQLNegocio = new ConsultasMySQLNegocio(); this._consultasFBNegocio = new ConsultasFBNegocio(); }
private void btnAcceder_Click(object sender, EventArgs e) { try { this._consultasMySQLNegocio = new ConsultasMySQLNegocio(); this._consultasFBNegocio = new ConsultasFBNegocio(); // validaciones if (string.IsNullOrEmpty(this.tbUsuario.Text)) { throw new Exception("Llene el campo Usuario"); } if (string.IsNullOrEmpty(this.tbPass.Text)) { throw new Exception("Llene el campo Clave"); } Modelos.Response resp = this._consultasMySQLNegocio.validaAcceso(this.tbUsuario.Text, this.tbPass.Text); if (resp.status == Modelos.Estatus.OK) { // almacenar credeniales Modelos.Login.idUsuario = resp.usuario.idUsuario; Modelos.Login.nombre = resp.usuario.nombreCompleto; Modelos.Login.usuario = resp.usuario.usuario; string fecha = getFechaFireBird(); // bitacora this._consultasMySQLNegocio.generaBitacora( "Nuevo Acceso a usuario '" + Modelos.Login.nombre + "'", fecha); this.Hide(); new FormPrincipal().ShowDialog(); this.Close(); } else { throw new Exception(resp.error); } } catch (Exception Ex) { MessageBox.Show(Ex.Message, "Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void FormPrincipal_Load(object sender, EventArgs e) { try { this._sucursal = " " + Modelos.Login.sucursal; this.lbLeyenda.Text += this._sucursal; this._consultasFBNegocio = new ConsultasFBNegocio(); this._consultasMySQLNegocio = new ConsultasMySQLNegocio(); this.verificarInformacionPendiente(); } catch (Exception Ex) { MessageBox.Show(Ex.Message, "Actualizar Precios Carnicerías", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void btnProbarConMysql_Click(object sender, EventArgs e) { try { // validaciones foreach (Control x in this.groupBox2.Controls) { if (x is TextBox) { if (string.IsNullOrEmpty(((TextBox)x).Text)) { throw new Exception("Campos incompletos, Por favor verifique"); } } } Modelos.ConectionString.connMySQL = string.Format( "Data Source={0};database={1};User Id={2};password={3};", this.tbServidorMs.Text, this.tbBaseDeDatosMs.Text, this.tbUsuarioMs.Text, this.tbContraseniaMs.Text); this._consultasMySQLNegocio = new ConsultasMySQLNegocio(); bool pruebaConn = this._consultasMySQLNegocio.pruebaConn(); if (pruebaConn) { MessageBox.Show("Conexión Exitosa!!!", "Configuración", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { throw new Exception("Falló la conexión a la base de datos"); } } catch (Exception Ex) { MessageBox.Show(Ex.Message, "Configuración", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public frmDescargaInfo() { InitializeComponent(); this._consultasMySQLNegocio = new ConsultasMySQLNegocio(); this._consultasFBNegocio = new ConsultasFBNegocio(); }