示例#1
0
 /// <summary>
 /// 根据Identity 获取Email
 /// </summary>
 /// <param name="identitys"></param>
 public static void GetNamesByIdentitys(Innovator inn, Item identitys, ref string names)
 {
     if (!identitys.isError() && identitys.getItemCount() > 0)
     {
         for (int i = 0; i < identitys.getItemCount(); i++)
         {
             Item   identityItem = identitys.getItemByIndex(i);
             string isAlias      = identityItem.getProperty("is_alias");
             string id           = identityItem.getProperty("id");
             if (isAlias == "1")
             {
                 //根据Id 获取邮箱账户
                 Item   userItem = UserDA.GetUserByIdentityId(inn, id);
                 string name     = userItem.getProperty("keyed_name");
                 if (!string.IsNullOrEmpty(name) && names.IndexOf(name) < 0 && name != "Innovator Admin")
                 {
                     names += name + "、";
                 }
             }
             else
             {
                 Item childIdentity = IdentityDA.GetChildIdentity(inn, id);
                 GetNamesByIdentitys(inn, childIdentity, ref names);
             }
         }
     }
 }
示例#2
0
 /// <summary>
 /// 根据Identity 获取Email
 /// </summary>
 /// <param name="identitys"></param>
 public static void GetEmailByIdentitys(Innovator inn, Item identitys, List <string> listEmail, List <string> names)
 {
     if (!identitys.isError() && identitys.getItemCount() > 0)
     {
         for (int i = 0; i < identitys.getItemCount(); i++)
         {
             Item   identityItem = identitys.getItemByIndex(i);
             string isAlias      = identityItem.getProperty("is_alias");
             string id           = identityItem.getProperty("id");
             if (isAlias == "1")
             {
                 //根据Id 获取邮箱账户
                 Item   userItem = UserDA.GetUserByIdentityId(inn, id);
                 string email    = userItem.getProperty("email");
                 string name     = userItem.getProperty("keyed_name");
                 if (!string.IsNullOrEmpty(name) && names.IndexOf(name) < 0 && name != "Innovator Admin")
                 {
                     names.Add(name);
                 }
                 if (!string.IsNullOrEmpty(email) && listEmail.IndexOf(email) < 0)
                 {
                     listEmail.Add(email);
                 }
             }
             else
             {
                 Item childIdentity = IdentityDA.GetChildIdentity(inn, id);
                 GetEmailByIdentitys(inn, childIdentity, listEmail, names);
             }
         }
     }
 }