Esempio n. 1
0
    public static DataRow DatosTerceroTronWeb(string cod_docum)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OVDES"))
            {
                Tercero_DB objdb = new Tercero_DB();

                DataTable dt = new DataTable();

                DataSet ds = objdb.DatosTerceroTronWeb_DB(cnx, cod_docum);

                dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    return(dt.Rows[0]);
                }
                else
                {
                    return(null);
                }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 2
0
    public static bool ClienteBloqueado(string cod_docum)
    {
        DataRow    tercero    = null;
        Tercero_DB objtercero = new Tercero_DB();

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                tercero = objtercero.ClienteBloqueado_DB(cod_docum, Conexion);

                if (tercero["p_retorno"].ToString() == "N")
                {
                    return(true); /* NO ESTA BLOQUEADO */
                }
                else
                {
                    return(false); /* ESTA BLOQUEADO */
                }
            }
        }
        catch
        {
            return(true);
        }
    }
Esempio n. 3
0
    public static decimal PrimaExenta(string cod_modalidad, string cod_ramo)
    {
        DataRow     prima_exenta = null;
        Vehiculo_DB objdb        = new Vehiculo_DB();

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                prima_exenta = objdb.PrimaExenta_DB(cod_modalidad, cod_ramo, Conexion);

                System.Globalization.NumberFormatInfo nfi = new
                                                            System.Globalization.NumberFormatInfo();
                nfi.NumberGroupSeparator = ",";


                return(Convert.ToDecimal(prima_exenta["p_monto_exenta"].ToString(), nfi));
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 4
0
    public static void Carga_Ciudades(DropDownList cmb, string cod_estado)
    {
        try
        {
            cmb.Items.Clear();
            using (OracleConnection cnx = MConexion.getConexion("OF0"))
            {
                Localidades_DB objdb = new Localidades_DB();
                DataSet        ds    = objdb.getCiudad(cnx, "CHI", cod_estado);

                cmb.DataSource     = ds;
                cmb.DataTextField  = "Nom_Prov";
                cmb.DataValueField = "Cod_Prov";


                cmb.DataBind();
                cmb.Items.Insert(0, new ListItem("Seleccionar", "0"));
                cmb.SelectedIndex = 0;
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 5
0
    public static string ValidaDuracionDiasHabil(string fecha, int cant_dias)
    {
        MCommand objComando = new MCommand();

        try
        {
            using (OracleConnection conexion = MConexion.getConexion("OVDES"))
            {
                objComando.Connection = conexion;

                objComando.CommandText = "p_valida_fechas_habil";

                //objComando.agregarINParametro("p_cod_cia", OracleDbType.Varchar2, cod_cia);
                //objComando.agregarINParametro("p_cod_ramo", OracleDbType.Varchar2, cod_ramo);
                objComando.agregarINParametro("p_fecha", OracleDbType.Varchar2, fecha);
                objComando.agregarINParametro("p_num_dias", OracleDbType.Varchar2, cant_dias);
                objComando.agregarOUTParametro("p_valida", OracleDbType.Varchar2, 300);

                DataRow dr = objComando.ejecutarRegistroSP();
                return(dr["p_valida"].ToString());
            }
        }
        catch (Exception ex)
        {
            throw new Exception("ERROR p_valida_fechas_habil : " + ex.Message);
        }
    }
Esempio n. 6
0
    public static void getDescuentosOpcionales(DropDownList cmb1, string cod_docum)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OVDES"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();
                DataSet     ds    = objdb.getDescuentosOpcionales_DB(cod_docum, "801", cnx);

                DataTable dt = ds.Tables[0];

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    cmb1.Items.Add(new ListItem(dt.Rows[i]["PORC"].ToString(), dt.Rows[i]["COD_DESCUENTO"].ToString()));
                }
                cmb1.Items.Insert(0, new ListItem("0", "0"));
                cmb1.SelectedIndex = 0;

                ds.Dispose();
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
    public static int CantPreguntas(bool AutoNuevo)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OVDES"))
            {
                string html = "";
                PreguntasDeclaracion_DB objdb = new PreguntasDeclaracion_DB();
                DataSet ds = objdb.TraePreguntas_DB(cnx);

                if (ds.Tables.Count > 0)
                {
                    DataView dv = ds.Tables[0].DefaultView;
                    dv.Sort = "[ID_PREGUNTA] ASC";
                    DataTable dt = dv.ToTable();
                    if (AutoNuevo)
                    {
                        return(1);
                    }
                    else
                    {
                        return(dt.Rows.Count);
                    }
                }
                else
                {
                    return(0);
                }
            }
        }
        catch (Exception ex)
        {
            return(0);
        }
    }
Esempio n. 8
0
    public static string ValidaDescuentosOpcionales(string cod_docum)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OVDES"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();
                DataSet     ds    = objdb.getDescuentosOpcionales_DB(cod_docum, "801", cnx);

                DataTable dt = ds.Tables[0];

                if (dt.Rows.Count >= 1)
                {
                    return("S");
                }
                else
                {
                    return("N");
                }
                ds.Dispose();
            }
        }
        catch (Exception ex)
        {
            return("N");
        }
    }
Esempio n. 9
0
    public static DataRow GuardaTerceroCotizacion(string P_NUM_COTIZACION,
                                                  string COD_DOCUM_ASEG,
                                                  string P_NOMBRES,
                                                  string P_AP_PATERNO,
                                                  string P_AP_MATERNO,
                                                  string P_MAIL,
                                                  string P_CELULAR,
                                                  string P_FONO_FIJO)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Tercero_DB objdb = new Tercero_DB();

                DataRow objdatos_tercero = objdb.GuardaTerceroCotizacion_DB(P_NUM_COTIZACION,
                                                                            COD_DOCUM_ASEG,
                                                                            P_NOMBRES,
                                                                            P_AP_PATERNO,
                                                                            P_AP_MATERNO,
                                                                            P_MAIL,
                                                                            P_CELULAR,
                                                                            P_FONO_FIJO,
                                                                            Conexion);

                return(objdatos_tercero);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 10
0
    // #CCE
    public static string DesctoPAT()
    {
        OracleCommand cmd = new OracleCommand();

        using (OracleConnection cnx = MConexion.getConexion("OVDES"))
        {
            try
            {
                cmd.Connection  = cnx;
                cmd.CommandText = "f_get_parametros";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add("result", OracleDbType.Varchar2, 128);
                cmd.Parameters["result"].Direction = ParameterDirection.ReturnValue;

                cmd.Parameters.Add("p_nombre", OracleDbType.Varchar2);
                cmd.Parameters["p_nombre"].Value = "DSCTO_VEH_PAT";

                cmd.ExecuteNonQuery();
                string valor = cmd.Parameters["result"].Value.ToString();
                return(valor);
            }

            catch (Exception ex)
            {
                throw new Exception("ERROR Cobranza.cs / DesctoPAT : " + ex.Message);
            }
        }
    }
Esempio n. 11
0
    public static DataRow GeneraXML(string cod_ramo, string cod_docum_mae, string cod_docum_aseg, string cod_docum_tomad, string num_cotizacion, string cod_plan_pago, string mca_inspeccion, string fec_vig_ini, string dia_pago, string forma_pago, string codbanco, string codtarjeta, string nrotarjeta, string mestarjeta, string aniotarjeta, string mca_suplanta)
    {
        DataRow   emision       = null;
        DataRow   error_emision = null;
        Emitir_DB objemite      = new Emitir_DB();

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                emision = objemite.GeneraXML_DB(cod_docum_mae, cod_docum_aseg, cod_docum_tomad, num_cotizacion, cod_plan_pago, mca_inspeccion, fec_vig_ini, dia_pago, forma_pago, codbanco, codtarjeta, nrotarjeta, mestarjeta, aniotarjeta, mca_suplanta, Conexion);

                if (emision["P_ERROR"].ToString() == "N")
                {
                    StringBuilder objXML = new StringBuilder();

                    objXML.Append("<XML ACCION=\"P\" COD_RAMO=\"");
                    objXML.Append(cod_ramo);
                    objXML.Append("\" NUM_POLIZA=\"");
                    objXML.Append("\">");

                    objXML.Append(emision["P_MEL_XML_POL_P2000030"]);
                    objXML.Append(emision["P_MEL_XML_POL_P2000031"]);
                    objXML.Append(emision["P_MEL_XML_POL_P2000020"]);
                    objXML.Append(emision["P_MEL_XML_POL_P2000040"]);
                    objXML.Append(emision["P_MEL_XML_POL_P2000060"]);
                    //objXML.Append(emision["P_MEL_XML_POL_P1001331"]);

                    objXML.Append("</XML>");

                    string XML;

                    XML = objXML.ToString();
                    XML = XML.Replace("null", "");

                    DataRow emitir = EmitirPoliza(XML);

                    return(emitir);
                }
                else
                {
                    return(error_emision);
                }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
    public static string ValidaDiasHabiles(string fecha, int dias)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OVDES"))
            {
                PreguntasDeclaracion_DB objdb = new PreguntasDeclaracion_DB();

                return(objdb.ValidaDiasHabiles_DB(cnx, fecha, dias));
            }
        }
        catch (Exception ex)
        {
            return("");
        }
    }
    public static string ValidaRespuestaBloqueo(int id_pregunta, int id_preguntapadre, string resp)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OVDES"))
            {
                PreguntasDeclaracion_DB objdb = new PreguntasDeclaracion_DB();

                return(objdb.ValidaRespuestaBloqueo_DB(cnx, id_pregunta, id_preguntapadre, resp));
            }
        }
        catch (Exception ex)
        {
            return("");
        }
    }
Esempio n. 14
0
    public static string TraeCorreo(string cod_docum)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                DataRow objdatos_tercero = Tercero_DB.TraeCorreo_DB(cod_docum, Conexion);

                return(objdatos_tercero["p_correo"].ToString());
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 15
0
    public static void GuardaDatosVehEmision(string ID, string COD_COLOR, string NRO_MOTOR, string NRO_CHASIS)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();

                DataRow objdatos_veh = objdb.GuardaDatosVehEmision_DB(ID, COD_COLOR, NRO_MOTOR, NRO_CHASIS, Conexion);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 16
0
    public static void GuardaDatosFactura(string num_cotizacion, string num_factura, string fec_factura, string cod_docum_factura, string nom_factura)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();

                DataRow objdatos_veh = objdb.GuardaDatosFactura_DB(num_cotizacion, num_factura, fec_factura, cod_docum_factura, nom_factura, Conexion);
            }
        }

        catch (Exception ex)
        {
            //throw new Exception(ex.Message);
        }
    }
Esempio n. 17
0
    public static string ValidaNroMotor(string nro_motor)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();

                DataRow objdb_nro = objdb.ValidaNroMotor_DB(nro_motor, Conexion);

                return(objdb_nro["g_existe"].ToString());
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 18
0
    public static void GrabaDescuentoOpc(string cod_descuento, string num_cotizacion)
    {
        DataRow     descuento = null;
        Vehiculo_DB objdb     = new Vehiculo_DB();

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                descuento = objdb.GrabaDescuentoOpc_DB(cod_descuento, num_cotizacion, Conexion);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 19
0
    public DataSet Carga_Comunas_despacho(string ciu)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OF0"))
            {
                Localidades_DB objdb = new Localidades_DB();

                DataSet ds = objdb.getComuna_despacho(cnx, "CHI", ciu);

                return(ds);
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 20
0
    public static void AutorizaInspeccionBSPWEB(string num_cotizacion)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();

                DataRow objdatos_veh = objdb.AutorizaInspeccionBSPWEB_DB(num_cotizacion, Conexion);

                //return objdatos_veh["p_error"].ToString();
            }
        }

        catch (Exception ex)
        {
            //throw new Exception(ex.Message);
        }
    }
Esempio n. 21
0
    public static string CuentaHabilitada(string cod_docum)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Tercero_DB objdb = new Tercero_DB();

                DataRow objdatos_tercero = objdb.CuentaHabilitada_DB(cod_docum, Conexion);

                return(objdatos_tercero["p_existe"].ToString());
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 22
0
    public static string TraeNomTipVehi(string cod_marca, string cod_modelo, string cod_sub_modelo)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();

                DataRow objdatos_veh = objdb.TraeNomTipVehi_DB(cod_marca, cod_modelo, cod_sub_modelo, Conexion);

                return(objdatos_veh["p_nom_tip_vehi"].ToString());
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 23
0
    public static string GuardaDatosInspeccion(string p_num_cotizacion, string p_datos_tercero, string p_datos_vehiculo, string p_datos_inspeccionDP, string p_datos_inspeccionAcc)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();

                DataRow objdatos_veh = objdb.GuardaDatosInspeccion_DB(p_num_cotizacion, p_datos_tercero, p_datos_vehiculo, p_datos_inspeccionDP, p_datos_inspeccionAcc, Conexion);

                return(objdatos_veh["p_error"].ToString());
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 24
0
    public static DataRow EmitirPoliza(string xml)
    {
        DataRow   emision    = null;
        Emitir_DB objemision = new Emitir_DB();

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OF0"))
            {
                emision = objemision.EmitirPoliza_DB(xml, Conexion);
                return(emision);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 25
0
    public static DataRow DatosAutomotora(string cod_docum_automotora)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Tercero_DB objdb = new Tercero_DB();

                DataRow objdatos_tercero = objdb.DatosAutomotora_DB(cod_docum_automotora, Conexion);

                return(objdatos_tercero);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 26
0
    public static void GuardaDatosInspeccionBSPWEB(string num_cotizacion, string num_matricula, string nombre_contacto, string direccion_contacto, string cod_region_contacto, string cod_ciudad_contacto, string cod_comuna_contacto, string fono_contacto, string celular_contacto, string observaciones_contacto, string nom_aseg, string cod_area)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();

                DataRow objdatos_veh = objdb.GuardaDatosInspeccionBSPWeb_DB(num_cotizacion, num_matricula, nombre_contacto, direccion_contacto, cod_region_contacto, cod_ciudad_contacto, cod_comuna_contacto, fono_contacto, celular_contacto, observaciones_contacto, nom_aseg, cod_area, Conexion);

                //return objdatos_veh["p_error"].ToString();
            }
        }

        catch (Exception ex)
        {
            //throw new Exception(ex.Message);
        }
    }
Esempio n. 27
0
    public static DataRow GuardaTer(string cod_docum, string ape1_tercero, string ape2_tercero, string nom_tercero, string nom_direccion, int cod_region, int cod_ciudad, int cod_comuna, string tlf_pais, string tlf_zona, string tlf_numero, string mca_sexo)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Tercero_DB objdb = new Tercero_DB();

                DataRow objdatos_tercero = objdb.GuardaTer_DB(cod_docum, ape1_tercero, ape2_tercero, nom_tercero, nom_direccion, cod_region, cod_ciudad, cod_comuna, tlf_pais, tlf_zona, tlf_numero, mca_sexo, Conexion);

                return(objdatos_tercero);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 28
0
    public static string ValidaGAP(string cod_docum)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Tercero_DB objdb = new Tercero_DB();

                DataRow objdatos_tercero = objdb.ValidaGAP_DB(cod_docum, Conexion);

                return(objdatos_tercero["P_RESPUESTA"].ToString());
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 29
0
    public static void ActualizaNumPoliza(string num_cotizacion, string num_poliza)
    {
        DataRow   emision    = null;
        Emitir_DB objemision = new Emitir_DB();

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                emision = objemision.ActualizaNumPoliza_DB(num_cotizacion, num_poliza, Conexion);
                //return emision;
            }
        }

        catch (Exception ex)
        {
            // throw new Exception(ex.Message);
        }
    }
Esempio n. 30
0
    public static DataRow DatosVehID(string ID)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();

                DataRow objdatos_veh = objdb.DatosVeh_ID_DB(ID, Conexion);

                return(objdatos_veh);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }