private void button1_Click(object sender, EventArgs e) { EntidadesReceptoras entidad = new EntidadesReceptoras(); String[] registro = new String[12]; //call altaRegistroAutorizacion(13090111,1,5,'Prueba 1',1,2,'Desarrollo',1,'9:00 a 1:00','2017/10/02','2017/10/02','480'); registro[0] = matricula; registro[1] = idEntidadReceptora; registro[2] = tipo; registro[3] = txtUnidadResponsable.Text; registro[4] = cmbEncargado.SelectedValue.ToString(); registro[5] = cmbPrograma.SelectedValue.ToString(); registro[6] = txtActividades.Text; registro[7] = dias; registro[8] = Convert.ToString(maskedHora1.Text) + " a " + Convert.ToString(maskedHora2.Text); registro[9] = dtimeInicio.Value.ToString("yyyy/MM/dd"); registro[10] = dtimeTermino.Value.ToString("yyyy/MM/dd"); registro[11] = totalHoras; if (entidad.AltaRegistroAutorizacion(registro)) { MessageBox.Show("Alta Exitosa"); } else { MessageBox.Show("Error"); } /*AgregarAlumnoRegistroAutorizacion agregar = new AgregarAlumnoRegistroAutorizacion(); * agregar.MdiParent = this.MdiParent; * agregar.Show();*/ }
private void cmbEntidad_SelectedIndexChanged(object sender, EventArgs e) { EntidadesReceptoras entidad = new EntidadesReceptoras(); String[] arreglo = new String[8]; arreglo = entidad.infoEntidad(cmbEntidad.SelectedValue.ToString()); txtCalle.Text = arreglo[0]; txtCalle1.Text = arreglo[1]; txtCalle2.Text = arreglo[2]; txtNoExt.Text = arreglo[3]; txtNoInt.Text = arreglo[4]; txtColonia.Text = arreglo[5]; txtReferencia.Text = arreglo[6]; txtMunicipio.Text = arreglo[7]; cargarEncargados(Convert.ToInt32(cmbEntidad.SelectedValue.ToString())); }
public void cargarEntidades() { try { MySqlDataAdapter dt = new MySqlDataAdapter(); EntidadesReceptoras entidad = new EntidadesReceptoras(); dt = entidad.ConsultarEntidades(); DataTable table = new DataTable(); dt.Fill(table); cmbEntidad.ValueMember = "id"; cmbEntidad.DisplayMember = "nom"; cmbEntidad.DataSource = table; } catch (MySqlException e) { MessageBox.Show("Error >> " + e.ToString()); } }
private void button1_Click(object sender, EventArgs e) { EntidadesReceptoras entidad = new EntidadesReceptoras(); String[] arreglo = new String[9]; arreglo[0] = txtNombre.Text; arreglo[1] = txtCalle.Text; arreglo[2] = txtCalle1.Text; arreglo[3] = txtCalle2.Text; arreglo[4] = txtNoExt.Text; arreglo[5] = txtNoInt.Text; arreglo[6] = txtColonia.Text; arreglo[7] = txtReferencia.Text; arreglo[8] = cmbMunicipio.SelectedValue.ToString(); if (entidad.AltaEntidad(arreglo)) { MessageBox.Show("Entidad guardad correctamente"); //this.Close(); } else { MessageBox.Show("Error"); } }