protected void DV_Click(object sender, EventArgs e)
        {
            int DV;

            DV = UtilContratosArrto.Digitoverificador(Convert.ToInt32(this.TextBoxIdEdo.Text), Convert.ToInt32(TextBoxUltConsecutivo.Text));
            this.LabelDV.Text = "Digito verificador: " + DV.ToString();
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["Contexto"] == null)
                {
                    Response.Redirect(ConfigurationManager.AppSettings.Get("URL_SSO") + ConfigurationManager.AppSettings.Get("TokenApp").Replace("-", ""));
                }

                this.ColocarURLCierreSession();

                //validar informacion de la cuenta del usuario, si existe excepcion redireccionar a Msj.aspx
                this.ValidaInstitucionUsr();

                //SI LLEGA  AQUI ENTONCES PASO LA VALIDACION PORQUE NO HUBO REDIRECCIONAMIENTO

                //USERNAME
                this.LabelUsr.Text = ((SSO)Session["Contexto"]).UserName.ToUpper();

                //NOMBRE
                this.LabelNombre.Text = ((SSO)Session["Contexto"]).Nombre.ToUpper() + " " + ((SSO)Session["Contexto"]).ApellidoP.ToUpper() + " " + ((SSO)Session["Contexto"]).ApellidoM.ToUpper();


                //CARGO
                if (!String.IsNullOrEmpty(((SSO)Session["Contexto"]).Cargo))
                {
                    this.LabelCargo.Text = ((SSO)Session["Contexto"]).Cargo.ToUpper();
                }
                else
                {
                    this.LabelCargo.Text = "--";
                }

                //INSTITUCION
                if (!String.IsNullOrEmpty(((SSO)Session["Contexto"]).NombreInstitucion))
                {
                    this.LabelInstitucion.Text = ((SSO)Session["Contexto"]).NombreInstitucion.ToUpper();
                }
                else
                {
                    this.LabelInstitucion.Text = "--";
                }

                //SECTOR
                if (!String.IsNullOrEmpty(((SSO)Session["Contexto"]).NombreSector))
                {
                    this.LabelSector.Text = ((SSO)Session["Contexto"]).NombreSector.ToUpper();
                }
                else
                {
                    this.LabelSector.Text = "--";
                }

                //ROL
                String RolUsr = UtilContratosArrto.ObtenerNombreRolUsrApp(((SSO)Session["Contexto"]).LRol);
                this.LabelRol.Text = RolUsr.ToUpper();
            }
        }//load
        protected void Page_Load(object sender, EventArgs e)
        {
            string color = ConfigurationManager.AppSettings["Color"];

            string version = ConfigurationManager.AppSettings["Version"];

            if (!string.IsNullOrEmpty(color) && !string.IsNullOrWhiteSpace(version))
            {
                //poner version y color
                this.DivVersion.Style.Add("background-color", color);
                this.DivVersion.InnerText = version;
            }



            if (!IsPostBack)
            {
                try
                {
                    if (Session["Contexto"] != null)
                    {
                        SSO    usuario = (SSO)Session["Contexto"];
                        String RolUsr  = UtilContratosArrto.ObtenerNombreRolUsrApp(usuario.LRol);
                        var    oic     = UtilContratosArrto.Roles.OIC.ToString();

                        if (RolUsr == oic)
                        {
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "soloLectura", "ValidarSoloLectura('none');", true);
                        } //MZT presentar u ocultar menu item
                        //ADMINISTRADOR DE CONTRATOS
                        else if (RolUsr.Equals("ADMINISTRADOR DE CONTRATOS", StringComparison.InvariantCultureIgnoreCase) || RolUsr.Equals("ADMINISTRADOR", StringComparison.InvariantCultureIgnoreCase))
                        {
                            itemJust.Visible = true;
                            //ScriptManager.RegisterStartupScript(this, typeof(Page), "soloLectura", "MuestraJustipreciaciones();", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "soloLectura", "ValidarSoloLectura('none');", true);
                        //ScriptManager.RegisterStartupScript(this, typeof(Page), "alertUsuario", "alert('No se ha podido recuperar el objeto Contexto del usuario firmado, contacte al administrador del sistema.');", true);
                    }
                }
                catch (Exception ex)
                {
                    string msj = ex.InnerException == null ? ex.Message : ex.InnerException.Message;
                    Session["Msj"] = msj;
                    Response.Redirect("Msj.aspx", false);
                }
            }
        }
Example #4
0
        //interconexion con el BUS
        private bool InterconectarCredencialesConSSO()
        {
            UserName = Request.QueryString["UserName"];
            Token    = Request.QueryString["Token"];

            if (Request.QueryString["DebugMode"] != null)
            {
                //UserName = "******";
                //Token = "organocontrolinterno01";

                //UserName = "******";
                //Token = "promovente01";

                //UserName = "******";
                //Token = "administrador01";

                //UserName = "******";
                //Token = "desa11";

                //UserName = "******";
                //Token = "desa14";

                //UserName = "******";
                //Token = "*****@*****.**";

                UserName = "******";
                Token    = "desa03";

                //UserName = "******";
                //Token = "genguntza";

                //UserName = "******";
                //Token = "desa10";

                //UserName = "******";
                //Token = "desa04";
            }

            Boolean Ok = false;

            if (String.IsNullOrEmpty(UserName) || String.IsNullOrEmpty(Token))
            {
                redireccionSSO();
            }
            else
            {
                ////interconexion con el BUS para ejecutar metodo
                SSO usuario = null;
                try
                {
                    usuario             = new NG().ObtenerUsuario(UserName);
                    Session["Contexto"] = usuario;

                    if (usuario != null)
                    {
                        String RolUsr = UtilContratosArrto.ObtenerNombreRolUsrApp(usuario.LRol);
                        //if (RolUsr == UtilContratosArrto.Roles.OIC.ToString())
                        //    ScriptManager.RegisterStartupScript(this, typeof(Page), "soloLectura", "ValidarSoloLectura('none');", true);
                    }
                    else
                    {
                        //ScriptManager.RegisterStartupScript(this, typeof(Page), "soloLectura", "ValidarSoloLectura('none');", true);
                        //ScriptManager.RegisterStartupScript(this, typeof(Page), "alertUsuario", "alert('No se ha podido recuperar el objeto Contexto del usuario firmado, contacte al administrador del sistema.');", true);
                    }
                    Ok = true;
                }
                catch (Exception ex)
                {
                    string msj = ex.InnerException == null ? ex.Message : ex.InnerException.Message;
                    Session["Msj"] = msj;
                    Response.Redirect("Msj.aspx", false);
                }
            }
            return(Ok);
        }