コード例 #1
0
ファイル: OverviewView.cs プロジェクト: kevinassen1992/KBS2
        public OverviewView(BaseController baseController, int id)
        {
            bc = baseController;

            questionlists = bc.qlc.getAll();
            questionlistLogs = bc.stc.getQuestionlistLogs();

            colleges = bc.cc.getColleges();

            OverviewViewPanelStatistiek = new CustomPanel();
            OverviewViewPanelStatistiek.BackColor = Color.Transparent;
            OverviewViewPanelStatistiek.Height = Screen.PrimaryScreen.Bounds.Height;
            OverviewViewPanelStatistiek.Width = Screen.PrimaryScreen.Bounds.Width - 225;
            OverviewViewPanelStatistiek.Location = new Point(225, 0);
            OverviewViewPanelStatistiek.BorderStyle = BorderStyle.Fixed3D;
            OverviewViewPanelStatistiek.AutoScroll = true;
            OverviewViewPanelStatistiek.AutoScrollMargin = new Size(0, 95);

            // Fills the table with data from "Colleges"
            foreach (College c in colleges)
            {
                Label collegeTitle = new Label();
                collegeTitle.BackColor = Color.Transparent;
                collegeTitle.Text = c.title;
                collegeTitle.Name = c.title;
                collegeTitle.Size = new Size(300, 75);
                collegeTitle.Font = new Font("Segoe print", 26F);
                collegeTitle.Location = new Point(x, y);
                OverviewViewPanelStatistiek.Controls.Add(collegeTitle);
                CustomPanel questionlistPanel = new CustomPanel();
                questionlistPanel.BackColor = Color.Transparent;
                questionlistPanel.Name = "listPanel" + c.id;
                questionlistPanel.Size = new Size(1000, 181);
                questionlistPanel.BackColor = Color.Transparent;
                questionlistPanel.Location = new Point(x, y + 75);
                createTable(questionlistPanel, c.id);
                questionlistPanel.AutoScrollMargin = new Size(0, 95);
                OverviewViewPanelStatistiek.Controls.Add(questionlistPanel);
                //Makes room for the next college
            }
        }
コード例 #2
0
        // OverViewCollegeView constructor,
        public OverviewCollegeView(BaseController Basecontroller)
        {
            bc = Basecontroller;
            //Gets all the colleges for the student.
            colleges = bc.scc.getColleges(bc.user.id);

            OverviewCollegePanel = new CustomPanel();
            OverviewCollegePanel.BackColor = Color.Transparent;
            OverviewCollegePanel.Height = Screen.PrimaryScreen.Bounds.Height;
            OverviewCollegePanel.Width = Screen.PrimaryScreen.Bounds.Width - 225;
            OverviewCollegePanel.Location = new Point(225, 0);
            OverviewCollegePanel.BorderStyle = BorderStyle.Fixed3D;
            OverviewCollegePanel.AutoScroll = true;
            OverviewCollegePanel.AutoScrollMargin = new Size(0, 95);

            //input label for subject code
            codeLabel = new Label();
            codeLabel.Name = "Name_Input";
            codeLabel.Location = new Point(100, 90);
            codeLabel.Font = new Font("Segoe print", 26F);
            codeLabel.Size = new Size(250, 75);
            codeLabel.Text = "Unieke code:";
            OverviewCollegePanel.Controls.Add(codeLabel);

            //Input screen for subject-code
            code = new TextBox();
            code.Name = "code_Input";
            code.Location = new Point(350, 90);
            code.Font = new Font("Ariel", 30F);
            code.Size = new Size(185, 55);
            code.MaxLength = 5;
            code.CharacterCasing = CharacterCasing.Upper;
            code.Multiline = true;
            code.BorderStyle = BorderStyle.Fixed3D;
            OverviewCollegePanel.Controls.Add(code);

            //Button for submitting subject-code
            var addCollegeButton = new Button();
            addCollegeButton.Font = new Font("Segoe print", 20F);
            addCollegeButton.Location = new Point(550, 90);
            addCollegeButton.Size = new Size(200, 55);
            addCollegeButton.Name = "add";
            addCollegeButton.Text = "Toevoegen";
            addCollegeButton.MouseClick += new MouseEventHandler(addCollegeButton_Click);
            addCollegeButton.BackgroundImage = Properties.Resources.grey_wash_wall;
            addCollegeButton.ForeColor = Color.White;
            addCollegeButton.FlatStyle = FlatStyle.Flat;
            OverviewCollegePanel.Controls.Add(addCollegeButton);

            //Makes table for each college
            foreach (College c in colleges)
            {
                Label collegeTitle = new Label();
                collegeTitle.BackColor = Color.Transparent;
                collegeTitle.Text = c.title;
                collegeTitle.Name = c.title;
                collegeTitle.Size = new Size(300, 75);
                collegeTitle.Font = new Font("Segoe print", 26F);
                collegeTitle.Location = new Point(x, y);
                OverviewCollegePanel.Controls.Add(collegeTitle);

                CustomPanel questionlistPanel = new CustomPanel();
                questionlistPanel.BackColor = Color.Transparent;
                questionlistPanel.Name = "listPanel" + c.id;
                questionlistPanel.Size = new Size(1000, 181);
                questionlistPanel.BackColor = Color.Transparent;
                questionlistPanel.Location = new Point(x, y + 75);
                createTable(questionlistPanel, c.id);
                questionlistPanel.AutoScrollMargin = new Size(0, 95);
                OverviewCollegePanel.Controls.Add(questionlistPanel);
            }
        }
コード例 #3
0
        public OverviewCollegeView(BaseController Basecontroller)
        {
            bc = Basecontroller;
            colleges = bc.cc.getColleges();

            mainPanel = new CustomPanel();
            mainPanel.BackColor = Color.Transparent;
            mainPanel.Height = Screen.PrimaryScreen.Bounds.Height;
            mainPanel.Width = Screen.PrimaryScreen.Bounds.Width - 225;
            mainPanel.Location = new Point(225, 0);
            mainPanel.BorderStyle = BorderStyle.Fixed3D;
            mainPanel.AutoScroll = true;
            mainPanel.AutoScrollMargin = new Size(0,95);

            foreach (College c in colleges)
            {
                // initialize title
                Label collegeTitle = new Label();
                collegeTitle.BackColor = Color.Transparent;
                collegeTitle.Text = c.title;
                collegeTitle.Name = c.title;
                collegeTitle.Size = new Size(300, 75);
                collegeTitle.Font = new Font("Segoe print", 26F);
                collegeTitle.Location = new Point(x, y);
                mainPanel.Controls.Add(collegeTitle);

                // initialize setActive butoon
                Button setActive = new Button();
                setActive.Name = "Actief#" + c.id;
                setActive.Font = new Font("Segoe Print", 8F);
                // check if there is a code already
                if(c.status == false)
                {
                    setActive.Text = "Zet Actief";
                } else
                {
                    setActive.Text = "Zet Inactief";
                }

                setActive.Location = new Point(x + 300, y + 20);
                setActive.Size = new Size(100, 30);
                setActive.FlatStyle = FlatStyle.Flat;
                setActive.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
                setActive.FlatAppearance.BorderColor = Color.White;
                setActive.ForeColor = Color.White;
                setActive.FlatAppearance.BorderSize = 1;
                setActive.MouseClick += new MouseEventHandler(setActiveClick);
                mainPanel.Controls.Add(setActive);

                // initialize code
                Code = new Label();
                Code.Name = "Code#" + c.id;
                Code.Font = new Font("Arial", 9F);
                Code.Text = c.code;
                Code.Location = new Point(x + 450, y + 25);
                Code.Size = new Size(55, 50);
                codeList.Add(Code);
                mainPanel.Controls.Add(Code);

                // initialize edit
                Button Edit = new Button();
                Edit.Name = "Bewerk#" + c.id;
                Edit.Font = new Font("Segoe Print", 8F);
                Edit.Text = "Bewerk";
                Edit.Location = new Point(x + 720, y + 20);
                Edit.Size = new Size(100, 30);
                Edit.FlatStyle = FlatStyle.Flat;
                Edit.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
                Edit.FlatAppearance.BorderColor = Color.White;
                Edit.ForeColor = Color.White;
                Edit.FlatAppearance.BorderSize = 1;
                Edit.MouseClick += new MouseEventHandler(setEditClick);
                mainPanel.Controls.Add(Edit);

                // initialize delete
                Button Delete = new Button();
                Delete.Name = "Verwijder #" + c.id;
                Delete.Font = new Font("Segoe Print", 8F);
                Delete.Text = "Verwijder";
                Delete.Location = new Point(x + 875, y + 20);
                Delete.Size = new Size(100, 30);
                Delete.FlatStyle = FlatStyle.Flat;
                Delete.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
                Delete.FlatAppearance.BorderColor = Color.White;
                Delete.ForeColor = Color.White;
                Delete.FlatAppearance.BorderSize = 1;
                Delete.MouseClick += new MouseEventHandler(setDeleteClick);
                mainPanel.Controls.Add(Delete);

                // initialize panel
                CustomPanel questionlistPanel = new CustomPanel();
                questionlistPanel.BackColor = Color.Transparent;
                questionlistPanel.Name = "listPanel" + c.id;
                questionlistPanel.Size = new Size(1000, 181);
                questionlistPanel.BackColor = Color.Transparent;
                questionlistPanel.Location = new Point(x, y + 75);
                createTable(questionlistPanel, c.id);
                questionlistPanel.AutoScrollMargin = new Size(0, 95);
                mainPanel.Controls.Add(questionlistPanel);
                //Makes room for the next college
            }
        }