示例#1
0
 def rulesEngine_Employer(self,email,UserType,typeOfPlan):
     try:
         reader = XmlReader()
         EmployerPlanName,EmployerPlanCount,EmployerPlanPrice,EmployerMessagePermission = reader.readmyFile(UserType)
         if self.count == "":
             fetchJobsCount = FetchJobsCount(mysql,email,'','')
             self.count,result  = fetchJobsCount.getJobsCount()
         concreteComponent = NormalEmployer()
         concrete_decorator_planA = Employer_Plan_decorator(concreteComponent)
         for index, item in enumerate(EmployerPlanName):
             if typeOfPlan == item:
                 allowPosting,allowMessagePermission = concrete_decorator_planA.plan_rules(EmployerPlanCount[index],self.count,EmployerMessagePermission[index])
         return allowPosting,allowMessagePermission
     except Exception as e:
         excep_msg = "Error occured in method rulesEngine_Employer_BSL method"
         level = logging.getLogger().getEffectiveLevel()
         logmyerror.loadMyExceptionInDb(level,excep_msg,e)
         logging.info(excep_msg, exc_info=True)