Пример #1
0
def delete(option: int, dfcard: DataFrame) -> None:
    resp = 'Y'
    while resp.upper() == 'Y':
        regcard: Card = validcard(option, dfcard)
        if int(regcard.codeCard) > 0:
            resp = ' '
            while resp.upper() not in 'YN':
                resp = input(f'Confirm the delete the {regcard.codeCard} - '
                             f'{regcard.nameCard} [Y/N]? ')
            if resp.upper() == 'Y':
                dfcard = dfcard.drop(
                    dfcard[(dfcard.Code == regcard.codeCard)].index)

                Card.deletedb(regcard)

        resp = ' '
        while resp.upper() not in 'YN':
            resp = input('Do you want continue [Y/N}? ')
Пример #2
0
def delete(option: int) -> None:
    resp = 'Y'
    while resp.upper() == 'Y':
        regcard: Card = validcard(option)
        if int(regcard.codeCard) > 0:
            countcodepouch = Pouch.countcodepouchcard(regcard.codeCard)

            if countcodepouch == 0:
                resp = ' '
                while resp.upper() not in 'YN':
                    resp = input(
                        f'Confirm the delete the {regcard.codeCard} - '
                        f'{regcard.nameCard} [Y/N]? ')
                    if resp.upper() == 'Y':
                        Card.deletedb(regcard)
            else:
                print(f'\33[1;31mHave Pouch registered\33[m')
        resp = ' '
        while resp.upper() not in 'YN':
            resp = input('Do you want continue [Y/N}? ')