public ActionResult UsersStuff()
 {
     Compression.SetCompression();
     UserData data = new UserData();
     if(!SessionManager.IsUserInSession())
     {
         data.Error = "User not loged in";
         data.IsError = true;
         return View(data);
     }
     data.UserName = SessionManager.UserName;
     int userId = (int)SessionManager.UserId;
     data.Snippets = Model.GetUsersCode(userId);
     data.Regexes = Model.GetUsersRegex(userId);
     data.Replaces = Model.GetUsersRegexReplace(userId);
     return View(data);
 }
        public ActionResult UsersStuff(int page = 0, string Query = null)
        {
            Compression.SetCompression();
            UserData data = new UserData();
            if (!SessionManager.IsUserInSession())
            {
                data.Error = "Not logged in.";
                data.IsError = true;
                return View(data);
            }
            data.UserName = SessionManager.UserName;
            int userId = (int)SessionManager.UserId;
            if (string.IsNullOrEmpty(Query))
            {
                data.Items = Model.GetUsersItems(userId, page);
                data.CurrentPage = page;
                data.TotalRecords = Model.GetUsersTotal(userId);
            }
            else
            {
                data.Query = Query;
                data.Items = Search.MakeSearch(Query, (int)SessionManager.UserId)
                                   .Select(f => new SavedItem()
                                   {
                                       Date = f.Date,
                                       Guid = f.Guid,
                                       Program = f.Code,
                                       Regex = f.Regex,
                                       Title = f.Title,
                                       Type = f.ID.StartsWith("code") ? 1 : (f.ID.StartsWith("regex_r") ? 3 : 2),
                                       Lang = f.Lang.ToLanguageEnum(),
                                       IsLive = f.IsLive ?? false
                                   })
                                   .ToList();
                data.CurrentPage = 0;
                data.TotalRecords = data.Items.Count();
            }

            data.Wall_ID = Model.GetUserWallId();
            return View(data);
        }