def sale_manage(self):
     self.sale = SaleMenu()
     grant = []
     for i in range(len(IDDao().select_grant('admin'))):
         a = IDDao().select_grant(self.ui.lbl_mode.text()).count(IDDao().select_grant('admin')[i])
         grant.append(a)
     if grant[2] == 0:
         self.sale.ui.tab_product.removeTab(0)
    def check_grant(self):
        grant = []
        for i in range(len(IDDao().select_grant('admin'))):
            a = IDDao().select_grant(self.ui.lbl_mode.text()).count(
                IDDao().select_grant('admin')[i])
            grant.append(a)

        if grant[4] == 0:
            self.ui.tab_manage.removeTab(1)
        if grant[3] == 0:
            self.ui.tab_manage.removeTab(0)
    def __init__(self, *args, **kwargs):
        super().__init__()
        self.pdt = ProductDao()
        self.idt = IDDao()
        self.sdt = SaleDao()
        self.ui = uic.loadUi("ui/main_menu.ui", self)

        self.month_count = 14
        self.graphcount = 0

        # combobox
        self.combobox_setting()

        # graph
        self.graph()

        # table
        self.table_pro = create_table(table=self.ui.table_pro, data=['제품코드', '제품명', '종류', '제품가격', '마진율(%)'])
        self.sale_pro = create_table(table=self.ui.table_sale, data=['제품명', '판매량', '판매금액', '판매일'])

        self.load_pro_all()
        self.load_sale_all()

        self.ui.btn_out.clicked.connect(self.exit)  # logout
        self.ui.btn_manage.clicked.connect(self.manage)
        self.ui.btn_sale.clicked.connect(self.sale_manage)
        self.ui.btn_exit.clicked.connect(self.exit)
        self.ui.btn_set.clicked.connect(self.user_setting)
        self.ui.combo_menu.currentIndexChanged.connect(self.select_menu)
        self.ui.combo_sale_year.currentIndexChanged.connect(self.select_sale)
        self.ui.combo_sale_month.currentIndexChanged.connect(self.select_month)
        self.ui.show()
    def __init__(self):
        super().__init__()
        self.ui = uic.loadUi("ui/manager.ui")
        self.idt = IDDao()

        self.ui.btn_edit_user.setEnabled(False)

        self.table_user = create_table(table=self.ui.table_user,
                                       data=['ID', '이름', '권한', '이메일'])
        self.load_user()

        self.ui.le_pass.setEchoMode(QLineEdit.Password)

        self.ui.com_grant.addItem('--select--')
        for i in range(len(self.idt.select_mode())):
            self.ui.com_grant.addItems(self.idt.select_mode()[i])

        self.set_context_menu(self.ui.table_user)
        self.ui.btn_init.clicked.connect(self.coffee_init)
        self.ui.btn_backup.clicked.connect(self.Backup)
        self.ui.btn_restore.clicked.connect(self.Restore)
        self.ui.btn_del_user.clicked.connect(self.del_user)
        self.ui.btn_insert_user.clicked.connect(self.ins_user)
        self.ui.btn_edit_user.clicked.connect(self.edit_user)

        self.ui.btn_exit.clicked.connect(self.exit)
        self.ui.show()
    def __init__(self):
        super().__init__()
        self.idt = IDDao()
        self.ui = uic.loadUi('ui/findpass.ui')

        self.ui.btn_exit.clicked.connect(self.exit)
        self.ui.btn_find.clicked.connect(self.find)

        self.ui.show()
Exemple #6
0
 def update(self):
     name = self.ui.le_name.text()
     password = self.ui.le_pass.text()
     email = self.ui.le_email.text()
     self.idt = IDDao()
     print(self.idt.select_item_id(self.ui.lbl_id.text())[0][1])
     self.idt.update_setting(self.ui.lbl_id.text(), name, password, email)
     self.ui.lbl_name.setText(
         self.idt.select_item_id(self.ui.lbl_id.text())[0][0])
     QMessageBox.information(self, '사용자 정보', '변경되었습니다.', QMessageBox.Ok)
Exemple #7
0
    def __init__(self):
        super().__init__()
        self.ui = uic.loadUi("ui/User_registration.ui")

        self.idt = IDDao()
        self.idt.select_item()

        self.ui.le_pass.setEchoMode(QLineEdit.Password)

        self.ui.com_grant.addItem('--select--')
        for i in range(len(self.idt.select_mode()) - 1):
            self.ui.com_grant.addItems(self.idt.select_mode()[i + 1])

        self.ui.btn_ok.clicked.connect(self.sign_up)
        self.ui.btn_can.clicked.connect(self.exit)

        self.ui.le_pass.returnPressed.connect(self.sign_up)
        self.ui.le_id.returnPressed.connect(self.sign_up)
        self.ui.le_name.returnPressed.connect(self.sign_up)
        self.ui.le_email.returnPressed.connect(self.sign_up)

        self.ui.show()