private void btnBuscar_Click(object sender, EventArgs e) { try { BuscarPendienteEntregaVentas buscar = new BuscarPendienteEntregaVentas(); if (buscar.ShowDialog() == DialogResult.OK) { ID = buscar.ID; Mov = buscar.Mov; MovID = buscar.MovID; txtMovimiento.Text = Mov + " " + MovID; DataTable dt = InvConsultas.PendienteDeEntrega_InfoCliente(ID); txtClienteNombre.Text = dt.Rows[0]["Nombre"].ToString(); txtNoCliente.Text = dt.Rows[0]["Cliente"].ToString(); txtCorreo.Text = dt.Rows[0]["Correo"].ToString(); txtTelefono.Text = dt.Rows[0]["Telefonos"].ToString(); cfgArticulos.DataSource = InvConsultas.PendienteDeEntrega_Detalle(ID); Formato(); btnGuardar.Enabled = true; } } catch (Exception ex) { MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Pendiente de Entrega", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnGuardar_Click(object sender, EventArgs e) { try { if (txtContacto.Text == "") { MessageBox.Show("El campo de contacto debe de llevar informacion", "Pendiente de Entrega", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (txtConTel.Text == "") { MessageBox.Show("El campo de contacto tel debe de llevar informacion", "Pendiente de Entrega", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DataTable dt = (DataTable)cfgArticulos.DataSource; PendienteID = InvConsultas.PendienteDeEntrega_Guardar(Mov, MovID, UsuarioIniciado.Almacen, txtObservaciones.Text, UsuarioIniciado.Usuario, dt, txtContacto.Text, txtConTel.Text); MessageBox.Show("El pendiente se ha guardado con Exito", "Pendiente de Entrega", MessageBoxButtons.OK, MessageBoxIcon.Information); btnGuardar.Enabled = false; pnlPrincipal.Enabled = false; btnImprimir.Enabled = true; } catch (Exception ex) { MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Pendiente de Entrega", MessageBoxButtons.OK, MessageBoxIcon.Error); } }