コード例 #1
0
        private void dgvlistado_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex != -1 && e.ColumnIndex != 7)
            {
                REC01_RECIBO obj = new REC01_RECIBO();
                obj.RECIBO           = Convert.ToDecimal(dgvlistado.CurrentRow.Cells[0].Value);
                obj.USUARIO_CREACION = dgvlistado.CurrentRow.Cells[5].Value.ToString();
                obtenerRecibo(obj);
                txtnombre.Focus();
                btnanular.Visible  = true;
                btnguardar.Enabled = true;
            }
            else if (e.ColumnIndex == 7)
            {
                DataGridViewRow dgv = dgvlistado.Rows[e.RowIndex];

                frmVistaPrevia vp = new frmVistaPrevia();
                vp.recibo     = Convert.ToDecimal(dgv.Cells[0].Value);
                vp.usuario    = dgv.Cells[5].Value.ToString();
                vp.medio_pago = Convert.ToDecimal(dgv.Cells[8].Value);
                this.Hide();
                vp.ShowDialog();
                this.Close();
            }
        }
コード例 #2
0
        private void RegistrarNuevoRecibo()
        {
            REC01_CORRELATIVO_RECIBO objcorrelativo = new REC01_CORRELATIVO_RECIBO();
            Recibo objrecibo = new Recibo();
            Mensaje <REC01_CORRELATIVO_RECIBO> objresp = objrecibo.obtenerCorrelativoFisico();

            if ((objresp.data.CORRELATIVO_FINAL < objresp.data.CORRELATIVO_ACTUAL) && string.IsNullOrEmpty(txtrecibo.Text.ToString()))
            {
                MessageBox.Show("Se ha terminado Rango de Correlativos Fisicos, Favor de Proceder a Modificar los rangos en el Mantenimiento de Correlativos para continuar");
            }
            else if (string.IsNullOrWhiteSpace(txtnit.Text.ToString()))
            {
                MessageBox.Show("El campo de Nit se encuentra vacio o contiene un espacio, sino tiene un nit colocar C/F");
                txtnit.Focus();
            }
            else if (string.IsNullOrWhiteSpace(txtnombre.Text.ToString()))
            {
                MessageBox.Show("El campo de Nombre se encuentra vacio o contiene un espacio, favor de colocar un dato en el campo");
                txtnombre.Focus();
            }
            else if (string.IsNullOrWhiteSpace(txtdireccion.Text.ToString()))
            {
                MessageBox.Show("El campo de Dirección se encuentra vacio o contiene un espacio, favor de colocar un dato en el campo");
                txtdireccion.Focus();
            }
            else if (cbxpais.SelectedIndex.Equals(-1))
            {
                MessageBox.Show("Favor de ingresar el dato de un Pais");
                cbxpais.Focus();
            }
            else if (cbxconcepto.SelectedIndex.Equals(-1))
            {
                MessageBox.Show("Favor de ingresar el dato de un Concepto");
                cbxconcepto.Focus();
            }
            else if (string.IsNullOrWhiteSpace(txtprecio.Text.ToString()))
            {
                MessageBox.Show("El campo de Precio se encuentra vacio o contiene un espacio, favor de colocar un dato en el campo");
                txtprecio.Focus();
            }
            else if (string.IsNullOrWhiteSpace(txtcantidad.Text.ToString()))
            {
                MessageBox.Show("El campo de Cantidad se encuentra vacio o contiene un espacio, favor de colocar un dato en el campo");
                txtcantidad.Focus();
            }
            else
            {
                guardarRecibo();

                if (validaCorrelativoExistente)
                {
                    MessageBox.Show(mensajeValidacionCorrelativoExistente);
                }
                else
                {
                    llenarListado();
                    frmVistaPrevia nfvp = new frmVistaPrevia();
                    nfvp.recibo     = Global.correlativousuario;
                    nfvp.usuario    = Global.usuariologueado;
                    nfvp.medio_pago = Global.mediodepago;
                    this.Hide();
                    nfvp.ShowDialog();
                    this.Close();
                }
            }
        }