Ejemplo n.º 1
0
        private void btnGuardarCliente_Click(object sender, EventArgs e)
        {
            string validacionResultado = validarCampos();

            if (validacionResultado != "")
            {
                MessageBox.Show(validacionResultado, "Campos Incompletos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            Cliente c         = ObtenerDatosCliente();
            bool    resultado = AD_VariosXFede.AgregaClienteABD(c);

            if (resultado)
            {
                MessageBox.Show("Cliente agregado correctamente");
                LimpiarCampos();
                CargarComboBarrios();
                CargarComboTiposDocumentos();
                CargarGrilla();
            }
            else
            {
                MessageBox.Show("No se pudo cargar el cliente");
            }
        }
Ejemplo n.º 2
0
        private void reportViewer9_Load(object sender, EventArgs e)
        {
            DataTable tabla = new DataTable();

            tabla = AD_VariosXFede.ObtenerRegistroEstadias();
            ReportDataSource ds = new ReportDataSource("RegistrosEstadias", tabla);

            reportViewer9.LocalReport.DataSources.Clear();
            reportViewer9.LocalReport.DataSources.Add(ds);
            reportViewer9.LocalReport.Refresh();
        }
Ejemplo n.º 3
0
        private void btnBuscarCliente_Click(object sender, EventArgs e)
        {
            string numero  = txtNroDoc.Text;
            int    tipoDoc = (int)(cmbTipoDoc.SelectedValue);

            Cliente cli = new Cliente();

            cli = AD_VariosXFede.ObtenerIdClienteXDocumento(numero, tipoDoc);

            txtNombre.Text   = cli.NombreCliente;
            txtApellido.Text = cli.ApellidoCliente;
        }
Ejemplo n.º 4
0
        private void grdClientes_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int indice = e.RowIndex;

            if (indice >= 0)
            {
                btnActualizar.Enabled     = true;
                btnEliminar.Enabled       = true;
                btnAgregarCliente.Enabled = false;
                cmbTipoDoc.Enabled        = false;
                txtNroDoc.Enabled         = false;


                DataGridViewRow filaSeleccionada = grdClientes.Rows[indice];
                string          nroDoc           = filaSeleccionada.Cells["nroDoc"].Value.ToString();
                int             tipoDoc          = int.Parse(filaSeleccionada.Cells["tipoDoc"].Value.ToString());

                Cliente c = AD_VariosXFede.ObtenerIdClienteXDocumento(nroDoc, tipoDoc);

                LimpiarCampos();
                CargarCampos(c);
            }
        }