Пример #1
0
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (gvUser.SelectedRow != null)
            {
                var idStr = gvUser.SelectedRow.Cells[1].Text;
                Guid id;
                if (Guid.TryParse(idStr, out id))
                {
                    var m = UserManager.GetUserById(id);
                    var pass = string.Empty;

                    if(m.PASSWORT != null && m.PASSWORT != string.Empty)
                    {
                        pass = Cryptography.DecryptStringFromBytes_AES(m.PASSWORT);
                    }

                    var user = new NewUser
                    {
                        ID = m.ID,
                        Name = m.NAME,
                        Password = pass,
                        SysAdmin = m.ISADMIN.HasValue ? m.ISADMIN.Value : false
                    };

                    ScriptManager.RegisterStartupScript(this, GetType(), "SELECTMOVEMENT_"
                        + ClientID, "var selectedUser = '******';", true);
                }
            }
        }
        public string GetUserData(string data)
        {
            var user = SessionManager.CurrentUser;

            var retUser = new NewUser
            {
                ID = user.ID,
                Name = user.NAME,
                Password =
                    string.IsNullOrEmpty(user.PASSWORT)
                        ? string.Empty
                        : Cryptography.DecryptStringFromBytes_AES(user.PASSWORT),
                Language = user.CULTURE
            };

            return JsonConvert.SerializeObject(retUser);
        }