Ejemplo n.º 1
0
        protected void Editar_Click(object sender, EventArgs e)
        {
            GridViewRow row;
            string      rut_participe;
            string      tipo;
            string      ciudad_notario;
            string      notario_publico;
            string      fecha_personeria;

            string del = new ParticipanteBC().del_participe(Convert.ToDouble(rut_persona));

            for (int i = 0; i < gr_dato.Rows.Count; i++)
            {
                row = gr_dato.Rows[i];

                tipo             = (string)row.Cells[2].Text;
                ciudad_notario   = (string)row.Cells[4].Text;
                notario_publico  = (string)row.Cells[5].Text;
                fecha_personeria = (string)row.Cells[6].Text;
                rut_participe    = (string)row.Cells[0].Text;
                CheckBox chk = (CheckBox)gr_dato.Rows[i].FindControl("chk");

                string add = new ParticipanteBC().add_participe(Convert.ToDouble(rut_persona), Convert.ToDouble(rut_participe), tipo, chk.Checked, ciudad_notario, notario_publico, Convert.ToDateTime(fecha_personeria));
            }
        }
Ejemplo n.º 2
0
        private void add_persona()
        {
            //string persona = new PersonaBC().add_persona(Convert.ToDouble(this.txt_rut.Text),
            //                                                this.txt_dv.Text,
            //                                                Convert.ToInt16(this.dl_comuna.SelectedValue),
            //                                                   "",
            //                                                   this.txt_nombre.Text,
            //                                                   this.txt_paterno.Text,
            //                                                   this.txt_materno.Text,
            //                                                   "0",
            //                                                   "0",
            //                                                   "",
            //                                                   "",
            //                                                   "0",
            //                                                   this.txt_telefono.Text,
            //                                                   "",
            //                                                   "",
            //                                                   this.txt_direccion.Text,
            //                                                   this.txt_numero.Text,
            //                                                   this.txt_depto.Text,
            //                                                   "0");
            string   rupart    = "";
            DateTime direccion = Convert.ToDateTime("1991/01/01");

            if (this.DatosParticipante.Guardar_Form())
            {
                if (this.DatosParticipante.InfoPersona != null)
                {
                    rupart = this.DatosParticipante.InfoPersona.Rut.ToString();
                }
            }

            Direcciones mdirec = new DireccionesBC().getDireccionPorDefecto(Convert.ToInt32(rupart));
            UpdatePanel up     = (UpdatePanel)this.Master.FindControl("UpdatePanel1");

            if (mdirec == null)
            {
                FuncionGlobal.alerta_updatepanel("Debe ingresar la direccion", Page, up);
                return;
            }
            if (this.txt_fecha.Text != "")
            {
                direccion = Convert.ToDateTime(this.txt_fecha.Text);
            }

            if (rupart != "")

            {
                string participe = new ParticipanteBC().add_participe(Convert.ToDouble(rut_persona),
                                                                      Convert.ToDouble(rupart),
                                                                      this.dl_tipo.SelectedValue,
                                                                      this.chk_firma.Checked,
                                                                      this.txt_ciudad_n.Text,
                                                                      this.txt_notario.Text,
                                                                      direccion);
            }
        }
Ejemplo n.º 3
0
        public int InsertarParticipanteAdultoUnico(ParticipanteBE objParticipanteBE)
        {
            int            codigoParticipante = 0;
            ParticipanteBC objParticipanteBC  = new ParticipanteBC();

            try
            {
                codigoParticipante = objParticipanteBC.InsertarParticipanteAdulto(objParticipanteBE);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(codigoParticipante);
        }
Ejemplo n.º 4
0
        public bool InsertarParticipante(List <ParticipanteBE> lstParticipantes)
        {
            ParticipanteBC objParticipanteBC = new ParticipanteBC();
            bool           resultado;

            try
            {
                resultado = objParticipanteBC.InsertarParticipante(lstParticipantes);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(resultado);
        }
Ejemplo n.º 5
0
        public void GetParticipantes()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("rut_participe"));
            dt.Columns.Add(new DataColumn("nombre"));
            dt.Columns.Add(new DataColumn("tipo"));
            dt.Columns.Add(new DataColumn("ciudad_notario"));
            dt.Columns.Add(new DataColumn("notario_publico"));
            dt.Columns.Add(new DataColumn("fecha_participante"));

            DataColumn col = new DataColumn("check");

            col.DataType = System.Type.GetType("System.Boolean");

            dt.Columns.Add(col);


            List <Participante> lparticipe = new ParticipanteBC().Getparticipante(Convert.ToDouble(rut_persona));



            foreach (Participante mparticipe in lparticipe)
            {
                DataRow dr = dt.NewRow();


                dr["rut_participe"]      = mparticipe.Participe.Rut;
                dr["nombre"]             = mparticipe.Participe.Nombre + " " + mparticipe.Participe.Apellido_paterno + " " + mparticipe.Participe.Apellido_materno;
                dr["tipo"]               = mparticipe.Tipo;
                dr["check"]              = mparticipe.Firma;
                dr["ciudad_notario"]     = mparticipe.Ciudad_notario;
                dr["notario_publico"]    = mparticipe.Notario_publico;
                dr["fecha_participante"] = string.Format("{0:dd/MM/yyyy}", mparticipe.Fecha_participante);

                dt.Rows.Add(dr);
            }

            this.gr_dato.DataSource = dt;
            this.gr_dato.DataBind();
            Carga_Link();
        }
Ejemplo n.º 6
0
        private bool Guardar_Form()
        {
            string output = "";

            if (!this.agp_persona.Guardar_Form())
            {
                output = this.agp_persona.MensajeError;
                ScriptManager.RegisterStartupScript(this.up_control, this.up_control.GetType(), "ErrorPersona", "alert('Ha ocurrido un error al guardar los datos del representante:\\n\\n" + output + "');", true);
                return(false);
            }

            output = new ParticipanteBC().add_participe(Convert.ToDouble(this.Rut), this.agp_persona.Rut, this.dl_tipo.SelectedValue, this.chk_firma.Checked, this.txt_ciudad.Text, this.txt_notario.Text, Convert.ToDateTime(this.txt_fecha.Text));
            if (output != "")
            {
                ScriptManager.RegisterStartupScript(this.up_control, this.up_control.GetType(), "ErrorPersona", "alert('Ha ocurrido un error al guardar los datos del representante:\\n\\n" + output + "');", true);
                return(false);
            }
            this.On_Cambio_Representantes(new EventArgs());
            return(true);
        }
Ejemplo n.º 7
0
        public string DevolverParticipanteAdulto(string id, string token)
        {
            ParticipanteBC objParticipanteBC = new ParticipanteBC();
            bool           existe            = false;

            try
            {
                if (id.Substring(0, 1).Equals("0"))
                {
                    return("");
                }

                long entero     = 0;
                bool canConvert = long.TryParse(id, out entero);

                if (canConvert == false)
                {
                    return("");
                }
            }

            catch (Exception)
            {
                return("");
            }

            try
            {
                existe = objParticipanteBC.VerificaParticipanteAdultoActivo(id);
            }
            catch (Exception ex)
            {
                LogBC  objLogBC = new LogBC();
                string mensaje  = "Metodo: DevolverParticipanteAdulto (Verificar Existencia Participante). Mensaje: " + ex.Message;
                objLogBC.InsertarLog(mensaje);

                return("");
            }

            if (existe)
            {
                string vacio = "";
                return(vacio);
            }
            else
            {
                string json = "";
                // hosting: sdch-upc.davidfischman.com
                // produccion: 66.135.63.156
                string url = ConfigurationManager.AppSettings["JSON_PERSONA_ADULTO"] + id + "/person?token=" + token;
                try
                {
                    var syncClient = new WebClient();
                    json = syncClient.DownloadString(url);
                }
                catch (Exception ex)
                {
                    LogBC  objLogBC = new LogBC();
                    string mensaje  = "Metodo: DevolverParticipante. Mensaje: " + ex.Message;
                    objLogBC.InsertarLog(mensaje);

                    return("");
                }

                return(json);
            }
        }
Ejemplo n.º 8
0
        public bool EnviarEmail(List <ParticipanteBE> lstParticipantes)
        {
            ParticipanteBC objParticipanteBC = new ParticipanteBC();

            return(objParticipanteBC.EnviarEmail(lstParticipantes));
        }
Ejemplo n.º 9
0
        public List <ParticipanteBE> ListarParticipantesMasivos()
        {
            ParticipanteBC objParticipanteBC = new ParticipanteBC();

            return(objParticipanteBC.ListarParticipantesMasivos());
        }
Ejemplo n.º 10
0
        protected void bt_guardar_Click(object sender, EventArgs e)
        {
            UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1");

            if (tipo_operacion == "CVT" || tipo_operacion == "CCV")
            {
                Correo mcorreo = new CorreoBC().getCorreoPorDefecto(Convert.ToInt32(this.Datoscomprador.getRut().ToString()));

                if (mcorreo == null)
                {
                    FuncionGlobal.alerta_updatepanel(
                        "Vendedor: En esta venta debe ingresar el correo del Comprador, o ingresar su correo Personal",
                        Page, up);
                    return;
                }
            }

            if (!this.chk_leasing.Checked)
            {
                if (this.txt_patente.Text.Trim() == "")
                {
                    FuncionGlobal.alerta_updatepanel("Debe ingresar la patente", Page, up);
                    return;
                }
            }

            if (this.dl_sucursal_origen.SelectedValue == "0")
            {
                FuncionGlobal.alerta_updatepanel("Ingrese la Sucursal de origen", Page, up);
                return;
            }


            double rut_vendedor = this.Datosvendedor.getRut();

            List <Direcciones> ldireccion_vendedor = new DireccionesBC().getdirecciones(Convert.ToInt32(rut_vendedor));

            if (ldireccion_vendedor.Count == 0)
            {
                FuncionGlobal.alerta_updatepanel("El Vendedor no tiene direccion", Page, up);
                return;
            }
            else
            {
                if (chk_leasing.Checked == true)
                {
                    if (tipo_operacion == "CTC")
                    {
                        double rut = this.Datosvendedor.getRut();
                        List <Participante> lparticipantes = new ParticipanteBC().Getparticipante(rut);
                        if (lparticipantes.Count > 0)
                        {
                            add();
                        }
                        else
                        {
                            FuncionGlobal.alerta_updatepanel("El vendedor no tiene participantes", Page, up);
                            return;
                        }
                    }
                    else
                    {
                        double rut = this.Datosvendedor.getRut();
                        List <Participante> lparticipantes = new ParticipanteBC().Getparticipante(rut);
                        double rut2 = this.Datoscomprador.getRut();
                        List <Participante> lparticipantes2 = new ParticipanteBC().Getparticipante(rut2);
                        if (lparticipantes.Count > 0 && lparticipantes2.Count >= 0)
                        {
                            add();
                        }
                        else
                        {
                            FuncionGlobal.alerta_updatepanel("Faltan Participantes", Page, up);
                            return;
                        }
                    }
                }
                else
                {
                    if (this.txt_kilometraje.Text == "")
                    {
                        FuncionGlobal.alerta_updatepanel("Debe ingresar el kilometraje", Page, up);
                        return;
                    }
                    if (this.lbl_codigo.Text == "")// modificar a
                    {
                        FuncionGlobal.alerta_updatepanel("Ingrese el codigo de Servicio Impuestos Internos", Page, up);
                        return;
                    }
                    else
                    {
                        if (this.txt_precio.Text == "")
                        {
                            FuncionGlobal.alerta_updatepanel("Ingrese el precio del vehiculo", Page, up);
                            return;
                        }
                        else
                        {
                            double rut = this.Datosvendedor.getRut();
                            List <Participante> lparticipantes = new ParticipanteBC().Getparticipante(rut);

                            double rut2 = this.Datoscomprador.getRut();
                            List <Participante> lparticipantes2 = new ParticipanteBC().Getparticipante(rut2);

                            List <Direcciones> ldireccion = new DireccionesBC().getdirecciones(Convert.ToInt32(rut2));

                            List <Correo> lcorreo = new CorreoBC().getcorreos(Convert.ToInt32(rut2));

                            if (tipo_operacion != "CTC" && tipo_operacion != "CTMAG")
                            {
                                if (this.Datoscomprador.getRut() >= 50000000)
                                {
                                    if (lparticipantes2.Count == 0)
                                    {
                                        FuncionGlobal.alerta_updatepanel("El comprador no tiene Representantes", Page, up);
                                        return;
                                    }
                                }


                                if (id_cliente == 3 || id_cliente == 4)
                                {
                                    if (lcorreo.Count == 0)
                                    {
                                        FuncionGlobal.alerta_updatepanel("No ingreso correo electronico para el comprador", Page, up);
                                        return;
                                    }
                                }

                                if (ldireccion.Count == 0)
                                {
                                    FuncionGlobal.alerta_updatepanel("El comprador no tiene direccion", Page, up);
                                    return;
                                }
                            }
                            if (this.Datosvendedor.getRut() >= 50000000)
                            {
                                if (lparticipantes.Count == 0)
                                {
                                    FuncionGlobal.alerta_updatepanel("El vendedor no tiene Representantes", Page, up);
                                    return;
                                }
                            }



                            add();
                        }
                    }
                }
            }
        }