// private static ISession  _Req;
        public static int CurUserId(HttpRequest Req = null)
        {
            byte[] bb;
            int    ug = 1;


            if (Req.HttpContext.Session.Keys.Contains("userInfo"))
            {
                string sessid = Req.HttpContext.Session.Id;
                Req.HttpContext.Session.TryGetValue("userInfo", out bb);
                ug = CoreLogic.ConvertiByte(bb);
                return(ug);
            }
            else
            {
                E24Exception e = new E24Exception("Сессия пользователя устарела.", 5001);

                throw e;
            }

            return(-1);
        }