/// <summary> /// If project doesn't exist then it adds it as instance of the class Project to the list (projectList) /// </summary> /// <param name="processing"></param> internal void addProject(Processing processing, DataTransfer dataTransfer, TestExist testExist) { //tests if is commercial, adds a new instance and adds the project name if (dataTransfer.commercial) { processing.projectListC.Add(new CommercialProject(processing.CurrentLine[processing.headingPostitions.ProjectPosition], null)); List <string> sublist = new List <string>() { null }; processing.projectListC[dataTransfer.posProjectC].UseageList.Add(sublist); } else { processing.projectList.Add(new AcademicProject(processing.CurrentLine[processing.headingPostitions.ProjectPosition], null)); List <string> sublist = new List <string>() { null }; processing.projectList[dataTransfer.posProject].UseageList.Add(sublist); } //Adds User to list addUser(processing, dataTransfer); //Adds equipment to list addEquipment(processing, dataTransfer); //Adds hours addHours(processing, dataTransfer, testExist); }
/// <summary> /// Adds the hours at the specified position by posUser and posEquipment /// </summary> /// <param name="processing"></param> internal void addHours(Processing processing, DataTransfer dataTransfer, TestExist testExist) { //calculates hours float hours = dataTransfer.hoursCalc(processing); //test if there is already an entry at posUser,posEquipment testExist.testHourPosExists(processing, dataTransfer); //adds the hours variable to that given point hours = dataTransfer.sumHours(processing, hours); //sets the given coordinate to the hours output if (dataTransfer.commercial) { processing.projectListC[dataTransfer.posProjectC].UseageList[dataTransfer.posEquipment][dataTransfer.posUser] = Convert.ToString(hours); processing.commercialHour = processing.commercialHour + hours; } else { processing.projectList[dataTransfer.posProject].UseageList[dataTransfer.posEquipment][dataTransfer.posUser] = Convert.ToString(hours); processing.academicHours = processing.academicHours + hours; } }