예제 #1
0
 public CreateStudent(IHomeWorkModel model, string userName, string email, string password)
 {
     this.userName = userName;
     this.email    = email;
     this.password = password;
     this.model    = model;
 }
        public void register(IHomeWorkModel model, ModelUser user, string classRoomName)
        {
            this.model         = model;
            this.user          = user;
            this.classRoomName = classRoomName;

            model.addWatcher(viewUpdated, this.getUserDataKey());
        }
예제 #3
0
        public void register(IHomeWorkModel model, int studentId)
        {
            this.model     = model;
            this.studentId = studentId;


            model.addWatcher(viewUpdated, DataKeys.getUserKey(studentId));
        }
예제 #4
0
        public void register(IHomeWorkModel model, int teacherId)
        {
            this.model     = model;
            this.teacherId = teacherId;


            model.addWatcher(viewUpdated, this.getTeacherDataKey());
        }
예제 #5
0
 public EditTeacher(IHomeWorkModel model, int teacherId, string userName, string email, string password)
 {
     this.teacherId = teacherId;
     this.userName  = userName;
     this.email     = email;
     this.password  = password;
     this.model     = model;
 }
예제 #6
0
        public NewUserPage(IHomeWorkModel model)
        {
            InitializeComponent();
            this.model = model;


            NewUserPageControler controler = new NewUserPageControler(this.type_Picker, this.go_Button, this.model, this.userName_Entry, this.email_Entry, this.password_Entry, this);
        }
예제 #7
0
 public EditStudent(IHomeWorkModel model, int studentId, string userName, string email, string password)
 {
     this.studentId = studentId;
     this.userName  = userName;
     this.email     = email;
     this.password  = password;
     this.model     = model;
 }
예제 #8
0
        public AssignmentsPage(int studentId)
        {
            InitializeComponent();
            this.studentId = studentId;
            this.model     = ((App)Application.Current).model;
            this.assignmentListView.register(this.model, studentId);

            AssignmentsPage_Controler controler = new AssignmentsPage_Controler(assignmentListView, this, this.studentId);
        }
예제 #9
0
        public LoginPage(IHomeWorkModel model)
        {
            InitializeComponent();

            this.model = model;


            LoginPageControler controler = new LoginPageControler(this.model, this.email_Entry, this.password_Entry, this.login_Button, this.newUser_Button, this);
        }
예제 #10
0
        public AssignmentPage_Controler(int assignmentId, Button edit_Button, IHomeWorkModel model, ModelUser user, Page page)
        {
            edit_Button.Clicked += Edit_Button_Clicked;

            this.assignmentId = assignmentId;
            this.edit_Button  = edit_Button;
            this.model        = model;
            this.user         = user;
            this.page         = page;
        }
예제 #11
0
 public AddClassRoomToTeacher(
     IHomeWorkModel model,
     string classRoomName,
     int teacherId
     )
 {
     this.model         = model;
     this.classRoomName = classRoomName;
     this.teacherId     = teacherId;
 }
예제 #12
0
        public AssignmentPage(int assignmentId, ModelUser user)
        {
            InitializeComponent();
            this.model = ((App)Application.Current).model;

            this.assignmentView.register(model, assignmentId, user.id);

            AssignmentPage_Controler controler = new AssignmentPage_Controler(assignmentId, this.edit_Button, this.model, user, this);

            //controler.initialize();
        }
예제 #13
0
        public StudentAssignmentPage(int assignmentId, int userId)
        {
            this.model = ((App)Application.Current).model;

            InitializeComponent();
            this.assignmentView.register(this.model, assignmentId, userId);

            StudentAssignmentPage_Controler controler = new StudentAssignmentPage_Controler(assignmentId, this.model);

            controler.initialize();
        }
예제 #14
0
 public LoginPageControler(IHomeWorkModel model, Entry email, Entry password, Button login_Button, Button newUser_Button, Page page)
 {
     this.model                   = model;
     this.email                   = email;
     this.password                = password;
     this.login_Button            = login_Button;
     this.newUser_Button          = newUser_Button;
     this.page                    = page;
     this.login_Button.Clicked   += Login_Button_Clicked;
     this.newUser_Button.Clicked += NewUser_Button_Clicked;
 }
예제 #15
0
 public TeacherPageControler(
     Button addClassRoom_button, ClassRoomListView classRoomListView, int teacherId, Page page, Button logout_Button, IHomeWorkModel model)
 {
     addClassRoom_button.Clicked       += addClassRoom_buttonClick;
     classRoomListView.list.ItemTapped += ClassRoomListView_tapped;
     this.teacherId              = teacherId;
     this.page                   = page;
     this.logout_Button          = logout_Button;
     this.model                  = model;
     this.logout_Button.Clicked += Logout_Button_Clicked;
 }
예제 #16
0
        public TeacherPage(int teacherId)
        {
            this.model = ((App)Application.Current).model;
            //this.model.initializeForTeacher(teacherId);

            InitializeComponent();

            this.classRoomListView.register(this.model, teacherId);

            TeacherPageControler controler = new TeacherPageControler(addClassRoom_button, classRoomListView, teacherId, this, this.logout_Button, this.model);
        }
예제 #17
0
        public NewUserPageControler(Picker type_Picker, Button go_Button, IHomeWorkModel model, Entry name_Entry, Entry email_Entry, Entry password_Entry, Page page)
        {
            this.type_Picker    = type_Picker;
            this.go_Button      = go_Button;
            this.model          = model;
            this.name_Entry     = name_Entry;
            this.email_Entry    = email_Entry;
            this.password_Entry = password_Entry;
            this.page           = page;

            this.go_Button.Clicked += Go_Button_Clicked;
        }
예제 #18
0
        public SubscriptionPageControler(int studentId, Button addSubscription_Button, Page page, IHomeWorkModel model, Button logout_Button)
        {
            addSubscription_Button.Clicked += AddSubscription_Button_Clicked;

            this.studentId = studentId;
            this.addSubscription_Button = addSubscription_Button;
            this.page          = page;
            this.model         = model;
            this.logout_Button = logout_Button;

            this.logout_Button.Clicked += Logout_Button_Clicked;
        }
        async void confirm_buttonClicked(object sender, EventArgs e)
        {
            IHomeWorkModel model = ((App)Application.Current).model;

            string classRoomname = this.newClassRoom_entry.Text;

            if (classRoomname != null)
            {
                Task <Response> tAdd = model.addClassRoomToTeacher(classRoomname, this.teacherId);

                Task <Page> tPop = ((App)Application.Current).MainPage.Navigation.PopAsync();

                await Task.WhenAll(tPop, tAdd);
            }
        }
예제 #20
0
        public SubscriptionsPage(int studentId)
        {
            this.model = ((App)Application.Current).model;

            InitializeComponent();

            this.subscriptionListView.register(this.model, studentId);

            SubscriptionPageControler controler = new SubscriptionPageControler(
                studentId,
                this.addSubscription_Button,
                this,
                this.model,
                this.logout_Button
                );
        }
예제 #21
0
        public ClassRoomPage(string classRoomName, int teacherId)
        {
            this.classRoomName = classRoomName;

            this.model = ((App)Application.Current).model;
            this.model.initializeForClassRoom(classRoomName);

            InitializeComponent();

            this.classRoomName_Label.Text = classRoomName;

            ModelUser user = this.model.getItem <ModelUser>(DataKeys.getUserKey(teacherId));

            this.assignmentListView.register(model, user, classRoomName);

            ClassRoomPageControler controler = new ClassRoomPageControler(this, addAssignment_button, teacherId, classRoomName, assignmentListView, user);
        }
예제 #22
0
        async void Confirm_Button_Clicked(object sender, EventArgs e)
        {
            IHomeWorkModel model = ((App)Application.Current).model;

            string   assignmentName        = this.name_Entry.Text;
            DateTime assignmentDueDate     = this.datePicker.Date;
            string   assignmentDescription = this.description_Entry.Text;

            if (assignmentName != null)
            {
                Task <Response> tAdd = model.addAssignmentToClassRoom(assignmentName, assignmentDueDate, assignmentDescription, false, classRoomName, teacherId);

                Task <Page> tPop = ((App)Application.Current).MainPage.Navigation.PopAsync();

                await Task.WhenAll(tAdd, tPop);
            }
        }
 public SubsriptionSearchPage_Controler(
     Button confirmSub_Button,
     int studentId,
     Entry subName_Entry,
     IHomeWorkModel model,
     Page page,
     Label confirmingText
     )
 {
     this.confirmingText    = confirmingText;
     this.confirmSub_Button = confirmSub_Button;
     this.studentId         = studentId;
     this.subName_Entry     = subName_Entry;
     this.model             = model;
     this.page = page;
     this.confirmSub_Button.Clicked += Confirm_Button_Clicked;
 }
        public SubscriptionSearchPage(int studentId)
        {
            this.model     = ((App)Application.Current).model;
            this.studentId = studentId;
            InitializeComponent();



            SubsriptionSearchPage_Controler controler = new SubsriptionSearchPage_Controler(
                this.confirmSub_Button,
                this.studentId,
                subName_Entry,
                this.model,
                this,
                this.confirmingText
                );
        }
예제 #25
0
 public AddAssignmentToClassRoom(
     IHomeWorkModel model,
     string assignmentName,
     DateTime dueDate,
     string description,
     bool isClosed,
     string classRoomName,
     int teacherId
     )
 {
     this.model          = model;
     this.assignmentName = assignmentName;
     this.dueDate        = dueDate;
     this.description    = description;
     this.isClosed       = isClosed;
     this.classRoomName  = classRoomName;
     this.teacherId      = teacherId;
 }
예제 #26
0
 public EditAssignment(
     IHomeWorkModel model,
     string assignmentName,
     DateTime assignmentDueDate,
     string assignmentDescription,
     bool isClosed,
     int assignmentId,
     int teacherId
     )
 {
     this.model                 = model;
     this.assignmentName        = assignmentName;
     this.assignmentDueDate     = assignmentDueDate;
     this.assignmentDescription = assignmentDescription;
     this.isClosed              = isClosed;
     this.assignmentId          = assignmentId;
     this.teacherId             = teacherId;
 }
        public studentBaseTabPage(int studentId)
        {
            this.model     = ((App)Application.Current).model;
            this.studentId = studentId;
            InitializeComponent();

            NavigationPage subscriptionPage = new NavigationPage(new SubscriptionsPage(studentId));

            subscriptionPage.Title = "ClassRooms";

            NavigationPage assignmentPage = new NavigationPage(new AssignmentsPage(studentId));

            assignmentPage.Title = "Assignments";

            Children.Add(subscriptionPage);
            Children.Add(assignmentPage);

            //this.model.initializeForStudent(studentId);
        }
예제 #28
0
        public TestingPageControler(
            Collection<SwitchCell> switches,
            IHomeWorkModel model,
            CommandCentre theCommandCentre,
            Button go_Button,
            Page page,
            Button fullTest_Button
        ) {



            this.switches = switches;
            this.model = model;
            this.theCommandCentre = theCommandCentre;
            this.go_Button = go_Button;
            this.page = page;
            this.fullTest_Button = fullTest_Button;

            this.go_Button.Clicked += go_Button_Clicked;
            this.fullTest_Button.Clicked += fullTest_Button_Clicked;
        }
예제 #29
0
        public testingPage(IHomeWorkModel model) {
            InitializeComponent();
            this.model = model;

            switches.Add(this.addAssignment_Switch);
            switches.Add(this.addClassRoom_Switch);
            switches.Add(this.createStudent_Switch);
            switches.Add(this.createTeacher_Switch);

            switches.Add(this.editAssignment_Switch);
            switches.Add(this.editStudent_Switch);
            switches.Add(this.editTeacher_Switch);

            switches.Add(this.archiveStudent_Switch);
            switches.Add(this.archiveTeacher_Switch);
            switches.Add(this.archiveClassRoom_Switch);
            switches.Add(this.archiveAssignment_Switch);

            switches.Add(this.unArchiveStudent_Switch);
            switches.Add(this.unArchiveTeacher_Switch);
            switches.Add(this.unArchiveAssignment_Switch);
            switches.Add(this.unArchiveClassRoom_Switch);

            switches.Add(this.sub_Switch);
            switches.Add(this.unsub_Switch);
            switches.Add(this.markDone_Switch);
            switches.Add(this.undoMarkDone_Switch);

            switches.Add(this.initStudent_Switch);
            switches.Add(this.initTeacher_Switch);




            //Setting up CommandCentre ---------------------


            this.theCommandCentre.addCommand(this.createTeacher_Switch.Text, new CreateTeacher(model, "Clark", "Clark@Test", "1234"));
            this.theCommandCentre.addCommand(this.addClassRoom_Switch.Text, new AddClassRoomToTeacher(model, "maths16", 1));
            //remember to make unique NAME EACH TIME!!!!1
            this.theCommandCentre.addCommand(this.addAssignment_Switch.Text, new AddAssignmentToClassRoom(
                    model,
                    "testAssignment7",
                    new DateTime(1, 1, 1),
                    "teeeeeest",
                    false,
                    "maths16",
                    1
            ));
            this.theCommandCentre.addCommand(this.editAssignment_Switch.Text, new EditAssignment(
                    model,
                    "testAssignment7",
                    new DateTime(1, 1, 1),
                    "lorsalh",
                    false,
                    1,
                    1
                ));


            this.theCommandCentre.addCommand(this.createStudent_Switch.Text, new CreateStudent(model, "Ed","ed@Test", "1234"));





            this.theCommandCentre.addCommand(this.editStudent_Switch.Text, new EditStudent(model,3, "Ed", "Ed@Test", "54321"));
            this.theCommandCentre.addCommand(this.editTeacher_Switch.Text, new EditTeacher(model, 1, "Brown", "Brown@Test", "4321"));

            this.theCommandCentre.addCommand(this.archiveClassRoom_Switch.Text, new ArchiveClassRoom(model, "hist8", 1));
            this.theCommandCentre.addCommand(this.archiveAssignment_Switch.Text, new ArchiveAssignment(model, 34, 1));
            this.theCommandCentre.addCommand(this.archiveStudent_Switch.Text, new ArchiveStudent(model, 3));
            this.theCommandCentre.addCommand(this.archiveTeacher_Switch.Text, new ArchiveTeacher(model, 1));

            this.theCommandCentre.addCommand(this.unArchiveClassRoom_Switch.Text, new UnArchiveClassRoom(model, "hist8", 1));
            this.theCommandCentre.addCommand(this.unArchiveAssignment_Switch.Text, new UnArchiveAssignment(model, 34, 1));
            this.theCommandCentre.addCommand(this.unArchiveStudent_Switch.Text, new UnArchiveStudent(model, 3));
            this.theCommandCentre.addCommand(this.unArchiveTeacher_Switch.Text, new UnArchiveTeacher(model, 1));

            this.theCommandCentre.addCommand(this.sub_Switch.Text, new SubStudent(model, 4, "hist8"));
            this.theCommandCentre.addCommand(this.unsub_Switch.Text, new UnSubStudent(model, 4, "hist8"));
            this.theCommandCentre.addCommand(this.markDone_Switch.Text, new MarkAssignmentDone(model, 2, 3));
            this.theCommandCentre.addCommand(this.undoMarkDone_Switch.Text, new UndoMarkAssignmentDone(model, 2, 3));

            this.theCommandCentre.addCommand(this.initStudent_Switch.Text, new InitStudent(model, 1));
            this.theCommandCentre.addCommand(this.initTeacher_Switch.Text, new InitTeacher(model, 1));





            TestingPageControler controler = new TestingPageControler(this.switches, this.model, this.theCommandCentre, this.go_Button, this, this.fullTest_Button);

        }
예제 #30
0
 public StudentAssignmentPage_Controler(int assignmentId, IHomeWorkModel model)
 {
     this.assignmentId = assignmentId;
     this.model        = model;
 }