public int GetEmail(string email, string userId = "") { int userID = -1; bool ignoreCurrentUser = false; UserData userData = new UserData(); ColumnDataHelper columnDH = new ColumnDataHelper(); columnDH.Fields.Add("email"); columnDH.FieldValues.Add(email); columnDH.FieldTypes.Add(typeof(string)); if (!String.IsNullOrEmpty(userId)) { ignoreCurrentUser = true; columnDH.Fields.Add("userid"); columnDH.FieldValues.Add(userId); columnDH.FieldTypes.Add(typeof(int)); } DataTable dt = userData.GetRecords(columnDH.GetWhereClause(ignoreCurrentUser)); if (dt.Rows.Count > 0) { userID = Convert.ToInt32(dt.Rows[0]["userID"].ToString()); } return(userID); }
public int GetLoginData(string email, string paswoord) { int userID = -1; UserData userData = new UserData(); ColumnDataHelper columnDH = new ColumnDataHelper(); columnDH.Fields.Add("email"); columnDH.FieldValues.Add(email); columnDH.FieldTypes.Add(typeof(string)); columnDH.Fields.Add("paswoord"); columnDH.FieldValues.Add(paswoord); columnDH.FieldTypes.Add(typeof(string)); DataTable dt = userData.GetRecords(columnDH.GetWhereClause()); if (dt.Rows.Count > 0) { userID = Convert.ToInt32(dt.Rows[0]["userID"].ToString()); } return(userID); }