public TEntity SetRole(string personId, string roleId)
        {
            int id = personId.ToInt();
            var tp = db.LocationCardToPersonnels.Find(i => i.PersonnelId == id);

            if (tp == null)
            {
                return(null);
            }
            TagService tagService = new TagService(db);
            var        tag        = tagService.SetRole(tp.LocationCardId + "", roleId);

            if (tag == null)
            {
                return(null);
            }
            return(GetEntity(personId));
        }
 public TEntity SetRole(string personId, string roleId)
 {
     try
     {
         int id = personId.ToInt();
         var tp = db.LocationCardToPersonnels.Find(i => i.PersonnelId == id);
         if (tp == null)
         {
             return(null);
         }
         TagService tagService = new TagService(db);
         var        tag        = tagService.SetRole(tp.LocationCardId + "", roleId);
         if (tag == null)
         {
             return(null);
         }
         return(GetEntity(personId));
     }
     catch (System.Exception ex)
     {
         Log.Error(tag, "SetRole", "Exception:" + ex);
         return(null);
     }
 }