public void addStep(ActivityData activity) { RoadScholarContext rsContext = new RoadScholarContext(); activities.Add(activity); rsContext.SaveChanges(); }
public bool registerStudent(StudentData studentData) { if (StudentNotExist(studentData.PhoneNumber)) { RoadScholarContext rsContext = new RoadScholarContext(); rsContext.addStudent(studentData); return(true); } return(false); }
private bool StudentNotExist(string phoneOfStudent) { RoadScholarContext rsContext = new RoadScholarContext(); StudentData studentData = rsContext.getStudent(phoneOfStudent, RoomId); if (studentData == null) { return(true); } return(false); }
public ExperimentData(ExperimentData exp) : base(exp) { this.expID = -1; this.ExperimentQuestion = exp.ExperimentQuestion; this.Type = "Experiment"; RoadScholarContext rsContext = new RoadScholarContext(); this.activities = new List <ActivityData>(); foreach (ActivityData act in exp.activities) { ActivityData copiedActivity = null; if (act is TrueFalseQuestionData) { copiedActivity = new TrueFalseQuestionData((TrueFalseQuestionData)act); rsContext.addActivity(copiedActivity); } else if (act is AmericanQuestionData) { copiedActivity = new AmericanQuestionData((AmericanQuestionData)act); rsContext.addActivity(copiedActivity); } else if (act is ShortAnswerQuestionData) { copiedActivity = new ShortAnswerQuestionData((ShortAnswerQuestionData)act); rsContext.addActivity(copiedActivity); } else if (act is InstructionData) { copiedActivity = new InstructionData((InstructionData)act); rsContext.addActivity(copiedActivity); } else if (act is ImageData) { copiedActivity = new ImageData((ImageData)act); rsContext.addActivity(copiedActivity); } else if (act is VideoData) { copiedActivity = new VideoData((VideoData)act); rsContext.addActivity(copiedActivity); } else if (act is MeasurementData) { copiedActivity = new MeasurementData((MeasurementData)act); rsContext.addActivity(copiedActivity); } this.activities.Add(copiedActivity); } }
public TeacherData(string FirstName, string LastName, string Email, string PhoneNumber, string Password) { this.FirstName = FirstName; this.LastName = LastName; this.Password = Password; this.Email = Email; this.PhoneNumber = PhoneNumber; RoomData room = new RoomData(); RoadScholarContext rsContext = new RoadScholarContext(); rsContext.addRoom(room); RoomId = room.id; }