Beispiel #1
0
        public int InsertarTransaccionPago(int flag, CENTransaccionPago objTP, CENPagoEfectivo objPE, CENPagoTransferencia objePT)
        {
            CADTransaccionPago objCADTP = null;

            try
            {
                objCADTP = new CADTransaccionPago();
                return(objCADTP.InsertarTransaccionPago(flag, objTP, objPE, objePT));
            } catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        public int InsertarTransaccionPago(int flag, CENTransaccionPago objTP, CENPagoEfectivo objPE, CENPagoTransferencia objePT)
        {
            int           response = 0;
            SqlConnection con      = null;
            SqlCommand    cmd      = null;
            CADConexion   CadCx    = new CADConexion();

            try
            {
                con             = new SqlConnection(CadCx.CxSQL());
                cmd             = new SqlCommand("pa_registrar_modificar_transaccion_pago", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@p_flag", flag);
                cmd.Parameters.AddWithValue("@p_codPrestamo", objTP.codPrestamo);
                cmd.Parameters.AddWithValue("@p_nroCuota", objTP.nroCuota);
                cmd.Parameters.AddWithValue("@p_codVenta", objTP.codVenta);
                cmd.Parameters.AddWithValue("@p_ntraMedioPago", objTP.ntraMedioPago);
                cmd.Parameters.AddWithValue("@p_tipoCambio", objTP.tipoCambio);
                cmd.Parameters.AddWithValue("@p_tipoMoneda", objTP.tipoMoneda);
                cmd.Parameters.AddWithValue("@p_igv", objTP.IGV);
                cmd.Parameters.AddWithValue("@p_estado", objTP.estado);
                cmd.Parameters.AddWithValue("@p_importe", objPE.importe);
                cmd.Parameters.AddWithValue("@p_vuelto", objPE.vuelto);
                cmd.Parameters.AddWithValue("@p_nroTransferencia", objePT.nroTransferencia);
                cmd.Parameters.AddWithValue("@p_cuentaTransferencia", objePT.cuentaTransferencia);
                cmd.Parameters.AddWithValue("@p_banco", objePT.banco);
                cmd.Parameters.AddWithValue("@p_fechaTransferencia", objePT.fechaTransferencia);
                cmd.Parameters.Add("@resultado", SqlDbType.Int).Direction = ParameterDirection.Output;
                con.Open();
                cmd.ExecuteNonQuery();
                response = Convert.ToInt32(cmd.Parameters["@resultado"].Value);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
            return(response);
        }
        public static int InsertarTransaccionPago(string flag, string codPrestamo, string nroCuota,
                                                  string codVenta, string ntraMedioPago, string tipoCambio,
                                                  string tipoMoneda, string igv, string estado, string importe, string vuelto,
                                                  string nroTransf, string nroCuenta, string banco, string fechaTrans)
        {
            int?CodPrestamos;
            int?NroCuotas;

            int Flag = Convert.ToInt16(flag);

            if (codPrestamo == null)
            {
                CodPrestamos = null;
            }
            else
            {
                CodPrestamos = Convert.ToInt32(codPrestamo);
            }

            if (nroCuota == null)
            {
                NroCuotas = null;
            }
            else
            {
                NroCuotas = Convert.ToInt32(nroCuota);
            }

            CENTransaccionPago objTP = new CENTransaccionPago()
            {
                codPrestamo   = CodPrestamos,
                nroCuota      = NroCuotas,
                codVenta      = Convert.ToInt32(codVenta),
                ntraMedioPago = Convert.ToInt16(ntraMedioPago),
                tipoCambio    = Convert.ToDecimal(tipoCambio),
                tipoMoneda    = Convert.ToInt16(tipoMoneda),
                IGV           = Convert.ToDecimal(igv),
                estado        = Convert.ToInt16(estado)
            };

            CENPagoEfectivo objPE = new CENPagoEfectivo()
            {
                importe    = Convert.ToDecimal(importe),
                vuelto     = Convert.ToDecimal(vuelto),
                tipoMoneda = Convert.ToInt16(tipoMoneda),
                estado     = Convert.ToInt16(estado)
            };

            CENPagoTransferencia objePT = new CENPagoTransferencia()
            {
                nroTransferencia    = nroTransf,
                cuentaTransferencia = nroCuenta,
                banco              = banco,
                importe            = Convert.ToDecimal(importe),
                tipoMoneda         = Convert.ToInt16(tipoMoneda),
                fechaTransferencia = Convert.ToDateTime(fechaTrans),
                estado             = Convert.ToInt16(estado)
            };

            CLNPagoTransaccion objCLNTP = null;

            try
            {
                objCLNTP = new CLNPagoTransaccion();
                int ok = objCLNTP.InsertarTransaccionPago(Flag, objTP, objPE, objePT);

                return(ok);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }