public string GetDestination(long userId, string pluginId, MemberContactsInfo.UserTypes type) { var Destination = Context.MemberContactsInfo.Where(a => a.UserId == userId && a.ServiceProvider == pluginId && a.UserType == type).FirstOrDefault(); if (Destination != null) { return(Destination.Contact); } return(""); }
public string GetDestination(long userId, string pluginId, MemberContactsInfo.UserTypes type) { MemberContactsInfo memberContactsInfo = ( from a in context.MemberContactsInfo where a.UserId == userId && (a.ServiceProvider == pluginId) && (int)a.UserType == (int)type select a).FirstOrDefault(); if (memberContactsInfo == null) { return(""); } return(memberContactsInfo.Contact); }
public void CheckContactInfoHasBeenUsed(string serviceProvider, string contact, MemberContactsInfo.UserTypes userType = 0) { if (context.MemberContactsInfo.FirstOrDefault((MemberContactsInfo item) => (item.ServiceProvider == serviceProvider) && (item.Contact == contact) && (int)item.UserType == (int)userType) != null) { throw new HimallException(string.Format("{0}已经被其它用户绑定", contact)); } }
/// <summary> /// 根据插件类型和ID和目标获取信息 /// </summary> /// <param name="pluginId"></param> /// <param name="contact"></param> /// <param name="type"></param> /// <returns></returns> public static MemberContactsInfo GetMemberContactsInfo(string pluginId, string contact, MemberContactsInfo.UserTypes type) { return(_iMessageService.GetMemberContactsInfo(pluginId, contact, type)); }
/// <summary> /// 获取发送目标 /// </summary> /// <param name="userId">用户ID</param> /// <param name="pluginId">插件ID</param> /// <param name="type">用户类型</param> /// <returns></returns> public static string GetDestination(long userId, string pluginId, MemberContactsInfo.UserTypes type) { return(_iMessageService.GetDestination(userId, pluginId, type)); }
public MemberContactsInfo GetMemberContactsInfo(string pluginId, string contact, MemberContactsInfo.UserTypes type) { return(( from a in context.MemberContactsInfo where (a.ServiceProvider == pluginId) && (int)a.UserType == (int)type && (a.Contact == contact) select a).FirstOrDefault()); }
public MemberContactsInfo GetMemberContactsInfo(string pluginId, string contact, MemberContactsInfo.UserTypes type) { return(Context.MemberContactsInfo.Where(a => a.ServiceProvider == pluginId && a.UserType == type && a.Contact == contact).FirstOrDefault()); }