public void generateModule() { theModule = generalController.getTheModule(modNumber); if (theModule.ModuleLevel.Equals("Four")) { this.textLabel1.Add(new Label()); System.Drawing.Point p = new System.Drawing.Point(20, 50 + modNumberTabTwo * 50); (textLabel1[modNumber] as Label).Location = p; (textLabel1[modNumber] as Label).Size = new System.Drawing.Size(300, 20); (textLabel1[modNumber] as Label).Text = theModule.ModuleCode + ": " + theModule.Name + " - " + theModule.ModuleCredits + " Credits - SEM: " + theModule.ModuleSemester; this.tabTwo.Controls.Add((textLabel1[modNumber] as Label)); //for (int i = 0; i < theModule.NumberOfAssessments; i++) //{ // this.assLabel.Add(new Label()); // System.Drawing.Point a = new System.Drawing.Point(20, 50 + modNumberTabTwo * 50); // (assLabel[modNumber] as Label).Location = a; // (assLabel[modNumber] as Label).Size = new System.Drawing.Size(300, 20); // (assLabel[modNumber] as Label).Text = "Hi"; // this.tabTwo.Controls.Add((assLabel[modNumber] as Label)); // Console.WriteLine(theModule.NumberOfAssessments); // createAssessmentTextboxes(modNumberTabTwo); // modNumberTabTwo++; //} createAssessmentTextboxes(modNumberTabTwo); modNumberTabTwo++; } else if (theModule.ModuleLevel.Equals("Five")) { this.textLabel1.Add(new Label()); System.Drawing.Point p = new System.Drawing.Point(20, 50 + modNumberTabThree * 50); (textLabel1[modNumber] as Label).Location = p; (textLabel1[modNumber] as Label).Size = new System.Drawing.Size(300, 20); (textLabel1[modNumber] as Label).Text = theModule.ModuleCode + ": " + theModule.Name + " - " + theModule.ModuleCredits + " Credits - SEM: " + theModule.ModuleSemester; this.tabThree.Controls.Add((textLabel1[modNumber] as Label)); createAssessmentTextboxes(modNumberTabThree); modNumberTabThree++; } else if (theModule.ModuleLevel.Equals("Six")) { this.textLabel1.Add(new Label()); System.Drawing.Point p = new System.Drawing.Point(20, 50 + modNumberTabFour * 50); (textLabel1[modNumber] as Label).Location = p; (textLabel1[modNumber] as Label).Size = new System.Drawing.Size(300, 20); (textLabel1[modNumber] as Label).Text = theModule.ModuleCode + ": " + theModule.Name + " - " + theModule.ModuleCredits + " Credits - SEM: " + theModule.ModuleSemester; this.tabFour.Controls.Add((textLabel1[modNumber] as Label)); createAssessmentTextboxes(modNumberTabFour); modNumberTabFour++; } modNumber++; }
public void createAssessmentTextboxes(int x) { theModule = generalController.getTheModule(modNumber); for (int i = 0; i < theModule.NumberOfAssessments; i++) { //Add textboxes if (theModule.ModuleLevel.Equals("Four")) { assTextBoxes.Add(new TextBox()); System.Drawing.Point g = new System.Drawing.Point(350 + increase, 50 + x * 50); (assTextBoxes[examMark] as TextBox).Location = g; (assTextBoxes[examMark] as TextBox).Size = new System.Drawing.Size(30, 20); this.tabTwo.Controls.Add(assTextBoxes[examMark] as TextBox); increase += 100; examMark++; } if (theModule.ModuleLevel.Equals("Five")) { assTextBoxes.Add(new TextBox()); System.Drawing.Point g = new System.Drawing.Point(350 + increase, 50 + x * 50); (assTextBoxes[examMark] as TextBox).Location = g; (assTextBoxes[examMark] as TextBox).Size = new System.Drawing.Size(30, 20); this.tabThree.Controls.Add(assTextBoxes[examMark] as TextBox); increase += 100; examMark++; } if (theModule.ModuleLevel.Equals("Six")) { assTextBoxes.Add(new TextBox()); System.Drawing.Point g = new System.Drawing.Point(350 + increase, 50 + x * 50); (assTextBoxes[examMark] as TextBox).Location = g; (assTextBoxes[examMark] as TextBox).Size = new System.Drawing.Size(30, 20); this.tabFour.Controls.Add(assTextBoxes[examMark] as TextBox); increase += 100; examMark++; } } increase = 0; }
public void createModule(String moduleName, String moduleCode, int moduleAssessments, String moduleSemester, int moduleCredits, String moduleLevel) { ModuleModel module = new ModuleModel(moduleName, moduleCode, moduleAssessments, moduleSemester, moduleCredits, moduleLevel); moduleData.Add(module); }