public bool ResetPass(string Email) { Member members = new Member(); members.Proc_SearchMembersByMail(Email); if (members.RowCount == 0) return false; string accounts = ""; for (int i = 0; i < members.RowCount; i++) { accounts += string.Format("<li><a href='http://chat2connect.com/resetpass.aspx?rc={0}'>{1}</a></li>", Helper.General.EncryptString("mid=" + members.MemberID.ToString() + "&email=" + members.Email), members.GetColumn("UserName")); members.MoveNext(); } try { MailMessage msg = new MailMessage(); string mail = HttpContext.GetGlobalResourceObject("Global", "Mail").ToString(); string mailto = Email; msg.To.Add(mailto); msg.From = new MailAddress(mail); msg.Subject = HttpContext.GetGlobalResourceObject("Global", "ResetSubject").ToString(); msg.IsBodyHtml = true; msg.BodyEncoding = System.Text.Encoding.Unicode; msg.Body = string.Format(HttpContext.GetGlobalResourceObject("Global", "ResetPassBody").ToString(), accounts); SmtpClient client = new SmtpClient(HttpContext.GetGlobalResourceObject("Global", "server").ToString(), 25); client.UseDefaultCredentials = false; client.Credentials = new System.Net.NetworkCredential(mail, HttpContext.GetGlobalResourceObject("Global", "Password").ToString()); client.Send(msg); } catch (Exception ex) { return false; } return true; }
public void GetOnlineFriends() { List<dynamic> friends = new List<dynamic>(); MembershipUser user = Membership.GetUser(); Member member = new Member(); member.GetMemberByUserId(new Guid(user.ProviderUserKey.ToString())); Member online = new Member(); online.GetMemberFriendsByStatus(member.MemberID, true); if (online.RowCount > 0) { for (int i = 0; i < online.RowCount; i++) { friends.Add(new { id = online.MemberID, name = online.GetColumn("UserName"), IsSelected = false }); online.MoveNext(); } } string result = Newtonsoft.Json.JsonConvert.SerializeObject(friends); HttpContext.Current.Response.ContentType = "application/json; charset=utf-8"; HttpContext.Current.Response.Write(result); //return result; }
public List<dynamic> SearchAccountsByMail(string email) { List<dynamic> people = new List<dynamic>(); Member members = new Member(); members.Proc_SearchMembersByMail(email); for (int i = 0; i < members.RowCount; i++) { people.Add(new { MemberID = members.MemberID, MemberName = members.GetColumn("UserName").ToString(), ProfileImg = members.ProfilePic, IsPassReseted = false }); members.MoveNext(); } if (people.Count > 0) { return people; } else return null; }
public List<dynamic> SearchMembers_AddFriends(int mid, string stext) { List<dynamic> people = new List<dynamic>(); Member members = new Member(); members.Proc_SearchMembers(mid, stext); for (int i = 0; i < members.RowCount; i++) { people.Add(new { MemberID = members.MemberID, MemberName = members.GetColumn("UserName").ToString(), ProfileImg = members.ProfilePic, FriendsCount = (int)members.GetColumn("FriendsCount"), IsFriend = false }); members.MoveNext(); } if (people.Count > 0) { return people; } else return null; }
public void GetHelpMembers() { Member member = new Member(); member.GetHelpMembers(); var friends = member.DefaultView.Table.AsEnumerable().Select(m => new { MemberID = m[Member.ColumnNames.MemberID], Name = m[Member.ColumnNames.Name], TypeSpecID = member.GetColumn("MemberTypeSpecID"), ProfilePic = (m[Member.ColumnNames.ProfilePic] == DBNull.Value ? defaultImg : m[Member.ColumnNames.ProfilePic]), IsOnline = m[Member.ColumnNames.IsOnLine], StatusMsg = m[Member.ColumnNames.StatusMsg], Status = Helper.EnumUtil.ParseEnum<Helper.Enums.MemberStatus>(Helper.TypeConverter.ToInt32(m[Member.ColumnNames.Status])).ToString().ToLower() } ).ToList(); SetContentResult(friends); }