def delete_project(bdo_id): """ Function for the bdo to delete the project :param bdo_id: bdo _id :return: null """ table_name = 'PROJECT' print(ct.Project_available_in_your_block) project_list = qb.get_item_for_asignee(table_name, bdo_id) print("-" * 60) for item in project_list: print('Project Id : {} | Project Name :{}'.format(item[0], item[1])) print("-" * 60) item_id = input(ct.Enter_the_project_id_to_be_deleted) qb.delete_item_from_table(table_name, item_id, 'id') qb.delete_item_from_table(ct.PROJECT_MEMBER_DETAIL_TABLE, item_id, 'project_id')
def view_complaints(bdo_id): """ Function to view the complaints registered under BDO :param bdo_id: bdo+id :return: null """ table_name = 'COMPLAINT' result_data = qb.fetch_complaints_by_authority(table_name, bdo_id, 'BDO') if len(result_data) != 0: print("-" * 140) for item in result_data: print('Complaint Id : {complaint_id} | Member Id : {member_id} | ' 'Message : {message} | Complaint Date : {date}'.format(complaint_id=item[0], member_id=item[1], message=item[2], date=item[3])) print("-" * 140) complaint_id = input(ct.Choose_complaint_that_has_been_resolved) qb.delete_item_from_table(table_name, complaint_id, 'id') else: print(ct.No_Complaint_present)
def delete_member(gpm_id): """ Function to delete a member form the table :param gpm_id: gpm id :return: null """ table_name = 'MEMBER' print(ct.Member_available_in_your_zone) member_list = qb.get_item_for_asignee(table_name, gpm_id) print("-" * 60) for item in member_list: print('Member Id : {} | Member Name :{}'.format(item[0], item[1])) print("-" * 60) item_id = input(ct.Enter_the_member_id_to_be_deleted) qb.delete_item_from_table(table_name, item_id, 'id') qb.delete_item_from_table(ct.PROJECT_MEMBER_DETAIL_TABLE, item_id, 'member_id') qb.delete_item_from_table(ct.WAGE_APPROVAL_TABLE, item_id, 'member_id') qb.delete_item_from_table(ct.COMPLAINT_TABLE, item_id, 'member_id')