示例#1
0
    def breakLinks(self, empID):
        #break external links, but don't change existing emp file for archive purposes
        tempEmp = employee(empID)
        tempEmp.inFile()

        #remove each project and all superiors/subordinates
        for projID, projHier in tempEmp.retProjList():
            for sub in projHier.retSub():
                tempEmp = employee(sub)
                tempEmp.inFile()
                tempEmp.remProjSup(projID, empID,
                                   0)  #remove sup from sub, no push
            for sup in projHier.retSup():
                tempEmp = employee(sup)
                tempEmp.inFile()
                tempEmp.remProjSub(projID, empID,
                                   0)  #remove sup from sub, no push
            #remove emp from Proj
            from ProjClass import project
            tempProj = project(projID, "")
            tempProj.inFile()
            tempProj.remEmp(empID)

        for skID, skLvl in tempEmp.retSkillList():
            tempSk = ability(skID, "temp", "Skill")
            tempSk.inFile()
            tempSk.remEmp(empID)

        for intID, intLvl in tempEmp.retIntList():
            tempInt = ability(intID, "temp", "Int")
            tempInt.inFile()
            tempInt.remEmp(empID)

        return 1
示例#2
0
    def breakLinks(self,empID):
        #break external links, but don't change existing emp file for archive purposes
        tempEmp=employee(empID)        
        tempEmp.inFile()        


        #remove each project and all superiors/subordinates        
        for projID,projHier in tempEmp.retProjList():
            for sub in projHier.retSub():
                tempEmp=employee(sub)
                tempEmp.inFile()
                tempEmp.remProjSup(projID,empID,0)#remove sup from sub, no push
            for sup in projHier.retSup():
                tempEmp=employee(sup)
                tempEmp.inFile()
                tempEmp.remProjSub(projID,empID,0)#remove sup from sub, no push
            #remove emp from Proj
            from ProjClass import project
            tempProj = project(projID,"")
            tempProj.inFile()
            tempProj.remEmp(empID)

        for skID,skLvl in tempEmp.retSkillList():
            tempSk=ability(skID,"temp","Skill")
            tempSk.inFile()
            tempSk.remEmp(empID)

        for intID,intLvl in tempEmp.retIntList():
            tempInt=ability(intID,"temp","Int")
            tempInt.inFile()
            tempInt.remEmp(empID)       
        
        return 1
示例#3
0
 def renameAbil(self,abilID,newNm):
     self.inFile()
     tempAbil=ability(abilID,"",self.kind)
     tempAbil.inFile()
     tempAbil.rename(newNm)
     self.abilList[abilID]=newNm
     self.outFile()
示例#4
0
 def remSkill(self, skID):
     self.inFile()
     from AbilClass import ability
     self.skills.pop(skID)
     tempSk = ability(skID, "temp", "Skill")
     tempSk.inFile()
     tempSk.remEmp(self.id)
     self.outFile()
示例#5
0
 def remInt(self, intID):
     self.inFile()
     from AbilClass import ability
     self.interests.pop(intID)
     tempInt = ability(intID, "temp", "Int")
     tempInt.inFile()
     tempInt.remEmp(self.id)
     self.outFile()
示例#6
0
 def remInt(self,intID):
     self.inFile()
     from AbilClass import ability
     self.interests.pop(intID)
     tempInt=ability(intID,"temp","Int")
     tempInt.inFile()
     tempInt.remEmp(self.id)
     self.outFile()  
示例#7
0
 def remSkill(self,skID):
     self.inFile()
     from AbilClass import ability
     self.skills.pop(skID)
     tempSk=ability(skID,"temp","Skill")
     tempSk.inFile()
     tempSk.remEmp(self.id)
     self.outFile()
示例#8
0
 def addAbil(self,abilName):
     #Add to master list
     #Assuming it has already been checked to not be in list
     self.inFile()
     self.lastID+=1
     tempClass = ability(self.lastID,abilName,self.kind)
     self.abilList[self.lastID]=abilName
     self.outFile() #write updated file
     tempClass.outFile() #create and write the class file          
     return self.lastID
示例#9
0
 def addInt(self,intID,intLvl): 
     #TODO called from employee after confirming interests exists in master list
     self.inFile()
     from AbilClass import ability
     if not self.interests.has_key(intID):
         self.interests[intID]=intLvl
         tempInt=ability(intID,"TempName","Int")
         tempInt.inFile()
         tempInt.addEmp(self.id,intLvl) #Add to Ability level list
         self.outFile()
示例#10
0
 def addSkill(self,skID,skLvl):
     #TODO called from employee after confirming skill exists in master list
     self.inFile()
     from AbilClass import ability
     if not self.skills.has_key(skID):
         self.skills[skID]=skLvl
         tempSk=ability(skID,"TempName","Skill")
         tempSk.inFile()
         tempSk.addEmp(self.id,skLvl)
         self.outFile()
示例#11
0
 def addSkill(self, skID, skLvl):
     #TODO called from employee after confirming skill exists in master list
     self.inFile()
     from AbilClass import ability
     if not self.skills.has_key(skID):
         self.skills[skID] = skLvl
         tempSk = ability(skID, "TempName", "Skill")
         tempSk.inFile()
         tempSk.addEmp(self.id, skLvl)
         self.outFile()
示例#12
0
 def addInt(self, intID, intLvl):
     #TODO called from employee after confirming interests exists in master list
     self.inFile()
     from AbilClass import ability
     if not self.interests.has_key(intID):
         self.interests[intID] = intLvl
         tempInt = ability(intID, "TempName", "Int")
         tempInt.inFile()
         tempInt.addEmp(self.id, intLvl)  #Add to Ability level list
         self.outFile()
示例#13
0
 def chgIntLvl(self,intID,intLvl):
     self.inFile()
     from AbilClass import ability        
     if self.interests.has_key(intID):
         self.interests[intID]=intLvl
         tempSk=ability(intID,"TempName","Int")
         tempSk.inFile()
         tempSk.chgLvl(self.id,intLvl)
         self.outFile()
     else:
         return -1 #This skill doesn't exist            
示例#14
0
 def chgSkillLvl(self,skID,skLvl):
     self.inFile()
     from AbilClass import ability        
     if self.skills.has_key(skID):
         self.skills[skID]=skLvl
         tempSk=ability(skID,"TempName","Skill")
         tempSk.inFile()
         tempSk.chgLvl(self.id,skLvl)
         self.outFile()
     else:
         return -1 #This skill doesn't exist
示例#15
0
 def chgSkillLvl(self, skID, skLvl):
     self.inFile()
     from AbilClass import ability
     if self.skills.has_key(skID):
         self.skills[skID] = skLvl
         tempSk = ability(skID, "TempName", "Skill")
         tempSk.inFile()
         tempSk.chgLvl(self.id, skLvl)
         self.outFile()
     else:
         return -1  #This skill doesn't exist
示例#16
0
 def chgIntLvl(self, intID, intLvl):
     self.inFile()
     from AbilClass import ability
     if self.interests.has_key(intID):
         self.interests[intID] = intLvl
         tempSk = ability(intID, "TempName", "Int")
         tempSk.inFile()
         tempSk.chgLvl(self.id, intLvl)
         self.outFile()
     else:
         return -1  #This skill doesn't exist
示例#17
0
 def remAbil(self,abilID):
     self.inFile()
     tempAbil=ability(abilID,"",self.kind)
     tempAbil.inFile()
     from EmpClass import employee #Remove from all employees first
     for empID, empSk in tempAbil.retList():
         tempEmp=employee(empID)
         tempEmp.inFile()
         if self.kind=="Int":
             tempEmp.remInt(abilID)
         else:
             tempEmp.remSkill(abilID)
     #Then remove from the list
     self.abilList.pop(abilID)
     self.outFile()