public static Member MemberLoginViaNickName(string NickName, string Password) { IDataReader dr = null; try { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_MemberLoginViaNickName"); db.AddInParameter(dbCommand, "NickName", DbType.String, NickName); db.AddInParameter(dbCommand, "Password", DbType.String, Password); //execute the stored procedure dr = db.ExecuteReader(dbCommand); } catch (Exception ex) { throw ex; } List <Member> member = Member.PopulateObject(dr); if (member.Count > 0) { return(member[0]); } else { return(null); } }
public static Member MemberLogin(string EmailAddress, string Password) { IDataReader dr = null; try { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_MemberLogin"); db.AddInParameter(dbCommand, "Email", DbType.String, EmailAddress); db.AddInParameter(dbCommand, "Password", DbType.String, Password); //execute the stored procedure dr = db.ExecuteReader(dbCommand); } catch (Exception ex) { throw ex; } List <Member> member = Member.PopulateObject(dr); if (member.Count > 0) { return(member[0]); } else { throw new BadCredentialsException(Properties.Resources.BadCredentials_InvalidEmailAddressOrPassword); } }
/// <summary> /// Hamids chat reference /// </summary> /// <param name="Email"></param> /// <returns></returns> public static Member GetMemberByEmail(string Email) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_GetMemberByEmail"); db.AddInParameter(dbCommand, "Email", DbType.String, Email); Member member = null; //execute the stored procedure using (IDataReader dr = db.ExecuteReader(dbCommand)) { List <Member> members = Member.PopulateObject(dr); if (members.Count > 0) { member = members[0]; } dr.Close(); } return(member); }
public static Member GetMemberViaNickname(string Nickname) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_GetMemberViaNickname"); db.AddInParameter(dbCommand, "Nickname", DbType.String, Nickname); //execute the stored procedure IDataReader dr = db.ExecuteReader(dbCommand); List <Member> members = Member.PopulateObject(dr); dr.Close(); if (members.Count == 0) { throw new BadCredentialsException(Properties.Resources.BadCredentials_InvalidNickname); } return(members[0]); }
public static Member GetMemberViaWebMemberID(string WebMemberID) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_GetMemberViaWebMemberID"); db.AddInParameter(dbCommand, "WebMemberID", DbType.String, WebMemberID); //execute the stored procedure IDataReader dr = db.ExecuteReader(dbCommand); List <Member> members = Member.PopulateObject(dr); dr.Close(); if (members.Count == 0) { throw new ArgumentException(String.Format(Properties.Resources.Argument_InvalidWebMemberID, WebMemberID)); } return(members[0]); }
public static Member AuthenticateMember(string WebMemberID, string Password) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_MemberAuthenticate"); db.AddInParameter(dbCommand, "WebMemberID", DbType.String, WebMemberID); db.AddInParameter(dbCommand, "Password", DbType.String, Password); //execute the stored procedure IDataReader dr = db.ExecuteReader(dbCommand); List <Member> members = Member.PopulateObject(dr); dr.Close(); if (members.Count == 0) { throw new BadCredentialsException(Properties.Resources.BadCredentials_InvalidWebMemberIDOrPassword); } return(members[0]); }
public static Member GetMemberViaWebMemberIDNoEx(string WebMemberID) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_GetMemberViaWebMemberID"); db.AddInParameter(dbCommand, "WebMemberID", DbType.String, WebMemberID); //execute the stored procedure IDataReader dr = db.ExecuteReader(dbCommand); List <Member> members = Member.PopulateObject(dr); Member ReturnMember = null; dr.Close(); if (members.Count > 0) { ReturnMember = members[0]; } return(ReturnMember); }
public static Member SafeMemberLogin(string Nickname, string Password) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_GetMemberViaNicknamePassword"); db.AddInParameter(dbCommand, "Nickname", DbType.String, Nickname); db.AddInParameter(dbCommand, "Password", DbType.String, Password); //execute the stored procedure IDataReader dr = db.ExecuteReader(dbCommand); List <Member> members = Member.PopulateObject(dr); dr.Close(); if (members.Count > 0) { return(members[0]); } else { return(null); } }