Esempio n. 1
0
        private void CargarWebService_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            int porcentaje = e.ProgressPercentage;

            switch (porcentaje)
            {
            case 1:
                Modulo.Otros.Cargando cargar = new Otros.Cargando();
                cargar.CambiarMensaje("Buscando datos");
                AbrirFormulario(cargar);
                break;

            case 2:
                Cl_Persona inicio = (Cl_Persona)e.UserState;
                controles.llenarFormulario(inicio);
                AbrirFormulario(controles);
                break;

            case 3:

                AbrirFormulario(controles);
                lblErrorRut.Text = "Funcionario sin datos previos";
                break;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ClPersona     = new Cl_Persona();
            ClUtilitarios = new Cl_Utilitarios();
            System.Web.UI.HtmlControls.HtmlGenericControl sidvar;
            sidvar         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("MenuAdm");
            sidvar.Visible = false;

            System.Web.UI.WebControls.Label lblUsuario;
            lblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
            lblUsuario.Text = "Usuario Creado";

            System.Web.UI.WebControls.Label LblTipoUsuario;
            LblTipoUsuario         = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
            LblTipoUsuario.Visible = false;

            System.Web.UI.HtmlControls.HtmlGenericControl lines;
            lines         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("lines");
            lines.Visible = false;

            System.Web.UI.HtmlControls.HtmlGenericControl Notif;
            Notif         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Notif");
            Notif.Visible = false;

            System.Web.UI.HtmlControls.HtmlImage ImgPerfil;
            ImgPerfil         = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
            ImgPerfil.Src     = "../imagenes/User_Ok.png";
            ImgPerfil.Visible = true;

            if (!IsPostBack)
            {
                Mensaje.Text = "Estimado(a): " + ClPersona.Nombre_Usuario(Convert.ToInt32(ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["appel"].ToString()), true))) + " tenemos el agrado de informarle que su usuario para ingresar al Sistema Electrónico de Gestión Forestal -SEGEFOR- fue creado con éxito en breve estará recibiendo en su correo electrónico sus datos de ingreso al sistema.";
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUsuario     = new Cl_Usuario();
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();
            ClGestion     = new Cl_Gestion_Registro();
            ClManejo      = new Cl_Manejo();
            ClCatalogos   = new Cl_Catalogos();

            GrdSolicitudes.ItemDataBound     += GrdSolicitudes_ItemDataBound;
            GrdSolicitudes.NeedDataSource    += GrdSolicitudes_NeedDataSource;
            GrdSolicitudes.ItemCommand       += GrdSolicitudes_ItemCommand;
            GrdDetalle.ItemCommand           += GrdDetalle_ItemCommand;
            GrdDetalle.NeedDataSource        += GrdDetalle_NeedDataSource;
            BtnBuscar.ServerClick            += BtnBuscar_ServerClick;
            GrdManejoForestal.NeedDataSource += GrdManejoForestal_NeedDataSource;
            GrdManejoForestal.ItemDataBound  += GrdManejoForestal_ItemDataBound;
            GrdManejoForestal.ItemCommand    += GrdManejoForestal_ItemCommand;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                ClUsuario.Insertar_Ingreso_Pagina(8, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_IngresoPagina());
                ClUtilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                System.Web.UI.WebControls.Label LblPerfil;
                LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                LblPerfil.Text = ClUsuario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                System.Web.UI.WebControls.Label LblUsuario;
                LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));

                System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                System.Web.UI.WebControls.Image      ImgPerfil;
                ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");
                if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                {
                    ImgPerfilFake.Visible = false;
                    ImgPerfil.Visible     = true;
                }
                else
                {
                    ImgPerfilFake.Visible = true;
                    ImgPerfil.Visible     = false;
                    if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                    {
                        ImgPerfilFake.Src = "../imagenes/male.png";
                    }

                    else
                    {
                        ImgPerfilFake.Src = "../imagenes/female.png";
                    }
                }
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClPersona     = new Cl_Persona();
            ClUtilitarios = new Cl_Utilitarios();
            ClTraductor   = new Cl_Traductor();
            ClUsuario     = new Cl_Usuario();
            ClCita        = new Cl_Cita();

            BtnGrabar.Click += BtnGrabar_Click;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                int     PersonaId = Convert.ToInt32(ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["Person"].ToString()), true));
                DataSet DsArchivo = new DataSet();
                DsArchivo = ClPersona.Get_Datos_Persona(Convert.ToInt32(PersonaId), Session["Idioma"].ToString());
                //LblNombreUsuario.Text = DsArchivo.Tables["DATOS"].Rows[0]["Nombre"].ToString();
                if (DsArchivo.Tables["DATOS"].Rows[0]["Foto_Perfil"].ToString() != "")
                {
                    byte[] bytes = (byte[])DsArchivo.Tables["DATOS"].Rows[0]["Foto_Perfil"];
                    ImgPerfil.Src = "data:image/png;base64," + Convert.ToBase64String(bytes);
                }
                LblNombreDato.InnerText = DsArchivo.Tables["DATOS"].Rows[0]["Nombres"] + " " + DsArchivo.Tables["DATOS"].Rows[0]["Apellidos"];
                DsArchivo.Clear();
                DataSet dsEspecialidad = ClPersona.Get_Especialidad_Usuario(PersonaId, Session["Idioma"].ToString());
                if (dsEspecialidad.Tables["Datos"].Rows.Count > 0)
                {
                    string Especialidades = "";
                    for (int i = 0; i < dsEspecialidad.Tables["Datos"].Rows.Count; i++)
                    {
                        if (Especialidades == "")
                        {
                            Especialidades = dsEspecialidad.Tables["Datos"].Rows[i]["Espe"].ToString();
                        }
                        else
                        {
                            Especialidades = Especialidades + ", " + dsEspecialidad.Tables["Datos"].Rows[i]["Espe"].ToString();
                        }
                    }
                    LblEspecialidadesDato.InnerText = Especialidades;
                }
                else
                {
                    LblEspecialidadesDato.InnerText = "";
                }
                Traduce();

                var localDateTime = DateTime.Now.ToString("yyyy-MM-dd");
                TxtFecCita.Value = localDateTime;

                var localTime = DateTime.Now.ToString("HH:mm");
                TxtHoraCita.Value = localTime;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUtilitarios     = new Cl_Utilitarios();
            ClPersona         = new Cl_Persona();
            ClGestio_Registro = new Cl_Gestion_Registro();
            DataSet Ds_Formulario_BosqueNatural = new DataSet();

            Ds_Formulario_BosqueNatural           = ((DataSet)Session["Ds_Formulario_BosqueNatural"]);
            Reporte.PrintOptions.PaperOrientation = PaperOrientation.Portrait;
            Reporte.SetDataSource((DataSet)Ds_Formulario_BosqueNatural);

            if (Convert.ToInt32(Session["TipoReporte"]) == 1)
            {
                string UsuarioId = ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["utilisateurid"].ToString()), true);
                Reporte.Subreports[0].SetDataSource(ClGestio_Registro.Fincas_Registro(Convert.ToInt32(UsuarioId), Convert.ToInt32(Session["TipoReporte"])));
            }
            else
            {
                string[] GestionId = Ds_Formulario_BosqueNatural.Tables["Dt_BosqueNatural"].Rows[0]["NUG"].ToString().Split('-');
                string   IdGestion = HttpUtility.UrlDecode(Request.QueryString["traiteid"].ToString());
                Reporte.Subreports[0].SetDataSource(ClGestio_Registro.Fincas_Registro(Convert.ToInt32(IdGestion), Convert.ToInt32(Session["TipoReporte"])));
            }


            string llamada = ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["appel"].ToString()), true);
            string NomReporte;

            if (llamada == "1")
            {
                NomReporte = Ds_Formulario_BosqueNatural.Tables["Dt_Plantacion_Voluntaria"].Rows[0]["NUG"] + ".pdf";
            }
            else
            {
                NomReporte = Guid.NewGuid().ToString() + ".pdf";
            }
            //string url = System.AppDomain.CurrentDomain.BaseDirectory + DirRep + NomReporte;
            string url     = Server.MapPath(".") + @"\" + DirRep + NomReporte;
            string attchat = Server.MapPath(".") + @"\" + DirRep + NomReporte;
            //string attchat = System.AppDomain.CurrentDomain.BaseDirectory + DirRep + NomReporte;
            DiskFileDestinationOptions options2 = new DiskFileDestinationOptions
            {
                DiskFileName = url
            };
            ExportOptions exportOptions = Reporte.ExportOptions;

            exportOptions.ExportDestinationType    = ExportDestinationType.DiskFile;
            exportOptions.ExportFormatType         = ExportFormatType.PortableDocFormat;
            exportOptions.ExportDestinationOptions = options2;
            Reporte.Export();
            url = DirApp + DirRepLong + NomReporte;
            //if (llamada == "1")
            //{
            //    string Mensaje = "Su solicitud fue enviada exitosamente, con Numero Único de Gestión (NUG): " + Ds_Formulario_BosqueNatural.Tables["Dt_Plantacion_Voluntaria"].Rows[0]["NUG"] + ". Por lo que solicitamos presentarse a la oficina Subregional " + Ds_Formulario_BosqueNatural.Tables["Dt_Plantacion_Voluntaria"].Rows[0]["SubRegion"] + ", con la documentación que deberá presentar para dar trámite a su solicitud.";
            //    ClUtilitarios.EnvioCorreo(Session["Correo_Usuario"].ToString(), ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"])).ToString(), "Solicitud SEGEFOR", Mensaje, 1, attchat, NomReporte);
            //}
            base.Response.Redirect(url);
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClTraductor   = new Cl_Traductor();
            ClCatalogos   = new Cl_Catalogos();
            ClUsuario     = new Cl_Usuario();
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();
            ClClinca      = new Cl_Clinica();
            ClCliente     = new Cl_Cliente();

            ImageButton ImgEng;

            ImgEng        = (ImageButton)Master.FindControl("ImgEng");
            ImgEng.Click += ImgEng_Click;

            ImageButton ImgEsp;

            ImgEsp        = (ImageButton)Master.FindControl("ImgEsp");
            ImgEsp.Click += ImgEsp_Click;

            CboPais.SelectedIndexChanged         += CboPais_SelectedIndexChanged;
            CboDepartamento.SelectedIndexChanged += CboDepartamento_SelectedIndexChanged;
            BtnGrabar.Click           += BtnGrabar_Click;
            GrdDetalle.NeedDataSource += GrdDetalle_NeedDataSource;
            GrdDetalle.ItemCommand    += GrdDetalle_ItemCommand;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                DataSet dsPermisos = ClUsuario.Get_Roles_Forma_Usuario(Convert.ToInt32(Session["UsuarioId"]), 2);
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Editar"]) == 0)
                {
                    BtnGrabar.Enabled = false;
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Insertar"]) == 0)
                {
                    BtnGrabar.Enabled = false;
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Eliminar"]) == 0)
                {
                }
                dsPermisos.Clear();
                Traduce();
                DataSet DsClincas = ClClinca.Get_Clincas(Convert.ToInt32(Session["ClienteId"]));
                if (DsClincas.Tables["Datos"].Rows.Count == 1)
                {
                    GrdDetalle.Columns[7].Visible = false;
                }
                ValidaGrabar();
            }
            TxtIdioma.Value = Session["Idioma"].ToString();
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClCatalogos   = new Cl_Catalogos();
            ClUtilitarios = new Cl_Utilitarios();
            ClUsuario     = new Cl_Usuario();
            ClPersona     = new Cl_Persona();
            CboDep.SelectedIndexChanged += CboDep_SelectedIndexChanged;
            BtnCrearUsuario.Click       += BtnCrearUsuario_Click;
            CboTipoIdentificacion.SelectedIndexChanged += CboTipoIdentificacion_SelectedIndexChanged;
            LnkTerminos.Click += LnkTerminos_Click;

            System.Web.UI.HtmlControls.HtmlGenericControl sidvar;
            sidvar         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("MenuAdm");
            sidvar.Visible = false;

            System.Web.UI.WebControls.Label lblUsuario;
            lblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
            lblUsuario.Text = "Nuevo Usuario";

            System.Web.UI.WebControls.Label LblTipoUsuario;
            LblTipoUsuario         = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
            LblTipoUsuario.Visible = false;

            System.Web.UI.HtmlControls.HtmlGenericControl lines;
            lines         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("lines");
            lines.Visible = false;

            System.Web.UI.HtmlControls.HtmlGenericControl Notif;
            Notif         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Notif");
            Notif.Visible = false;

            System.Web.UI.HtmlControls.HtmlImage ImgPerfil;
            ImgPerfil         = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
            ImgPerfil.Src     = "../imagenes/New_User.png";
            ImgPerfil.Visible = true;
            TxtFecNac.MinDate = new DateTime(1920, 1, 1);
            TxtFecNac.MaxDate = DateTime.Today;


            if (!IsPostBack)
            {
                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoGenero(), CboGenero, "generoid", "genero");
                ClUtilitarios.AgregarSeleccioneCombo(CboGenero, "Genero");
                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoDepartamentos(), CboDep, "DepartamentoId", "Departamento");
                ClUtilitarios.AgregarSeleccioneCombo(CboDep, "Departamento");
                ClUtilitarios.AgregarSeleccioneCombo(CboMun, "Municipio");
                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoTipoIdentificacion(), CboTipoIdentificacion, "Origen_PersonaId", "Origen_Persona");
                ClUtilitarios.AgregarSeleccioneCombo(CboTipoIdentificacion, "Tipo de identificación");
                TxtFecNac.SelectedDate = DateTime.Today;
                TxtFecNac.MaxDate      = DateTime.Today;
                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoPais(), CboPais, "PaisId", "Pais");
                ClUtilitarios.AgregarSeleccioneCombo(CboPais, "Pais");
                TxtFecVenId.MinDate = DateTime.Today;
            }
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUsuario     = new Cl_Usuario();
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();

            BtnIngresar.Click         += BtnIngresar_Click;
            BtnOlvio.ServerClick      += BtnOlvio_ServerClick;
            BtnEnviaClave.ServerClick += BtnEnviaClave_ServerClick;
            string conver = HttpUtility.UrlEncode(ClUtilitarios.Encrypt("1234", true));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ClPersona = new Cl_Persona();
            DataSet DsArchivo = new DataSet();

            DsArchivo = ClPersona.Foto_Perfil(Convert.ToInt32(Session["PersonaId"]));
            if (DsArchivo.Tables["DATOS"].Rows.Count != 0)
            {
                Response.ContentType = DsArchivo.Tables["DATOS"].Rows[0]["ContentType"].ToString();
                if (DsArchivo.Tables["DATOS"].Rows[0]["Foto"].ToString() != "")
                {
                    Response.BinaryWrite((byte[])DsArchivo.Tables["DATOS"].Rows[0]["Foto"]);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                ClUsuario     = new Cl_Usuario();
                ClUtilitarios = new Cl_Utilitarios();
                ClPersona     = new Cl_Persona();
                string Test = HttpUtility.UrlEncode(ClUtilitarios.Encrypt("4", true));

                ClUsuario.Insertar_Ingreso_Pagina(44, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_IngresoPagina());
                ClUtilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                System.Web.UI.WebControls.Label LblPerfil;
                LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                LblPerfil.Text = ClUsuario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                System.Web.UI.WebControls.Label LblUsuario;
                LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));

                System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                System.Web.UI.WebControls.Image      ImgPerfil;
                ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");
                if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                {
                    ImgPerfilFake.Visible = false;
                    ImgPerfil.Visible     = true;
                }
                else
                {
                    ImgPerfilFake.Visible = true;
                    ImgPerfil.Visible     = false;
                    if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                    {
                        ImgPerfilFake.Src = "../imagenes/male.png";
                    }

                    else
                    {
                        ImgPerfilFake.Src = "../imagenes/female.png";
                    }
                }
            }
        }
Esempio n. 11
0
 internal void llenarFormulario(Cl_Persona inicio)
 {
     txtNombre.Text           = inicio.nombre;
     txtApellido.Text         = inicio.apellido;
     txtCorreo.Text           = inicio.correo;
     dtpFechaNacimiento.Value = inicio.fechaNacimiento;
     if (inicio.sexo == '1')
     {
         rbHombre.Checked = true;
     }
     else if (inicio.sexo == '0')
     {
         rbMujer.Checked = false;
     }
     txtTelefono.Text = inicio.telefono.ToString();;
 }
Esempio n. 12
0
        public int insertarVenta(Cl_Persona cliente, Cl_Usuario usuario, int totalVenta, int despacho, int tipoPago)
        {
            try
            {
                string   rut          = cliente.rut;
                string   nombre       = cliente.nombre;
                string   apellido     = cliente.apellido;
                int      edad         = cliente.edad;
                string   direccion    = cliente.direccion;
                string   correo       = cliente.correo;
                string   comuna       = cliente.comuna;
                int      tipoDespacho = despacho;
                object[] parametros   = new object[12];
                parametros[0]  = null;
                parametros[1]  = rut;
                parametros[2]  = nombre;
                parametros[3]  = apellido;
                parametros[4]  = edad;
                parametros[5]  = correo;
                parametros[6]  = comuna;
                parametros[7]  = totalVenta;
                parametros[8]  = direccion;
                parametros[9]  = tipoDespacho;
                parametros[10] = tipoPago;
                parametros[11] = "P_IDVENTA";

                if (usuario.idTipoUsuario == 5)
                {
                    parametros[0] = usuario.idTrabajador;
                }
                operaciones.abrirConexion();

                OracleCommand cmd = operaciones.execSP("PKG_VENTA.INSERTAR_VENTA", parametros);
                cmd.ExecuteNonQuery();
                int idVenta = Convert.ToInt32(cmd.Parameters["P_IDVENTA"].Value);
                //int idVenta = Convert.ToInt32(dr[0]);
                return(idVenta);
            }
            catch (Exception err)
            {
                throw new Exception(err.Message);
            }
            finally
            {
                operaciones.cerrarConexion();
            }
        }
Esempio n. 13
0
        public int ingresarTrabajador(Cl_Persona persona, Cl_Contrato contrato, Cl_Trabajador trabajador, Cl_Usuario usuario)
        {
            try
            {
                object[] parametros = new object[16];
                parametros[0] = persona.rut;
                parametros[1] = persona.nombre;
                parametros[2] = persona.apellido;
                parametros[3] = persona.edad;
                parametros[4] = persona.direccion;
                parametros[5] = persona.correo;
                parametros[6] = persona.idComuna;
                parametros[7] = trabajador.sueldo;

                contrato.rutaAfp = "./img/trabajadores/" + persona.rut + "/afp.png";
                File.WriteAllBytes(contrato.rutaAfp, contrato.afp);
                parametros[8] = contrato.rutaAfp;

                contrato.rutaSalud = "./img/trabajadores/" + persona.rut + "/salud.png";
                File.WriteAllBytes(contrato.rutaSalud, contrato.salud);
                parametros[9] = contrato.rutaSalud;

                contrato.rutaCarnet = "./img/trabajadores/" + persona.rut + "/carnet.png";
                File.WriteAllBytes(contrato.rutaCarnet, contrato.carnet);
                parametros[10] = contrato.rutaCarnet;

                contrato.rutaCerNacimiento = "./img/trabajadores/" + persona.rut + "/certificado-nacimiento.png";
                File.WriteAllBytes(contrato.rutaCerNacimiento, contrato.cerNacimiento);
                parametros[11] = contrato.rutaCerNacimiento;

                contrato.rutaCerResidencia = "./img/trabajadores/" + persona.rut + "/certificado-residencia.png";
                File.WriteAllBytes(contrato.rutaCerResidencia, contrato.cerResidencia);
                parametros[12] = contrato.rutaCerResidencia;

                parametros[13] = usuario.idTipoUsuario;
                parametros[14] = usuario.user;
                parametros[15] = usuario.pass;
                OracleCommand cmd = operaciones.execSP("PKG_TRABAJADORES.INGRESAR_TRABAJADOR", parametros);
                return(1);
            }
            catch
            {
                return(0);
            }
        }
Esempio n. 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClPersona   = new Cl_Persona();
            ClTraductor = new Cl_Traductor();
            ClUsuario   = new Cl_Usuario();
            ClClinica   = new Cl_Clinica();

            if (!IsPostBack)
            {
                if (Session["Paciente"].ToString() == "0")
                {
                    if (Session["PersonaId"].ToString() != "")
                    {
                        DataSet DsArchivo = new DataSet();
                        DsArchivo             = ClPersona.Get_Datos_Persona(Convert.ToInt32(Session["PersonaId"]), Session["Idioma"].ToString());
                        LblNombreUsuario.Text = DsArchivo.Tables["DATOS"].Rows[0]["Nombre"].ToString();
                        if (DsArchivo.Tables["DATOS"].Rows[0]["Foto_Perfil"].ToString() != "")
                        {
                            byte[] bytes = (byte[])DsArchivo.Tables["DATOS"].Rows[0]["Foto_Perfil"];
                            ImgPerfil.Src = "data:image/png;base64," + Convert.ToBase64String(bytes);
                        }
                        DsArchivo.Clear();

                        if (Convert.ToInt32(Session["ClinicaId"]) > 0)
                        {
                            DataSet DsLogoClinica = new DataSet();
                            DsLogoClinica      = ClClinica.Get_Clinca(Convert.ToInt32(Session["ClinicaId"]));
                            LblNomClinica.Text = DsLogoClinica.Tables["DATOS"].Rows[0]["Nombre"].ToString();
                            if (DsLogoClinica.Tables["DATOS"].Rows[0]["Logo"].ToString() != "")
                            {
                                byte[] bytes = (byte[])DsLogoClinica.Tables["DATOS"].Rows[0]["Logo"];
                                ImgLogoClinica.Src = "data:image/png;base64," + Convert.ToBase64String(bytes);
                            }
                            DsLogoClinica.Clear();
                        }
                        Permisos(Convert.ToInt32(Session["UsuarioId"]));
                    }
                    if (Convert.ToInt32(Session["TipoUsuarioId"]) != 5)
                    {
                        VerificaClnica();
                    }
                }
                Traduce();
            }
        }
Esempio n. 15
0
        private void CargarWebService_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker IniciarAplicacion = sender as BackgroundWorker;
            string           funcionario       = (string)e.Argument;

            CargarWebService.ReportProgress(1);
            daoWebService dao = new daoWebService();

            Cl_Persona per = dao.RecuperarPersona(funcionario);

            if (per != null)
            {
                CargarWebService.ReportProgress(2, per);
            }
            else
            {
                CargarWebService.ReportProgress(3);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();
            DataSet Ds_FormularioInscripcion = new DataSet();

            Ds_FormularioInscripcion = ((DataSet)Session["DataFormulario"]);
            Reporte.PrintOptions.PaperOrientation = PaperOrientation.Portrait;
            Reporte.SetDataSource((DataSet)Ds_FormularioInscripcion);
            string llamada = ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["appel"].ToString()), true);
            string NomReporte;

            if (llamada == "1")
            {
                NomReporte = ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["traite"].ToString()), true) + ".pdf";
            }
            else
            {
                NomReporte = Guid.NewGuid().ToString() + ".pdf";
            }
            string url     = Server.MapPath(".") + @"\" + DirRep + NomReporte;
            string attchat = Server.MapPath(".") + @"\" + DirRep + NomReporte;
            DiskFileDestinationOptions options2 = new DiskFileDestinationOptions
            {
                DiskFileName = url
            };
            ExportOptions exportOptions = Reporte.ExportOptions;

            exportOptions.ExportDestinationType    = ExportDestinationType.DiskFile;
            exportOptions.ExportFormatType         = ExportFormatType.PortableDocFormat;
            exportOptions.ExportDestinationOptions = options2;
            Reporte.Export();
            url = DirApp + DirRepLong + NomReporte;
            //if (llamada == "1")
            //{
            //    string Mensaje = "Su solicitud fue enviada exitosamente, con Numero Único de Gestión (NUG): " + ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["traite"].ToString()), true) + ". Por lo que solicitamos presentarse a la oficina Subregional " + Ds_FormularioInscripcion.Tables["Dt_Formulario"].Rows[0]["SubRegion"] + ", con la documentación que deberá presentar para dar trámite a su solicitud.";
            //    ClUtilitarios.EnvioCorreo(Session["Correo_Usuario"].ToString(), ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"])).ToString(), "Solicitud SEGEFOR", Mensaje, 1, attchat,NomReporte);
            //}

            base.Response.Redirect(url);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ClTraductor   = new Cl_Traductor();
            ClCatalogos   = new Cl_Catalogos();
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();
            ClUsuario     = new Cl_Usuario();

            BtnGrabar.Click           += BtnGrabar_Click;
            GrdDetalle.NeedDataSource += GrdDetalle_NeedDataSource;
            GrdDetalle.ItemCommand    += GrdDetalle_ItemCommand;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                Traduce();
            }
        }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClTraductor   = new Cl_Traductor();
            ClCatalogos   = new Cl_Catalogos();
            ClUsuario     = new Cl_Usuario();
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();

            BtnGrabar.Click += BtnGrabar_Click;

            ImageButton ImgEsp;

            ImgEsp        = (ImageButton)Master.FindControl("ImgEsp");
            ImgEsp.Click += ImgEsp_Click;

            ImageButton ImgEng;

            ImgEng        = (ImageButton)Master.FindControl("ImgEng");
            ImgEng.Click += ImgEng_Click;



            Traduce();
            System.Web.UI.HtmlControls.HtmlGenericControl sidebar;
            sidebar         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("sidebar");
            sidebar.Visible = false;

            System.Web.UI.HtmlControls.HtmlGenericControl liMensajes;
            liMensajes         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("liMensajes");
            liMensajes.Visible = false;

            System.Web.UI.HtmlControls.HtmlGenericControl liTickets;
            liTickets         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("liTickets");
            liTickets.Visible = false;

            System.Web.UI.HtmlControls.HtmlGenericControl liPerfil;
            liPerfil         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("liPerfil");
            liPerfil.Visible = false;
        }
Esempio n. 19
0
 public Cl_Persona obtenerCliente(string rut)
 {
     try
     {
         Cl_Persona       cliente = new Cl_Persona();
         OracleDataReader dr;
         object[]         parametros = new object[2];
         parametros[0] = rut;
         parametros[1] = "V_CLIENTE";
         operaciones.abrirConexion();
         OracleCommand cmd = operaciones.execSP("PKG_CLIENTE.OBTENER_CLIENTE", parametros);
         dr = cmd.ExecuteReader();
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 cliente.rut       = dr[0].ToString();
                 cliente.nombre    = dr[1].ToString();
                 cliente.apellido  = dr[2].ToString();
                 cliente.edad      = Convert.ToInt32(dr[3]);
                 cliente.direccion = dr[4].ToString();
                 cliente.correo    = dr[5].ToString();
                 cliente.comuna    = dr[6].ToString();
             }
             dr.Dispose();
         }
         return(cliente);
     }
     catch (Exception err)
     {
         throw new Exception(err.Message);
     }
     finally
     {
         operaciones.cerrarConexion();
     }
 }
Esempio n. 20
0
        private void txtRut_Leave(object sender, EventArgs e)
        {
            //servicio_cliente = new ServicioClient();
            Cl_Persona cliente = daoCliente.obtenerCliente(txtRut.Text);

            if (cliente.rut != null)
            {
                txtNombre.Text         = cliente.nombre;
                txtApellido.Text       = cliente.apellido;
                txtEdad.Text           = cliente.edad.ToString();
                txtDireccion.Text      = cliente.direccion;
                txtCorreo.Text         = cliente.correo;
                cboComuna.SelectedItem = cliente.comuna;
                txtNombre.Enabled      = false;
                txtApellido.Enabled    = false;
                txtEdad.Enabled        = false;
                txtDireccion.Enabled   = false;
                txtCorreo.Enabled      = false;
                cboComuna.Enabled      = false;
            }
            else
            {
                txtNombre.Text          = "";
                txtApellido.Text        = "";
                txtEdad.Text            = "";
                txtDireccion.Text       = "";
                txtCorreo.Text          = "";
                cboComuna.SelectedIndex = 0;

                txtNombre.Enabled    = true;
                txtApellido.Enabled  = true;
                txtEdad.Enabled      = true;
                txtDireccion.Enabled = true;
                txtCorreo.Enabled    = true;
                cboComuna.Enabled    = true;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUsuario     = new Cl_Usuario();
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();
            ClRegistro    = new Cl_Registro();

            BtnSubirFoto.Click          += BtnSubirFoto_Click;
            BtnUploadMapaVocacion.Click += BtnUploadMapaVocacion_Click;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                ClUsuario.Insertar_Ingreso_Pagina(52, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_IngresoPagina());
                ClUtilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                System.Web.UI.WebControls.Label LblPerfil;
                LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                LblPerfil.Text = ClUsuario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                System.Web.UI.WebControls.Label LblUsuario;
                LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));


                DataSet dsPermisos = ClUsuario.Get_Roles(Convert.ToInt32(Session["UsuarioId"]), 52);
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Editar"]) == 0)
                {
                    BtnSubirFoto.Visible          = false;
                    BtnUploadMapaVocacion.Visible = false;
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Insertar"]) == 0)
                {
                    BtnSubirFoto.Visible          = false;
                    BtnUploadMapaVocacion.Visible = false;
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Eliminar"]) == 0)
                {
                    BtnSubirFoto.Visible          = false;
                    BtnUploadMapaVocacion.Visible = false;
                }
                dsPermisos.Clear();


                System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                System.Web.UI.WebControls.Image      ImgPerfil;
                ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");

                if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                {
                    ImgPerfilFake.Visible = false;
                    ImgPerfil.Visible     = true;
                }
                else
                {
                    ImgPerfilFake.Visible = true;
                    ImgPerfil.Visible     = false;
                    if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                    {
                        ImgPerfilFake.Src = "../imagenes/male.png";
                    }

                    else
                    {
                        ImgPerfilFake.Src = "../imagenes/female.png";
                    }
                }
                CargarImagenes();
            }
        }
Esempio n. 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUsuario     = new Cl_Usuario();
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();
            ClCatalogos   = new Cl_Catalogos();
            ClProfesion   = new Cl_Profesion();
            GrdProfesion.NeedDataSource += GrdProfesion_NeedDataSource;
            BtnGrabar.Click             += BtnGrabar_Click;
            BtnNuevo.ServerClick        += BtnNuevo_ServerClick;
            GrdProfesion.ItemCommand    += GrdProfesion_ItemCommand;
            BtnYes.Click += BtnYes_Click;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                ClUsuario.Insertar_Ingreso_Pagina(22, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_IngresoPagina());
                ClUtilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                System.Web.UI.WebControls.Label LblPerfil;
                LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                LblPerfil.Text = ClUsuario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                System.Web.UI.WebControls.Label LblUsuario;
                LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));

                DataSet dsPermisos = ClUsuario.Get_Roles(Convert.ToInt32(Session["UsuarioId"]), 22);
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Editar"]) == 0)
                {
                    GrdProfesion.Columns[4].Visible = false;
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Insertar"]) == 0)
                {
                    BtnGrabar.Visible = false;
                    BtnNuevo.Visible  = false;
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Eliminar"]) == 0)
                {
                }
                dsPermisos.Clear();

                System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                System.Web.UI.WebControls.Image      ImgPerfil;
                ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");

                if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                {
                    ImgPerfilFake.Visible = false;
                    ImgPerfil.Visible     = true;
                }
                else
                {
                    ImgPerfilFake.Visible = true;
                    ImgPerfil.Visible     = false;
                    if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                    {
                        ImgPerfilFake.Src = "../imagenes/male.png";
                    }

                    else
                    {
                        ImgPerfilFake.Src = "../imagenes/female.png";
                    }
                }

                ClUtilitarios.LlenaCombo(ClCatalogos.Categoria_Profesion_GetAll(), CboCategoria, "CategoriaProfesionId", "CategoriaProfesion");
                ClUtilitarios.AgregarSeleccioneCombo(CboCategoria, "Grado Académico");
                ClUtilitarios.LlenaCombo(ClCatalogos.Estatus_Profesion_GetAll(), CboEstatus, "EstatusProfesionId", "EstatusProfesion");
                ClUtilitarios.AgregarSeleccioneCombo(CboEstatus, "Estatus");
            }
        }
Esempio n. 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Clutilitarios = new Cl_Utilitarios();
            Clususario    = new Cl_Usuario();
            ClPersona     = new Cl_Persona();

            BtnCambia.Click += BtnCambia_Click;
            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                Clususario.Insertar_Ingreso_Pagina(15, Convert.ToInt32(Session["UsuarioId"]), Clususario.CorrId_IngresoPagina());
                if (Clutilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["appel"].ToString()), true) == "1")
                {
                    System.Web.UI.HtmlControls.HtmlGenericControl sidvar;
                    sidvar         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("MenuAdm");
                    sidvar.Visible = false;

                    System.Web.UI.WebControls.Label lblUsuario;
                    lblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                    lblUsuario.Text = "Nuevo Usuario";


                    System.Web.UI.HtmlControls.HtmlGenericControl lines;
                    lines         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("lines");
                    lines.Visible = false;

                    System.Web.UI.HtmlControls.HtmlGenericControl Notif;
                    Notif         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Notif");
                    Notif.Visible = false;

                    DataSet dsPermisos = Clususario.Get_Roles(Convert.ToInt32(Session["UsuarioId"]), 15);
                    if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Editar"]) == 0)
                    {
                        BtnCambia.Visible = false;
                    }
                    if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Insertar"]) == 0)
                    {
                    }
                    if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Eliminar"]) == 0)
                    {
                    }
                    dsPermisos.Clear();

                    System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                    System.Web.UI.WebControls.Image      ImgPerfil;
                    ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                    ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");
                    if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                    {
                        ImgPerfilFake.Visible = false;
                        ImgPerfil.Visible     = true;
                    }
                    else
                    {
                        ImgPerfilFake.Visible = true;
                        ImgPerfil.Visible     = false;
                        if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                        {
                            ImgPerfilFake.Src = "../imagenes/male.png";
                        }

                        else
                        {
                            ImgPerfilFake.Src = "../imagenes/female.png";
                        }
                    }

                    System.Web.UI.WebControls.Label LblPerfil;
                    LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                    LblPerfil.Text = Clususario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                    System.Web.UI.WebControls.Label LblUsuario;
                    LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                    LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));
                }
                else
                {
                    Clutilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                    System.Web.UI.WebControls.Label LblPerfil;
                    LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                    LblPerfil.Text = Clususario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                    System.Web.UI.WebControls.Label LblUsuario;
                    LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                    LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));

                    DataSet dsPermisos = Clususario.Get_Roles(Convert.ToInt32(Session["UsuarioId"]), 15);
                    if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Editar"]) == 0)
                    {
                        BtnCambia.Visible = false;
                    }
                    if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Insertar"]) == 0)
                    {
                    }
                    if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Eliminar"]) == 0)
                    {
                    }
                    dsPermisos.Clear();


                    System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                    System.Web.UI.WebControls.Image      ImgPerfil;
                    ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                    ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");
                    if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                    {
                        ImgPerfilFake.Visible = false;
                        ImgPerfil.Visible     = true;
                    }
                    else
                    {
                        ImgPerfilFake.Visible = true;
                        ImgPerfil.Visible     = false;
                        if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                        {
                            ImgPerfilFake.Src = "../imagenes/male.png";
                        }

                        else
                        {
                            ImgPerfilFake.Src = "../imagenes/female.png";
                        }
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUsuario     = new Cl_Usuario();
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();
            ClManejo      = new Cl_Manejo();
            ClRegistro    = new Cl_Registro();

            BtnRegresar.Click += BtnRegresar_Click;
            CboNombre.SelectedIndexChanged     += CboNombre_SelectedIndexChanged;
            BtnAsignaRegente.Click             += BtnAsignaRegente_Click;
            CboNombreEcut.SelectedIndexChanged += CboNombreEcut_SelectedIndexChanged;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                ClUtilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                System.Web.UI.WebControls.Label LblPerfil;
                LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                LblPerfil.Text = ClUsuario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                System.Web.UI.WebControls.Label LblUsuario;
                LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));



                System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                System.Web.UI.WebControls.Image      ImgPerfil;
                ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");

                if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                {
                    ImgPerfilFake.Visible = false;
                    ImgPerfil.Visible     = true;
                }
                else
                {
                    ImgPerfilFake.Visible = true;
                    ImgPerfil.Visible     = false;
                    if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                    {
                        ImgPerfilFake.Src = "../imagenes/male.png";
                    }

                    else
                    {
                        ImgPerfilFake.Src = "../imagenes/female.png";
                    }
                }

                TxtAreaAprovecha.Text = ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["taille"].ToString()), true);
                double Area        = Convert.ToDouble(TxtAreaAprovecha.Text);
                int    CategoriaId = Convert.ToInt32(ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["categorie"].ToString()), true));
                ClUtilitarios.LlenaCombo(ClManejo.Get_Regentes(Area, 2), CboNombre, "RegistroId", "Nombre");
                if (CategoriaId == 8)
                {
                    if (Area > 1)
                    {
                        ClUtilitarios.LlenaCombo(ClManejo.Get_Regentes(Area, 1), CboNombreEcut, "RegistroId", "Nombre");
                        DivEcut.Visible = true;
                    }
                }

                switch (CategoriaId)
                {
                case 3:
                    LblTitulo.Text = "SOLICITUD DE LICENCIA DE APROVECHAMIENTO FORESTAL";
                    break;

                case 4:
                    LblTitulo.Text = "SOLICITUD DE LICENCIA DE APROVECHAMIENTO CON FINES SANITARIOS";
                    break;

                case 5:
                    LblTitulo.Text = "SOLICITUD DE LICENCIA DE SANEAMIENTO";
                    break;

                case 6:
                    LblTitulo.Text = "SOLICITUD DE LICENCIA DE SALVAMENTO";
                    break;

                case 7:
                    LblTitulo.Text = "SOLICITUD DE LICENCIA CON FINES CIENTIFICOS";
                    break;

                case 8:
                    LblTitulo.Text = "SOLICITUD DE LICENCIA PARA CAMBIO DE USO DE TIERRA";

                    break;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUsuario                        = new Cl_Usuario();
            ClUtilitarios                    = new Cl_Utilitarios();
            ClPersona                        = new Cl_Persona();
            ClCatalogos                      = new Cl_Catalogos();
            BtnBuscar.ServerClick           += BtnBuscar_ServerClick;
            CboPersona.SelectedIndexChanged += CboPersona_SelectedIndexChanged;
            BtnGrabar.Click                 += BtnGrabar_Click;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                ClUsuario.Insertar_Ingreso_Pagina(49, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_IngresoPagina());
                ClUtilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                System.Web.UI.WebControls.Label LblPerfil;
                LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                LblPerfil.Text = ClUsuario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                System.Web.UI.WebControls.Label LblUsuario;
                LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));


                DataSet dsPermisos = ClUsuario.Get_Roles(Convert.ToInt32(Session["UsuarioId"]), 49);
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Editar"]) == 0)
                {
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Insertar"]) == 0)
                {
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Eliminar"]) == 0)
                {
                }
                dsPermisos.Clear();


                System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                System.Web.UI.WebControls.Image      ImgPerfil;
                ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");

                if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                {
                    ImgPerfilFake.Visible = false;
                    ImgPerfil.Visible     = true;
                }
                else
                {
                    ImgPerfilFake.Visible = true;
                    ImgPerfil.Visible     = false;
                    if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                    {
                        ImgPerfilFake.Src = "../imagenes/male.png";
                    }

                    else
                    {
                        ImgPerfilFake.Src = "../imagenes/female.png";
                    }
                }

                ClUtilitarios.LlenaCombo(ClCatalogos.Get_PersonasGestionTecnico(), CboPersona, "PersonaId", "Nombres");
                ClUtilitarios.AgregarSeleccioneCombo(CboPersona, "Persona");
            }
        }
Esempio n. 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUsuario     = new Cl_Usuario();
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();
            ClCatalogos   = new Cl_Catalogos();
            ClRegiones    = new Cl_Regiones();

            GrdRegiones.ItemDataBound                     += GrdRegiones_ItemDataBound;
            GrdRegiones.ItemCommand                       += GrdRegiones_ItemCommand;
            GrdSubRegiones.NeedDataSource                 += GrdSubRegiones_NeedDataSource;
            GrdRegiones.NeedDataSource                    += GrdRegiones_NeedDataSource;
            GrdSubRegiones.ItemDataBound                  += GrdSubRegiones_ItemDataBound;
            GrdSubRegiones.ItemCommand                    += GrdSubRegiones_ItemCommand;
            btnNuevo.ServerClick                          += btnNuevo_ServerClick;
            BtnGrabar.ServerClick                         += BtnGrabar_ServerClick;
            GrdMunicipios.NeedDataSource                  += GrdMunicipios_NeedDataSource;
            BtnNuevoMun.ServerClick                       += BtnNuevoMun_ServerClick;
            CboDepartamento.SelectedIndexChanged          += CboDepartamento_SelectedIndexChanged;
            BtnGrabarMunicipio.ServerClick                += BtnGrabarMunicipio_ServerClick;
            GrdMunicipios.ItemDataBound                   += GrdMunicipios_ItemDataBound;
            GrdMunicipios.ItemCommand                     += GrdMunicipios_ItemCommand;
            CboDepartamentoSubRegion.SelectedIndexChanged += CboDepartamentoSubRegion_SelectedIndexChanged;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                ClUsuario.Insertar_Ingreso_Pagina(51, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_IngresoPagina());
                ClUtilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                System.Web.UI.WebControls.Label LblPerfil;
                LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                LblPerfil.Text = ClUsuario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                System.Web.UI.WebControls.Label LblUsuario;
                LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));


                DataSet dsPermisos = ClUsuario.Get_Roles(Convert.ToInt32(Session["UsuarioId"]), 51);
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Editar"]) == 0)
                {
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Insertar"]) == 0)
                {
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Eliminar"]) == 0)
                {
                }
                dsPermisos.Clear();


                System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                System.Web.UI.WebControls.Image      ImgPerfil;
                ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");

                if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                {
                    ImgPerfilFake.Visible = false;
                    ImgPerfil.Visible     = true;
                }
                else
                {
                    ImgPerfilFake.Visible = true;
                    ImgPerfil.Visible     = false;
                    if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                    {
                        ImgPerfilFake.Src = "../imagenes/male.png";
                    }

                    else
                    {
                        ImgPerfilFake.Src = "../imagenes/female.png";
                    }
                }
                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoPersonas(), CboPersona, "PersonaId", "Persona");
                ClUtilitarios.AgregarSeleccioneCombo(CboPersona, "Persona");
                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoDepartamentos(), CboDepartamento, "DepartamentoId", "Departamento");
                ClUtilitarios.AgregarSeleccioneCombo(CboDepartamento, "Departamento");
                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoDepartamentos(), CboDepartamentoSubRegion, "DepartamentoId", "Departamento");
                ClUtilitarios.AgregarSeleccioneCombo(CboDepartamentoSubRegion, "Departamento");
            }
        }
Esempio n. 27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Clutilitarios = new Cl_Utilitarios();
            Clususario    = new Cl_Usuario();
            ClPersona     = new Cl_Persona();

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                Clutilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                System.Web.UI.WebControls.Label LblPerfil;
                LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                LblPerfil.Text = Clususario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                System.Web.UI.WebControls.Label LblUsuario;
                LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));

                System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                System.Web.UI.WebControls.Image      ImgPerfil;
                ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");
                if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                {
                    ImgPerfilFake.Visible = false;
                    ImgPerfil.Visible     = true;
                }
                else
                {
                    ImgPerfilFake.Visible = true;
                    ImgPerfil.Visible     = false;
                    if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                    {
                        ImgPerfilFake.Src = "../imagenes/male.png";
                    }

                    else
                    {
                        ImgPerfilFake.Src = "../imagenes/female.png";
                    }
                }

                System.Web.UI.HtmlControls.HtmlGenericControl Notif;
                Notif         = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Notif");
                Notif.Visible = false;
                string llamada = "";
                if (Request.QueryString["appel"].ToString() != "0")
                {
                    llamada = Clutilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["appel"].ToString()), true);
                }
                if (llamada == "0")
                {
                    Mensaje.Visible = false;
                    LnkLink.Visible = false;
                }
                else if (llamada == "1")
                {
                    Mensaje.Visible = true;
                    LnkLink.Visible = true;
                    Mensaje.Text    = "Estimado(a): " + ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"])) + " su solicitud fue enviada exitosamente, en breve recibira un correo donde podra imprimir su formulario de inscripción, debera presentarse a la oficina del INAB correspondiente lo antes posible, por favor dirigase al siguiente enlace para ver sus gestiones e imprimir los documentos correspondientes para el ingreso de su gestión";
                    //RadWindow1.Title = "Formulario de Inscripción";
                    //RadWindow1.NavigateUrl = "~/WeForms_Reportes/Wfrm_RepFormularioProfesional.aspx?appel=" + HttpUtility.UrlEncode(Clutilitarios.Encrypt("1", true)) + "&traite=" + HttpUtility.UrlEncode(Request.QueryString["traite"]) + "";
                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "function f(){$find('" + RadWindow1.ClientID + "').show();Sys.Application.remove_load(f);}Sys.Application.add_load(f);", true);
                }
                else if (llamada == "2")
                {
                    Mensaje.Visible = true;
                    LnkLink.Visible = true;
                    Mensaje.Text    = "Estimado(a): " + ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"])) + " su solicitud fue enviada exitosamente, en breve recibira un correo donde podra imprimir su formulario de inscripción, debera presentarse a la oficina del INAB correspondiente lo antes posible, por favor dirigase al siguiente enlace para ver sus gestiones e imprimir los documentos correspondientes para el ingreso de su gestión";
                    //RadWindow1.Title = "Formulario de Inscripción";
                    //RadWindow1.NavigateUrl = "~/WeForms_Reportes/Wfrm_RepFormularioPlantacion.aspx?appel=" + HttpUtility.UrlEncode(Clutilitarios.Encrypt("1", true)) + "&traite=" + HttpUtility.UrlEncode(Request.QueryString["traite"]) + "";
                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "function f(){$find('" + RadWindow1.ClientID + "').show();Sys.Application.remove_load(f);}Sys.Application.add_load(f);", true);
                }
                else if (llamada == "3")
                {
                    Mensaje.Visible = true;
                    LnkLink.Visible = true;
                    Mensaje.Text    = Clutilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["message"].ToString()), true);
                }
                else if (llamada == "4")
                {
                    Mensaje.Visible = true;
                    LnkLink.Visible = true;
                    Mensaje.Text    = "Estimado(a): " + ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"])) + " la solicitud de inscripción de Bosques Naturales a nombre de: " + Session["Solicitante"] + " fue enviada exitosamente.";
                    //RadWindow1.Title = "Formulario de Inscripción";
                    //RadWindow1.NavigateUrl = "~/WeForms_Reportes/Wfrm_RepFormularioPlantacion.aspx?appel=" + HttpUtility.UrlEncode(Clutilitarios.Encrypt("1", true)) + "&traite=" + HttpUtility.UrlEncode(Request.QueryString["traite"]) + "";
                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "function f(){$find('" + RadWindow1.ClientID + "').show();Sys.Application.remove_load(f);}Sys.Application.add_load(f);", true);
                }
            }
        }
Esempio n. 28
0
        private void btnConfirmar_Click(object sender, EventArgs e)
        {
            /*string rut = txtRut.Text;
             * string nombre = txtNombre.Text;
             * string apellido = txtApellido.Text;
             * int edad = Convert.ToInt32(txtEdad.Text);
             * string direccion = txtDireccion.Text;
             * string comuna = cboComuna.SelectedItem.ToString();*/
            Cl_Persona cliente = new Cl_Persona();

            if (!validarRut(txtRut.Text.ToString()))
            {
                MessageBox.Show("Ingrese un RUT Valido");
                return;
            }
            else
            {
                cliente.rut = txtRut.Text;
            }

            if (txtNombre.Text.ToString().Length < 3)
            {
                MessageBox.Show("Ingrese un nombre con al menos 3 caracteres");
                return;
            }
            else
            {
                cliente.nombre = txtNombre.Text;
            }

            if (txtApellido.Text.ToString().Length < 3)
            {
                MessageBox.Show("Ingrese un apellido con al menos 3 caracteres");
                return;
            }
            else
            {
                cliente.apellido = txtApellido.Text;
            }
            if (txtEdad.Text.ToString().Equals(""))
            {
                MessageBox.Show("Ingrese una Edad");
                return;
            }
            else
            {
                int edad = Convert.ToInt32(txtEdad.Text);
                if (edad >= 18 && edad <= 80)
                {
                    cliente.edad = Convert.ToInt32(txtEdad.Text);
                }
                else
                {
                    MessageBox.Show("Ingrese una edad valida");
                    return;
                }
            }
            if (txtDireccion.Text.ToString().Length > 3)
            {
                cliente.direccion = txtDireccion.Text;
            }
            else
            {
                MessageBox.Show("Ingrese una direccion valida");
                return;
            }

            cliente.correo = txtCorreo.Text;
            cliente.comuna = cboComuna.SelectedItem.ToString();
            int despacho = 0;
            int tipoPago = 0;

            //servicio_cliente = new ServicioClient();
            if (cboTipoDespacho.SelectedItem != null)
            {
                if (cboTipoDespacho.SelectedItem.ToString().Equals("Domicilio"))
                {
                    despacho = 1;
                }
                else if (cboTipoDespacho.SelectedItem.ToString().Equals("Tienda"))
                {
                    despacho = 2;
                }
            }
            else
            {
                MessageBox.Show("Seleccione un tipo de despacho");
                return;
            }
            if (cboTipoPago.SelectedItem != null)
            {
                if (cboTipoPago.SelectedItem.ToString().Equals("Efectivo"))
                {
                    tipoPago = 1;
                }
                if (cboTipoPago.SelectedItem.ToString().Equals("Credito"))
                {
                    tipoPago = 2;
                }
                if (cboTipoPago.SelectedItem.ToString().Equals("Debito"))
                {
                    tipoPago = 3;
                }
            }
            else
            {
                MessageBox.Show("Seleccione un tipo de Pago");
                return;
            }

            int idVenta = daoVenta.insertarVenta(cliente, vendedor, totalVenta, despacho, tipoPago);

            foreach (var item in listaCarrito)
            {
                int totalProd = (item.precio * item.cantidad) - ((item.cantidad * item.precio) * (item.descuento / 100));
                int resp      = daoVenta.insertarDetalleVenta(idVenta, item.cantidad, totalProd, item.idProducto);
                if (resp != 1)
                {
                    MessageBox.Show("No se pudo insertar el detalle de la venta");
                    return;
                }
            }
            MessageBox.Show("La venta fue ingresada correctamente");
            vendControl.vaciarCarrito();
            vendControl.cargarProductos();
            this.Close();
        }
Esempio n. 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUsuario         = new Cl_Usuario();
            ClUtilitarios     = new Cl_Utilitarios();
            ClPersona         = new Cl_Persona();
            ClCatalogos       = new Cl_Catalogos();
            ClGestionRegistro = new Cl_Gestion_Registro();

            CboRegion.SelectedIndexChanged       += CboRegion_SelectedIndexChanged;
            CboDepartamento.SelectedIndexChanged += CboDepartamento_SelectedIndexChanged;
            CboActividad.SelectedIndexChanged    += CboActividad_SelectedIndexChanged;
            CboProfesion.SelectedIndexChanged    += CboProfesion_SelectedIndexChanged;
            BtnVistaPrevia.Click += BtnVistaPrevia_Click;
            BtnEnviar.Click      += BtnEnviar_Click;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                ClUsuario.Insertar_Ingreso_Pagina(23, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_IngresoPagina());
                ClUtilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                System.Web.UI.WebControls.Label LblPerfil;
                LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                LblPerfil.Text = ClUsuario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                System.Web.UI.WebControls.Label LblUsuario;
                LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));

                DataSet dsPermisos = ClUsuario.Get_Roles(Convert.ToInt32(Session["UsuarioId"]), 23);
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Editar"]) == 0)
                {
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Insertar"]) == 0)
                {
                    BtnEnviar.Visible = false;
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Eliminar"]) == 0)
                {
                }
                dsPermisos.Clear();

                System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                System.Web.UI.WebControls.Image      ImgPerfil;
                ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");

                if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                {
                    ImgPerfilFake.Visible = false;
                    ImgPerfil.Visible     = true;
                }
                else
                {
                    ImgPerfilFake.Visible = true;
                    ImgPerfil.Visible     = false;
                    if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                    {
                        ImgPerfilFake.Src = "../imagenes/male.png";
                    }

                    else
                    {
                        ImgPerfilFake.Src = "../imagenes/female.png";
                    }
                }

                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoRegion(), CboRegion, "RegionId", "Nombre");
                ClUtilitarios.AgregarSeleccioneCombo(CboRegion, "Región");
                ClUtilitarios.AgregarSeleccioneCombo(CboSubRegion, "Subregión");
                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoDepartamentos(), CboDepartamento, "DepartamentoId", "Departamento");
                ClUtilitarios.AgregarSeleccioneCombo(CboDepartamento, "Departamento");
                ClUtilitarios.AgregarSeleccioneCombo(CboMunicipio, "Municipio");
                ClUtilitarios.LlenaCombo(ClCatalogos.ListadoSubCategoriasRegistro(7, Convert.ToInt32(Session["PersonaId"])), CboActividad, "SubCategoriaId", "Nombre_Subcategoria");
                ClUtilitarios.AgregarSeleccioneCombo(CboActividad, "Actividad");
                CargaInfo();
                TxtCelular.Enabled = true;
            }
        }
Esempio n. 30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClUsuario     = new Cl_Usuario();
            ClUtilitarios = new Cl_Utilitarios();
            ClPersona     = new Cl_Persona();
            ClManejo      = new Cl_Manejo();
            ClRegistro    = new Cl_Registro();
            ClInmueble    = new Cl_Inmueble();
            Cl_Gestion    = new Cl_Gestion_Registro();

            GrdPlanesSolicitados.NeedDataSource            += GrdPlanesSolicitados_NeedDataSource;
            GrdPlanesSolicitadosComoRegente.NeedDataSource += GrdPlanesSolicitadosComoRegente_NeedDataSource;
            GrdPlanesSolicitadosComoRegente.ItemCommand    += GrdPlanesSolicitadosComoRegente_ItemCommand;
            GrdPlanesSolicitadosComoRegente.ItemDataBound  += GrdPlanesSolicitadosComoRegente_ItemDataBound;
            GrdPlanesSolicitados.ItemDataBound             += GrdPlanesSolicitados_ItemDataBound;
            GrdPlanesSolicitados.ItemCommand += GrdPlanesSolicitados_ItemCommand;
            BtnYes.ServerClick += BtnYes_ServerClick;

            if (Session["UsuarioId"] == null)
            {
                Response.Redirect("~/Wfrm_Login.aspx");
            }
            else if (!IsPostBack)
            {
                ClUsuario.Insertar_Ingreso_Pagina(46, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_IngresoPagina());
                ClUtilitarios.Permisos(Master, Convert.ToInt32(Session["UsuarioId"]));
                System.Web.UI.WebControls.Label LblPerfil;
                LblPerfil      = (System.Web.UI.WebControls.Label)Master.FindControl("LblTipoUsuario");
                LblPerfil.Text = ClUsuario.Get_Tipo_Usuario(Convert.ToInt32(Session["UsuarioId"]));

                System.Web.UI.WebControls.Label LblUsuario;
                LblUsuario      = (System.Web.UI.WebControls.Label)Master.FindControl("lblUsuario");
                LblUsuario.Text = ClPersona.Nombre_Usuario(Convert.ToInt32(Session["PersonaId"]));


                DataSet dsPermisos = ClUsuario.Get_Roles(Convert.ToInt32(Session["UsuarioId"]), 46);
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Editar"]) == 0)
                {
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Insertar"]) == 0)
                {
                }
                if (Convert.ToInt32(dsPermisos.Tables["Datos"].Rows[0]["Eliminar"]) == 0)
                {
                }
                dsPermisos.Clear();


                System.Web.UI.HtmlControls.HtmlImage ImgPerfilFake;
                System.Web.UI.WebControls.Image      ImgPerfil;
                ImgPerfilFake = (System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("ImgPerfilFake");
                ImgPerfil     = (System.Web.UI.WebControls.Image)Master.FindControl("ImgPerfil");

                if (ClPersona.Existe_FotoPerfil(Convert.ToInt32(Session["PersonaId"])) == true)
                {
                    ImgPerfilFake.Visible = false;
                    ImgPerfil.Visible     = true;
                }
                else
                {
                    ImgPerfilFake.Visible = true;
                    ImgPerfil.Visible     = false;
                    if (ClPersona.Genero_Usuario(Convert.ToInt32(Session["PersonaId"])) == 1)
                    {
                        ImgPerfilFake.Src = "../imagenes/male.png";
                    }

                    else
                    {
                        ImgPerfilFake.Src = "../imagenes/female.png";
                    }
                }

                int EsEMPF = ClRegistro.EsElaboradorPM_Activo(Convert.ToInt32(Session["PersonaId"]));
                if (EsEMPF == 0)
                {
                    DivTitPlanProceso.Visible = false;
                    DivPlanProceso.Visible    = false;
                }
            }
        }