Beispiel #1
0
        private void getdireccion()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("id_direccion"));
            dt.Columns.Add(new DataColumn("tipo_direccion"));
            dt.Columns.Add(new DataColumn("direccion"));
            dt.Columns.Add(new DataColumn("numero"));
            dt.Columns.Add(new DataColumn("comuna"));
            dt.Columns.Add(new DataColumn("Complemento"));
            DataColumn col = new DataColumn("check");

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

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

            foreach (Direcciones mdireccion in ldireccion)
            {
                DataRow dr = dt.NewRow();

                dr["id_direccion"]   = mdireccion.Id_direccion;
                dr["tipo_direccion"] = mdireccion.Tipo_direccion;
                dr["direccion"]      = mdireccion.Direccion;
                dr["numero"]         = mdireccion.Numero;
                dr["comuna"]         = mdireccion.Comuna.Nombre;
                dr["complemento"]    = mdireccion.Complemento;
                dr["check"]          = mdireccion.Check;
                dt.Rows.Add(dr);
            }

            this.gr_dato.DataSource = dt;
            this.gr_dato.DataBind();
        }
Beispiel #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);
            }
        }
Beispiel #3
0
        protected void GuardarForm()
        {
            string output = new DireccionesBC().add_direcciones(this.Rut, this.txt_direccion.Text.Trim().ToUpper(), this.dl_tipo_direccion.SelectedValue.Trim(), this.txt_numero.Text.Trim().ToUpper(), Convert.ToInt32(this.dl_comuna.SelectedValue), this.txt_complemento.Text.Trim().ToUpper(), Convert.ToInt32(this.hdn_id_direccion.Value));

            if (output != "")
            {
                ScriptManager.RegisterStartupScript(this.up_control, this.up_control.GetType(), "ErrorPersona", "alert('Ha ocurrido un error al guardar los datos de la dirección:\\n\\n" + output + "');", true);
                return;
            }
            this.Guardar_Direccion(new EventArgs());
        }
Beispiel #4
0
        protected void chk_prioridad_CheckedChanged(object sender, EventArgs e)
        {
            int index = ((GridViewRow)((CheckBox)sender).Parent.Parent).RowIndex;

            for (int i = 0; i < this.gr_datos.Rows.Count; i++)
            {
                int      id_direccion = Convert.ToInt32(this.gr_datos.DataKeys[i].Values[0]);
                CheckBox chk          = (CheckBox)this.gr_datos.Rows[i].FindControl("chk_prioridad");
                chk.Checked = (index == i) ? true : false;
                chk.Enabled = (index == i) ? false : true;
                string output = new DireccionesBC().act_checkDireccion(id_direccion, chk.Checked.ToString());
            }
            this.Cambio_Direccion(new EventArgs());
        }
Beispiel #5
0
        protected void txt_rut_TextChanged(object sender, EventArgs e)
        {
            if (txt_rut.Text != "")
            {
                txt_dv.Text = digitoVerificador(txt_rut.Text);
            }
            Persona person = new PersonaBC().getpersonabyrut(Convert.ToInt32(txt_rut.Text.Trim()));

            if (person != null)
            {
                txtNombre.Text    = person.Nombre;
                txtApellidoP.Text = person.Apellido_paterno;
                txtApellidoM.Text = person.Apellido_materno;

                txt_celular.Text = person.Celular;

                List <Telefonos> telper = new TelefonoBC().gettelefonos(Convert.ToInt32(person.Rut));

                foreach (Telefonos item in telper)
                {
                    if (item.Tipo_telefono == "TCEL")
                    {
                        txt_celular.Text = item.Numero.ToString();
                    }
                    if (item.Tipo_telefono == "TOFI")
                    {
                        txt_telefono.Text = item.Numero.ToString();
                    }
                }

                Direcciones dirper = new DireccionesBC().getDireccionPorDefecto(Convert.ToInt32(person.Rut));



                if (dirper != null)
                {
                    txt_numeriDir.Text = dirper.Numero;
                    txtdireccion.Text  = dirper.Direccion;

                    Comuna compers = new ComunaBC().getComuna(Convert.ToInt16(dirper.Comuna.Id_Comuna));
                    cboComuna.SelectedValue = compers.Id_Comuna.ToString();
                }
            }
            else
            {
                txtNombre.Focus();
            }
        }
Beispiel #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.txt_direcion.Text == "" | this.dl_comuna.SelectedValue == "0" | this.dl_tipo_direccion.SelectedValue == "0")
            {
                FuncionGlobal.alerta("INGRESE LOS DATOS CORRESPONDIENTES", Page);
                return;
            }

            string add = new DireccionesBC().add_direcciones(Convert.ToInt32(lbl_rut.Text), this.txt_direcion.Text, this.dl_tipo_direccion.SelectedValue.ToString(), this.txt_numero.Text, Convert.ToInt32(this.dl_comuna.SelectedValue.ToString()), this.txt_complemento.Text.ToString(), 0);

            FuncionGlobal.alerta("DIRECCION INGRESADA CON EXITO", Page);
            this.txt_direcion.Text = "";
            this.txt_numero.Text   = "";

            getdireccion();
        }
Beispiel #7
0
        protected void Busca_Direcciones(int rut)
        {
            //var query = (from d in new DireccionesBC().getdirecciones(rut)
            //             join p in new ParametroBC().GetParametroByTipoParametro("TDIR") on d.Tipo_direccion equals p.Codigoparametro
            //             where Convert.ToBoolean(d.Check) == true
            //             orderby d.Id_direccion ascending
            //             select new
            //             {
            //                 tipoDireccion = p.Valoralfanumerico.ToUpper().Trim(),
            //                 direccion = d.Direccion.ToUpper().Trim(),
            //                 numero = d.Numero.ToUpper().Trim(),
            //                 complemento = d.Complemento.ToUpper().Trim(),
            //                 ciudad = d.Comuna.Ciudad.Region.Capital.ToUpper().Trim(),
            //                 comuna = d.Comuna.Nombre.ToUpper().Trim()
            //             }).FirstOrDefault();

            Direcciones query = new DireccionesBC().getDireccionPorDefecto(rut);


            if (query != null)
            {
                if (this.lbl_tipo_direccion != null)
                {
                    this.lbl_tipo_direccion.Text = query.Tipo_direccion;
                }
                if (this.lbl_direccion != null)
                {
                    this.lbl_direccion.Text = query.Direccion;
                }
                if (this.lbl_numero != null)
                {
                    this.lbl_numero.Text = query.Numero;
                }
                if (this.lbl_complemento != null)
                {
                    this.lbl_complemento.Text = query.Complemento;
                }
                //if (this.lbl_ciudad != null) this.lbl_ciudad.Text = query.c;
                if (query.Comuna != null)
                {
                    if (this.lbl_comuna != null)
                    {
                        this.lbl_comuna.Text = query.Comuna.Nombre.ToString();
                    }
                }
            }
        }
Beispiel #8
0
        public void actualizar()
        {
            GridViewRow row;

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

                string id_direccion = this.gr_dato.Rows[i].Cells[0].Text;

                string add = new DireccionesBC().act_checkDireccion(Convert.ToInt32(id_direccion), chk.Checked.ToString());

                FuncionGlobal.alerta("PRIORIDAD ACTUALIZADA CON EXITO", Page);
            }
            getdireccion();
        }
Beispiel #9
0
        private void add_persona()
        {
            string rupart = "";

            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.Id_direccion == 0)
            {
                FuncionGlobal.alerta_updatepanel("Debe ingresar la direccion", Page, up);
                return;
            }

            add_gr_dato();
        }
Beispiel #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();
                        }
                    }
                }
            }
        }
Beispiel #11
0
        private void add()
        {
            string rutcomp        = "0";
            string rutvend        = "0";
            string rutcompp       = "0";
            string financiamiento = "0";


            UpdatePanel        up         = (UpdatePanel)this.Master.FindControl("UpdatePanel1");
            double             rut2       = this.Datoscomprador.getRut();
            List <Direcciones> ldireccion = new DireccionesBC().getdirecciones(Convert.ToInt32(rut2));

            if (this.dl_forma_pago.SelectedValue == "2" & this.dl_financiera.SelectedValue == "0")
            {
                FuncionGlobal.alerta_updatepanel("Debe seleccionar un banco o financiera", Page, up);
                return;
            }

            if (id_cliente == 3 || id_cliente == 4)
            {
                if (tipo_operacion == "CVT")
                {
                    if (this.dl_forma_pago.SelectedValue == "0")
                    {
                        FuncionGlobal.alerta_updatepanel("Debe seleccionar forma de pago", Page, up);
                        return;
                    }
                }
            }



            if (vent == "CTC" || vent == "CTMAG")
            {
                Cliente mcliente = new ClienteBC().getclienteusuario(this.Datoscomprador.getRut(), (string)(Session["usrname"]));
                if (vent == "CTC" && mcliente.Check == true || vent == "CTMAG" && mcliente.Check == true)
                {
                    tipo_operacion = "CTM";
                }
                else
                {
                    if (vent == "CTC")
                    {
                        tipo_operacion = "CCV";
                    }
                    else
                    {
                        tipo_operacion = "CVEN";
                    }
                    if (ldireccion.Count == 0)
                    {
                        FuncionGlobal.alerta_updatepanel("El comprador no tiene direccion", Page, up);
                        return;
                    }
                }
            }

            if (tipo_operacion != "CTC" || tipo_operacion != "CTMAG")
            {
                if (this.Datoscomprador.Guardar_Form())
                {
                    if (this.Datoscomprador.InfoPersona != null)
                    {
                        rutcomp = this.Datoscomprador.InfoPersona.Rut.ToString();
                    }
                }
            }
            if (this.Datosvendedor.Guardar_Form())
            {
                if (this.Datosvendedor.InfoPersona != null)
                {
                    rutvend = this.Datosvendedor.InfoPersona.Rut.ToString();
                }
            }

            if (this.agpCompraPara.Guardar_Form())
            {
                if (this.agpCompraPara.InfoPersona != null)
                {
                    rutcompp = this.agpCompraPara.InfoPersona.Rut.ToString();
                }
            }

            int factura = 0;

            if (this.txtNumFactura.Text != "")
            {
                factura = Convert.ToInt32(txtNumFactura.Text);
            }

            Int32 add = new OperacionBC().add_operacion(Convert.ToInt32(this.lbl_numero.Text),
                                                        Convert.ToInt16(this.dl_cliente.SelectedValue), tipo_operacion,
                                                        (string)(Session["usrname"]), 0, this.txt_numero_emisor.Text.Trim(),
                                                        Convert.ToInt32(this.dl_sucursal_origen.SelectedValue), factura);

            if (tipo_operacion != "CVT")
            {
                this.id_solicitud = Convert.ToInt32(this.lbl_numero.Text);
            }
            else
            {
                if (this.lbl_numero.Visible == true)
                {
                    this.id_solicitud = Convert.ToInt32(this.lbl_numero.Text);
                }
            }

            if (chk_leasing.Checked == true)
            {
                string leasing = new Leasing_transferenciaBC().add_leasing(add,
                                                                           this.txt_patente.Text.Trim(),
                                                                           Convert.ToInt32(this.txt_n_contrato.Text),
                                                                           Convert.ToDateTime(this.txt_fecha_contrato.Text),
                                                                           Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_valor_opcion.Text)),
                                                                           Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_valor_cesion.Text)),
                                                                           Convert.ToInt32(this.txt_n_vehiculos.Text));
            }
            DatosVehiculo mdato = new DatosvehiculoBC().getDatovehiculobyPatente_id_solicitud(this.txt_patente.Text.Trim(), id_solicitud);
            //DatosVehiculo mdato = new DatosvehiculoBC().getDatovehiculobypatente(this.txt_patente.Text);

            Marcavehiculo marca            = new MarcavehiculoBC().getmarcavehiculo(69);
            Tipovehiculo  tipvehi          = new TipovehiculoBC().getTipoVehiculo("PDF");
            Int32         id_dato_vehiculo = 0;
            Int32         rut_prenda       = 0;

            if (mdato != null && id_solicitud != 0)
            {
                if (vent == "CTM")
                {
                    marca            = mdato.Marca;
                    tipvehi          = mdato.Tipo_vehiculo;
                    id_dato_vehiculo = 0;
                }
                else
                {
                    rut_prenda       = mdato.Rut_prenda;
                    id_dato_vehiculo = mdato.Id_dato_vehiculo;
                    marca            = mdato.Marca;
                    tipvehi          = mdato.Tipo_vehiculo;
                }
            }

            DatosVehiculo mdato2;

            if (id_dato_vehiculo != 0)
            {
                mdato2 = new DatosvehiculoBC().getDatovehiculobyPatente_id_solicitud(this.txt_patente.Text.Trim(), id_solicitud);
            }
            else
            {
                mdato2 = new DatosvehiculoBC().getDatovehiculobypatente(this.txt_patente.Text);
            }
            if (mdato2 != null)
            {
                string datovehi = new DatosvehiculoBC().add_Datosvehiculo(add,
                                                                          mdato2.Marca,
                                                                          mdato2.Tipo_vehiculo,
                                                                          txt_patente.Text,
                                                                          FuncionGlobal.digitoVerificadorPatente(txt_patente.Text),
                                                                          mdato2.Modelo, mdato2.Chassis, mdato2.Motor, mdato2.Vin, mdato2.Serie, Convert.ToInt32(mdato2.Ano), "", mdato2.Color, 0, 0, "", 0, 0,
                                                                          Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_kilometraje.Text)),
                                                                          Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_tasacion.Text)),
                                                                          lbl_codigo.Text, Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_precio.Text)),
                                                                          Convert.ToInt32(id_dato_vehiculo), DateTime.Now, "", "false", "", 0, financiamiento, mdato2.Transmision, mdato2.Equipamiento);
            }
            else
            {
                if (this.dl_marca_vehiculo.SelectedValue != "0")
                {
                    marca = new MarcavehiculoBC().getmarcavehiculo(Convert.ToInt16(this.dl_marca_vehiculo.SelectedValue));
                }
                if (this.dl_tipo_vehiculo.SelectedValue != "0")
                {
                    tipvehi = new TipovehiculoBC().getTipoVehiculo(this.dl_tipo_vehiculo.SelectedValue);
                }

                string datovehi = new DatosvehiculoBC().add_Datosvehiculo(add,
                                                                          marca,
                                                                          tipvehi,
                                                                          txt_patente.Text,
                                                                          FuncionGlobal.digitoVerificadorPatente(txt_patente.Text),
                                                                          this.txt_modelo.Text, this.txt_chassis.Text, this.txt_motor.Text, "", "", Convert.ToInt32(this.txt_anno.Text), "", this.txt_color.Text, 0, Convert.ToInt32(this.txt_p_bruto.Text), this.dl_combustible.SelectedValue, 0, 0,
                                                                          Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_kilometraje.Text)),
                                                                          Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_tasacion.Text)),
                                                                          lbl_codigo.Text, Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_precio.Text)), id_dato_vehiculo, DateTime.Now,
                                                                          "", "false", "", 0, financiamiento.Trim(), this.dl_financiera.SelectedValue, "0", "0");
            }
            if (vent == "")
            {
                DatosVehiculo vehicu = new DatosvehiculoBC().getDatovehiculobyPatente_id_solicitud(this.txt_patente.Text, add);
                if (tipo_operacion == "CTMAG")
                {
                    string add_stock = new StockVentasBC().add_sotckventas(add, 0, "false", vehicu.Id_dato_vehiculo, false);
                }
                else
                {
                    string add_stock = new StockVentasBC().add_sotckventas(add, 0, "false", vehicu.Id_dato_vehiculo, true);
                }
            }
            else
            {
                DatosVehiculo vehicu = new DatosvehiculoBC().getDatovehiculo(id_solicitud);
                if (vent == "CTC" || vent == "CTMAG")
                {
                    Cliente mcliente = new ClienteBC().getclienteusuario(this.Datoscomprador.InfoPersona.Rut, (string)(Session["usrname"]));
                    if (vent == "CTC" && mcliente.Check == true || vent == "CTMAG")
                    {
                        string add_stock = new StockVentasBC().add_sotckventas(id_solicitud, add, "false", vehicu.Id_dato_vehiculo, true);
                    }
                    else
                    {
                        string add_stock = new StockVentasBC().add_sotckventas(id_solicitud, add, "true", vehicu.Id_dato_vehiculo, true);
                    }
                }
                else
                {
                    string add_stock = new StockVentasBC().add_sotckventas(id_solicitud, add, "true", vehicu.Id_dato_vehiculo, true);
                }
            }

            if (add != 0)
            {
                string add_TR = new TransferenciaBC().add_Transferencia(add,
                                                                        Convert.ToDouble(rutvend),
                                                                        Convert.ToDouble(rutcomp),
                                                                        Convert.ToDouble(rutcompp),
                                                                        Convert.ToInt32(this.dl_sucursal_origen.SelectedValue),
                                                                        this.dl_tag.SelectedValue,
                                                                        this.dl_financiera.SelectedValue,
                                                                        this.dl_forma_pago.SelectedValue
                                                                        );



                if (add_TR == "" && vent != "CTC" || vent != "CTMAG")
                {
                    string add_or = new EstadooperacionBC().add_estado_orden(Convert.ToInt32(add), 1, tipo_operacion, "", (string)(Session["usrname"]));
                }
            }



            this.lbl_operacion.Visible = true;
            this.lbl_numero.Visible    = true;
            this.lbl_operacion.Text    = "Operación de Transferencia Numero:";
            this.lbl_numero.Text       = Convert.ToString(add);

            FuncionGlobal.alerta("CONTRATO DE TRANSFERENCIA, INGRESADO CON EXITO", Page);
        }
Beispiel #12
0
        protected void bt_guardar_Click(object sender, EventArgs e)
        {
            lblerror2.Text = "";
            if (rdbtipodir.SelectedIndex == -1)
            {
                lblerror2.Visible = true;
                lblerror2.Text    = "Debe seleccionar un tipo de direccion";
            }
            else
            {
                UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1");


                if (txt_celular.Text != "")
                {
                    string celupers = new TelefonoBC().add_telefonos(Convert.ToInt32(txt_rut.Text), "TCEL", Convert.ToInt32(this.txt_celular.Text), 0);
                }


                if (txt_telefono.Text != "")
                {
                    string telefonopers = new TelefonoBC().add_telefonos(Convert.ToInt32(txt_rut.Text), "TOFI", Convert.ToInt32(this.txt_telefono.Text), 0);
                }

                string pers    = new PersonaBC().add_persona(Convert.ToInt32(txt_rut.Text), txt_dv.Text.Trim(), 2, "", txtNombre.Text, txtApellidoP.Text, txtApellidoM.Text, "0", "0", "", "", "", txt_telefono.Text, "", "", txtdireccion.Text, "0", rdbtipodir.SelectedValue, "", giro);
                string dirpers = new DireccionesBC().add_direcciones(Convert.ToInt32(txt_rut.Text), this.txtdireccion.Text, rdbtipodir.SelectedValue, this.txt_numeriDir.Text, Convert.ToInt32(cboComuna.SelectedValue), "", 0);

                switch (lbl_Oper_Tipo.Text)
                {
                //case "C":
                //    string magenda = new AgendaBC().del_agenda(Convert.ToInt32(lbl_Oper_ID.Text));
                //    string add_esta = new EstadooperacionBC().add_estado_orden(Convert.ToInt16(lbl_Oper_ID.Text), 60, "AGND", txt_obs.Text, (string)(Session["usrname"]));
                //    FuncionGlobal.alerta_updatepanel("Operacion " + lbl_Oper_ID.Text + " guardada correctamente", Page, up);

                //    mensajeOper(7, lbl_Oper_ID.Text);

                //    break;
                case "R":
                    if (cbo_EjeCom.SelectedValue != "0")
                    {
                        lblerror2.Text       = "";
                        cbo_EjeCom.BackColor = System.Drawing.Color.White;
                        Int32  rut     = Convert.ToInt32(txt_rut.Text);
                        string add     = new AgendaBC().add_agenda(Convert.ToInt32(lbl_Oper_ID.Text), Convert.ToDateTime(lbl_Oper_Fecha.Text), lbl_Oper_Hora.Text, rut, (string)(Session["usrname"]), cbo_EjeCom.SelectedValue, cbo_tipoagenda.SelectedValue, dl_Usuarios.SelectedValue.Trim());
                        string add_est = new EstadooperacionBC().add_estado_orden(Convert.ToInt32(lbl_Oper_ID.Text), 80, "AGND", txt_obs.Text, (string)(Session["usrname"]));
                    }
                    else
                    {
                        lblerror2.Text       = "debe Seleccionar un Ejecutivo Comercial";
                        cbo_EjeCom.BackColor = System.Drawing.Color.Yellow;
                        cbo_EjeCom.Focus();
                        return;
                    }
                    break;

                case "T":
                    if (cbo_EjeCom.SelectedValue != "0")
                    {
                        lblerror2.Text       = "";
                        cbo_EjeCom.BackColor = System.Drawing.Color.White;
                        Int32  opr           = new OperacionBC().add_operacion(0, Convert.ToInt16(lbl_Oper_IDCli.Text), "AGND", (string)(Session["usrname"]), 0, "", 0, 0);
                        string add_operacion = new AgendaBC().add_agenda(Convert.ToInt32(opr), Convert.ToDateTime(lbl_Oper_Fecha.Text), lbl_Oper_Hora.Text, Convert.ToInt32(txt_rut.Text), (string)(Session["usrname"]), cbo_EjeCom.SelectedValue, cbo_tipoagenda.SelectedValue, dl_Usuarios.SelectedValue.Trim());
                        string add_or        = new EstadooperacionBC().add_estado_orden(Convert.ToInt32(opr), 10, "AGND", txt_obs.Text, (string)(Session["usrname"]));

                        foreach (GridViewRow row in grdAddCreditos.Rows)
                        {
                            string idref  = row.Cells[0].Text;
                            string addBCA = new MasterBCABC().add_MasterBCA(opr, idref, 0);
                        }
                        mensajeOper(1, opr.ToString());
                        FuncionGlobal.alerta_updatepanel("Operacion " + opr + " guardada correctamente", Page, up);
                    }
                    else
                    {
                        lblerror2.Text       = "debe Seleccionar un Ejecutivo Comercial";
                        cbo_EjeCom.BackColor = System.Drawing.Color.Yellow;
                        cbo_EjeCom.Focus();
                        return;
                    }
                    break;
                }

                bt_guardar.Enabled = false;
                bt_Volver.Visible  = true;
            }
        }
Beispiel #13
0
        private void CrearOperacion(string _id_oper, string _hora, string _tipo, string _fecha)
        {
            txt_obs.Text          = "";
            TBL_Agenda.Visible    = false;
            TBL_Operacion.Visible = true;
            lblerror2.Text        = "";
            id_solicitud          = _id_oper;
            fecha = _fecha;
            hora  = _hora;
            tipo  = _tipo;
            bt_guardar.Enabled  = false;
            lbl_Oper_Fecha.Text = fecha;
            lbl_Oper_Hora.Text  = hora;
            lbl_Oper_ID.Text    = _id_oper;
            lbl_Oper_Tipo.Text  = _tipo;

            if (tipo == "C")
            {
                Agenda agaux = new AgendaBC().getAgenda(Convert.ToInt32(id_solicitud));

                Persona          pers   = new PersonaBC().getpersonabyrut(agaux.Rut_persona);
                Direcciones      dirper = new DireccionesBC().getDireccionPorDefecto(Convert.ToInt32(pers.Rut));
                List <Telefonos> telper = new TelefonoBC().gettelefonos(Convert.ToInt32(pers.Rut));
                txt_rut.Text             = pers.Rut.ToString();
                txt_dv.Text              = pers.Dv;
                txtNombre.Text           = pers.Nombre;
                txtApellidoP.Text        = pers.Apellido_paterno;
                txtApellidoM.Text        = pers.Apellido_materno;
                cbo_EjeCom.SelectedValue = agaux.Ejecutivo;
                txtdireccion.Text        = dirper.Direccion;
                txt_numeriDir.Text       = dirper.Numero;
                this.giro = pers.Giro;
                foreach (Telefonos item in telper)
                {
                    if (item.Tipo_telefono == "TCEL")
                    {
                        txt_celular.Text = item.Numero.ToString();
                    }
                    if (item.Tipo_telefono == "TOFI")
                    {
                        txt_telefono.Text = item.Numero.ToString();
                    }
                }

                if (dirper.Tipo_direccion != null && dirper.Tipo_direccion != "")
                {
                    rdbtipodir.SelectedValue = dirper.Tipo_direccion.Trim();
                }
                //this.bt_finalizar.Visible = true;
                //this.bt_guardar.Text = "Eliminar";

                txt_cantidadCredito.Visible = false;
                btnAgregarcredito.Visible   = false;
                Label18.Visible             = false;

                btnRechCred.Visible = false;
                List <MasterBCA> lbca = new MasterBCABC().getMAsterBCA(Convert.ToInt32(id_solicitud));
                CreditosBice(lbca);
            }

            this.lbl_fecha.Text     = fecha;// +" " + hora;
            this.lbl_operacion.Text = id_solicitud;
            GET_AGENDA();
        }