Ejemplo n.º 1
0
def Personal_Discussion():
    option = request.json['option']
    Eco_Msg = {}
    if (option == 'cancel'):
        for emp in client_level1.project.employees_allocated:
            game.changeEmployee_Feeling(emp, Feelings.happy)
        Eco_Msg['status'] = 'InComplete'
        Eco_Msg[
            'msg'] = "all the Employees were granted with a leaves so project deadline will be crossed.So it tends to failure"
        Eco_Msg['list_emp'] = []
    else:
        list_Reasons = [
            'Family Trip', 'Medical emergency', 'Relatives Marriage Function',
            'family function', 'Festival celebration', 'going to native',
            'Friends get-together', 'Friends Brithday party',
            'My sister Engagement', "My brother's Engagement ",
            "My sister is getting married", "My brother is getting married"
        ]
        global list_emp
        for i in list_emp:
            i['reason'] = list_Reasons[random.randint(0, 11)]
        Eco_Msg['status'] = ''
        Eco_Msg['msg'] = ""
        Eco_Msg['list_emp'] = list_emp
    return Eco_Msg
Ejemplo n.º 2
0
def personal_request_():
    global otherdict
    Eco_Msg = {}
    list_a = request.json['list_accept']
    if len(list_a) == len(client_level1.project.employees_allocated):
        #for emp in client_level1.project.employees_allocated :
        #   game.changeEmployee_Feeling(emp,Feelings.happy)

        Eco_Msg['status'] = ''
        Eco_Msg['msg'] = ""
        Eco_Msg['option'] = ['Discussion', 'cancel']
    #some peoples applied for leave no one granted with leave
    #list_emp -list of employees applied for leave
    #list_a -list of employeed=s granted with leave
    if len(list_a) == 0 and len(list_emp) != 0:
        otherdict['leaves'] = 0
        for i in list_emp:
            game.changeEmployee_Feeling(i, Feelings.sad)
        Eco_Msg['status'] = "Completed"
        Eco_Msg[
            'msg'] = "all the employees feelings changed to sad who were applied for leave"
        Eco_Msg['option'] = []

    else:
        for i in client_level1.project.employees_allocated:
            if i in list_a:
                game.changeEmployee_Feeling(i, Feelings.happy)
        global replace_Employee
        replace_Employee = list_a
        Eco_Msg['status'] = ""
        Eco_Msg['msg'] = ""
        Eco_Msg['option'] = ['Replace', 'Cancel']
    return Eco_Msg
Ejemplo n.º 3
0
def Holidays_Action():
    list_a = request.json['list_accept']
    d_msg = {}
    if (len(list_a) == len(list_emp)):
        for emp in list_emp:
            game.changeEmployee_Feeling(emp, Feelings.happy)
        d_msg['Status'] = "InComplete"
        d_msg[
            'Message'] = "all the Employees were granted with a leaves so project deadline will be crossed.So it tends to failure"
    elif (len(list_a) == 0):
        otherdict['leaves'] = 0
        for i in list_a:
            game.changeEmployee_Feeling(i, Feelings.sad)
        d_msg['Status'] = "Completed"
        d_msg[
            'Message'] = "all the employees feelings changed to sad who were applied for leave"
    elif len(list_a) < len(list_emp):
        for i in client_level1.project.employees_allocated:
            if i not in list_a:
                game.changeEmployee_Feeling(emp, Feelings.sad)
            else:
                game.changeEmployee_Feeling(emp, Feelings.happy)
        d_msg['Status'] = "Completed"
        d_msg[
            'Message'] = "if some employees were leave so that work load falls on other team member so other feelings changed to sad"
    return d_msg
Ejemplo n.º 4
0
def Personal_Discussion_Process_():
    list_a = request.json['list_accept']
    Eco_Msg = {}
    if len(list_a) == len(list_emp):
        for emp in client_level1.project.employees_allocated:
            game.changeEmployee_Feeling(emp, Feelings.happy)
        Eco_Msg['status'] = 'InComplete'
        Eco_Msg[
            'msg'] = "all the Employees were granted with a leaves so project deadline will be crossed.So it tends to failure"
        Eco_Msg = []
    elif (len(list_a)) == 0:
        for emp in client_level1.project.employees_allocated:
            game.changeEmployee_Feeling(emp, Feelings.sad)
        Eco_Msg['status'] = 'Completed'
        Eco_Msg['msg'] = "all the employees feelings changed to sad"
        Eco_Msg = []
    else:
        for i in client_level1.project.employees_allocated:
            if i in list_a:
                game.changeEmployee_Feeling(i, Feelings.happy)
        global replace_Employee
        replace_Employee = list_a
        Eco_Msg = {}
        Eco_Msg['status'] = ''
        Eco_Msg['msg'] = ""
        Eco_Msg['option'] = ['Replace', 'Cancel']
    return Eco_Msg
Ejemplo n.º 5
0
def Personal_Replace():
    option = request.json['option']
    Eco_Msg = {}
    list_employee = game.employee_not_Allocated()
    if option == "cancel" or len(list_employee) == 0:
        for i in client_level1.project.employees_allocated:
            if i not in replace_Employee:
                game.changeEmployee_Feeling(i, Feelings.sad)
        Eco_Msg['status'] = "Complete"
        Eco_Msg[
            'msg'] = "if some employees were leave so that work load falls on other team member so other feelings changed to sad"
        Eco_Msg['reason'] = (
            (lambda: "Employees not Available not available for Replacement",
             lambda: "")[option == "cancel"]())
        Eco_Msg['Employee'] = []
    else:
        Eco_Msg['status'] = ""
        Eco_Msg['msg'] = ""
        Eco_Msg['reason'] = ""
        Eco_Msg['Employee'] = list_employee

    return Eco_Msg
Ejemplo n.º 6
0
def personal_request():
    global otherdict
    list_a = request.json['list_accept']
    if len(list_a) == len(client_level1.project.employees_allocated):
        for emp in client_level1.project.employees_allocated:
            game.changeEmployee_Feeling(emp, Feelings.happy)
        return "all the Employees were granted with a leaves so project deadline will be crossed.So it tends to failure"
    #some peoples applied for leave no one granted with leave
    #list_emp -list of employees applied for leave
    #list_a -list of employeed=s granted with leave
    if len(list_a) == 0 and len(list_emp) != 0:
        otherdict['leaves'] = 0
        for i in list_a:
            game.changeEmployee_Feeling(emp, Feelings.sad)
        return "all the employees feelings changed to sad who were applied for leave"

    for i in client_level1.project.employees_allocated:
        if i not in list_a:
            game.changeEmployee_Feeling(emp, Feelings.sad)
        else:
            game.changeEmployee_Feeling(emp, Feelings.happy)
    return "if some employees were leave so that work load falls on other team member so other feelings changed to sad"
Ejemplo n.º 7
0
def Personal_Discussion_Process():
    list_a = request.json['list_accept']
    Eco_Msg = {}
    if len(list_a) == len(list_emp):
        for emp in client_level1.project.employees_allocated:
            game.changeEmployee_Feeling(emp, Feelings.happy)
        Eco_Msg['status'] = 'InComplete'
        Eco_Msg[
            'msg'] = "all the Employees were granted with a leaves so project deadline will be crossed.So it tends to failure"
    elif (len(list_a)) == 0:
        for emp in client_level1.project.employees_allocated:
            game.changeEmployee_Feeling(emp, Feelings.sad)
        Eco_Msg['status'] = 'Completed'
        Eco_Msg['msg'] = "all the employees feelings changed to sad"
    else:
        for i in client_level1.project.employees_allocated:
            if i in list_a:
                game.changeEmployee_Feeling(i, Feelings.happy)
            else:
                game.changeEmployee_Feeling(i, Feelings.sad)
        Eco_Msg['status'] = "Complete"
        Eco_Msg[
            'msg'] = "if some employees were leave so that work load falls on other team member so other feelings changed to sad"
    return Eco_Msg
Ejemplo n.º 8
0
def weather_change_action(option):
    d_msg = {}
    if option == "Work from Home":
        for i in client_level1.project.employees_allocated:
            game.changeEmployee_Feeling(i, Feelings.ok)
        d_msg['Status'] = "Completed"
        d_msg[
            'Message'] = "It is a good decision eventhough the employees were not happy but they are ok with the situation"
    elif option == "declared Leave":
        for i in client_level1.project.employees_allocated:
            game.changeEmployee_Feeling(i, Feelings.happy)
        client_level1.changeFeelings(Feelings.sad)
        d_msg['Status'] = "InComplete"
        d_msg[
            'Message'] = "Failed Because eventhough the employee was happy.The client were not Happy because all the Employees were granted with a leaves so project deadline will be crossed.So it tends to failure"
    elif option == "come to office":
        for i in client_level1.project.employees_allocated:
            game.changeEmployee_Feeling(i, Feelings.sad)
        client_level1.changeFeelings(Feelings.happy)
        d_msg['Status'] = "Completed"
        d_msg[
            'Message'] = "Partial Success Because All the Employees were not Happy with the Decision"

    return d_msg