Example #1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (txtDni.Text == "")
            {
                MessageBox.Show("Ingrese un dni");
            }

            else

            if (txtAApyn.Text == "")
            {
                MessageBox.Show("El cliente no existe en el sistema");
            }

            else

            if (txtOperaciones.SelectedValue == "")
            {
                MessageBox.Show("Seleccione un campo en la solapa operaciones");
            }

            else

            if (cbPlazo.SelectedValue == "")
            {
                MessageBox.Show("Seleccione un campo en la solapa plazo");
            }

            else

            if (rbComercio.Checked == false && rbPrestamo.Checked == false)
            {
                MessageBox.Show("Asigne tipo de prestamo");
            }

            else

            if ((cbOrigen.SelectedValue == "") && (cbRelacOrigen.SelectedValue == ""))
            {
                MessageBox.Show("Ingrese un origen");
            }

            else

            if (txtImporte.Text == "")
            {
                MessageBox.Show("Ingrese un importe");
            }

            else

            if (txtPlazo.Text == "")
            {
                MessageBox.Show("Ingrese un plazo");
            }

            else

            if (txtAApyn.Text == "")
            {
                MessageBox.Show("El cliente no existe en la base de datos");
            }

            else

            if (cbEstado.SelectedValue == "")
            {
                MessageBox.Show("Seleccione un estado");
            }

            else
            {
                string tipoPrestamo;

                if (rbPrestamo.Checked == true)
                {
                    tipoPrestamo = "S";
                }
                else
                {
                    tipoPrestamo = "N";
                }

                Brl.guardarGestionCliente(txtDni.Text,
                                          txtAApyn.Text,
                                          txtOperaciones.Text,
                                          tipoPrestamo,
                                          cbOrigen.Text,
                                          cbRelacOrigen.Text,
                                          txtImporte.Text,
                                          txtPlazo.Text,
                                          cbPlazo.Text,
                                          cbEstado.Text,
                                          txtObservaciones.Text
                                          );



                MessageBox.Show("La gestion se guardo con exito");

                dgvGrillaHistorialCliente.DataSource = Brl.obtenerHistorialCliente(txtDni.Text);

                if (FrmPrincipal.SolicitoGestion == 1)
                {
                    Brl.cambiarEstadoCampanaFinalizado(FrmPrincipal.dniCliente);
                }
            }
        }