private void addLevel4(object a, ModuleArg e)
        {
            level4Tab.Controls.Clear();

            this.modulesLevel4List.Add(e.module);

            if (e.module.setModuleCredits == 15)
            {
                creditAverageCounterLvl4 = creditAverageCounterLvl4 + 1;
            }
            if (e.module.setModuleCredits == 30)
            {
                creditAverageCounterLvl4 = creditAverageCounterLvl4 + 2;
            }

            setLevel4Labels();


            if (e.module.setModuleCredits == 15)
            {
                markLvl4     = markLvl4 + temporaryL4;
                credit15or30 = 0;
                Console.WriteLine("ASD" + markLvl4);
            }
            if (e.module.setModuleCredits == 30)
            {
                markLvl4     = (temporaryL4 * 2) + markLvl4;
                credit15or30 = 1;
                Console.WriteLine("BRR" + markLvl4);
            }


            level4Tab.Controls.Add(addModuleBtn);
        }
Exemplo n.º 2
0
        private void showMessage(object a, ModuleArg e)
        {
            this.modules = e.module;
            List <Assessments> temp = new List <Assessments>();

            temp = modules.AssessmentList;
            ModuleArg modArgs = new ModuleArg(modules);

            moduleFormClose(this, modArgs);
            this.Close();
        }
        private void addLevel6(object a, ModuleArg e)
        {
            level6Tab.Controls.Clear();

            this.modulesLevel6List.Add(e.module);

            setLevel6Labels();

            //tempCreditCounterLvl6 = tempCreditCounterLvl6 + e.module.setModuleCredits;

            level6Tab.Controls.Add(addModuleLevel6);
            //moduleDetails.removeClick += new EventHandler(AddModuleControl_moduleRemoveBtn_Click);
        }
 private void viewSum(object a, ModuleArg e)
 {
 }
 private void showMessage(object a, ModuleArg e)
 {
 }
        //GENERATE BUTTON ON AddAssessmentsForm
        private void button1_Click(object sender, EventArgs e)
        {
            totalMark = 0;

            int errorDetector       = 0;
            int weightDetector      = 0;
            int weightCountDetector = 0;

            int goDown = 30;

            //moduleDetails = new AddModuleControl();


            Assessments assessments = new Assessments();

            //moduleDetails.modName = moduleNameNew;
            //moduleDetails.modCode = moduleCodeNew;
            //moduleDetails.modCredits = moduleCreditsNew;

            assessmentName = new Label[numAssessments];


            for (int i = 0; i < numAssessments; i++)
            {
                assessmentName[i]          = new Label();
                assessmentName[i].AutoSize = true;
                assessmentName[i].Text     = assessmentNameTxt[i].Text;
                //moduleDetails.Controls.Add(assessmentName[i]);
                assessmentName[i].Location = new System.Drawing.Point(300, goDown);
                goDown = goDown + 30;

                totalMark   = double.Parse(assessmentMarkTxt[i].Text);
                totalWeight = totalWeight + double.Parse(assessmentWeightTxt[i].Text);

                if (totalMark > 100.00)
                {
                    errorDetector = 1;
                }
            }
            if (totalWeight > 100)
            {
                weightDetector = 1;
            }
            if (totalWeight != 100)
            {
                weightCountDetector = 1;
            }

            if (errorDetector == 1 || weightDetector == 1 || weightCountDetector == 1)
            {
                Console.WriteLine("ERRORS DETECTED");
                totalWeight         = 0;
                totalMark           = 0;
                weightCountDetector = 0;
            }
            else
            {
                for (int i = 0; i < numAssessments; i++)
                {
                    Assessments tempAssessment = new Assessments();
                    tempAssessment.setAssessmentName   = assessmentNameTxt[i].Text;
                    tempAssessment.setAssessmentWeight = Int32.Parse(assessmentWeightTxt[i].Text);
                    tempAssessment.setAssessmentMark   = Int32.Parse(assessmentMarkTxt[i].Text);
                    modules.AssessmentList.Add(tempAssessment);
                }

                goDown = 30;

                ////////////////////
                ModuleArg modArgs = new ModuleArg(modules);
                moduleFormClose(this, modArgs);
                ////////////////////

                this.Close();
            }
        }