(name, password, salary, position, name_to_update)
| 1154 | ) |
| 1155 | |
| 1156 | def update_employee_data(name, password, salary, position, name_to_update): |
| 1157 | try: |
| 1158 | cur = backend.cur |
| 1159 | if name_to_update: |
| 1160 | cur.execute( |
| 1161 | "UPDATE staff SET Name = ? WHERE name = ?", (name, name_to_update) |
| 1162 | ) |
| 1163 | |
| 1164 | cur.execute("UPDATE staff SET Name = ? WHERE name = ?", (password, name)) |
| 1165 | cur.execute( |
| 1166 | "UPDATE staff SET password = ? WHERE name = ?", (password, name) |
| 1167 | ) |
| 1168 | cur.execute("UPDATE staff SET salary = ? WHERE name = ?", (salary, name)) |
| 1169 | cur.execute( |
| 1170 | "UPDATE staff SET position = ? WHERE name = ?", (position, name) |
| 1171 | ) |
| 1172 | backend.conn.commit() |
| 1173 | show_popup_message( |
| 1174 | stacked_widget, "Employee Update successfully", UPDATE_EMPLOYEE_PAGE2 |
| 1175 | ) |
| 1176 | |
| 1177 | except: |
| 1178 | show_popup_message( |
| 1179 | stacked_widget, "Please fill in all fields", UPDATE_EMPLOYEE_PAGE2 |
| 1180 | ) |
| 1181 | |
| 1182 | # Create Home Page |
| 1183 | home_page = create_home_page( |
no test coverage detected