Esempio n. 1
0
    public static DataRow GuardaNomTer(string cod_docum, string ape1_tercero, string ape2_tercero, string nom_tercero)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Tercero_DB objdb = new Tercero_DB();

                DataRow objdatos_tercero = objdb.GuardaNomTer_DB(cod_docum, ape1_tercero, ape2_tercero, nom_tercero, Conexion);

                return(objdatos_tercero);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 2
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. 3
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. 4
0
    public static void PlanesPagoConvenio(DropDownList cmb, string cod_cia, string cod_ramo, string tip_pago, string cod_agt, string cod_convenio)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Cobranza_DB objCotizador = new Cobranza_DB();

                cmb.DataSource     = objCotizador.PlanesPagoConvenio_DB(cod_cia, cod_ramo, tip_pago, cod_agt, cod_convenio, Conexion);
                cmb.DataTextField  = "NOM_FRACC_PAGO";
                cmb.DataValueField = "NUM_CUOTAS";
                cmb.DataBind();
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 5
0
    public static DataRow ValorCuotaSinInteres(string prima, string num_cuotas)
    {
        DataRow     cuota       = null;
        Cobranza_DB objcobranza = new Cobranza_DB();

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                cuota = objcobranza.ValorCuotaSinInteres_DB(prima, Convert.ToInt32(num_cuotas), Conexion);
                return(cuota);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 6
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. 7
0
    public static DataRow ValorCuota(decimal prima, string tip_cuota, string num_cuotas, decimal descuento, string cod_ramo, string dia_pago)
    {
        DataRow     cuota       = null;
        Cobranza_DB objcobranza = new Cobranza_DB();

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                cuota = objcobranza.ValorCuota_DB(cod_ramo, prima, descuento, Convert.ToInt32(num_cuotas), tip_cuota, dia_pago, Conexion);
                return(cuota);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 8
0
    public static void Combo_Partes_Veh(DropDownList cmb1, DropDownList cmb2)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OF0"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();
                DataSet     ds    = objdb.getPartesVeh(cnx);

                //cmb1.DataSource = ds.Tables[0];
                //cmb1.DataTextField = "PARTE";
                //cmb1.DataValueField = "COD_PARTE";
                //cmb1.DataBind();
                //cmb1.Items.Insert(0, new ListItem("Seleccionar", "0"));
                //cmb1.SelectedIndex = 0;

                DataTable dt = ds.Tables[0];

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

                /*******/

                cmb2.DataSource     = ds.Tables[1];
                cmb2.DataTextField  = "NOM_DANO";
                cmb2.DataValueField = "COD_DANO";
                cmb2.DataBind();
                cmb2.Items.Insert(0, new ListItem("Seleccionar", "0"));
                cmb2.SelectedIndex = 0;

                ds.Dispose();
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 9
0
    public static string DiaPago(string cod_docum)
    {
        DataRow     diapago     = null;
        Cobranza_DB objcobranza = new Cobranza_DB();

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                diapago = objcobranza.DiaPago_DB(cod_docum, Conexion);

                return(diapago["p_dia_pago"].ToString());
            }
        }

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

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                emision = objemision.ImprimirMandato_DB(Conexion, num_cotizacion);

                return(emision["p_nom_fic"].ToString());
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 11
0
    public static void PlanesPagoCompara(DropDownList cmb, string tip_pago)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Cobranza_DB objCotizador = new Cobranza_DB();

                cmb.DataSource     = objCotizador.PlanesPagoCompara_DB(1, tip_pago, Conexion);
                cmb.DataTextField  = "NOM_FRACC_PAGO";
                cmb.DataValueField = "NUM_CUOTAS";
                cmb.DataBind();
                //cmb.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Seleccionar", "0"));
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 12
0
    public static void Tarjetas(DropDownList cmb, string tip_tarjeta)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Cobranza_DB objCotizador = new Cobranza_DB();

                cmb.DataSource     = objCotizador.Tarjetas_DB(Conexion, tip_tarjeta);
                cmb.DataTextField  = "NOM_TARJETA";
                cmb.DataTextField  = cmb.DataTextField.ToUpper();
                cmb.DataValueField = "COD_TARJETA";
                cmb.DataBind();
                cmb.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Seleccionar", "0"));
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 13
0
    public static DataRow GuardaTerCompara(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, string num_movil, string email, string fecha_nac)
    {
        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                Tercero_DB objdb = new Tercero_DB();

                DataRow objdatos_tercero = objdb.GuardaTerCompara_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, num_movil, email, fecha_nac, Conexion);

                return(objdatos_tercero);
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 14
0
    public static void Carga_Regiones(DropDownList cmb)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OF0"))
            {
                Localidades_DB objdb = new Localidades_DB();
                DataSet        ds    = objdb.getRegion(cnx, "CHI");

                cmb.DataSource     = ds;
                cmb.DataTextField  = "Nom_Estado";
                cmb.DataValueField = "Cod_Estado";
                cmb.DataBind();
                cmb.Items.Insert(0, new ListItem("Seleccionar", "0"));
                cmb.SelectedIndex = 0;
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 15
0
    public void Carga_Comuna(DropDownList cmb, string ciudad, string valor)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OF0"))
            {
                Localidades_DB objdb = new Localidades_DB();
                DataSet        ds    = objdb.getComuna(cnx, "CHI", ciudad);

                cmb.DataSource     = ds;
                cmb.DataTextField  = "NOM_LOCALIDAD";
                cmb.DataValueField = "Cod_LOCALIDAD";
                cmb.DataBind();
                cmb.Items.Insert(0, new ListItem("Seleccionar", "0"));
                //
                if (int.Parse(valor) > 0)
                {
                    cmb.SelectedIndex = 0;
                    foreach (ListItem item in cmb.Items)
                    {
                        if (item.Value == valor)
                        {
                            cmb.SelectedValue = valor;
                            break;
                        }
                    }
                }
                else
                {
                    cmb.SelectedIndex = 0;
                }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 16
0
    public static void Carga_Comunas(DropDownList cmb, string cod_prov)
    {
        try
        {
            cmb.Items.Clear();
            using (OracleConnection cnx = MConexion.getConexion("OF0"))
            {
                Localidades_DB objdb = new Localidades_DB();
                DataSet        ds    = objdb.getComuna(cnx, "CHI", cod_prov);

                cmb.DataSource     = ds;
                cmb.DataTextField  = "Nom_Localidad";
                cmb.DataValueField = "Cod_Localidad";

                cmb.DataBind();
                cmb.Items.Insert(0, new ListItem("Seleccionar", "0"));
                cmb.SelectedIndex = 0;
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 17
0
    public static void Combo_Colores(DropDownList cmb)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OF0"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();
                DataSet     ds    = objdb.getColores(cnx);

                cmb.DataSource     = ds;
                cmb.DataTextField  = "NOM_COLOR";
                cmb.DataValueField = "COD_COLOR";
                cmb.DataBind();
                cmb.Items.Insert(0, new ListItem("Seleccionar", "0"));
                cmb.SelectedIndex = 0;

                ds.Dispose();
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 18
0
    public static void Combo_SubModelos(DropDownList cmb, string cod_marca, string cod_modelo)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OF0"))
            {
                Vehiculo_DB objdb = new Vehiculo_DB();
                DataSet     ds    = objdb.getSubModelos(cnx, cod_marca, cod_modelo);

                cmb.DataSource     = ds;
                cmb.DataTextField  = "NOM_SUB_MODELO";
                cmb.DataValueField = "COD_SUB_MODELO";
                cmb.DataBind();
                cmb.Items.Insert(0, new ListItem("Seleccionar", "0"));
                cmb.SelectedIndex = 0;

                ds.Dispose();
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Esempio n. 19
0
    public static decimal IVA()
    {
        DataRow     diapago     = null;
        Cobranza_DB objcobranza = new Cobranza_DB();

        try
        {
            using (OracleConnection Conexion = MConexion.getConexion("OVDES"))
            {
                diapago = objcobranza.IVA_DB(Conexion);

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

                return(Convert.ToDecimal(diapago["ivas"].ToString(), nfi));
            }
        }

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

        string namefile;
        string namefilePDF;
        string proceso;

        try
        {
            using (OracleConnection cnxOF0 = MConexion.getConexion("OF0"))
            {
                DataRow dr = Emitir_DB.getFileName(cnxOF0, num_poliza);
                namefilePDF = dr["P_NOM_ARCHIVO"].ToString();
                //namefile = namefilePDF.Substring(0, namefilePDF.IndexOf("."));

                System.Threading.Thread.Sleep(6000);

                DataRow drtxt = Emitir_DB.insertaTxt(cnxOF0, "1", "DPATH", namefilePDF + ".TXT");
                proceso = drtxt["p_error"].ToString();

                if (proceso == "0")
                {
                    System.Threading.Thread.Sleep(6000);

                    proceso = Emitir_DB.insertPDF(MConexion.getConexion("OVDES"), "LIS", namefilePDF + ".TXT");

                    System.Threading.Thread.Sleep(6000);

                    if (proceso == "0")
                    {
                        // Se concatena despues de firmado
                        //proceso = ConfigurationManager.AppSettings["Server"] +
                        //          "/pdf/" + namefilePDF + ".PDF";

                        //proceso = namefilePDF + ".PDF";
                        proceso = namefilePDF;

                        //#region Firmando PDF y Generando Link
                        //string lafirmo = ConfigurationManager.AppSettings["McaFirmaPDF"];
                        //if (lafirmo == "S")
                        //{
                        //    bool resp = UtilesWeb.firmaPDFServidor(namefile);
                        //    //System.Threading.Thread.Sleep(5000);
                        //    if (resp)
                        //        proceso = "http://" + ConfigurationManager.AppSettings["Server13"] + "/pdf/" + namefile + "_sign.PDF";
                        //    else
                        //        UtilesWeb.EnviaCorreoAcusete("NO FIRMO RCI :" + namefilePDF, "REVISAR PROCESO FIRMA");
                        //}
                        //#endregion

                        return(proceso);
                    }
                    else
                    {
                        return("ERROR");
                    }
                }
                else
                {
                    return("ERROR");
                }
            }
        }
        catch
        {
            return("ERROR");
        }
    }
    public static string TraePreguntas(bool autoNuevo, string cuota, out List <string> lstPreguntas)
    {
        try
        {
            using (OracleConnection cnx = MConexion.getConexion("OVDES"))
            {
                string html = "";
                PreguntasDeclaracion_DB objdb = new PreguntasDeclaracion_DB();
                DataSet ds = objdb.TraePreguntas_DB(cnx);
                lstPreguntas = new List <string>();
                if (ds.Tables.Count > 0)
                {
                    DataView dv = ds.Tables[0].DefaultView;
                    dv.Sort = "[ID_PREGUNTA] ASC";
                    DataTable dt = dv.ToTable();
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (autoNuevo)
                        {
                            if (dr["ID_PREGUNTA"].ToString() == "1")
                            {
                                lstPreguntas.Add(dr["DESC_PREGUNTA"].ToString());

                                html += "<div class='bloque left lineal' style='width: 69%; margin-top: 15px; margin-bottom: 0;'>";
                                html += "<label class='text' for='patente'>";
                                html += dr["desc_pregunta"].ToString();
                                html += "</label></br>";
                                html += "<span style='float: left; margin: 4px 10px 0 0; padding: 0;'>";
                                html += "<input type='radio' id='Resp" + dr["id_pregunta"].ToString() + "_1' name='p" + dr["id_pregunta"].ToString() + "' onchange=\"preguntas_declaracion_estado(this, '" + dr["respuesta_afirmativa"].ToString() + "', '" + dr["id_pregunta"].ToString() + "', '" + dr["id_pregunta_padre"].ToString() + "') \"/>";
                                html += dr["respuesta_afirmativa"].ToString() + " &nbsp;&nbsp; </span>";
                                html += "<span style='float: left; margin: 4px 10px 0 0; padding: 0;'>";
                                html += "<input type='radio' id='Resp" + dr["id_pregunta"].ToString() + "_2' name='p" + dr["id_pregunta"].ToString() + "' onchange=\"preguntas_declaracion_estado(this, '" + dr["respuesta_negativa"].ToString() + "', '" + dr["id_pregunta"].ToString() + "', '" + dr["id_pregunta_padre"].ToString() + "') \"/>";
                                html += dr["respuesta_negativa"].ToString() + "</span>";
                                html += "</div></br>";
                                break;
                            }
                        }
                        else
                        {
                            if (dr["ID_PREGUNTA"].ToString() != "4")
                            {
                                lstPreguntas.Add(dr["DESC_PREGUNTA"].ToString());
                            }
                            else
                            {
                                lstPreguntas.Add(dr["DESC_PREGUNTA"].ToString() + cuota);
                            }

                            html += "<div class='bloque left lineal' style='width: 69%; margin-top: 15px; margin-bottom: 0;'>";
                            html += "<label class='text' for='patente'>";
                            if (dr["ID_PREGUNTA"].ToString() != "4")
                            {
                                html += dr["DESC_PREGUNTA"].ToString();
                            }
                            else
                            {
                                html += dr["DESC_PREGUNTA"].ToString() + cuota;
                            }
                            html += "</label></br>";
                            html += "<span style='float: left; margin: 4px 10px 0 0; padding: 0;'>";
                            if (dr["ID_PREGUNTA"].ToString() == "1")
                            {
                                html += "<input type='radio'  id='Resp" + dr["ID_PREGUNTA"].ToString() + "_1' name='P" + dr["ID_PREGUNTA"].ToString() + "' onchange=\"preguntas_declaracion_estado(this, '" + dr["RESPUESTA_AFIRMATIVA"].ToString() + "', '" + dr["ID_PREGUNTA"].ToString() + "', '" + dr["ID_PREGUNTA_PADRE"].ToString() + "') \"/>";
                            }
                            else
                            {
                                html += "<input disabled type='radio'  id='Resp" + dr["ID_PREGUNTA"].ToString() + "_1' name='P" + dr["ID_PREGUNTA"].ToString() + "' onchange=\"preguntas_declaracion_estado(this, '" + dr["RESPUESTA_AFIRMATIVA"].ToString() + "', '" + dr["ID_PREGUNTA"].ToString() + "', '" + dr["ID_PREGUNTA_PADRE"].ToString() + "') \"/>";
                            }
                            //html += "</span>";
                            //html += "<span>" + dr["RESPUESTA_AFIRMATIVA"].ToString() + " &nbsp;&nbsp; </span>";
                            html += dr["RESPUESTA_AFIRMATIVA"].ToString() + " &nbsp;&nbsp; </span>";
                            html += "<span style='float: left; margin: 4px 10px 0 0; padding: 0;'>";
                            if (dr["ID_PREGUNTA"].ToString() == "1")
                            {
                                html += "<input type='radio'  id='Resp" + dr["ID_PREGUNTA"].ToString() + "_2' name='P" + dr["ID_PREGUNTA"].ToString() + "' onchange=\"preguntas_declaracion_estado(this, '" + dr["RESPUESTA_NEGATIVA"].ToString() + "', '" + dr["ID_PREGUNTA"].ToString() + "', '" + dr["ID_PREGUNTA_PADRE"].ToString() + "') \"/>";
                            }
                            else
                            {
                                html += "<input disabled type='radio'  id='Resp" + dr["ID_PREGUNTA"].ToString() + "_2' name='P" + dr["ID_PREGUNTA"].ToString() + "' onchange=\"preguntas_declaracion_estado(this, '" + dr["RESPUESTA_NEGATIVA"].ToString() + "', '" + dr["ID_PREGUNTA"].ToString() + "', '" + dr["ID_PREGUNTA_PADRE"].ToString() + "') \"/>";
                            }
                            //html += "</span>";
                            html += dr["RESPUESTA_NEGATIVA"].ToString() + "</span>";
                            html += "</div></br>";
                        }
                    }
                }

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