public void AddStudentToGroup(string userId, string groupId) { handler = new DataHandler(); string insert = "INSERT INTO user_UsersInGroups (UserId, GroupId) VALUES ('" + userId + "','" + groupId + "')"; handler.ExecuteNonQuery(insert); }
public void CreateGroup(string GroupId, string GroupName, string UserId) { handler = new DataHandler(); string insert = "INSERT INTO user_Groups (GroupId, GroupName, TeacherId) " + "VALUES ('" + GroupId + "','" + GroupName + "','" + UserId + "')"; handler.ExecuteNonQuery(insert); }
public static void SubscribeToTeacher(string teacherEmail, string userId) { //get the teacher's userId from the email address the user entered DataHandler handler = new DataHandler(); string select = "SELECT UserId FROM aspnet_Membership WHERE LoweredEmail = '" + teacherEmail.ToLower() + "'"; string teacherId = handler.ExecuteScalar(select); //add the teacher to the student by the teacher's userId string insert = "INSERT INTO user_UserHasTeachers (TeacherId, UserId) VALUES ('" + teacherId + "', '" + userId + "')"; handler.ExecuteNonQuery(insert); }