Exemplo n.º 1
0
        public void RenuevaPoliza(object sender, DirectEventArgs e)
        {
            OBD_danos.wsDataConnection dc = new OBD_danos.wsDataConnection();

            dc.UpdateEstatusCot(Convert.ToInt32(Session["IdCotR"]), 7); //Se cambia el estatus de la cotización a Renovación.
            dc.UpdateEstatusEmi(Convert.ToInt32(Session["IdCotR"]), 6); //Se cambia el estatus de la póliza a Rehabilitada.

            //Se redirige Cotización, asignando a la variable de sesión el IdCotizacion el id de la cotización seleccionada.
            Session["NumCot"] = Convert.ToInt32(Session["IdCotR"]);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Funcion que busca si el socio de la cooperativa actual existe en la BD Prybe
        /// </summary>
        /// <param name="sender">object sender</param>
        /// <param name="e">EventArgs e</param>
        protected void Busca_Socio(object sender, EventArgs e)
        {
            DateTime fechaNac, fechaIng;
            bool habilitaExt = false;

            if (this.txtNumSocio.Text.Trim() != "")
            {
                OBD_danos.wsDataConnection opCotiza = new OBD_danos.wsDataConnection();
                OBD_danos.Socio DatSocio = new OBD_danos.Socio();
                //  Ejecuta la operacion para buscar y guardar los datos del socio en el objeto DatSocio
                this.txtNumSocio.Text = this.txtNumSocio.Text.Trim();
                Session["NoCoopEE"] = cbCoop.Value;
                DatSocio = opCotiza.ReturnDatSocio(this.txtNumSocio.Text, Convert.ToInt32(Session["NoCoopEE"]));

                //  Verifica si la busqueda regreso los datos
                if (DatSocio.boolEncontrado == true)
                {
                    Session["noSocioEE"] = txtNumSocio.Text;
                    Session["eeIdCotiza"] = 0;
                    Session["eeIdEmite"] = 0;
                    LimpiaCampos();
                    //  Si la busqueda encontro al socio, extrae los datos y los muestra en los controles
                    this.txtNumSocio.Text = Convert.ToString(Session["noSocioEE"]);
                    this.txtNombre1.Text = DatSocio.Nombre;
                    this.txtNombre2.Text = DatSocio.Nombre2;
                    this.txtApellido1.Text = DatSocio.ApePat;
                    this.txtApellido2.Text = DatSocio.ApeMat;
                    this.txtEmail.Text = DatSocio.Correo;
                    fechaNac = Convert.ToDateTime(DatSocio.FechaNac);
                    this.txtFechaNac.Text = fechaNac.ToString("dd-MM-yyyy");
                    fechaIng = Convert.ToDateTime(DatSocio.FechaIng);
                    this.txtFechaIngre.Text = fechaIng.ToString("dd-MM-yyyy");
                    if (DatSocio.Tel == "")
                    {
                        txt_Tel1.Value = "";
                    }
                    else
                    {
                        txt_Tel1.Text = DatSocio.Tel;
                    }

                    if (DatSocio.Lada == "")
                    {
                        this.txt_Lada1.Value = "";
                    }
                    else
                    {
                        this.txt_Lada1.Text = DatSocio.Lada;
                    }
                    this.cb_TipoTel1.SetValue(DatSocio.IdTipoTel);
                    if (DatSocio.Sexo == true)
                    {
                        this.rbSMa.Checked = true;
                    }
                    else
                    {
                        this.rbSFe.Checked = true;
                    }

                    txt_RFC.Text = DatSocio.RFC;
                    txt_CURP.Text = DatSocio.CURP;

                    cb_Ocupacion.SetValue(DatSocio.IdOcupacion);
                    cb_Civil.SetValue(DatSocio.IdEdoCivil);
                    txt_Calle.Text = DatSocio.Calle;
                    txt_NoExt.Text = DatSocio.NoExt;
                    txt_NoInt.Text = DatSocio.NoInt;
                    txt_Colonia.Text = DatSocio.Colonia;

                }
                else
                {
                    LimpiaCampos();
                }

                //  Habilita los controles para permitir la edición-inserción de los datos.
                habilitaExt = true;
                HabilitaControles(habilitaExt);
            }
            else
            {
                //Acceso.GeneraMensaje("No introdujo el numero de socio",
                //    "Introduzca el numero de socio en la casilla y despues vuelva a dar clic en buscar", 'W');
                habilitaExt = false;
                HabilitaControles(habilitaExt);
            }

            HabilitaControles(true);

        }
Exemplo n.º 3
0
        protected void Modifica_Emision(object sender, DirectEventArgs e)
        {
            OBD_danos.wsDataConnection busqueda = new OBD_danos.wsDataConnection();
            OBD_danos.EmisionExterna ee = new OBD_danos.EmisionExterna();
            int idEmision = Convert.ToInt32(Session["IdEE"]);
            bool sexo;


            ee = busqueda.EE_RegresaEmisionExterna(idEmision);
            sexo = Convert.ToBoolean(ee.Sexo);

            txtNumSocio.Text = ee.NoSocio;
            txtNombre1.Text = ee.PrimerNombre;
            txtNombre2.Text = ee.SegundoNombre;
            txtApellido1.Text = ee.ApellidoPaterno;
            txtApellido2.Text = ee.ApellidoMaterno;
            txt_RFC.Text = ee.RFC;
            txt_CURP.Text = ee.CURP;
            cb_Ocupacion.SetValue(ee.IdOcupacion);
            cb_Civil.SetValue(ee.IdCivil);
            txtEmail.Text = ee.Correo;
            txtFechaNac.Text = Convert.ToDateTime(ee.FechaNacimiento).ToShortDateString();
            txtFechaIngre.Text = Convert.ToDateTime(ee.FechaIngreso).ToShortDateString(); ;
            cbEstado.SetValueAndFireSelect(ee.IdEstado);
            txt_Calle.Text = ee.Calle;
            txt_NoExt.Text = ee.NoExterior;
            txt_NoInt.Text = ee.NoInterior;
            txt_Colonia.Text = ee.Poblacion;

            if (sexo == true)
            {
                rbSMa.Checked = true;
                rbSFe.Checked = false;
            }
            else
            {
                rbSMa.Checked = false;
                rbSFe.Checked = true;
            }
            cbAseguradora.SetValue(ee.IdAseguradora);
            cbTipoServicio.SetValue(ee.ValorVehiculo);
            cbCobertura.SetValue(ee.Cobertura);
            cbAno.SetValue(((Convert.ToInt32(ee.AnoVehiculo)) - 1996) + 1);
            cbMarca.SetValue(ee.IdMarca);
            txtModelo.Text = ee.Modelo;
            txt_NoMotor.Text = ee.NoMotor;
            txt_NoSerie.Text = ee.NoSerie;
            txt_Placa.Text = ee.NoPlacas;
            txt_Descripcion.Text = ee.Descripcion;
            cb_RegistroV.SetValue(ee.TipoRegVe);
            txt_RegVeh.Text = ee.RegistroVehicular;
            txt_Lada1.Text = ee.Lada;
            txt_Tel1.Text = ee.Telefono;
            cb_TipoTel1.SetValue(ee.IdTipoTel);
            txt_Vigencia.Text = Convert.ToDateTime(ee.FechaVigencia).ToShortDateString();
            cbMunicipio.SetValueAndFireSelect(ee.IdMunicipio);

            txtSuma.Text = ee.SumaAsegurada;
            txtPoliza.Text = ee.NoPoliza;
            txtPrimaNeta.Text = ee.PrimaNeta;
            txtDerechos.Text = ee.DerechoPoliza;
            txtIVA.Text = ee.IVA;
            txtPrimaTotal.Text = ee.PrimaTotal;

            Session["eeIdCotiza"] = ee.IdCotiza;
            Session["eeIdEmite"] = ee.IdEmite;
            Session["IdBeneficiario"] = ee.IdBeneficiario;

            HabilitaControles(true);
            btEditaEE.Disabled = true;
            btnModificar.Disabled = true;
            wdEE.Hide();
        }
Exemplo n.º 4
0
        protected void ModificaEE(object sender, EventArgs e)
        {
            OBD_danos.wsDataConnection data = new OBD_danos.wsDataConnection();

            List<OBD_danos.EEConsulta> lista = new List<OBD_danos.EEConsulta>(data.EE_ConsultaEmisiones("", ""));

            stDatEE.DataSource = lista;
            stDatEE.DataBind();

            wdEE.Show();
        }
Exemplo n.º 5
0
        /************************************************************************/
        /************************************************************************/
        /************************************************************************/

        protected void GuardaEE(object sender, EventArgs e)
        {
            OBD_danos.wsDataConnection inserta = new OBD_danos.wsDataConnection();
            OBD_danos.Error ErrorOper = new OBD_danos.Error();
            OBD_danos.IdSocio NumSocio = new OBD_danos.IdSocio();
            OBD_danos.IdCotizacion NumCot = new OBD_danos.IdCotizacion();

            int eeIdCotiza, eeIdEmite;

            DateTime fechaNac, fechaIng;

            fechaNac = Convert.ToDateTime(txtFechaNac.Text);
            fechaIng = Convert.ToDateTime(txtFechaIngre.Text);


            if (rbSMa.Checked == true)
            {
                Session["sexoEE"] = 1;
            }
            else
            {
                Session["sexoEE"] = 0;
            }


            ErrorOper = inserta.InsertSocio(this.txtNumSocio.Text, this.txtNombre1.Text, this.txtNombre2.Text,
                            this.txtApellido1.Text, this.txtApellido2.Text, fechaNac.ToString("yyyy-MM-dd"), fechaIng.ToString("yyyy-MM-dd"),
                            (int)(Session["sexoEE"]), this.txtEmail.Text, txt_RFC.Text, txt_CURP.Text, 1, 1, Convert.ToInt32(cbSucursal.Value),
                            Convert.ToInt32(this.cbColonia.SelectedItem.Value), 1, txt_Calle.Text, txt_NoExt.Text, txt_NoInt.Text, 1, 1,
                            Convert.ToInt32(this.cb_TipoTel1.SelectedItem.Value), this.txt_Lada1.Text, this.txt_Tel1.Text, "", 
                            4, "000", "0000000", "", 0);

            NumSocio = inserta.ReturnIdSocio(Convert.ToInt32(cbSucursal.Value), this.txtNumSocio.Text);

            if (txtBeneB.Text == "" || txtBeneB.Text.Equals(EmptyValue.EmptyString))
            {
                Session["IdBeneficiario"] = 1;
            }

            bool error;


            eeIdCotiza = Convert.ToInt32(Session["eeIdCotiza"]);
            eeIdEmite = Convert.ToInt32(Session["eeIdEmite"]);

            if (eeIdCotiza != 0)
            {
                eeIdCotiza = Convert.ToInt32(Session["eeIdCotiza"]);
                eeIdEmite = Convert.ToInt32(Session["eeIdEmite"]);
            }
            else
            {
                eeIdCotiza = 0;
                eeIdEmite = 0;
            }

            error = inserta.EE_Inserta(eeIdCotiza, /*Convert.ToInt32(Session["Ejecutivo"])*/1, NumSocio.CIdSocio_IdSoc, Convert.ToInt32(cbVersion.Value),
                Convert.ToInt32(cbTipoServicio.Value), txtSuma.Text, DateTime.Today.ToString(), eeIdEmite, txtPoliza.Text, Convert.ToInt32(cbAseguradora.Value), Convert.ToInt32(cbCobertura.Value),
                txt_NoMotor.Text, txt_NoSerie.Text, txt_Placa.Text, "1", txtPrimaNeta.Text, txtDerechos.Text, txtIVA.Text, txtPrimaTotal.Text, txt_Vigencia.Text, Convert.ToDateTime(txt_Vigencia.Text).AddYears(1).ToString(),
                Convert.ToInt32(cb_RegistroV.Value), txt_RegVeh.Text, "EMISION EXTERNA", Convert.ToInt32(cb_ModoPago.Value), txt_Colonia.Text, Convert.ToString(cbCP.Value), Convert.ToInt32(Session["IdBeneficiario"]), txt_Descripcion.Text,
                DateTime.Today.ToString());

            if (error == true)
            {
                Acceso.GeneraMensaje("Problema:" + "Emisión Externa",
                            "Ocurrio un error al intentar guardar la emisión externa", 'W');
                HabilitaControles(false);
                LimpiaCampos();
                btnModificar.Disabled = false;
                btnGuardar.Disabled = true;
                btnCancelar.Disabled = true;
                
                correoEnvia.EnviaCorreo("*****@*****.**",
                                            "*****@*****.**",
                                            "PORTAL PRYBE - ERROR AL INTENTAR CREAR EMISIÓN EXTERNA",
                                            "SE HA PRESENTADO UN ERROR AL INTENTAR INSERTAR UNA EMISIÓN EXTERNA",
                                            true);
            }

            else
            {
                correoEnvia.EnviaCorreo("*****@*****.**",
                                            "*****@*****.**",
                                            "PORTAL PRYBE - SE HA GENERADO UNA EMISIÓN EXTERNA EXITOSAMENTE",
                                            "PÓLIZA: " + txtPoliza.Text + Environment.NewLine,
                                            true);

                Acceso.GeneraMensaje("Correcto:" + "Emisión Externa",
                            "Se guardo la emisión externa de manera correcta!", 'I');

                
                HabilitaControles(false);
                LimpiaCampos();
                btnModificar.Disabled = false;
                btnGuardar.Disabled = true;
                btnCancelar.Disabled = true;
            }
        }
Exemplo n.º 6
0
        protected void GuardaEmisor(object sender, DirectEventArgs e)
        {
            OBD_danos.wsDataConnection modifica = new OBD_danos.wsDataConnection();
            string IdCot;
            bool error;
            IdCot = Convert.ToString(Session["idCot"]);
            error = modifica.ModificaEmisor(IdCot, cbEjecutivo.SelectedItem.Value);

            wdEmisor.Hide();
        }