public string Get(string password, string email) { User user = new User(email, password); if (user.SessionID == null) { return(ObjectToJsonConverter.ObjectToJson(new Error(ErrorCodes.USER_NOT_IN_DB))); } return(ObjectToJsonConverter.ObjectToJson(user.SessionID)); }
public string Get(string email) { SqlCommand UserInfo = new SqlCommand(UserQueries.UserInfo); UserInfo.Parameters.AddWithValue("@email", email); DataSet userData = new DataSet(); userData = DBManager.ExecuteCommand(UserInfo); return(ObjectToJsonConverter.ObjectToJson(new User(userData.Tables[0].Rows[0]))); }
public string Get(int userId) { SqlCommand UserPosts = new SqlCommand(PostQueries.UserPosts); UserPosts.Parameters.AddWithValue("@id", userId); DataSet postData = new DataSet(); postData = DBManager.ExecuteCommand(UserPosts); Post post = new Post(postData.Tables[0].Rows[0]); return(ObjectToJsonConverter.ObjectToJson(post)); }