public int GetCompanyIdByRealm(string name)
        {
            if (name.IsNullOrEmpty())
            {
                return(-2);
            }
            var obj = RealmRepository.Find(o => o.Name == name && o.State == 1);

            if (obj == null)
            {
                return(0);
            }
            return(obj.CID);
        }
        public CompanyAuthorize GetOne(object id)
        {
            var obj = CompanyAuthorRepository.Get(id);

            if (obj != null)
            {
                var realm = RealmRepository.Find(o => o.CID == obj.CID);
                if (realm != null)
                {
                    obj.RealmName  = realm.Name;
                    obj.RealmState = realm.State == 1;
                    obj.RealmUrl   = realm.Url;
                }
            }
            return(obj);
        }