before interface 13.11.2024

This commit is contained in:
krivoshein
2024-11-13 09:54:35 +03:00
parent f4ca58ce91
commit 61aaac2b1c
62 changed files with 1233 additions and 1047 deletions

Binary file not shown.

View File

@@ -1,78 +1,121 @@
# ninja log v5
939 1049 7525981713172857 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/EWIEGA46WW/qrc_resources.cpp f2ed85aad0f78c7c
1076 3519 7525981737859367 CMakeFiles/InstructorsAndTrainees.dir/instructors/viewerinstructors.cpp.obj 2aa58696f5232c4b
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_viewertrainees.h 325fc9931da2ad77
57 1294 7526001966157653 CMakeFiles/InstructorsAndTrainees.dir/trainees/editortrainees.cpp.obj 2e9a885629b6e173
17 56 0 InstructorsAndTrainees_autogen/include/instructors/ui_viewerinstructors.h 325fc9931da2ad77
17 56 0 InstructorsAndTrainees_autogen/include/trainees/ui_dialogeditgroup.h 325fc9931da2ad77
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_editortrainees.h 325fc9931da2ad77
17 56 0 InstructorsAndTrainees_autogen/mocs_compilation.cpp 325fc9931da2ad77
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/mocs_compilation.cpp 325fc9931da2ad77
939 1049 7525981713172857 InstructorsAndTrainees_autogen/EWIEGA46WW/qrc_resources.cpp f2ed85aad0f78c7c
17 56 0 D:/LMS/DB_IaT/Debug64/CMakeFiles/InstructorsAndTrainees_autogen 325fc9931da2ad77
1053 3234 7525981734783034 CMakeFiles/InstructorsAndTrainees.dir/commonview.cpp.obj 3bdbb777b1ca4f9f
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_dialogeditinstructor.h 325fc9931da2ad77
17 56 0 InstructorsAndTrainees_autogen/include/trainees/ui_viewertrainees.h 325fc9931da2ad77
1061 3402 7525981736671953 CMakeFiles/InstructorsAndTrainees.dir/trainees/dialogedittrainee.cpp.obj 544a146272360182
17 56 0 InstructorsAndTrainees_autogen/include/trainees/ui_editortrainees.h 325fc9931da2ad77
1294 1665 7526001969842689 libInstructorsAndTrainees.dll d721655f2d9255b7
17 56 0 InstructorsAndTrainees_autogen/include/instructors/ui_dialogauthorizationinstructor.h 325fc9931da2ad77
13 253 7524942129142836 build.ninja 76aa11f472515be0
1073 3685 7525981739493337 CMakeFiles/InstructorsAndTrainees.dir/trainees/traineesview.cpp.obj a6ea1bfa14213881
1064 2292 7525981725238885 CMakeFiles/InstructorsAndTrainees.dir/trainees/computersLocations.cpp.obj 7aaac6302b47a301
1079 3311 7525981735671562 CMakeFiles/InstructorsAndTrainees.dir/instructors/databaseinstructors.cpp.obj 50eb3e676aec3cc5
1294 1665 7526001969842689 libInstructorsAndTrainees.dll.a d721655f2d9255b7
17 56 0 InstructorsAndTrainees_autogen/include/instructors/ui_editorinstructors.h 325fc9931da2ad77
1101 1321 7525981715851341 CMakeFiles/InstructorsAndTrainees.dir/InstructorsAndTrainees_autogen/EWIEGA46WW/qrc_resources.cpp.obj 54d07c59b3f7a2cf
1012 3479 7520793522676004 CMakeFiles/InstructorsAndTrainees.dir/instructorsAndTrainees.cpp.obj ff3fcdc370580ca2
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_editorinstructors.h 325fc9931da2ad77
17 56 0 InstructorsAndTrainees_autogen/include/tasks/ui_taskswidget.h 325fc9931da2ad77
17 56 0 InstructorsAndTrainees_autogen/include/instructors/ui_dialogeditinstructor.h 325fc9931da2ad77
1093 3696 7525981739656070 CMakeFiles/InstructorsAndTrainees.dir/instructors/instructorsview.cpp.obj d1fea9a96fa095b1
17 56 0 InstructorsAndTrainees_autogen/include/ui_instructorsandtraineeswidget.h 325fc9931da2ad77
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_dialogauthorizationinstructor.h 325fc9931da2ad77
1049 3541 7525981738084357 CMakeFiles/InstructorsAndTrainees.dir/InstructorsAndTrainees_autogen/mocs_compilation.cpp.obj 639ec716a2902c9f
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/tasks/ui_taskswidget.h 325fc9931da2ad77
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_dialogeditgroup.h 325fc9931da2ad77
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/ui_instructorsandtraineeswidget.h 325fc9931da2ad77
1070 3598 7525981738646009 CMakeFiles/InstructorsAndTrainees.dir/trainees/viewertrainees.cpp.obj 99b246ecbf2b6f9b
13 41 0 CMakeFiles/clean.additional 7155004b3956b606
17 56 0 CMakeFiles/InstructorsAndTrainees_autogen 325fc9931da2ad77
1067 3354 7525981736197679 CMakeFiles/InstructorsAndTrainees.dir/trainees/databasetrainees.cpp.obj b3eab31811ef0e17
17 56 0 InstructorsAndTrainees_autogen/include/trainees/ui_dialogedittrainee.h 325fc9931da2ad77
1058 3194 7525981734239997 CMakeFiles/InstructorsAndTrainees.dir/trainees/dialogeditgroup.cpp.obj 4bd8bab8b1110ba7
1083 3690 7525981739594632 CMakeFiles/InstructorsAndTrainees.dir/instructors/editorinstructors.cpp.obj b8e3d2e3a65912a8
1098 3612 7525981738797694 CMakeFiles/InstructorsAndTrainees.dir/tasks/taskswidget.cpp.obj 187ec526627f696e
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_dialogedittrainee.h 325fc9931da2ad77
939 1049 7525981713172857 InstructorsAndTrainees_autogen/EWIEGA46WW/qrc_resources.cpp f2ed85aad0f78c7c
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/mocs_compilation.cpp 325fc9931da2ad77
17 402 0 InstructorsAndTrainees_autogen/include/trainees/ui_viewertrainees.h 325fc9931da2ad77
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_dialogeditinstructor.h 325fc9931da2ad77
1053 3234 7525981734783034 CMakeFiles/InstructorsAndTrainees.dir/commonview.cpp.obj 3bdbb777b1ca4f9f
17 402 0 D:/LMS/DB_IaT/Debug64/CMakeFiles/InstructorsAndTrainees_autogen 325fc9931da2ad77
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/tasks/ui_taskswidget.h 325fc9931da2ad77
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_dialogauthorizationinstructor.h 325fc9931da2ad77
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/ui_instructorsandtraineeswidget.h 325fc9931da2ad77
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_dialogeditgroup.h 325fc9931da2ad77
402 1698 7531838035821493 CMakeFiles/InstructorsAndTrainees.dir/InstructorsAndTrainees_autogen/mocs_compilation.cpp.obj 639ec716a2902c9f
61 1098 7531240543218859 CMakeFiles/InstructorsAndTrainees.dir/instructors/databaseinstructors.cpp.obj 50eb3e676aec3cc5
17 402 0 InstructorsAndTrainees_autogen/include/ui_instructorsandtraineeswidget.h 325fc9931da2ad77
102 1804 7531837214477402 CMakeFiles/InstructorsAndTrainees.dir/instructors/instructorsview.cpp.obj d1fea9a96fa095b1
1086 3403 7525981736691900 CMakeFiles/InstructorsAndTrainees.dir/instructors/dialogeditinstructor.cpp.obj e02fcfe10480c54f
41 51 0 clean 9c4b4372737ab8da
17 56 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_viewerinstructors.h 325fc9931da2ad77
13 253 7531839302069843 build.ninja 76aa11f472515be0
89 1836 7531837214806736 CMakeFiles/InstructorsAndTrainees.dir/trainees/traineesview.cpp.obj a6ea1bfa14213881
1064 2292 7525981725238885 CMakeFiles/InstructorsAndTrainees.dir/trainees/computersLocations.cpp.obj 7aaac6302b47a301
405 1768 7531838036529893 CMakeFiles/InstructorsAndTrainees.dir/instructorsandtraineeswidget.cpp.obj 8e8beb29ba6ba100
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_editortrainees.h 325fc9931da2ad77
17 402 0 InstructorsAndTrainees_autogen/mocs_compilation.cpp 325fc9931da2ad77
56 1112 7531242705228988 CMakeFiles/InstructorsAndTrainees.dir/trainees/databasetrainees.cpp.obj b3eab31811ef0e17
17 402 0 CMakeFiles/InstructorsAndTrainees_autogen 325fc9931da2ad77
17 402 0 InstructorsAndTrainees_autogen/include/instructors/ui_dialogeditinstructor.h 325fc9931da2ad77
17 402 0 InstructorsAndTrainees_autogen/include/tasks/ui_taskswidget.h 325fc9931da2ad77
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_editorinstructors.h 325fc9931da2ad77
1012 3479 7520793522676004 CMakeFiles/InstructorsAndTrainees.dir/instructorsAndTrainees.cpp.obj ff3fcdc370580ca2
1101 1321 7525981715851341 CMakeFiles/InstructorsAndTrainees.dir/InstructorsAndTrainees_autogen/EWIEGA46WW/qrc_resources.cpp.obj 54d07c59b3f7a2cf
1112 1469 7531242708771354 libInstructorsAndTrainees.dll.a d721655f2d9255b7
17 402 0 InstructorsAndTrainees_autogen/include/instructors/ui_editorinstructors.h 325fc9931da2ad77
1112 1469 7531242708771354 libInstructorsAndTrainees.dll d721655f2d9255b7
17 402 0 InstructorsAndTrainees_autogen/include/trainees/ui_editortrainees.h 325fc9931da2ad77
17 402 0 InstructorsAndTrainees_autogen/include/instructors/ui_dialogauthorizationinstructor.h 325fc9931da2ad77
105 1888 7531837215325145 CMakeFiles/InstructorsAndTrainees.dir/tasks/taskswidget.cpp.obj 187ec526627f696e
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_dialogedittrainee.h 325fc9931da2ad77
92 1870 7531837215145617 CMakeFiles/InstructorsAndTrainees.dir/instructors/viewerinstructors.cpp.obj 2aa58696f5232c4b
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_viewertrainees.h 325fc9931da2ad77
81 1983 7531837216272616 CMakeFiles/InstructorsAndTrainees.dir/trainees/editortrainees.cpp.obj 2e9a885629b6e173
17 402 0 InstructorsAndTrainees_autogen/include/instructors/ui_viewerinstructors.h 325fc9931da2ad77
17 402 0 InstructorsAndTrainees_autogen/include/trainees/ui_dialogeditgroup.h 325fc9931da2ad77
17 402 0 InstructorsAndTrainees_autogen/include/trainees/ui_dialogedittrainee.h 325fc9931da2ad77
1058 3194 7525981734239997 CMakeFiles/InstructorsAndTrainees.dir/trainees/dialogeditgroup.cpp.obj 4bd8bab8b1110ba7
1090 3335 7525981736006531 CMakeFiles/InstructorsAndTrainees.dir/instructors/dialogauthorizationinstructor.cpp.obj f1f85077e88e8c7
1051 3803 7525981740695693 CMakeFiles/InstructorsAndTrainees.dir/instructorsandtraineeswidget.cpp.obj 8e8beb29ba6ba100
19 57 0 CMakeFiles/InstructorsAndTrainees_autogen 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/mocs_compilation.cpp 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/include/ui_instructorsandtraineeswidget.h 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/include/trainees/ui_editortrainees.h 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/include/trainees/ui_dialogeditgroup.h 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/include/trainees/ui_dialogedittrainee.h 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/include/trainees/ui_viewertrainees.h 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/include/instructors/ui_viewerinstructors.h 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/include/instructors/ui_editorinstructors.h 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/include/instructors/ui_dialogeditinstructor.h 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/include/instructors/ui_dialogauthorizationinstructor.h 325fc9931da2ad77
19 57 0 InstructorsAndTrainees_autogen/include/tasks/ui_taskswidget.h 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/CMakeFiles/InstructorsAndTrainees_autogen 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/mocs_compilation.cpp 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/ui_instructorsandtraineeswidget.h 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_editortrainees.h 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_dialogeditgroup.h 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_dialogedittrainee.h 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_viewertrainees.h 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_viewerinstructors.h 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_editorinstructors.h 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_dialogeditinstructor.h 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_dialogauthorizationinstructor.h 325fc9931da2ad77
19 57 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/tasks/ui_taskswidget.h 325fc9931da2ad77
57 1303 7526014018240729 CMakeFiles/InstructorsAndTrainees.dir/trainees/editortrainees.cpp.obj 2e9a885629b6e173
1303 1677 7526014021949564 libInstructorsAndTrainees.dll d721655f2d9255b7
1303 1677 7526014021949564 libInstructorsAndTrainees.dll.a d721655f2d9255b7
17 402 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_viewerinstructors.h 325fc9931da2ad77
13 41 0 CMakeFiles/clean.additional 7155004b3956b606
86 1871 7531837215155595 CMakeFiles/InstructorsAndTrainees.dir/trainees/viewertrainees.cpp.obj 99b246ecbf2b6f9b
98 2027 7531837216691491 CMakeFiles/InstructorsAndTrainees.dir/instructors/editorinstructors.cpp.obj b8e3d2e3a65912a8
939 1049 7525981713172857 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/EWIEGA46WW/qrc_resources.cpp f2ed85aad0f78c7c
17 353 0 CMakeFiles/InstructorsAndTrainees_autogen 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/mocs_compilation.cpp 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/include/ui_instructorsandtraineeswidget.h 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/include/trainees/ui_editortrainees.h 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/include/trainees/ui_dialogeditgroup.h 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/include/trainees/ui_dialogedittrainee.h 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/include/trainees/ui_viewertrainees.h 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/include/instructors/ui_viewerinstructors.h 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/include/instructors/ui_editorinstructors.h 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/include/instructors/ui_dialogeditinstructor.h 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/include/instructors/ui_dialogauthorizationinstructor.h 325fc9931da2ad77
17 353 0 InstructorsAndTrainees_autogen/include/tasks/ui_taskswidget.h 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/CMakeFiles/InstructorsAndTrainees_autogen 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/mocs_compilation.cpp 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/ui_instructorsandtraineeswidget.h 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_editortrainees.h 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_dialogeditgroup.h 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_dialogedittrainee.h 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_viewertrainees.h 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_viewerinstructors.h 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_editorinstructors.h 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_dialogeditinstructor.h 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_dialogauthorizationinstructor.h 325fc9931da2ad77
17 353 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/tasks/ui_taskswidget.h 325fc9931da2ad77
382 1964 7531839339498391 CMakeFiles/InstructorsAndTrainees.dir/tasks/taskswidget.cpp.obj 187ec526627f696e
378 2067 7531839340529769 CMakeFiles/InstructorsAndTrainees.dir/instructors/instructorsview.cpp.obj d1fea9a96fa095b1
369 2099 7531839340850124 CMakeFiles/InstructorsAndTrainees.dir/instructors/viewerinstructors.cpp.obj 2aa58696f5232c4b
354 2126 7531839341109418 CMakeFiles/InstructorsAndTrainees.dir/InstructorsAndTrainees_autogen/mocs_compilation.cpp.obj 639ec716a2902c9f
359 2160 7531839341449390 CMakeFiles/InstructorsAndTrainees.dir/trainees/editortrainees.cpp.obj 2e9a885629b6e173
366 2161 7531839341449390 CMakeFiles/InstructorsAndTrainees.dir/trainees/traineesview.cpp.obj a6ea1bfa14213881
375 2210 7531839341950869 CMakeFiles/InstructorsAndTrainees.dir/instructors/editorinstructors.cpp.obj b8e3d2e3a65912a8
356 2212 7531839341970816 CMakeFiles/InstructorsAndTrainees.dir/instructorsandtraineeswidget.cpp.obj 8e8beb29ba6ba100
363 2272 7531839342578795 CMakeFiles/InstructorsAndTrainees.dir/trainees/viewertrainees.cpp.obj 99b246ecbf2b6f9b
17 54 0 CMakeFiles/InstructorsAndTrainees_autogen 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/mocs_compilation.cpp 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/include/ui_instructorsandtraineeswidget.h 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/include/trainees/ui_editortrainees.h 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/include/trainees/ui_dialogeditgroup.h 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/include/trainees/ui_dialogedittrainee.h 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/include/trainees/ui_viewertrainees.h 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/include/instructors/ui_viewerinstructors.h 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/include/instructors/ui_editorinstructors.h 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/include/instructors/ui_dialogeditinstructor.h 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/include/instructors/ui_dialogauthorizationinstructor.h 325fc9931da2ad77
17 54 0 InstructorsAndTrainees_autogen/include/tasks/ui_taskswidget.h 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/CMakeFiles/InstructorsAndTrainees_autogen 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/mocs_compilation.cpp 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/ui_instructorsandtraineeswidget.h 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_editortrainees.h 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_dialogeditgroup.h 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_dialogedittrainee.h 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/trainees/ui_viewertrainees.h 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_viewerinstructors.h 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_editorinstructors.h 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_dialogeditinstructor.h 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/instructors/ui_dialogauthorizationinstructor.h 325fc9931da2ad77
17 54 0 D:/LMS/DB_IaT/Debug64/InstructorsAndTrainees_autogen/include/tasks/ui_taskswidget.h 325fc9931da2ad77
61 1646 7531839533616695 CMakeFiles/InstructorsAndTrainees.dir/trainees/databasetrainees.cpp.obj b3eab31811ef0e17
73 1706 7531839534240696 CMakeFiles/InstructorsAndTrainees.dir/instructors/databaseinstructors.cpp.obj 50eb3e676aec3cc5
79 1722 7531839534380323 CMakeFiles/InstructorsAndTrainees.dir/instructors/instructorsview.cpp.obj d1fea9a96fa095b1
64 1741 7531839534601666 CMakeFiles/InstructorsAndTrainees.dir/trainees/viewertrainees.cpp.obj 99b246ecbf2b6f9b
69 1807 7531839535259884 CMakeFiles/InstructorsAndTrainees.dir/instructors/viewerinstructors.cpp.obj 2aa58696f5232c4b
54 1819 7531839535390685 CMakeFiles/InstructorsAndTrainees.dir/InstructorsAndTrainees_autogen/mocs_compilation.cpp.obj 639ec716a2902c9f
83 1852 7531839535709841 CMakeFiles/InstructorsAndTrainees.dir/tasks/taskswidget.cpp.obj 187ec526627f696e
76 1855 7531839535739769 CMakeFiles/InstructorsAndTrainees.dir/instructors/editorinstructors.cpp.obj b8e3d2e3a65912a8
59 1861 7531839535800849 CMakeFiles/InstructorsAndTrainees.dir/trainees/editortrainees.cpp.obj 2e9a885629b6e173
67 1866 7531839535859449 CMakeFiles/InstructorsAndTrainees.dir/trainees/traineesview.cpp.obj a6ea1bfa14213881
56 1976 7531839536960691 CMakeFiles/InstructorsAndTrainees.dir/instructorsandtraineeswidget.cpp.obj 8e8beb29ba6ba100
1976 2385 7531839541029361 libInstructorsAndTrainees.dll d721655f2d9255b7
1976 2385 7531839541029361 libInstructorsAndTrainees.dll.a d721655f2d9255b7

View File

@@ -1,12 +1,17 @@
# Generated by CMake. Changes will be overwritten.
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/databaseinstructors.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/dialogeditinstructor.cpp
uic:ui_dialogeditinstructor.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/dialogedittrainee.cpp
uic:ui_dialogedittrainee.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/dialogeditgroup.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/computersLocations.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/instructorsandtraineeswidget.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/editortrainees.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/viewertrainees.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/computersLocations.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/dialogeditgroup.h
mmc:Q_OBJECT
uic:ui_dialogeditgroup.h
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/viewerinstructors.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/dialogauthorizationinstructor.cpp
@@ -15,47 +20,42 @@ D:/LMS/DB_IaT/InstructorsAndTrainees/instructorsandtraineeswidget.cpp
uic:ui_instructorsandtraineeswidget.h
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/editorinstructors.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/viewertrainees.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/instructorsandtraineeswidget.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/instructorsAndTrainees_global.h
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/instructorsview.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/commonview.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/databasetrainees.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/instructorsview.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/databasetrainees.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/viewerinstructors.cpp
uic:ui_viewerinstructors.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/viewertrainees.cpp
uic:ui_viewertrainees.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/dialogeditgroup.h
mmc:Q_OBJECT
uic:ui_dialogeditgroup.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/editortrainees.cpp
uic:ui_editortrainees.h
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/dialogeditinstructor.h
mmc:Q_OBJECT
uic:ui_dialogeditinstructor.h
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/instructorsview.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/editortrainees.cpp
uic:ui_editortrainees.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/traineesview.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/databaseinstructors.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/dialogauthorizationinstructor.h
mmc:Q_OBJECT
uic:ui_dialogauthorizationinstructor.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/traineesview.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/databaseinstructors.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/computersLocations.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/editortrainees.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/dialogedittrainee.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/tasks/taskswidget.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/traineesview.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/dialogedittrainee.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/viewertrainees.cpp
uic:ui_viewertrainees.h
D:/LMS/DB_IaT/InstructorsAndTrainees/commonview.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/databasetrainees.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/viewerinstructors.cpp
uic:ui_viewerinstructors.h
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/databasetrainees.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/tasks/taskswidget.cpp
uic:ui_taskswidget.h
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/editorinstructors.cpp
uic:ui_editorinstructors.h
D:/LMS/DB_IaT/InstructorsAndTrainees/commonview.cpp
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/dialogeditinstructor.cpp
uic:ui_dialogeditinstructor.h
D:/LMS/DB_IaT/InstructorsAndTrainees/instructors/databaseinstructors.h
mmc:Q_OBJECT
D:/LMS/DB_IaT/InstructorsAndTrainees/trainees/computersLocations.cpp

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.1, 2024-11-06T16:05:43. -->
<!-- Written by QtCreator 4.11.1, 2024-11-13T09:53:44. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

View File

@@ -6,8 +6,6 @@ DataBaseInstructors::DataBaseInstructors(DataBaseLMS* dbLMS):
adminMode(false)
{
this->dbLMS = dbLMS;
LoadInstructorsPSQL();
}
DataBaseInstructors::~DataBaseInstructors()
@@ -15,229 +13,91 @@ DataBaseInstructors::~DataBaseInstructors()
}
void DataBaseInstructors::LoadInstructorsPSQL()
{
listOfInstructors.clear();
listOfInstructors = dbLMS->selectAllInstructors();
QApplication::beep();
}
bool DataBaseInstructors::AuthorizationInstructor(QString login, QString password)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
if(! dbLMS->transactionBegin())
return false;
if(int id = dbLMS->selectInstructorID(login, password))
{
if(listOfInstructors[i].getArchived())
continue;
if(listOfInstructors[i].getLogin() == login && listOfInstructors[i].getPassword() == password)
{
Instructor instructor = listOfInstructors[i];
instructor.setLoggedIn(true);
int id = dbLMS->updateInstructor(instructor);
if(id)
{
LoadInstructorsPSQL();
return true;
}
else
return false;
}
if(dbLMS->updateInstructorLoggedIn(id, true))
return dbLMS->transactionEnd();
}
dbLMS->transactionEnd();
return false;
}
bool DataBaseInstructors::deAuthorizationInstructor(QString login)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
if(! dbLMS->transactionBegin())
return false;
if(int id = dbLMS->selectInstructorID(login))
{
if(listOfInstructors[i].getArchived())
continue;
if(listOfInstructors[i].getLogin() == login)
{
Instructor instructor = listOfInstructors[i];
instructor.setLoggedIn(false);
int id = dbLMS->updateInstructor(instructor);
if(id)
{
LoadInstructorsPSQL();
return true;
}
else
return false;
}
if(dbLMS->updateInstructorLoggedIn(id, false))
return dbLMS->transactionEnd();
}
dbLMS->transactionEnd();
return false;
}
QList<Instructor> DataBaseInstructors::getListInstructors()
{
return dbLMS->selectAllInstructors();
}
Instructor DataBaseInstructors::getInstructor(int id)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getID() == id)
return listOfInstructors[i];
}
return Instructor();
return dbLMS->selectInstructor(id);
}
QString DataBaseInstructors::getNameInstructorByLogin(QString login)
{
for(Instructor instructor : listOfInstructors)
{
if(instructor.getLogin() == login)
return instructor.getName();
}
return QString(QStringLiteral(""));
}
/*
QString DataBaseInstructors::getAuthorizedInstructorName()
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getLoggedIn())
return listOfInstructors[i].getName();
}
return QStringLiteral("");
}*/
int DataBaseInstructors::newInstructor()
{
Instructor instructor;
instructor.setName(generateDefaultNameInstructor());
instructor.setLogin(generateDefaultLoginInstructor());
instructor.setPassword(QStringLiteral("<password>"));
instructor.setIsAdmin(false);
instructor.setArchived(false);
instructor.setLoggedIn(false);
int id = dbLMS->insertInstructor(instructor);
if(id)
{
LoadInstructorsPSQL();
return id;
}
else
return 0;
return dbLMS->insertInstructor();
}
int DataBaseInstructors::deleteInstructor(int id)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getID() == id)
{
int id_del = dbLMS->deleteInstructor(id);
if(id_del)
{
LoadInstructorsPSQL();
return id_del;
}
else
return 0;
}
}
return 0;
return dbLMS->deleteInstructor(id);
}
int DataBaseInstructors::editInstructor(Instructor instructor)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
//Проверка дублирования логина и имени
QList<Instructor> listInstructors = dbLMS->selectAllInstructors();
for(Instructor exist_instructor : listInstructors)
{
if(listOfInstructors[i].getID() == instructor.getID())
{
if( (!checkExistNameInstructor(instructor.getName()) || instructor.getName() == listOfInstructors[i].getName()) &&
(!checkExistLoginInstructor(instructor.getLogin()) || instructor.getLogin() == listOfInstructors[i].getLogin()) )
{
int id = dbLMS->updateInstructor(instructor);
if(instructor.getLogin() == exist_instructor.getLogin() && instructor.getID() != exist_instructor.getID())
{//Логин уже существует!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing instructor login has been entered.\nThe changes will not be accepted."));
return 0;
}
if(id)
{
LoadInstructorsPSQL();
return id;
}
else
return 0;
}
if(instructor.getName() == exist_instructor.getName() && instructor.getID() != exist_instructor.getID())
{//Имя уже существует
QMessageBox::warning(nullptr, tr("Editing warning!"),
tr("An existing instructor name has been entered."));
//return 0;
}
}
return 0;
return dbLMS->updateInstructor(instructor);
}
bool DataBaseInstructors::isAdmin(int id)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getID() == id)
return listOfInstructors[i].getIsAdmin();
}
return false;
return dbLMS->selectInstructorIsAdmin(id);
}
bool DataBaseInstructors::isArchived(int id)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getID() == id)
return listOfInstructors[i].getArchived();
}
return false;
return dbLMS->selectInstructorArchived(id);
}
QString DataBaseInstructors::generateDefaultNameInstructor()
bool DataBaseInstructors::existLogin(QString login)
{
int numInstructor = 0;
QString name;
do
{
name = QStringLiteral("<") + tr("Instructor") + QStringLiteral(" ") + QString::number(++numInstructor) + QStringLiteral(">");
}while(checkExistNameInstructor(name));
return name;
}
bool DataBaseInstructors::checkExistNameInstructor(QString name)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getName() == name)
return true;
}
return false;
}
QString DataBaseInstructors::generateDefaultLoginInstructor()
{
int numInstructor = 0;
QString login;
do
{
login = QStringLiteral("<I") + QString::number(++numInstructor) + QStringLiteral(">");
}while(checkExistLoginInstructor(login));
return login;
}
bool DataBaseInstructors::checkExistLoginInstructor(QString login)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getLogin() == login)
return true;
}
return false;
}

View File

@@ -5,10 +5,8 @@
#include <QObject>
#include "instructorsAndTrainees_global.h"
#include "instructor.h"
#include "databaselms.h"
class DataBaseInstructors : QObject
{
Q_OBJECT
@@ -17,19 +15,12 @@ public:
DataBaseInstructors(DataBaseLMS* dbLMS);
~DataBaseInstructors();
void LoadInstructorsPSQL();
bool AuthorizationInstructor(QString login, QString password);
bool deAuthorizationInstructor(QString login);
QList<Instructor> getListInstructors(){ return listOfInstructors; } //Для загрузки
QList<Instructor> getListInstructors();
Instructor getInstructor(int id);
QString getNameInstructorByLogin(QString login);
//QString getAuthorizedInstructorName();
int newInstructor();
int deleteInstructor(int id);
int editInstructor(Instructor instructor);
@@ -37,19 +28,10 @@ public:
bool isAdmin(int id);
bool isArchived(int id);
bool existLogin(QString login);
private:
QString generateDefaultNameInstructor();
bool checkExistNameInstructor(QString name);
QString generateDefaultLoginInstructor();
bool checkExistLoginInstructor(QString login);
private:
QList<Instructor> listOfInstructors;
bool adminMode;
DataBaseLMS* dbLMS;
};

View File

@@ -12,6 +12,9 @@ EditorInstructors::EditorInstructors(DataBaseInstructors* db, bool adminMode, QW
preparationTreeWidget(ui->treeWidget);
setNotLoggedInVisible(true);
loadInstructorsFromDB();
if(adminMode)
ui->btnArchive->click();
}
EditorInstructors::~EditorInstructors()
@@ -21,9 +24,11 @@ EditorInstructors::~EditorInstructors()
void EditorInstructors::on_btnNewInstructor_clicked()
{
int id = dbInstructors->newInstructor();
loadInstructorsFromDB();
setCurrentInstructor(id);
if(int id = dbInstructors->newInstructor())
{
loadInstructorsFromDB();
setCurrentInstructor(id);
}
}
void EditorInstructors::on_btnDeleteInstructor_clicked()
@@ -36,7 +41,7 @@ void EditorInstructors::on_btnDeleteInstructor_clicked()
if(treeItemParent == nullptr)
{//Выбран Инструктор
int id = treeItemCurrent->text(0).toInt();
int id = treeItemCurrent->text(ColumnsTreeInsructors::clmn_ID).toInt();
if(dbInstructors->isAdmin(id))
{//Это Админ!
@@ -46,8 +51,8 @@ void EditorInstructors::on_btnDeleteInstructor_clicked()
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete it anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
{
dbInstructors->deleteInstructor(id);
loadInstructorsFromDB();
if(dbInstructors->deleteInstructor(id))
loadInstructorsFromDB();
}
}
}
@@ -63,9 +68,11 @@ void EditorInstructors::on_btnToOrFromArchive_clicked()
if(treeItemParent == nullptr)
{//Выбран Инструктор
int id = treeItemCurrent->text(0).toInt();
int id = treeItemCurrent->text(ColumnsTreeInsructors::clmn_ID).toInt();
Instructor instructor = dbInstructors->getInstructor(id);
if(instructor.getID() == 0)
return;
if(instructor.getArchived())
{//Архивный
@@ -103,29 +110,45 @@ void EditorInstructors::on_btnEdit_clicked()
if(treeItemParent == nullptr)
{//Выбран Инструктор
int id = treeItemCurrent->text(0).toInt();
int id = treeItemCurrent->text(ColumnsTreeInsructors::clmn_ID).toInt();
DialogEditInstructor dlg(this);
dlg.setInstructor(dbInstructors->getInstructor(id));
switch( dlg.exec() )
Instructor instructor = dbInstructors->getInstructor(id);
if(instructor.getID() == 0)
return;
dlg.setInstructor(instructor);
while (true)
{
case QDialog::Accepted:
{
if(int id_edit = dbInstructors->editInstructor(dlg.getInstructor()))
switch( dlg.exec() )
{
loadInstructorsFromDB();
setCurrentInstructor(id_edit);
case QDialog::Accepted:
{
Instructor instructor_edit = dlg.getInstructor();
if(int id_edit = dbInstructors->editInstructor(instructor_edit))
{//Отредактировано
loadInstructorsFromDB();
setCurrentInstructor(id_edit);
return;
}
else
{
dlg.setInstructor(instructor_edit);
continue;
}
break;
}
case QDialog::Rejected:
return;
break;
default:
return;
break;
}
else
QMessageBox::critical(this, tr("Editing error!"),
tr("An existing instructor name or login has been entered.\nThe changes will not be accepted."));
break;
}
case QDialog::Rejected:
break;
default:
break;
}
}
}
@@ -148,7 +171,7 @@ void EditorInstructors::on_treeWidget_currentItemChanged(QTreeWidgetItem *curren
if(treeItemParent == nullptr)
{//Выбран инструктор
int id = current->text(0).toInt();
int id = current->text(ColumnsTreeInsructors::clmn_ID).toInt();
if(dbInstructors->isArchived(id))
{//Архивный
@@ -189,7 +212,7 @@ void EditorInstructors::setCurrentInstructor(int id)
{
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
if(item != nullptr)
if(item->text(0).toInt() == id)
if(item->text(ColumnsTreeInsructors::clmn_ID).toInt() == id)
{
treeWidget->setCurrentItem(item);
break;

View File

@@ -2,9 +2,9 @@
#include <QTranslator>
#include "instructorsview.h"
InstructorsView::InstructorsView(DataBaseInstructors* db, TypeView type, bool adminMode, QWidget *parent):
InstructorsView::InstructorsView(DataBaseInstructors* dbInstructors, TypeView type, bool adminMode, QWidget *parent):
CommonView(type, adminMode, parent),
dbInstructors(db)
dbInstructors(dbInstructors)
{
}
@@ -22,30 +22,39 @@ void InstructorsView::preparationTreeWidget(QTreeWidget* tree)
treeWidget->header()->setStyleSheet(QStringLiteral("font-size: 10pt;"));
treeWidget->setColumnWidth(0, 50);
treeWidget->setColumnWidth(1, 250);
treeWidget->setColumnWidth(2, 100);
treeWidget->setColumnWidth(3, 100);
treeWidget->setColumnWidth(4, 100);
treeWidget->setColumnWidth(5, 80);
treeWidget->setColumnWidth(6, 80);
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_ID, 50);
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Instructor, 250);
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Login, 100);
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Password, 100);
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Administrator, 100);
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Archived, 80);
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Logged, 80);
if(typeView == TypeView::onlyView)
{//onlyView
treeWidget->setColumnHidden(2, true);
treeWidget->setColumnHidden(3, true);
treeWidget->setColumnHidden(5, true);
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_ID, true);
//treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Login, true);
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Password, true);
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Archived, true);
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Administrator, true);
}
else
{//control
treeWidget->setColumnHidden(5, true);
if(adminMode)
{
archiveVisible = true;
notLoggedInVisible = true;
}
else
{
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_ID, true);
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Archived, true);
}
}
}
void InstructorsView::loadInstructorsFromDB()
{
dbInstructors->LoadInstructorsPSQL();
if(treeWidget == nullptr)
return;
@@ -59,43 +68,46 @@ void InstructorsView::loadInstructorsFromDB()
{
QTreeWidgetItem *ItemInstructor = new QTreeWidgetItem(treeWidget);
ItemInstructor->setText(0, QString::number(instructor.getID()));
ItemInstructor->setText(1, instructor.getName());
ItemInstructor->setText(2, instructor.getLogin());
ItemInstructor->setText(3, instructor.getPassword());
ItemInstructor->setText(ColumnsTreeInsructors::clmn_ID, QString::number(instructor.getID()));
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Instructor, instructor.getName());
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Login, instructor.getLogin());
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Password, instructor.getPassword());
//Сокрытие пароля
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Password, QStringLiteral("******"));
if(instructor.getArchived())
{//Архивный
ItemInstructor->setText(5, tr("yes"));
ItemInstructor->setIcon(1, QIcon(QStringLiteral(":/icons/instructorArchive.png")));
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Archived, tr("yes"));
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Instructor, QIcon(QStringLiteral(":/icons/instructorArchive.png")));
setItemColorArchive(ItemInstructor);
}
else
{//Не Архивный
ItemInstructor->setText(5, tr("no"));
ItemInstructor->setIcon(1, QIcon(QStringLiteral(":/icons/instructor.png")));
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Archived, tr("no"));
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Instructor, QIcon(QStringLiteral(":/icons/instructor.png")));
setItemColorNoArchive(ItemInstructor);
}
if(instructor.getIsAdmin())
{//Админ
ItemInstructor->setText(4, tr("yes"));
ItemInstructor->setIcon(1, QIcon(QStringLiteral(":/icons/admin.png")));
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Administrator, tr("yes"));
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Instructor, QIcon(QStringLiteral(":/icons/admin.png")));
}
else
{//Не Админ
ItemInstructor->setText(4, tr("no"));
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Administrator, tr("no"));
}
if(instructor.getLoggedIn())
{//Залогинен
ItemInstructor->setText(6, tr("yes"));
ItemInstructor->setIcon(6, QIcon(QStringLiteral(":/icons/circleGreen.png")));
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Logged, tr("yes"));
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Logged, QIcon(QStringLiteral(":/icons/circleGreen.png")));
}
else
{//Не Залогинен
ItemInstructor->setText(6, tr("no"));
ItemInstructor->setIcon(6, QIcon(QStringLiteral(":/icons/circleGray.png")));
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Logged, tr("no"));
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Logged, QIcon(QStringLiteral(":/icons/circleGray.png")));
}
//Скрываем архивных (при необходимости)
@@ -110,7 +122,7 @@ void InstructorsView::loadInstructorsFromDB()
}
treeWidget->setSortingEnabled(true);
treeWidget->sortItems(1, Qt::SortOrder::AscendingOrder);
treeWidget->sortItems(ColumnsTreeInsructors::clmn_Instructor, Qt::SortOrder::AscendingOrder);
treeWidget->expandAll();
if(typeView == TypeView::control)
@@ -123,7 +135,7 @@ void InstructorsView::loadInstructorsFromDB()
void InstructorsView::reSetHeadTreeWidget()
{
QStringList listHeaders = {tr("ID"), tr("Instructor"), tr("Login"), tr("Password"), tr("Administrator"), tr("Archived"), tr("Logged")};
QStringList listHeaders = {tr("Instructor"), tr("Login"), tr("Password"), tr("Administrator"), tr("Archived"), tr("Logged"), tr("ID")};
treeWidget->setHeaderLabels(listHeaders);
}

View File

@@ -12,7 +12,18 @@ class InstructorsView: public CommonView
Q_OBJECT
public:
InstructorsView(DataBaseInstructors* db, TypeView type, bool adminMode, QWidget *parent = nullptr);
InstructorsView(DataBaseInstructors* dbInstructors, TypeView type, bool adminMode, QWidget *parent = nullptr);
protected:
enum ColumnsTreeInsructors{
clmn_Instructor = 0,
clmn_Login,
clmn_Password,
clmn_Administrator,
clmn_Archived,
clmn_Logged,
clmn_ID
};
protected:
void preparationTreeWidget(QTreeWidget* tree);

View File

@@ -66,7 +66,7 @@ void ViewerInstructors::on_btnEditorInstructors_clicked()
QHBoxLayout *layout = new QHBoxLayout(dialog);
layout->addWidget(&editorInstructors);
dialog->setWindowTitle(tr("Editor of instructors"));
dialog->setMinimumSize(1400, 800);
dialog->setMinimumSize(1600, 800);
dialog->exec();
loadInstructorsFromDB();

View File

@@ -7,7 +7,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::InstructorsAndTraineesWidget),
adminMode(false),
loginInstructorLoggedIn(QStringLiteral(""))
loginInstructorLoggedInLocal(QStringLiteral(""))
{
ui->setupUi(this);
@@ -25,13 +25,13 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
ui->verticalLayout->addWidget(m_viewerTrainees);
ui->verticalLayout->addWidget(m_viewerInstructors);
m_viewerTrainees->setMinimumSize(1400, 700);
m_viewerInstructors->setMinimumSize(1400, 400);
m_viewerTrainees->setMinimumSize(1600, 700);
m_viewerInstructors->setMinimumSize(1600, 400);
}
InstructorsAndTraineesWidget::~InstructorsAndTraineesWidget()
{
deAuthorizationInstructor(loginInstructorLoggedIn);
deAuthorizationInstructor(loginInstructorLoggedInLocal);
delete m_viewerInstructors;
delete m_viewerTrainees;
@@ -57,7 +57,7 @@ bool InstructorsAndTraineesWidget::authorizationInstructorLocal(QWidget* parent)
if(dataBaseInstructors->AuthorizationInstructor(login, password))
{
loginInstructorLoggedIn = login;
loginInstructorLoggedInLocal = login;
if(login == QStringLiteral("admin"))
adminMode = true;
@@ -82,9 +82,9 @@ bool InstructorsAndTraineesWidget::authorizationInstructorLocal(QWidget* parent)
return false;
}
bool InstructorsAndTraineesWidget::authorizationCompleted()
bool InstructorsAndTraineesWidget::authorizationIsCompleted()
{
if(loginInstructorLoggedIn == QStringLiteral(""))
if(loginInstructorLoggedInLocal == QStringLiteral(""))
return false;
else
return true;

View File

@@ -7,6 +7,7 @@
#include "databaseinstructors.h"
#include "viewertrainees.h"
#include "viewerinstructors.h"
#include "interfacedatabaselms.h"
namespace Ui {
class InstructorsAndTraineesWidget;
@@ -23,7 +24,7 @@ public:
public:
//Авторизация инструктора локальная
bool authorizationInstructorLocal(QWidget* parent = nullptr);
bool authorizationCompleted();
bool authorizationIsCompleted();
//Авторизация обучаемого на клиенте
bool authorizationTrainee(QString login, QString password, QString classroom_name = QStringLiteral(""), QString computer_name = QStringLiteral(""));
@@ -45,7 +46,7 @@ private:
ViewerInstructors* m_viewerInstructors;
bool adminMode;
QString loginInstructorLoggedIn;
QString loginInstructorLoggedInLocal;
};
#endif // INSTRUCTORSANDTRAINEESWIDGET_H

View File

@@ -27,12 +27,15 @@ void TasksWidget::slot_LanguageChanged(QString language)
void TasksWidget::viewListTasksForTrainee(QString login)
{
QStringList listTasks;
/*
QList<QString> listTasks;
QStringList strListTasks;
listTasks = pDbTrainees->getTasks(login);
ui->listWidgetTasks->clear();
ui->listWidgetTasks->addItems(listTasks);
*/
}
void TasksWidget::changeEvent(QEvent *event)

View File

@@ -2,23 +2,10 @@
#include <QApplication>
#include <QMessageBox>
DataBaseTrainees::DataBaseTrainees(DataBaseLMS* dbLMS)
DataBaseTrainees::DataBaseTrainees(DataBaseLMS* dbLMS):
adminMode(false)
{
listOfColorGroup.append(QColor(170, 190, 170));
listOfColorGroup.append(QColor(180, 180, 220));
listOfColorGroup.append(QColor(240, 220, 230));
listOfColorGroup.append(QColor(85, 170, 127));
listOfColorGroup.append(QColor(170, 115, 120));
listOfColorGroup.append(QColor(110, 160, 170));
listOfColorGroup.append(QColor(110, 170, 130));
listOfColorGroup.append(QColor(170, 170, 120));
listOfColorGroup.append(QColor(160, 170, 45));
listOfColorGroup.append(QColor(170, 140, 60));
listOfColorGroup.append(QColor(200, 200, 200));
this->dbLMS = dbLMS;
LoadTraineesGroupsPSQL();
}
DataBaseTrainees::~DataBaseTrainees()
@@ -26,430 +13,181 @@ DataBaseTrainees::~DataBaseTrainees()
}
void DataBaseTrainees::LoadTraineesGroupsPSQL()
void DataBaseTrainees::transactionBegin()
{
listOfTrainees.clear();
listOfGroups.clear();
dbLMS->transactionBegin();
}
listOfTrainees = dbLMS->selectAllTrainees();
listOfGroups = dbLMS->selectAllGroups();
QApplication::beep();
void DataBaseTrainees::transactionEnd()
{
dbLMS->transactionEnd();
}
bool DataBaseTrainees::AuthorizationTrainee(QString login, QString password, QString classroom_name, QString computer_name)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
if(! dbLMS->transactionBegin())
return false;
if(int id = dbLMS->selectTraineeID(login, password))
{
if(listOfTrainees[i].getArchived())
continue;
if(listOfTrainees[i].getLogin() == login && listOfTrainees[i].getPassword() == password)
{
Trainee trainee = listOfTrainees[i];
trainee.setLoggedIn(true);
//trainee.setLearnClass(learnClass);
//trainee.setComputer(computer);
int id = dbLMS->updateTrainee(trainee);
if(id)
{
LoadTraineesGroupsPSQL();
return true;
}
else
return false;
}
if(dbLMS->updateTraineeLoggedIn(id, true))
return dbLMS->transactionEnd();
}
dbLMS->transactionEnd();
return false;
}
bool DataBaseTrainees::deAuthorizationTrainee(QString login)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
if(! dbLMS->transactionBegin())
return false;
if(int id = dbLMS->selectTraineeID(login))
{
if(listOfTrainees[i].getArchived())
continue;
if(listOfTrainees[i].getLogin() == login)
{
Trainee trainee = listOfTrainees[i];
trainee.setLoggedIn(false);
//trainee.setLearnClass(QStringLiteral(""));
//trainee.setComputer(QStringLiteral(""));
int id = dbLMS->updateTrainee(trainee);
if(id)
{
LoadTraineesGroupsPSQL();
return true;
}
else
return false;
}
if(dbLMS->updateTraineeLoggedIn(id, false))
return dbLMS->transactionEnd();
}
dbLMS->transactionEnd();
return false;
}
/*
void DataBaseTrainees::setTasks(QString login, QStringList tasks)
QList<Task> DataBaseTrainees::getTasks(int id)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getLogin() == login)
listOfTrainees[i].setTasks(tasks);
}
}*/
QStringList DataBaseTrainees::getTasks(QString login)
{
QStringList tasksStrList;
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getLogin() == login)
{
QList<Task> tasks = listOfTrainees[i].getTasks();
for(Task task: tasks)
{
tasksStrList.append(task.getName());
}
}
}
return tasksStrList;
return dbLMS->selectTasksOfTrainee(id);
}
QString DataBaseTrainees::getNameTraineeOnComputer(QString computer_name)
{
/*
for(Trainee trainee : listOfTrainees)
{
if(trainee.getComputer().getName() == computer_name)
return trainee.getName();
}
}*/
return QString(QStringLiteral(""));
}
Trainee DataBaseTrainees::getTraineeOnComputer(QString computer_name)
{
/*
for(Trainee trainee : listOfTrainees)
{
if(trainee.getComputer().getName() == computer_name)
return trainee;
}
}*/
return Trainee();
}
QString DataBaseTrainees::getNameTraineeByLogin(QString login)
{
/*
for(Trainee trainee : listOfTrainees)
{
if(trainee.getLogin() == login)
return trainee.getName();
}
}*/
return QString(QStringLiteral(""));
}
/*
QColor DataBaseTrainees::getColorGroupByLogin(QString login)
{
QString nameTrainee = getNameTraineeByLogin(login);
Trainee trainee = getTrainee(nameTrainee);
QString nameGroup = trainee.getGroup();
Group group = getGroup(nameGroup);
return getColorGroup(group.getColor());
}*/
QList<Trainee> DataBaseTrainees::getListTraineesInGroup(int id)
{
QList<Trainee> listTrainees;
/*
for(Trainee trainee : listOfTrainees)
{
if(trainee.getGroup().getID() == id)
listTrainees.append(trainee);
}
*/
return listTrainees;
}
QList<Group> DataBaseTrainees::getListGroups()
{
return listOfGroups;
return dbLMS->selectAllGroups();
}
/*
QColor DataBaseTrainees::getColorGroup(Group::ColorGroup numColor)
{
if(numColor > listOfColorGroup.count() - 1)
return listOfColorGroup.at(Group::ColorGroup::colorAther);
return listOfColorGroup.at(numColor);
}*/
QList<Trainee> DataBaseTrainees::getListTrainees()
{
return dbLMS->selectAllTrainees();
}
Trainee DataBaseTrainees::getTrainee(int id)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getID() == id)
return listOfTrainees[i];
}
return Trainee();
return dbLMS->selectTrainee(id);
}
Group DataBaseTrainees::getGroup(int id)
{
//Группы
for(int i = 0; i < listOfGroups.count(); i++)
{
if(listOfGroups[i].getID() == id)
return listOfGroups[i];
}
return Group();
return dbLMS->selectGroup(id);
}
int DataBaseTrainees::newGroup()
{
Group group;
group.setName(generateDefaultNameGroup());
int id = dbLMS->insertGroup(group);
if(id)
{
LoadTraineesGroupsPSQL();
return id;
}
else
return 0;
return dbLMS->insertGroup();
}
int DataBaseTrainees::deleteGroup(int id)
{
//Группы
for(int i = 0; i < listOfGroups.count(); i++)
{
if(listOfGroups[i].getID() == id)
{
int id_del = dbLMS->deleteGroup(id);
if(id_del)
{
LoadTraineesGroupsPSQL();
return id_del;
}
else
return 0;
}
}
return 0;
return dbLMS->deleteGroup(id);
}
int DataBaseTrainees::editGroup(Group group)
{
//Группы
for(int i = 0; i < listOfGroups.count(); i++)
//Проверка дублирования имени
QList<Group> listGroups = dbLMS->selectAllGroups();
for(Group exist_group : listGroups)
{
if(listOfGroups[i].getID() == group.getID())
{
if(!checkExistNameGroup(group.getName()) || group.getName() == listOfGroups[i].getName())
{
int id = dbLMS->updateGroup(group);
if(id)
{
LoadTraineesGroupsPSQL();
return id;
}
else
return 0;
}
else
{
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing group name has been entered.\nThe changes will not be accepted."));
return 0;
}
if(group.getName() == exist_group.getName() && group.getID() != exist_group.getID())
{//Имя уже существует
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing group name has been entered."));
return 0;
}
}
return 0;
return dbLMS->updateGroup(group);
}
int DataBaseTrainees::newTrainee(int id_group)
{
Trainee trainee;
Group group;
group.setID(id_group);
trainee.setGroup(group);
trainee.setName(generateDefaultNameTrainee());
trainee.setLogin(generateDefaultLoginTrainee());
trainee.setPassword(QStringLiteral("<password>"));
trainee.setArchived(false);
trainee.setLoggedIn(false);
int id = dbLMS->insertTrainee(trainee);
if(id)
{
LoadTraineesGroupsPSQL();
return id;
}
else
return 0;
return dbLMS->insertTrainee(id_group);
}
int DataBaseTrainees::deleteTrainee(int id)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getID() == id)
{
int id_del = dbLMS->deleteTrainee(id);
if(id_del)
{
LoadTraineesGroupsPSQL();
return id_del;
}
return 0;
}
}
return 0;
return dbLMS->deleteTrainee(id);
}
int DataBaseTrainees::editTrainee(Trainee trainee)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
//Проверка дублирования логина и имени
QList<Trainee> listTrainees = dbLMS->selectAllTrainees();
for(Trainee exist_trainee : listTrainees)
{
if(listOfTrainees[i].getID() == trainee.getID())
{
if( (!checkExistNameTrainee(trainee.getName()) || trainee.getName() == listOfTrainees[i].getName()) &&
(!checkExistLoginTrainee(trainee.getLogin()) || trainee.getLogin() == listOfTrainees[i].getLogin()) )
{
int id = dbLMS->updateTrainee(trainee);
if(trainee.getLogin() == exist_trainee.getLogin() && trainee.getID() != exist_trainee.getID())
{//Логин уже существует!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing trainee login has been entered.\nThe changes will not be accepted."));
return 0;
}
if(id)
{
LoadTraineesGroupsPSQL();
return id;
}
else
return 0;
}
else
{
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing trainee's name or login has been entered.\nThe changes will not be accepted."));
return 0;
}
if(trainee.getName() == exist_trainee.getName() && trainee.getID() != exist_trainee.getID())
{//Имя уже существует
QMessageBox::warning(nullptr, tr("Editing warning!"),
tr("An existing trainee name has been entered."));
//return 0;
}
}
return 0;
return dbLMS->updateTrainee(trainee);
}
bool DataBaseTrainees::isArchived(int id)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getID()== id)
return listOfTrainees[i].getArchived();
}
return false;
return dbLMS->selectTraineeArchived(id);
}
QString DataBaseTrainees::generateDefaultNameGroup()
{
int numGroup = 0;
QString name;
do
{
name = tr("Group") + QStringLiteral(" ") + QString::number(++numGroup);
}while(checkExistNameGroup(name));
return name;
}
QString DataBaseTrainees::generateDefaultNameTrainee()
{
int numTrainee = 0;
QString name;
do
{
name = QStringLiteral("<") + tr("Trainee") + QStringLiteral(" ") + QString::number(++numTrainee) + QStringLiteral(">");
}while(checkExistNameTrainee(name));
return name;
}
bool DataBaseTrainees::checkExistNameGroup(QString name)
{
//Группы
for(int i = 0; i < listOfGroups.count(); i++)
{
if(listOfGroups[i].getName() == name)
return true;
}
return false;
}
bool DataBaseTrainees::checkExistNameTrainee(QString name)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getName() == name)
return true;
}
return false;
}
QString DataBaseTrainees::generateDefaultLoginTrainee()
{
int numTrainee = 0;
QString login;
do
{
login = QStringLiteral("<O") + QString::number(++numTrainee) + QStringLiteral(">");
}while(checkExistLoginTrainee(login));
return login;
}
bool DataBaseTrainees::checkExistLoginTrainee(QString login)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getLogin() == login)
return true;
}
return false;
}
/*
Group::ColorGroup DataBaseTrainees::generateDefaultColorGroup()
{
for(int i = 0; i < Group::ColorGroup::countColor; i++)
{
Group::ColorGroup color = (Group::ColorGroup)i;
if(!checkExistColorGroup(color))
return color;
}
return Group::ColorGroup::colorAther;
}*/
/*
bool DataBaseTrainees::checkExistColorGroup(Group::ColorGroup color)
{
//Группы
for(int i = 0; i < listOfGroups.count(); i++)
{
if(listOfGroups[i].getColor() == color)
return true;
}
return false;
}*/

View File

@@ -19,25 +19,28 @@ public:
DataBaseTrainees(DataBaseLMS* dbLMS);
~DataBaseTrainees();
void LoadTraineesGroupsPSQL();
//void LoadTraineesGroupsPSQL();
void transactionBegin();
void transactionEnd();
bool AuthorizationTrainee(QString login, QString password, QString classroom_name, QString computer_name);
bool deAuthorizationTrainee(QString login);
//void setTasks(QString login, QStringList tasks);
QStringList getTasks(QString login);
QList<Task> getTasks(int id);
QString getNameTraineeOnComputer(QString computer_name);
Trainee getTraineeOnComputer(QString computer_name);
QString getNameTraineeByLogin(QString login);
//QColor getColorGroupByLogin(QString login);
QList<Trainee> getListTraineesInGroup(int id);
QList<Group> getListGroups();
QList<Trainee> getListTrainees();
Trainee getTrainee(int id);
Group getGroup(int id);
Trainee getTrainee(int trainee_id);
Group getGroup(int group_id);
int newGroup();
int deleteGroup(int id);
@@ -50,20 +53,7 @@ public:
bool isArchived(int id);
private:
QString generateDefaultNameGroup();
QString generateDefaultNameTrainee();
bool checkExistNameGroup(QString name);
bool checkExistNameTrainee(QString name);
QString generateDefaultLoginTrainee();
bool checkExistLoginTrainee(QString login);
private:
QList<Trainee> listOfTrainees;
QList<Group> listOfGroups;
QList<QColor> listOfColorGroup;
bool adminMode;
DataBaseLMS* dbLMS;
};

View File

@@ -13,6 +13,9 @@ EditorTrainees::EditorTrainees(DataBaseTrainees* db, bool adminMode, QWidget *pa
preparationTreeWidget(ui->treeWidget);
setNotLoggedInVisible(true);
loadTraineesFromDB();
if(adminMode)
ui->btnArchive->click();
}
EditorTrainees::~EditorTrainees()
@@ -22,9 +25,11 @@ EditorTrainees::~EditorTrainees()
void EditorTrainees::on_btnNewGroup_clicked()
{
int id = dbTrainees->newGroup();
loadTraineesFromDB();
setCurrentGroup(id);
if(int id = dbTrainees->newGroup())
{
loadTraineesFromDB();
setCurrentGroup(id);
}
}
void EditorTrainees::on_btnDeleteGroup_clicked()
@@ -36,7 +41,7 @@ void EditorTrainees::on_btnDeleteGroup_clicked()
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
if(treeItemParent == nullptr)
{//Выбрана группа
int id_group = treeItemCurrent->text(0).toInt();
int id_group = treeItemCurrent->text(ColumnsTreeTrainees::clmn_ID).toInt();
if(dbTrainees->getListTraineesInGroup(id_group).count() > 0)
{
@@ -67,7 +72,7 @@ void EditorTrainees::on_btnNewTrainee_clicked()
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
if(treeItemParent == nullptr)
{//Выбрана группа. Можно добавить Обучаемого
int id_group = treeItemCurrent->text(0).toInt();
int id_group = treeItemCurrent->text(ColumnsTreeTrainees::clmn_ID).toInt();
if(int id = dbTrainees->newTrainee(id_group))
{
loadTraineesFromDB();
@@ -91,8 +96,8 @@ void EditorTrainees::on_btnDeleteTrainee_clicked()
if(treeItemParent != nullptr)
{//Выбран обучаемый
int id_trainee = treeItemCurrent->text(0).toInt();
int id_group = treeItemParent->text(0).toInt();
int id_trainee = treeItemCurrent->text(ColumnsTreeTrainees::clmn_ID).toInt();
int id_group = treeItemParent->text(ColumnsTreeTrainees::clmn_ID).toInt();
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
{
@@ -120,9 +125,11 @@ void EditorTrainees::on_btnToOrFromArchiveTrainee_clicked()
if(treeItemParent != nullptr)
{//Выбран обучаемый
int id_trainee = treeItemCurrent->text(0).toInt();
int id_trainee = treeItemCurrent->text(ColumnsTreeTrainees::clmn_ID).toInt();
Trainee trainee = dbTrainees->getTrainee(id_trainee);
if(trainee.getID() == 0)
return;
if(trainee.getArchived())
{//Архивный
@@ -168,61 +175,89 @@ void EditorTrainees::on_btnEdit_clicked()
if(treeItemParent == nullptr)
{//Выбрана группа
int id_group = treeItemCurrent->text(0).toInt();
int id_group = treeItemCurrent->text(ColumnsTreeTrainees::clmn_ID).toInt();
DialogEditGroup dlg(this);
dlg.setGroup(dbTrainees->getGroup(id_group));
switch( dlg.exec() )
Group group = dbTrainees->getGroup(id_group);
if(group.getID() == 0)
return;
dlg.setGroup(group);
while (true)
{
case QDialog::Accepted:
{
if(int id = dbTrainees->editGroup(dlg.getGroup()))
{//Отредактировано
loadTraineesFromDB();
setCurrentGroup(id);
}
else
switch( dlg.exec() )
{
//Ошибка редактирования
}
case QDialog::Accepted:
{
Group group_edit = dlg.getGroup();
break;
}
case QDialog::Rejected:
break;
default:
break;
if(int id = dbTrainees->editGroup(group_edit))
{//Отредактировано
loadTraineesFromDB();
setCurrentGroup(id);
return;
}
else
{
dlg.setGroup(group_edit);
continue;
}
break;
}
case QDialog::Rejected:
return;
break;
default:
return;
break;
}
}
}
else
{//Выбран обучаемый
int id_trainee = treeItemCurrent->text(0).toInt();
int id_trainee = treeItemCurrent->text(ColumnsTreeTrainees::clmn_ID).toInt();
DialogEditTrainee dlg(this);
dlg.setTrainee(dbTrainees->getTrainee(id_trainee));
switch( dlg.exec() )
Trainee trainee = dbTrainees->getTrainee(id_trainee);
if(trainee.getID() == 0)
return;
dlg.setTrainee(trainee);
while (true)
{
case QDialog::Accepted:
switch( dlg.exec() )
{
if(int id = dbTrainees->editTrainee(dlg.getTrainee()))
{//Отредактировано
loadTraineesFromDB();
setCurrentTrainee(id);
}
else
case QDialog::Accepted:
{
//Ошибка редактирования
}
Trainee trainee_edit = dlg.getTrainee();
if(int id = dbTrainees->editTrainee(trainee_edit))
{//Отредактировано
loadTraineesFromDB();
setCurrentTrainee(id);
return;
}
else
{
dlg.setTrainee(trainee_edit);
continue;
}
break;
}
case QDialog::Rejected:
return;
break;
default:
return;
break;
}
case QDialog::Rejected:
break;
default:
break;
}
}
}
@@ -244,7 +279,7 @@ void EditorTrainees::on_treeWidget_currentItemChanged(QTreeWidgetItem *current,
QTreeWidgetItem *treeItemParent = current->parent();
if(treeItemParent == nullptr)
{//Выбрана группа
int id_group = current->text(0).toInt();
int id_group = current->text(ColumnsTreeTrainees::clmn_ID).toInt();
if(adminMode)
{
@@ -276,7 +311,7 @@ void EditorTrainees::on_treeWidget_currentItemChanged(QTreeWidgetItem *current,
}
else
{//Выбран обучаемый
int id_trainee = current->text(0).toInt();
int id_trainee = current->text(ColumnsTreeTrainees::clmn_ID).toInt();
ui->btnNewGroup->setEnabled(false);
ui->btnDeleteGroup->setEnabled(false);
@@ -310,7 +345,7 @@ void EditorTrainees::setCurrentGroup(int id)
{
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
if(item != nullptr)
if(item->text(0).toInt() == id)
if(item->text(ColumnsTreeTrainees::clmn_ID).toInt() == id)
{
treeWidget->setCurrentItem(item);
break;
@@ -329,7 +364,7 @@ void EditorTrainees::setCurrentTrainee(int id)
{
QTreeWidgetItem * itemChild = item->child(j);
if(itemChild != nullptr)
if(itemChild->text(0).toInt() == id)
if(itemChild->text(ColumnsTreeTrainees::clmn_ID).toInt() == id)
{
treeWidget->setCurrentItem(itemChild);
break;

View File

@@ -1,9 +1,9 @@
#include <QHeaderView>
#include "traineesview.h"
TraineesView::TraineesView(DataBaseTrainees* db, TypeView type, bool adminMode, QWidget *parent):
TraineesView::TraineesView(DataBaseTrainees* dbTrainees, TypeView type, bool adminMode, QWidget *parent):
CommonView(type, adminMode, parent),
dbTrainees(db)
dbTrainees(dbTrainees)
{
}
@@ -21,32 +21,52 @@ void TraineesView::preparationTreeWidget(QTreeWidget *tree)
treeWidget->header()->setStyleSheet(QStringLiteral("font-size: 10pt;"));
treeWidget->setColumnWidth(0, 80);
treeWidget->setColumnWidth(1, 250);
treeWidget->setColumnWidth(2, 100);
treeWidget->setColumnWidth(3, 100);
treeWidget->setColumnWidth(4, 130);
treeWidget->setColumnWidth(5, 130);
treeWidget->setColumnWidth(6, 130);
treeWidget->setColumnWidth(7, 80);
treeWidget->setColumnWidth(8, 80);
treeWidget->setColumnWidth(9, 100);
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_ID, 80);
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_Trainee, 250);
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_Login, 100);
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_Password, 100);
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_Class, 130);
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_Computer, 130);
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_IP_address, 130);
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_Archived, 80);
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_Logged, 80);
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_Tasks, 200);
if(typeView == TypeView::onlyView)
{//onlyView
treeWidget->setColumnHidden(2, true);
treeWidget->setColumnHidden(3, true);
treeWidget->setColumnHidden(7, true);
treeWidget->setColumnHidden(ColumnsTreeTrainees::clmn_ID, true);
//treeWidget->setColumnHidden(ColumnsTreeTrainees::clmn_Login, true);
treeWidget->setColumnHidden(ColumnsTreeTrainees::clmn_Password, true);
treeWidget->setColumnHidden(ColumnsTreeTrainees::clmn_Archived, true);
archiveVisible = false;
notLoggedInVisible = true;
}
else
{//control
treeWidget->setColumnHidden(7, true);
if(adminMode)
{
archiveVisible = true;
notLoggedInVisible = true;
}
else
{
treeWidget->setColumnHidden(ColumnsTreeTrainees::clmn_ID, true);
treeWidget->setColumnHidden(ColumnsTreeTrainees::clmn_Archived, true);
}
}
}
void TraineesView::loadTraineesFromDB()
{
dbTrainees->LoadTraineesGroupsPSQL();
QList <Group> listGroups;
QList <Trainee> listTrainees;
dbTrainees->transactionBegin();
listGroups = dbTrainees->getListGroups();
listTrainees = dbTrainees->getListTrainees();
dbTrainees->transactionEnd();
if(treeWidget == nullptr)
return;
@@ -54,52 +74,56 @@ void TraineesView::loadTraineesFromDB()
//Обновление дерева
treeWidget->clear();
for(Group group : dbTrainees->getListGroups())
for(Group group : listGroups)
{
//Группа
QTreeWidgetItem *ItemGroup = new QTreeWidgetItem(treeWidget);
ItemGroup->setText(0, QString::number(group.getID()));
ItemGroup->setText(1, group.getName());
ItemGroup->setIcon(1, QIcon(QStringLiteral(":/icons/group.png")));
ItemGroup->setText(ColumnsTreeTrainees::clmn_ID, QString::number(group.getID()));
ItemGroup->setText(ColumnsTreeTrainees::clmn_Trainee, group.getName());
ItemGroup->setIcon(ColumnsTreeTrainees::clmn_Trainee, QIcon(QStringLiteral(":/icons/group.png")));
setItemColor(ItemGroup, QColor(170, 190, 170));
//Обучаемые
QList<Trainee> listTrainees;
listTrainees = dbTrainees->getListTraineesInGroup(group.getID());
for(Trainee trainee : listTrainees)
{
if(trainee.getGroup().getID() != group.getID())
continue;
QTreeWidgetItem *ItemTrainee = new QTreeWidgetItem();
ItemTrainee->setText(0, QString::number(trainee.getID()));
ItemTrainee->setText(1, trainee.getName());
ItemTrainee->setText(2, trainee.getLogin());
ItemTrainee->setText(3, trainee.getPassword());
ItemTrainee->setText(4, trainee.getComputer().getClassroom().getName());
ItemTrainee->setText(5, trainee.getComputer().getName());
ItemTrainee->setText(6, trainee.getComputer().getIpAddress());
ItemTrainee->setText(ColumnsTreeTrainees::clmn_ID, QString::number(trainee.getID()));
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Trainee, trainee.getName());
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Login, trainee.getLogin());
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Password, trainee.getPassword());
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Class, trainee.getComputer().getClassroom().getName());
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Computer, trainee.getComputer().getName());
ItemTrainee->setText(ColumnsTreeTrainees::clmn_IP_address, trainee.getComputer().getIpAddress());
//Сокрытие пароля
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Password, QStringLiteral("******"));
if(trainee.getArchived())
{//Архивный
ItemTrainee->setText(7, tr("yes"));
ItemTrainee->setIcon(1, QIcon(QStringLiteral(":/icons/traineeArchive.png")));
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Archived, tr("yes"));
ItemTrainee->setIcon(ColumnsTreeTrainees::clmn_Trainee, QIcon(QStringLiteral(":/icons/traineeArchive.png")));
setItemColorArchive(ItemTrainee);
}
else
{//Не Архивный
ItemTrainee->setText(7, tr("no"));
ItemTrainee->setIcon(1, QIcon(QStringLiteral(":/icons/trainee.png")));
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Archived, tr("no"));
ItemTrainee->setIcon(ColumnsTreeTrainees::clmn_Trainee, QIcon(QStringLiteral(":/icons/trainee.png")));
setItemColorNoArchive(ItemTrainee);
}
if(trainee.getLoggedIn())
{//Залогинен
ItemTrainee->setText(8, tr("yes"));
ItemTrainee->setIcon(8, QIcon(QStringLiteral(":/icons/circleGreen.png")));
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Logged, tr("yes"));
ItemTrainee->setIcon(ColumnsTreeTrainees::clmn_Logged, QIcon(QStringLiteral(":/icons/circleGreen.png")));
}
else
{//Не Залогинен
ItemTrainee->setText(8, tr("no"));
ItemTrainee->setIcon(8, QIcon(QStringLiteral(":/icons/circleGray.png")));
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Logged, tr("no"));
ItemTrainee->setIcon(ColumnsTreeTrainees::clmn_Logged, QIcon(QStringLiteral(":/icons/circleGray.png")));
}
QString tasksStr;
@@ -107,7 +131,7 @@ void TraineesView::loadTraineesFromDB()
{
tasksStr += task.getName() + QStringLiteral("; ");
}
ItemTrainee->setText(9, tasksStr);
ItemTrainee->setText(ColumnsTreeTrainees::clmn_Tasks, tasksStr);
ItemGroup->addChild(ItemTrainee);
@@ -124,7 +148,7 @@ void TraineesView::loadTraineesFromDB()
}
treeWidget->setSortingEnabled(true);
treeWidget->sortItems(1, Qt::SortOrder::AscendingOrder);
treeWidget->sortItems(ColumnsTreeTrainees::clmn_Trainee, Qt::SortOrder::AscendingOrder);
treeWidget->expandAll();
if(typeView == TypeView::control)
@@ -137,6 +161,6 @@ void TraineesView::loadTraineesFromDB()
void TraineesView::reSetHeadTreeWidget()
{
QStringList listHeaders = {tr("ID"), tr("Trainee"), tr("Login"), tr("Password"), tr("Class"), tr("Computer"), tr("IP address"), tr("Archived"), tr("Logged"), tr("Tasks")};
QStringList listHeaders = {tr("Trainee"), tr("Login"), tr("Password"), tr("Class"), tr("Computer"), tr("IP address"), tr("Archived"), tr("Logged"), tr("Tasks"), tr("ID")};
treeWidget->setHeaderLabels(listHeaders);
}

View File

@@ -12,7 +12,21 @@ class TraineesView: public CommonView
Q_OBJECT
public:
TraineesView(DataBaseTrainees* db, TypeView type, bool adminMode, QWidget *parent = nullptr);
TraineesView(DataBaseTrainees* dbTrainees, TypeView type, bool adminMode, QWidget *parent = nullptr);
protected:
enum ColumnsTreeTrainees{
clmn_Trainee = 0,
clmn_Login,
clmn_Password,
clmn_Class,
clmn_Computer,
clmn_IP_address,
clmn_Archived,
clmn_Logged,
clmn_Tasks,
clmn_ID
};
protected:
void preparationTreeWidget(QTreeWidget* tree);

View File

@@ -34,7 +34,7 @@ void ViewerTrainees::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column
{
if(item->childCount() == 0)
{//Выбран обучаемый
QString login = item->text(2);
QString login = item->text(ColumnsTreeTrainees::clmn_Login);
Q_EMIT signal_traineeSelected(login);
}
}
@@ -47,7 +47,7 @@ void ViewerTrainees::slot_tabMessengerChanged(QString login)
for (int j = 0; j < countChild; j++)
{//Проход по обучаемым
QString loginChild = ui->treeWidget->topLevelItem(i)->child(j)->text(2);
QString loginChild = ui->treeWidget->topLevelItem(i)->child(j)->text(ColumnsTreeTrainees::clmn_Login);
if(loginChild == login)
{
ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(i)->child(j));
@@ -83,7 +83,7 @@ void ViewerTrainees::on_btnEditorTrainees_clicked()
QHBoxLayout *layout = new QHBoxLayout(dialog);
layout->addWidget(&editorTraineesGroups);
dialog->setWindowTitle(tr("Editor of trainees"));
dialog->setMinimumSize(1400, 800);
dialog->setMinimumSize(1600, 800);
dialog->exec();
loadTraineesFromDB();