Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HasPermissionToSeeMe(Operaciones.UsuarioDetalle);
            try
            {
                seguridadService = ServiceFactory.GetSecurityService();

                if (!this.IsPostBack)
                {
                    if (this.Request.QueryString["Id"] == null)
                    {
                        usuarioCurrent = new UsuarioDto();
                    }
                    else
                    {
                        usuarioCurrent = seguridadService.ObtenerUsuario(Convert.ToInt64(this.Request.QueryString["Id"]));
                    }
                    InicializarListControls();
                    this.pnlPassword.Visible = usuarioCurrent.Id == 0;
                    Bindear();
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Instance.HandleException(ex);
            }
        }
Ejemplo n.º 2
0
        private void Bindear()
        {
            if (clienteCurrent.Id != 0)
            {
                this.txtRazonSocial.Text                = clienteCurrent.RazonSocial;
                this.txtCuit.Text                       = clienteCurrent.CUIT.ToString();
                this.txtNombreContacto.Text             = clienteCurrent.NombreContacto;
                this.txtApellidoContacto.Text           = clienteCurrent.ApellidoContacto;
                this.txtEmailContacto.Text              = clienteCurrent.EmailContacto;
                this.txtNombreContactoSecundario.Text   = clienteCurrent.NombreContactoSecundario;
                this.txtApellidoContactoSecundario.Text = clienteCurrent.ApellidoContactoSecundario;
                this.txtEmailContactoSecundario.Text    = clienteCurrent.EmailContactoSecundario;
                this.chkCalculaVencimientoConVisualizacionDoc.Checked = clienteCurrent.CalculaVencimientoConVisualizacionDoc;

                // asigno usuario
                ISeguridadService seguridadSvc = ServiceFactory.GetSecurityService();
                UsuarioDto        usuario      = seguridadSvc.ObtenerUsuario(clienteCurrent.UsuarioId);
                if (usuario != null)
                {
                    this.txtNombreUsuario.Text = usuario.NombreUsuario;
                    this.pnlUsuario.Visible    = true;
                }
                else
                {
                    this.pnlUsuario.Visible = false;
                }
            }
            else
            {
                btnVerAuditoria.Visible = false;
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.HasPermissionToSeeMe(Operaciones.CambiarPassVariosUsuarios);
            try
            {
                if (!this.IsPostBack)
                {
                    if (this.Request.QueryString["Id"] != null)
                    {
                        usuarioCurrent = seguridadService.ObtenerUsuario(Convert.ToInt64(this.Request.QueryString["Id"]));
                    }

                    Bindear();
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Instance.HandleException(ex);
            }
        }
Ejemplo n.º 4
0
        public bool IsInRole(string role)
        {
            bool isInRole                = false;
            ISeguridadService svc        = ServiceFactory.GetSecurityService();
            UsuarioDto        usuarioDto = svc.ObtenerUsuario(this.customIdentity.Name);

            if (usuarioDto != null &&
                usuarioDto.Roles != null &&
                usuarioDto.Roles.Count > 0)
            {
                foreach (var rol in usuarioDto.Roles)
                {
                    if (rol.Codigo == role)
                    {
                        isInRole = true;
                        break;
                    }
                }
            }
            return(isInRole);
        }
Ejemplo n.º 5
0
        private UsuarioDto ObtenerUsuario(string userName)
        {
            ISeguridadService svc = ServiceFactory.GetSecurityService();

            return(svc.ObtenerUsuario(userName));
        }