예제 #1
0
        public void addStep(ActivityData activity)
        {
            RoadScholarContext rsContext = new RoadScholarContext();

            activities.Add(activity);
            rsContext.SaveChanges();
        }
예제 #2
0
 public bool registerStudent(StudentData studentData)
 {
     if (StudentNotExist(studentData.PhoneNumber))
     {
         RoadScholarContext rsContext = new RoadScholarContext();
         rsContext.addStudent(studentData);
         return(true);
     }
     return(false);
 }
예제 #3
0
        private bool StudentNotExist(string phoneOfStudent)
        {
            RoadScholarContext rsContext   = new RoadScholarContext();
            StudentData        studentData = rsContext.getStudent(phoneOfStudent, RoomId);

            if (studentData == null)
            {
                return(true);
            }
            return(false);
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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;
        }