Example #1
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     {
         if (cbTipoBusqueda.Text == "Mes+Dias+Año")
         {
             NPago.BuscarPorDiasyMesAnio(dgvPagos, cbBuscarMes.Text, cbDiaInicio.Text, cbDiaFin.Text, cbAnio.Text);
         }
         else if (cbTipoBusqueda.Text == "Nombre+Mes+Dias+Año")
         {
             NPago.BuscarPorNombreDiasyMesAnio(dgvPagos, txtBuscarNomA.Text, cbBuscarMes.Text, cbDiaInicio.Text, cbDiaFin.Text, cbAnio.Text);
         }
         else if (cbTipoBusqueda.Text == "Nombre+Mes+Año")
         {
             NPago.BuscarNombreyMesAnio(dgvPagos, txtBuscarNomA.Text, cbBuscarMes.Text, cbAnio.Text);
         }
         else if (cbTipoBusqueda.Text == "Movil+Mes+Año")
         {
             NPago.BuscarMovilMesAnio(dgvPagos, txtMovil.Text, cbBuscarMes.Text, cbAnio.Text);
         }
         else if (cbTipoBusqueda.Text == "Movil+Mes+Dias+Año")
         {
             NPago.BuscarPorMovilDiasMesAnio(dgvPagos, txtMovil.Text, cbBuscarMes.Text, cbDiaInicio.Text, cbDiaFin.Text, cbAnio.Text);
         }
         lblTotal.Text = "REGISTROS: " + dgvPagos.Rows.Count.ToString();
         SumarColumnas();
     }
 }
Example #2
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult Opcion;
                Opcion = MessageBox.Show("Realmente desea eliminar los registros", "Sistema de ventas", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (Opcion == DialogResult.OK)
                {
                    string Codigo;


                    foreach (DataGridViewRow row in dgvPagos.Rows)
                    {
                        if (Convert.ToBoolean(row.Cells[0].Value))
                        {
                            Codigo = row.Cells[1].Value.ToString();
                            NPago.Eliminar(Convert.ToInt32(Codigo));
                            MessageBox.Show("Se Elimino correctamente el registro");
                        }
                    }
                }
                chkEliminar.Checked = false;

                this.MostrarTodosLosPagos();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
                MessageBox.Show("No se puedo eliminar el registro");
            }
        }
Example #3
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                string rpta = "";
                if (this.txtnombre.Text == string.Empty)
                {
                    mensajeerror("Falta ingresar algunos datos, serán remarcados");



                    if (this.textBox1.Text.Length == 0)
                    {
                        errorProvider1.SetError(this.textBox1, "ingrese el Nombre del Año");
                    }
                    else
                    {
                        errorProvider1.SetError(this.textBox1, "");
                    }
                }
                else
                {
                    if (this.isnuevo)
                    {
                        rpta = NPago.Insertar(Convert.ToInt32(textBox1.Text), Convert.ToInt32(txtnombre.Text), dateTimePicker1.Value, Convert.ToInt32(textBox3.Text));
                    }
                    else
                    {
                        rpta = NPago.Editar(Convert.ToInt32(this.txtiddamnificado.Text), Convert.ToInt32(textBox1.Text), Convert.ToInt32(txtnombre.Text), dateTimePicker1.Value, Convert.ToInt32(textBox3.Text));
                    }

                    if (rpta.Equals("OK"))
                    {
                        if (this.isnuevo)
                        {
                            this.mensajeok("Se Insertó de forma correcta el registro");
                        }
                        else
                        {
                            this.mensajeok("Se Actualizó de forma correcta el registro");
                        }
                    }
                    else
                    {
                        this.mensajeerror(rpta);
                    }

                    this.isnuevo  = false;
                    this.iseditar = false;
                    this.habilitar(false);
                    this.botones();
                    this.Limpiar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Example #4
0
 private void MostrarTodosLosPagos()
 {
     NPago.Mostrar(dgvPagos);
     chkEliminar.Checked = false;
     OcultarColumnaId();
     lblTotal.Text = "REGISTROS: " + dgvPagos.Rows.Count.ToString();
     SumarColumnas();
 }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ERespuestaJson objRespuesta = new ERespuestaJson();

            try
            {
                //obteniendo pagos pendientes
                List <EPago> lpagosPendientes = new List <EPago>();
                lpagosPendientes = NPago.listarPagosPendientes();
                var str_mensaje = "";

                str_mensaje += DateTime.Now.ToString();

                foreach (EPago item in lpagosPendientes)
                {
                    dynamic payment_response;
                    try
                    {
                        payment_response = JsonConvert.DeserializeObject(item.OBSERVACION);
                    }
                    catch (Exception ex)
                    {
                        payment_response = null;
                        NMascota.log_error("job_ProcessPendingPayments::" + (String.IsNullOrEmpty(ex.Message) ? ex.InnerException.Message : ex.Message), "obj_pago");
                    }

                    if (payment_response != null)
                    {
                        var payment_id = payment_response["Id"].Value;
                        //Si no encuentra el payment_id
                        if (payment_id == null)
                        {
                            str_mensaje += item.SOLICITUD_ID + "::" + payment_id + ":: Id de pago no se genero<br>";
                            continue;
                        }
                        //Obteniendo estado del pago
                        var result_payment = get_pay_mp(payment_id);
                        //Si no se encuentra el payment_id
                        if (result_payment.StatusDetail == null)
                        {
                            str_mensaje += item.SOLICITUD_ID + "::" + payment_id + ":: Id de pago no encontrado<br>";
                            continue;
                        }
                        processPaymentResponse(result_payment, item.SOLICITUD_ID, item.ID, item.EMAIL);
                        str_mensaje += item.SOLICITUD_ID + "::" + payment_id + "::" + result_payment.StatusDetail + "<br>";
                    }
                }

                str_mensaje           += DateTime.Now.ToString();
                bodyProcesos.InnerHtml = str_mensaje;
            }
            catch (Exception ex)
            {
                NMascota.log_error("job_ProcessPendingPayments::" + (String.IsNullOrEmpty(ex.Message) ? ex.InnerException.Message : ex.Message), "obj_pago");
            }
        }
Example #6
0
        private static int savePayDatabase(float total, string carnum, decimal solicitud_id, int opcion, string observacion, int estado, string mail, string vestado)
        {
            EUsuario eUsuario = (EUsuario)HttpContext.Current.Session["userRump"];
            EPago    objPago  = new EPago();

            objPago.USUARIO      = eUsuario.ID;
            objPago.TOTAL        = total;
            objPago.NUM_TARJETA  = carnum;
            objPago.SOLICITUD_ID = solicitud_id;
            objPago.OPCION       = opcion;
            objPago.OBSERVACION  = observacion;
            objPago.ESTADO       = estado;
            objPago.EMAIL        = mail;
            objPago.vPARAM1      = vestado;
            return(NPago.ActualizarPago(objPago));
        }
Example #7
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            NPago  oPneg = new NPago();
            NCuota oCneg = new NCuota();

            int      codigo         = Convert.ToInt32(this.cmbCodigo.SelectedValue.ToString());
            int      clientecodigo  = Convert.ToInt32(this.cmbCliente.SelectedValue.ToString());
            int      empleadocodigo = Convert.ToInt32(this.cmbEmpleado.SelectedValue.ToString());
            DateTime fecha          = this.dtpFecha.Value;
            DateTime hora           = this.dtpHora.Value;
            double   totalcuota     = Convert.ToDouble(this.txtTotalCuota.Text);
            double   mora           = Convert.ToDouble(this.txtMora.Text);
            double   pago           = Convert.ToDouble(this.txtPago.Text);

            string rpta = oPneg.insertarPago(codigo, empleadocodigo, clientecodigo, fecha, hora, totalcuota, mora, pago);

            if (rpta.Equals("OK"))
            {
                MessageBox.Show(rpta, "Insertar Pago", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show(rpta, "ERROR al Insertar Pago", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            bool   cancel = true;
            string rpta2  = oCneg.actualizarCuota(codigo, cancel);

            if (rpta2.Equals("OK"))
            {
                MessageBox.Show(rpta2, "Modificar Cuota", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show(rpta2, "ERROR al Modificar Cuota", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            this.limpiar();
            this.inicial(false);
        }
Example #8
0
        public static int updatePayDatabase(decimal idPago, int opcion, string observacion, int estado, string vestado)
        {
            EUsuario eUsuario = (EUsuario)HttpContext.Current.Session["userRump"];
            EPago    objPago  = new EPago();

            //Validando job de verificacion
            if (eUsuario == null)
            {
                objPago.USUARIO = 10585;//usuario de sistemas
            }
            else
            {
                objPago.USUARIO = eUsuario.ID;
            }

            objPago.OPCION      = opcion;
            objPago.OBSERVACION = observacion;
            objPago.ESTADO      = estado;
            objPago.ID          = idPago;
            objPago.vPARAM1     = vestado;
            return(NPago.ActualizarPago(objPago));
        }
Example #9
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (dtpFechaPago.Text == string.Empty || txtMonto.Text == string.Empty)
            {
                MessageBox.Show("¡No se admiten campos vacios");
            }
            else
            {
                try
                {
                    frmSeleccionarChofer frm = new frmSeleccionarChofer(this);
                    int idPago = NPago.Insertar(dtpFechaPago.Value.Day.ToString(), dtpFechaPago.Value.Month.ToString(), dtpFechaPago.Value.Year.ToString(), dtpFechaPago.Value.Hour.ToString() + ":" + dtpFechaPago.Value.Minute.ToString(), Convert.ToInt32(miid), Convert.ToDouble(txtMonto.Text));
                    // GuardarDatosImpresion(dtpFechaPago.Value.Day.ToString()+"/"+dtpFechaPago.Value.Month.ToString() + "/" + dtpFechaPago.Value.Year.ToString(), dtpFechaPago.Value.Hour.ToString() + ":" + dtpFechaPago.Value.Minute.ToString());
                    MostrarTodosLosPagos();
                    btnNuevo.Enabled = true;

                    int Result = Negocio.NDeuda.VincularPago(idPago, MIidDeuda);

                    if (Result > 0)
                    {
                        MessageBox.Show("Pago completado correctamente");
                        BloquearCampos(false);
                        Limpiar();
                        lblChofer.Text = "Chofer";
                    }
                    else
                    {
                        //TODO Aca lo que pasa si falla el update
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message + ex.StackTrace);
                }
            }
        }
Example #10
0
 private void buscarnombre()
 {
     this.dataGridView1.DataSource = NPago.buscarnombre(this.txtbuscar.Text);
     this.OcultarColumnas();
     label10.Text = "Total de Registros: " + Convert.ToString(dataGridView1.Rows.Count);
 }