coding utf-8 Form implementation generated from reading ui file menu u

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'd:\menu.ui'
#
# Created: Sat Oct 25 11:32:50 2008
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
import sys
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import Qt, QVariant
from PyQt4.QtGui import QFont, QStandardItemModel, QTableView
import psycopg2
#*************************************************************************************************************************************
class MainProgram(object):
def DrawInterfase(self, Workspace):
Workspace.setObjectName("Workspace")
Workspace.resize(1000,630)
Workspace.setWindowTitle ("Data Base")
Workspace.setMinimumSize(QtCore.QSize(1200,630))
self.stuff_departament = QtGui.QMainWindow(Workspace)
self.xa4a_window = QtGui.QMainWindow(Workspace)
self.xa4a_window.setWindowTitle ("xa4a window")
self.stuff_departament.setWindowTitle("Stuff departament")
self.stuff_departament.resize(989, 616)
self.stuff_departament.setSizePolicy (QtGui.QSizePolicy.Maximum,QtGui.QSizePolicy.Maximum)
self.stuff_departament.setMinimumSize(QtCore.QSize(1100, 615))
self.stuff_departament.setMaximumSize(QtCore.QSize(1100, 615))
Workspace.addWindow(self.stuff_departament)
Workspace.addWindow(self.xa4a_window)
self.stuff_departament.centralwidget = QtGui.QWidget(self.stuff_departament)
self.stuff_departament.tabwidget = QtGui.QTabWidget(self.stuff_departament.centralwidget)
self.stuff_departament.tabwidget.setGeometry(QtCore.QRect(0,0,1191,601))
self.stuff_departament.tabwidget.setMaximumSize(QtCore.QSize(1191,601))
self.stuff_departament.tabwidget.setMinimumSize(QtCore.QSize(1191,601))
self.stuff_departament.tabwidget.setSizePolicy (QtGui.QSizePolicy.Maximum,QtGui.QSizePolicy.Maximum)
self.stuff_departament.interview_tab = QtGui.QWidget()
self.stuff_departament.table_interview = QtGui.QTableView(self.stuff_departament.interview_tab)
self.stuff_departament.table_interview.setGeometry(QtCore.QRect(10,20,1082,485))
self.stuff_departament.add_interview_button = QtGui.QToolButton(self.stuff_departament.interview_tab)
self.stuff_departament.add_interview_button.setGeometry(QtCore.QRect(52,527,111,31))
self.stuff_departament.add_interview_button.setText("Add interview")
self.stuff_departament.edit_interview_button = QtGui.QToolButton(self.stuff_departament.interview_tab)
self.stuff_departament.edit_interview_button.setGeometry(QtCore.QRect(270,527,111,31))
self.stuff_departament.edit_interview_button.setText("Edit interview")
self.stuff_departament.delete_interview_button = QtGui.QToolButton(self.stuff_departament.interview_tab)
self.stuff_departament.delete_interview_button.setGeometry(QtCore.QRect(490,527,111,31))
self.stuff_departament.delete_interview_button.setText("Delete interview")
self.stuff_departament.accept_employer_button = QtGui.QToolButton(self.stuff_departament.interview_tab)
self.stuff_departament.accept_employer_button.setGeometry(QtCore.QRect(710,527,111,31))
self.stuff_departament.accept_employer_button.setText("Accept employer")
self.stuff_departament.reject_employer_button = QtGui.QToolButton(self.stuff_departament.interview_tab)
self.stuff_departament.reject_employer_button.setGeometry(QtCore.QRect(930,527,111,31))
self.stuff_departament.reject_employer_button.setText("Reject employer")
self.stuff_departament.search_interview_button = QtGui.QToolButton(self.stuff_departament.interview_tab)
self.stuff_departament.search_interview_button.setGeometry(QtCore.QRect(1011,0,81,20))
self.stuff_departament.search_interview_button.setText("Search")
self.stuff_departament.refresh_interview_button = QtGui.QToolButton(self.stuff_departament.interview_tab)
self.stuff_departament.refresh_interview_button.setGeometry(QtCore.QRect(911,0,81,20))
self.stuff_departament.refresh_interview_button.setText("Refresh")
self.stuff_departament.tabwidget.addTab(self.stuff_departament.interview_tab,"Interviews ")
self.stuff_departament.employer_tab = QtGui.QWidget()
self.stuff_departament.breaks_groupbox = QtGui.QGroupBox(self.stuff_departament.employer_tab)
self.stuff_departament.breaks_groupbox.setGeometry(QtCore.QRect(10, 350, 491, 221))
self.stuff_departament.breaks_groupbox.setTitle("Breaks in job")
self.stuff_departament.specialization_groupbox = QtGui.QGroupBox(self.stuff_departament.employer_tab)
self.stuff_departament.specialization_groupbox.setGeometry(QtCore.QRect(651, 350, 441, 221))
self.stuff_departament.specialization_groupbox.setTitle("Specializations")
self.stuff_departament.table_employer = QtGui.QTableView(self.stuff_departament.employer_tab)
self.stuff_departament.table_employer.setGeometry(QtCore.QRect(10,20,1082,321))
self.stuff_departament.table_break = QtGui.QTableView(self.stuff_departament.employer_tab)
self.stuff_departament.table_break.setGeometry(QtCore.QRect(20, 368, 421, 192))
self.stuff_departament.table_specialization = QtGui.QTableView(self.stuff_departament.employer_tab)
self.stuff_departament.table_specialization.setGeometry(QtCore.QRect(661, 368, 371, 192))
self.stuff_departament.edit_employer_button = QtGui.QToolButton(self.stuff_departament.employer_tab)
self.stuff_departament.edit_employer_button.setGeometry(QtCore.QRect(520, 360, 111, 31))
self.stuff_departament.edit_employer_button.setText("Edit employer")
self.stuff_departament.search_employer_button = QtGui.QToolButton(self.stuff_departament.employer_tab)
self.stuff_departament.search_employer_button.setGeometry(QtCore.QRect(1011, 0, 81, 20))
self.stuff_departament.search_employer_button.setText("Search")
self.stuff_departament.refresh_employer_button = QtGui.QToolButton(self.stuff_departament.employer_tab)
self.stuff_departament.refresh_employer_button.setGeometry(QtCore.QRect(911,0,81,20))
self.stuff_departament.refresh_employer_button.setText("Refresh")
self.stuff_departament.add_break_button = QtGui.QToolButton(self.stuff_departament.employer_tab)
self.stuff_departament.add_break_button.setGeometry(QtCore.QRect(450, 370, 41, 20))
self.stuff_departament.add_break_button.setText("Add")
self.stuff_departament.delete_break_button = QtGui.QToolButton(self.stuff_departament.employer_tab)
self.stuff_departament.delete_break_button.setGeometry(QtCore.QRect(450, 410, 41, 20))
self.stuff_departament.delete_break_button.setText("Delete")
self.stuff_departament.edit_break_button = QtGui.QToolButton(self.stuff_departament.employer_tab)
self.stuff_departament.edit_break_button.setGeometry(QtCore.QRect(450, 450, 41, 20))
self.stuff_departament.edit_break_button.setText("Edit")
self.stuff_departament.add_specialization_button = QtGui.QToolButton(self.stuff_departament.employer_tab)
self.stuff_departament.add_specialization_button.setGeometry(QtCore.QRect(1040, 370, 41, 20))
self.stuff_departament.add_specialization_button.setText("Add")
self.stuff_departament.delete_specialization_button = QtGui.QToolButton(self.stuff_departament.employer_tab)
self.stuff_departament.delete_specialization_button.setGeometry(QtCore.QRect(1040, 410, 41, 20))
self.stuff_departament.delete_specialization_button.setText("Delete")
self.stuff_departament.edit_specialization_button = QtGui.QToolButton(self.stuff_departament.employer_tab)
self.stuff_departament.edit_specialization_button.setGeometry(QtCore.QRect(1040, 450, 41, 20))
self.stuff_departament.edit_specialization_button.setText("Edit")
self.stuff_departament.tabwidget.addTab(self.stuff_departament.employer_tab,"Employees ")
self.stuff_departament.setCentralWidget(self.stuff_departament.centralwidget)
self.click_refresh_interview()
self.click_refresh_employer()
QtCore.QObject.connect(self.stuff_departament.add_interview_button, QtCore.SIGNAL("clicked()"),self.click_add_interview)
QtCore.QObject.connect(self.stuff_departament.edit_interview_button, QtCore.SIGNAL("clicked()"),self.click_edit_interview)
QtCore.QObject.connect(self.stuff_departament.delete_interview_button, QtCore.SIGNAL("clicked()"),self.click_delete_interview)
QtCore.QObject.connect(self.stuff_departament.accept_employer_button, QtCore.SIGNAL("clicked()"),self.click_accept_employer)
QtCore.QObject.connect(self.stuff_departament.reject_employer_button, QtCore.SIGNAL("clicked()"),self.click_reject_employer)
QtCore.QObject.connect(self.stuff_departament.search_interview_button, QtCore.SIGNAL("clicked()"),self.click_search_interview)
QtCore.QObject.connect(self.stuff_departament.refresh_interview_button, QtCore.SIGNAL("clicked()"),self.click_refresh_interview)
QtCore.QObject.connect(self.stuff_departament.edit_employer_button, QtCore.SIGNAL("clicked()"),self.click_edit_employer)
QtCore.QObject.connect(self.stuff_departament.search_employer_button, QtCore.SIGNAL("clicked()"),self.click_search_employer)
QtCore.QObject.connect(self.stuff_departament.refresh_employer_button, QtCore.SIGNAL("clicked()"),self.click_refresh_employer)
QtCore.QObject.connect(self.stuff_departament.add_break_button, QtCore.SIGNAL("clicked()"),self.click_add_break)
QtCore.QObject.connect(self.stuff_departament.delete_break_button, QtCore.SIGNAL("clicked()"),self.click_delete_break)
QtCore.QObject.connect(self.stuff_departament.edit_break_button, QtCore.SIGNAL("clicked()"),self.click_edit_break)
QtCore.QObject.connect(self.stuff_departament.add_specialization_button, QtCore.SIGNAL("clicked()"),self.click_add_spec)
QtCore.QObject.connect(self.stuff_departament.delete_specialization_button, QtCore.SIGNAL("clicked()"),self.click_delete_spec)
QtCore.QObject.connect(self.stuff_departament.edit_specialization_button, QtCore.SIGNAL("clicked()"),self.click_edit_spec)
QtCore.QMetaObject.connectSlotsByName(Workspace)
#*************************************************************************************************************************************
def click_add_interview (self):
print "'Add interview' button been pressed"
self.stuff_departament.add_interview_dialog = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.add_interview_dialog.setWindowTitle("Add interview")
self.stuff_departament.add_interview_dialog.resize(211, 510)
self.stuff_departament.add_interview_dialog.setMinimumSize(QtCore.QSize(211, 510))
self.stuff_departament.add_interview_dialog.setMaximumSize(QtCore.QSize(211, 510))
self.stuff_departament.add_interview_dialog.ok_button=QtGui.QPushButton(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.ok_button.setGeometry(QtCore.QRect(20, 480, 75, 23))
self.stuff_departament.add_interview_dialog.ok_button.setText("Ok")
self.stuff_departament.add_interview_dialog.cancel_button = QtGui.QPushButton(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.cancel_button.setGeometry(QtCore.QRect(120, 480, 75, 23))
self.stuff_departament.add_interview_dialog.cancel_button.setText("Cancel")
self.stuff_departament.add_interview_dialog.surname_lineedit = QtGui.QLineEdit(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.surname_lineedit.setGeometry(QtCore.QRect(70, 10, 131, 20))
self.stuff_departament.add_interview_dialog.name_lineedit = QtGui.QLineEdit(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.name_lineedit.setGeometry(QtCore.QRect(70, 40, 131, 20))
self.stuff_departament.add_interview_dialog.patronym_lineedit = QtGui.QLineEdit(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.patronym_lineedit.setGeometry(QtCore.QRect(70, 70, 131, 20))
self.stuff_departament.add_interview_dialog.dateedit = QtGui.QDateTimeEdit(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.dateedit.setGeometry(QtCore.QRect(70, 110, 130, 22))
self.stuff_departament.add_interview_dialog.address_groupbox = QtGui.QGroupBox (self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.address_groupbox.setGeometry(QtCore.QRect(5,160,200,240))
self.stuff_departament.add_interview_dialog.country_text = QtGui.QLineEdit (self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.country_text.setGeometry (QtCore.QRect(70,170,121,20))
self.stuff_departament.add_interview_dialog.city_text = QtGui.QLineEdit (self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.city_text.setGeometry (QtCore.QRect(70,210,121,20))
self.stuff_departament.add_interview_dialog.address1_text = QtGui.QLineEdit (self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.address1_text.setGeometry (QtCore.QRect(70,250,121,20))
self.stuff_departament.add_interview_dialog.address2_text = QtGui.QLineEdit (self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.address2_text.setGeometry (QtCore.QRect(70,290,121,20))
self.stuff_departament.add_interview_dialog.zip_text = QtGui.QLineEdit (self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.zip_text.setGeometry (QtCore.QRect(70,330,121,20))
self.stuff_departament.add_interview_dialog.phone_text = QtGui.QLineEdit (self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.phone_text.setGeometry (QtCore.QRect(70,370,121,20))
self.stuff_departament.add_interview_dialog.comment = QtGui.QPlainTextEdit (self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.comment.setGeometry (QtCore.QRect(10,420,190,50))
self.stuff_departament.add_interview_dialog.surname_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.surname_label.setGeometry(QtCore.QRect(10, 10, 46, 20))
self.stuff_departament.add_interview_dialog.surname_label.setText("Surname")
self.stuff_departament.add_interview_dialog.name_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.name_label.setGeometry(QtCore.QRect(10, 39, 46, 21))
self.stuff_departament.add_interview_dialog.name_label.setText("Name")
self.stuff_departament.add_interview_dialog.patronym_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.patronym_label.setGeometry(QtCore.QRect(10, 73, 46, 16))
self.stuff_departament.add_interview_dialog.patronym_label.setText("Patronymic")
self.stuff_departament.add_interview_dialog.date_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.date_label.setGeometry(QtCore.QRect(10, 110, 46, 21))
self.stuff_departament.add_interview_dialog.date_label.setText("Date")
self.stuff_departament.add_interview_dialog.country_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.country_label.setGeometry(QtCore.QRect(10,170,46,21))
self.stuff_departament.add_interview_dialog.country_label.setText("Country")
self.stuff_departament.add_interview_dialog.city_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.city_label.setGeometry(QtCore.QRect(10,210,46,21))
self.stuff_departament.add_interview_dialog.city_label.setText("City")
self.stuff_departament.add_interview_dialog.address1_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.address1_label.setGeometry(QtCore.QRect(10,250,46,21))
self.stuff_departament.add_interview_dialog.address1_label.setText("Address1")
self.stuff_departament.add_interview_dialog.address2_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.address2_label.setGeometry(QtCore.QRect(10,290,46,21))
self.stuff_departament.add_interview_dialog.address2_label.setText("Address2")
self.stuff_departament.add_interview_dialog.zip_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.zip_label.setGeometry(QtCore.QRect(10,330,46,21))
self.stuff_departament.add_interview_dialog.zip_label.setText("Zip")
self.stuff_departament.add_interview_dialog.phone_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.phone_label.setGeometry(QtCore.QRect(10,370,46,21))
self.stuff_departament.add_interview_dialog.phone_label.setText("Phone")
self.stuff_departament.add_interview_dialog.contact_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.contact_label.setGeometry(QtCore.QRect(10,140,46,21))
self.stuff_departament.add_interview_dialog.contact_label.setText("Contacts")
self.stuff_departament.add_interview_dialog.comment_label = QtGui.QLabel(self.stuff_departament.add_interview_dialog)
self.stuff_departament.add_interview_dialog.comment_label.setGeometry(QtCore.QRect(10,400,46,21))
self.stuff_departament.add_interview_dialog.comment_label.setText("Comment")
QtCore.QObject.connect(self.stuff_departament.add_interview_dialog.ok_button, QtCore.SIGNAL("clicked()"),self.add_interview_ok_pressed)
QtCore.QObject.connect(self.stuff_departament.add_interview_dialog.cancel_button, QtCore.SIGNAL("clicked()"),self.add_interview_cancel_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
self.stuff_departament.add_interview_dialog.show()
#*************************************************************************************************************************************
def click_edit_interview (self):
print "'Edit interview' button been pressed"
self.stuff_departament.edit_interview_dialog = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.edit_interview_dialog.setWindowTitle("Edit interview")
self.stuff_departament.edit_interview_dialog.resize(211, 510)
self.stuff_departament.edit_interview_dialog.setMinimumSize(QtCore.QSize(211, 510))
self.stuff_departament.edit_interview_dialog.setMaximumSize(QtCore.QSize(211, 510))
self.stuff_departament.edit_interview_dialog.ok_button=QtGui.QPushButton(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.ok_button.setGeometry(QtCore.QRect(20, 480, 75, 23))
self.stuff_departament.edit_interview_dialog.ok_button.setText("Ok")
self.stuff_departament.edit_interview_dialog.cancel_button = QtGui.QPushButton(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.cancel_button.setGeometry(QtCore.QRect(120, 480, 75, 23))
self.stuff_departament.edit_interview_dialog.cancel_button.setText("Cancel")
self.stuff_departament.edit_interview_dialog.surname_lineedit = QtGui.QLineEdit(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.surname_lineedit.setGeometry(QtCore.QRect(70, 10, 131, 20))
self.stuff_departament.edit_interview_dialog.name_lineedit = QtGui.QLineEdit(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.name_lineedit.setGeometry(QtCore.QRect(70, 40, 131, 20))
self.stuff_departament.edit_interview_dialog.patronym_lineedit = QtGui.QLineEdit(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.patronym_lineedit.setGeometry(QtCore.QRect(70, 70, 131, 20))
self.stuff_departament.edit_interview_dialog.dateedit = QtGui.QDateTimeEdit(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.dateedit.setGeometry(QtCore.QRect(70, 110, 130, 22))
self.stuff_departament.edit_interview_dialog.address_groupbox = QtGui.QGroupBox (self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.address_groupbox.setGeometry(QtCore.QRect(5,160,200,240))
self.stuff_departament.edit_interview_dialog.country_text = QtGui.QLineEdit (self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.country_text.setGeometry (QtCore.QRect(70,170,121,20))
self.stuff_departament.edit_interview_dialog.city_text = QtGui.QLineEdit (self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.city_text.setGeometry (QtCore.QRect(70,210,121,20))
self.stuff_departament.edit_interview_dialog.address1_text = QtGui.QLineEdit (self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.address1_text.setGeometry (QtCore.QRect(70,250,121,20))
self.stuff_departament.edit_interview_dialog.address2_text = QtGui.QLineEdit (self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.address2_text.setGeometry (QtCore.QRect(70,290,121,20))
self.stuff_departament.edit_interview_dialog.zip_text = QtGui.QLineEdit (self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.zip_text.setGeometry (QtCore.QRect(70,330,121,20))
self.stuff_departament.edit_interview_dialog.phone_text = QtGui.QLineEdit (self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.phone_text.setGeometry (QtCore.QRect(70,370,121,20))
self.stuff_departament.edit_interview_dialog.comment = QtGui.QPlainTextEdit (self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.comment.setGeometry (QtCore.QRect(10,420,190,50))
self.stuff_departament.edit_interview_dialog.surname_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.surname_label.setGeometry(QtCore.QRect(10, 10, 46, 20))
self.stuff_departament.edit_interview_dialog.surname_label.setText("Surname")
self.stuff_departament.edit_interview_dialog.name_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.name_label.setGeometry(QtCore.QRect(10, 39, 46, 21))
self.stuff_departament.edit_interview_dialog.name_label.setText("Name")
self.stuff_departament.edit_interview_dialog.patronym_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.patronym_label.setGeometry(QtCore.QRect(10, 73, 46, 16))
self.stuff_departament.edit_interview_dialog.patronym_label.setText("Patronymic")
self.stuff_departament.edit_interview_dialog.date_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.date_label.setGeometry(QtCore.QRect(10, 110, 46, 21))
self.stuff_departament.edit_interview_dialog.date_label.setText("Date")
self.stuff_departament.edit_interview_dialog.country_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.country_label.setGeometry(QtCore.QRect(10,170,46,21))
self.stuff_departament.edit_interview_dialog.country_label.setText("Country")
self.stuff_departament.edit_interview_dialog.city_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.city_label.setGeometry(QtCore.QRect(10,210,46,21))
self.stuff_departament.edit_interview_dialog.city_label.setText("City")
self.stuff_departament.edit_interview_dialog.address1_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.address1_label.setGeometry(QtCore.QRect(10,250,46,21))
self.stuff_departament.edit_interview_dialog.address1_label.setText("Address1")
self.stuff_departament.edit_interview_dialog.address2_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.address2_label.setGeometry(QtCore.QRect(10,290,46,21))
self.stuff_departament.edit_interview_dialog.address2_label.setText("Address2")
self.stuff_departament.edit_interview_dialog.zip_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.zip_label.setGeometry(QtCore.QRect(10,330,46,21))
self.stuff_departament.edit_interview_dialog.zip_label.setText("Zip")
self.stuff_departament.edit_interview_dialog.phone_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.phone_label.setGeometry(QtCore.QRect(10,370,46,21))
self.stuff_departament.edit_interview_dialog.phone_label.setText("Phone")
self.stuff_departament.edit_interview_dialog.contact_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.contact_label.setGeometry(QtCore.QRect(10,140,46,21))
self.stuff_departament.edit_interview_dialog.contact_label.setText("Contacts")
self.stuff_departament.edit_interview_dialog.comment_label = QtGui.QLabel(self.stuff_departament.edit_interview_dialog)
self.stuff_departament.edit_interview_dialog.comment_label.setGeometry(QtCore.QRect(10,400,46,21))
self.stuff_departament.edit_interview_dialog.comment_label.setText("Comment")
QtCore.QObject.connect(self.stuff_departament.edit_interview_dialog.ok_button, QtCore.SIGNAL("clicked()"),self.edit_interview_ok_pressed)
QtCore.QObject.connect(self.stuff_departament.edit_interview_dialog.cancel_button, QtCore.SIGNAL("clicked()"),self.edit_interview_cancel_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
self.stuff_departament.edit_interview_dialog.show()
#*************************************************************************************************************************************
def click_delete_interview (self):
print "'Delete interview' button been pressed"
self.stuff_departament.delete_interview_sure = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.delete_interview_sure.setWindowTitle("Delete interview")
self.stuff_departament.delete_interview_sure.resize(213, 78)
self.stuff_departament.delete_interview_sure.setMinimumSize(QtCore.QSize(213, 78))
self.stuff_departament.delete_interview_sure.setMaximumSize(QtCore.QSize(213, 78))
self.stuff_departament.delete_interview_sure.yes_button = QtGui.QPushButton(self.stuff_departament.delete_interview_sure)
self.stuff_departament.delete_interview_sure.yes_button.setGeometry(QtCore.QRect(20, 40, 75, 23))
self.stuff_departament.delete_interview_sure.yes_button.setText("Yes")
self.stuff_departament.delete_interview_sure.no_button = QtGui.QPushButton(self.stuff_departament.delete_interview_sure)
self.stuff_departament.delete_interview_sure.no_button.setGeometry(QtCore.QRect(120, 40, 75, 23))
self.stuff_departament.delete_interview_sure.no_button.setText("No")
self.stuff_departament.delete_interview_sure.are_you_sure_label = QtGui.QLabel(self.stuff_departament.delete_interview_sure)
self.stuff_departament.delete_interview_sure.are_you_sure_label.setGeometry(QtCore.QRect(70, 10, 81, 16))
self.stuff_departament.delete_interview_sure.are_you_sure_label.setText("Are you sure???")
self.stuff_departament.delete_interview_sure.show()
QtCore.QObject.connect(self.stuff_departament.delete_interview_sure.yes_button, QtCore.SIGNAL("clicked()"),self.delete_interview_sure_yes_pressed)
QtCore.QObject.connect(self.stuff_departament.delete_interview_sure.no_button, QtCore.SIGNAL("clicked()"),self.delete_interview_sure_no_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
#*************************************************************************************************************************************
def click_accept_employer (self):
print "'Accept employer' button been pressed"
self.stuff_departament.accept_employer_sure = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.accept_employer_sure.setWindowTitle("Accept employer")
self.stuff_departament.accept_employer_sure.resize(213, 78)
self.stuff_departament.accept_employer_sure.setMinimumSize(QtCore.QSize(213, 78))
self.stuff_departament.accept_employer_sure.setMaximumSize(QtCore.QSize(213, 78))
self.stuff_departament.accept_employer_sure.yes_button = QtGui.QPushButton(self.stuff_departament.accept_employer_sure)
self.stuff_departament.accept_employer_sure.yes_button.setGeometry(QtCore.QRect(20, 40, 75, 23))
self.stuff_departament.accept_employer_sure.yes_button.setText("Yes")
self.stuff_departament.accept_employer_sure.no_button = QtGui.QPushButton(self.stuff_departament.accept_employer_sure)
self.stuff_departament.accept_employer_sure.no_button.setGeometry(QtCore.QRect(120, 40, 75, 23))
self.stuff_departament.accept_employer_sure.no_button.setText("No")
self.stuff_departament.accept_employer_sure.are_you_sure_label = QtGui.QLabel(self.stuff_departament.accept_employer_sure)
self.stuff_departament.accept_employer_sure.are_you_sure_label.setGeometry(QtCore.QRect(70, 10, 81, 16))
self.stuff_departament.accept_employer_sure.are_you_sure_label.setText("Are you sure???")
self.stuff_departament.accept_employer_sure.id = QtGui.QLineEdit (self.stuff_departament.accept_employer_sure)
self.stuff_departament.accept_employer_sure.id.setGeometry (QtCore.QRect(70,10,50,20))
self.stuff_departament.accept_employer_sure.show()
QtCore.QObject.connect(self.stuff_departament.accept_employer_sure.yes_button, QtCore.SIGNAL("clicked()"),self.accept_employer_sure_yes_pressed)
QtCore.QObject.connect(self.stuff_departament.accept_employer_sure.no_button, QtCore.SIGNAL("clicked()"),self.accept_employer_sure_no_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
#*************************************************************************************************************************************
def click_reject_employer (self):
print "'Reject employer' button been pressed"
self.stuff_departament.reject_employer_sure = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.reject_employer_sure.setWindowTitle("Reject employer")
self.stuff_departament.reject_employer_sure.resize(213, 78)
self.stuff_departament.reject_employer_sure.setMinimumSize(QtCore.QSize(213, 78))
self.stuff_departament.reject_employer_sure.setMaximumSize(QtCore.QSize(213, 78))
self.stuff_departament.reject_employer_sure.yes_button = QtGui.QPushButton(self.stuff_departament.reject_employer_sure)
self.stuff_departament.reject_employer_sure.yes_button.setGeometry(QtCore.QRect(20, 40, 75, 23))
self.stuff_departament.reject_employer_sure.yes_button.setText("Yes")
self.stuff_departament.reject_employer_sure.no_button = QtGui.QPushButton(self.stuff_departament.reject_employer_sure)
self.stuff_departament.reject_employer_sure.no_button.setGeometry(QtCore.QRect(120, 40, 75, 23))
self.stuff_departament.reject_employer_sure.no_button.setText("No")
self.stuff_departament.reject_employer_sure.are_you_sure_label = QtGui.QLabel(self.stuff_departament.reject_employer_sure)
self.stuff_departament.reject_employer_sure.are_you_sure_label.setGeometry(QtCore.QRect(70, 10, 81, 16))
self.stuff_departament.reject_employer_sure.are_you_sure_label.setText("Are you sure???")
self.stuff_departament.reject_employer_sure.show()
QtCore.QObject.connect(self.stuff_departament.reject_employer_sure.yes_button, QtCore.SIGNAL("clicked()"),self.reject_employer_sure_yes_pressed)
QtCore.QObject.connect(self.stuff_departament.reject_employer_sure.no_button, QtCore.SIGNAL("clicked()"),self.reject_employer_sure_no_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
#*************************************************************************************************************************************
def click_search_interview (self):
print "'Search interview' button been pressed"
#*************************************************************************************************************************************
def click_refresh_interview (self):
print "'Refresh interview' button been pressed"
cursor.execute("SELECT surname,name,patronym,date,time,comment,worker_id,address_id,id,status FROM interview ORDER BY id")
interview_data = cursor.fetchall()
self.stuff_departament.model_interview = QStandardItemModel(len(interview_data), 8)
self.stuff_departament.model_interview.setHeaderData(0, Qt.Horizontal, QVariant("Id"))
self.stuff_departament.model_interview.setHeaderData(1, Qt.Horizontal, QVariant("Name"))
self.stuff_departament.model_interview.setHeaderData(2, Qt.Horizontal, QVariant("Address"))
self.stuff_departament.model_interview.setHeaderData(3, Qt.Horizontal, QVariant("Phone"))
self.stuff_departament.model_interview.setHeaderData(4, Qt.Horizontal, QVariant("Date"))
self.stuff_departament.model_interview.setHeaderData(5, Qt.Horizontal, QVariant("Time"))
self.stuff_departament.model_interview.setHeaderData(6, Qt.Horizontal, QVariant("Accept/Reject"))
self.stuff_departament.model_interview.setHeaderData(7, Qt.Horizontal, QVariant("Comment"))
self.stuff_departament.table_interview.setModel(self.stuff_departament.model_interview)
self.stuff_departament.table_interview.setColumnWidth(0,30)
self.stuff_departament.table_interview.setColumnWidth(1,150)
self.stuff_departament.table_interview.setColumnWidth(2,260)
self.stuff_departament.table_interview.setColumnWidth(3,70)
self.stuff_departament.table_interview.setColumnWidth(4,70)
self.stuff_departament.table_interview.setColumnWidth(5,70)
self.stuff_departament.table_interview.setColumnWidth(6,90)
self.stuff_departament.table_interview.setColumnWidth(7,300)
for i in range (len(interview_data)):
temp = interview_data[i]
name = temp[0] +" "+ temp[1] +" "+ temp[2]
self.stuff_departament.model_interview.setData(self.stuff_departament.model_interview.index(i, 0), QVariant(temp[8]))
self.stuff_departament.model_interview.setData(self.stuff_departament.model_interview.index(i, 1), QVariant(name))
self.stuff_departament.model_interview.setData(self.stuff_departament.model_interview.index(i, 4), QVariant(temp[3]))
self.stuff_departament.model_interview.setData(self.stuff_departament.model_interview.index(i, 5), QVariant(temp[4]))
status ="N/A"
if temp[9]==1:
status = "Accept"
if temp[9]==2:
status = "Reject"
self.stuff_departament.model_interview.setData(self.stuff_departament.model_interview.index(i, 6), QVariant(status))
self.stuff_departament.model_interview.setData(self.stuff_departament.model_interview.index(i, 7), QVariant(temp[5]))
cursor.execute("SELECT country, city, address1, address2, zip, phone FROM address WHERE address.address_id=%d"%(temp[7]))
temp = cursor.fetchone()
self.stuff_departament.model_interview.setData(self.stuff_departament.model_interview.index(i, 3), QVariant(temp[5]))
address = temp[0]+", "+temp[1]+", "+temp[2]+", "+str(temp[4])
if temp[3]!=None:
address = temp[0]+", "+temp[1]+", "+temp[2]+ ", "+temp[3]+", "+str(temp[4])
self.stuff_departament.model_interview.setData(self.stuff_departament.model_interview.index(i, 2), QVariant(address))
#*************************************************************************************************************************************
def click_edit_employer (self):
print "'Edit employer' button been pressed"
self.stuff_departament.edit_employer_dialog = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.edit_employer_dialog.setWindowTitle("Edit employer")
self.stuff_departament.edit_employer_dialog.resize(211, 510)
self.stuff_departament.edit_employer_dialog.setMinimumSize(QtCore.QSize(211, 510))
self.stuff_departament.edit_employer_dialog.setMaximumSize(QtCore.QSize(211, 510))
self.stuff_departament.edit_employer_dialog.ok_button=QtGui.QPushButton(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.ok_button.setGeometry(QtCore.QRect(20, 480, 75, 23))
self.stuff_departament.edit_employer_dialog.ok_button.setText("Ok")
self.stuff_departament.edit_employer_dialog.cancel_button = QtGui.QPushButton(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.cancel_button.setGeometry(QtCore.QRect(120, 480, 75, 23))
self.stuff_departament.edit_employer_dialog.cancel_button.setText("Cancel")
self.stuff_departament.edit_employer_dialog.surname_lineedit = QtGui.QLineEdit(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.surname_lineedit.setGeometry(QtCore.QRect(70, 10, 131, 20))
self.stuff_departament.edit_employer_dialog.name_lineedit = QtGui.QLineEdit(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.name_lineedit.setGeometry(QtCore.QRect(70, 40, 131, 20))
self.stuff_departament.edit_employer_dialog.patronym_lineedit = QtGui.QLineEdit(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.patronym_lineedit.setGeometry(QtCore.QRect(70, 70, 131, 20))
self.stuff_departament.edit_employer_dialog.dateedit = QtGui.QDateTimeEdit(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.dateedit.setGeometry(QtCore.QRect(70, 110, 130, 22))
self.stuff_departament.edit_employer_dialog.address_groupbox = QtGui.QGroupBox (self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.address_groupbox.setGeometry(QtCore.QRect(5,160,200,240))
self.stuff_departament.edit_employer_dialog.country_text = QtGui.QLineEdit (self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.country_text.setGeometry (QtCore.QRect(70,170,121,20))
self.stuff_departament.edit_employer_dialog.city_text = QtGui.QLineEdit (self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.city_text.setGeometry (QtCore.QRect(70,210,121,20))
self.stuff_departament.edit_employer_dialog.address1_text = QtGui.QLineEdit (self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.address1_text.setGeometry (QtCore.QRect(70,250,121,20))
self.stuff_departament.edit_employer_dialog.address2_text = QtGui.QLineEdit (self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.address2_text.setGeometry (QtCore.QRect(70,290,121,20))
self.stuff_departament.edit_employer_dialog.zip_text = QtGui.QLineEdit (self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.zip_text.setGeometry (QtCore.QRect(70,330,121,20))
self.stuff_departament.edit_employer_dialog.phone_text = QtGui.QLineEdit (self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.phone_text.setGeometry (QtCore.QRect(70,370,121,20))
self.stuff_departament.edit_employer_dialog.comment = QtGui.QPlainTextEdit (self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.comment.setGeometry (QtCore.QRect(10,420,190,50))
self.stuff_departament.edit_employer_dialog.surname_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.surname_label.setGeometry(QtCore.QRect(10, 10, 46, 20))
self.stuff_departament.edit_employer_dialog.surname_label.setText("Surname")
self.stuff_departament.edit_employer_dialog.name_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.name_label.setGeometry(QtCore.QRect(10, 39, 46, 21))
self.stuff_departament.edit_employer_dialog.name_label.setText("Name")
self.stuff_departament.edit_employer_dialog.patronym_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.patronym_label.setGeometry(QtCore.QRect(10, 73, 46, 16))
self.stuff_departament.edit_employer_dialog.patronym_label.setText("Patronymic")
self.stuff_departament.edit_employer_dialog.date_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.date_label.setGeometry(QtCore.QRect(10, 110, 46, 21))
self.stuff_departament.edit_employer_dialog.date_label.setText("Date")
self.stuff_departament.edit_employer_dialog.country_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.country_label.setGeometry(QtCore.QRect(10,170,46,21))
self.stuff_departament.edit_employer_dialog.country_label.setText("Country")
self.stuff_departament.edit_employer_dialog.city_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.city_label.setGeometry(QtCore.QRect(10,210,46,21))
self.stuff_departament.edit_employer_dialog.city_label.setText("City")
self.stuff_departament.edit_employer_dialog.address1_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.address1_label.setGeometry(QtCore.QRect(10,250,46,21))
self.stuff_departament.edit_employer_dialog.address1_label.setText("Address1")
self.stuff_departament.edit_employer_dialog.address2_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.address2_label.setGeometry(QtCore.QRect(10,290,46,21))
self.stuff_departament.edit_employer_dialog.address2_label.setText("Address2")
self.stuff_departament.edit_employer_dialog.zip_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.zip_label.setGeometry(QtCore.QRect(10,330,46,21))
self.stuff_departament.edit_employer_dialog.zip_label.setText("Zip")
self.stuff_departament.edit_employer_dialog.phone_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.phone_label.setGeometry(QtCore.QRect(10,370,46,21))
self.stuff_departament.edit_employer_dialog.phone_label.setText("Phone")
self.stuff_departament.edit_employer_dialog.contact_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.contact_label.setGeometry(QtCore.QRect(10,140,46,21))
self.stuff_departament.edit_employer_dialog.contact_label.setText("Contacts")
self.stuff_departament.edit_employer_dialog.comment_label = QtGui.QLabel(self.stuff_departament.edit_employer_dialog)
self.stuff_departament.edit_employer_dialog.comment_label.setGeometry(QtCore.QRect(10,400,46,21))
self.stuff_departament.edit_employer_dialog.comment_label.setText("Comment")
QtCore.QObject.connect(self.stuff_departament.edit_employer_dialog.ok_button, QtCore.SIGNAL("clicked()"),self.edit_employer_ok_pressed)
QtCore.QObject.connect(self.stuff_departament.edit_employer_dialog.cancel_button, QtCore.SIGNAL("clicked()"),self.edit_employer_cancel_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
self.stuff_departament.edit_employer_dialog.show()
#*************************************************************************************************************************************
def click_search_employer (self):
print "'Search employer' button been pressed"
#*************************************************************************************************************************************
def click_refresh_employer (self):
print "'Refresh employer' button been pressed"
cursor.execute("SELECT surname,name,patronym,hired,comment,address_id,fired, worker_id FROM worker ORDER BY worker_id")
employer_data = cursor.fetchall()
self.stuff_departament.model_employer = QStandardItemModel(len(employer_data), 8)
self.stuff_departament.model_employer.setHeaderData(0, Qt.Horizontal, QVariant("Id"))
self.stuff_departament.model_employer.setHeaderData(1, Qt.Horizontal, QVariant("Name"))
self.stuff_departament.model_employer.setHeaderData(2, Qt.Horizontal, QVariant("Address"))
self.stuff_departament.model_employer.setHeaderData(3, Qt.Horizontal, QVariant("Phone"))
self.stuff_departament.model_employer.setHeaderData(4, Qt.Horizontal, QVariant("Date"))
self.stuff_departament.model_employer.setHeaderData(5, Qt.Horizontal, QVariant("Date fired"))
self.stuff_departament.model_employer.setHeaderData(6, Qt.Horizontal, QVariant("Status"))
self.stuff_departament.model_employer.setHeaderData(7, Qt.Horizontal, QVariant("Comment"))
self.stuff_departament.table_employer.setModel(self.stuff_departament.model_employer)
self.stuff_departament.table_employer.setColumnWidth(0,30)
self.stuff_departament.table_employer.setColumnWidth(1,170)
self.stuff_departament.table_employer.setColumnWidth(2,270)
self.stuff_departament.table_employer.setColumnWidth(3,70)
self.stuff_departament.table_employer.setColumnWidth(4,70)
self.stuff_departament.table_employer.setColumnWidth(5,70)
self.stuff_departament.table_employer.setColumnWidth(6,50)
self.stuff_departament.table_employer.setColumnWidth(7,310)
for i,temp in enumerate(employer_data):
name = temp[0] +" "+ temp[1] +" "+ temp[2]
self.stuff_departament.model_employer.setData(self.stuff_departament.model_employer.index(i, 0), QVariant(temp[7]))
self.stuff_departament.model_employer.setData(self.stuff_departament.model_employer.index(i, 1), QVariant(name))
self.stuff_departament.model_employer.setData(self.stuff_departament.model_employer.index(i, 4), QVariant(temp[3]))
self.stuff_departament.model_employer.setData(self.stuff_departament.model_employer.index(i, 7), QVariant(temp[4]))
status="work"
fired_date = "-"
if temp[6]!=None:
status="Fired"
fired_date= temp[6]
self.stuff_departament.model_employer.setData(self.stuff_departament.model_employer.index(i, 6), QVariant(status))
self.stuff_departament.model_employer.setData(self.stuff_departament.model_employer.index(i, 5), QVariant(fired_date))
cursor.execute("SELECT country, city, address1, address2, zip, phone FROM address WHERE address.address_id=%d"%(temp[5]))
temp = cursor.fetchone()
self.stuff_departament.model_employer.setData(self.stuff_departament.model_employer.index(i, 3), QVariant(temp[5]))
address = temp[0]+", "+temp[1]+", "+temp[2]+", "+str(temp[4])
if temp[3]!=None:
address = temp[0]+", "+temp[1]+", "+temp[2]+ ", "+temp[3]+", "+str(temp[4])
self.stuff_departament.model_employer.setData(self.stuff_departament.model_employer.index(i, 2), QVariant(address))
#*************************************************************************************************************************************
def click_add_break (self):
print "'Add break' button been pressed"
self.stuff_departament.add_break_dialog = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.add_break_dialog.resize(201, 267)
self.stuff_departament.add_break_dialog.setMinimumSize (QtCore.QSize(201,267))
self.stuff_departament.add_break_dialog.setMaximumSize (QtCore.QSize(201,267))
self.stuff_departament.add_break_dialog.setWindowTitle ("Add break")
self.stuff_departament.add_break_dialog.from_date = QtGui.QDateEdit(self.stuff_departament.add_break_dialog)
self.stuff_departament.add_break_dialog.from_date.setGeometry(QtCore.QRect(70, 20, 81, 22))
self.stuff_departament.add_break_dialog.to_date = QtGui.QDateEdit(self.stuff_departament.add_break_dialog)
self.stuff_departament.add_break_dialog.to_date.setGeometry(QtCore.QRect(70, 60, 81, 22))
self.stuff_departament.add_break_dialog.break_type = QtGui.QComboBox(self.stuff_departament.add_break_dialog)
self.stuff_departament.add_break_dialog.break_type.setGeometry(QtCore.QRect(60, 100, 121, 22))
self.stuff_departament.add_break_dialog.break_comment = QtGui.QPlainTextEdit(self.stuff_departament.add_break_dialog)
self.stuff_departament.add_break_dialog.break_comment.setGeometry(QtCore.QRect(10, 150, 171, 64))
self.stuff_departament.add_break_dialog.ok_button = QtGui.QPushButton(self.stuff_departament.add_break_dialog)
self.stuff_departament.add_break_dialog.ok_button.setGeometry(QtCore.QRect(20, 230, 75, 23))
self.stuff_departament.add_break_dialog.ok_button.setText("Ok")
self.stuff_departament.add_break_dialog.cancel_button = QtGui.QPushButton(self.stuff_departament.add_break_dialog)
self.stuff_departament.add_break_dialog.cancel_button.setGeometry(QtCore.QRect(110, 230, 75, 23))
self.stuff_departament.add_break_dialog.cancel_button.setText("Cancel")
self.stuff_departament.add_break_dialog.date_from_label = QtGui.QLabel(self.stuff_departament.add_break_dialog)
self.stuff_departament.add_break_dialog.date_from_label.setGeometry(QtCore.QRect(10, 20, 51, 16))
self.stuff_departament.add_break_dialog.date_from_label.setText("Date from")
self.stuff_departament.add_break_dialog.date_to_label = QtGui.QLabel(self.stuff_departament.add_break_dialog)
self.stuff_departament.add_break_dialog.date_to_label.setGeometry(QtCore.QRect(10, 60, 46, 14))
self.stuff_departament.add_break_dialog.date_to_label.setText("Date to")
self.stuff_departament.add_break_dialog.break_type_label = QtGui.QLabel(self.stuff_departament.add_break_dialog)
self.stuff_departament.add_break_dialog.break_type_label.setGeometry(QtCore.QRect(10, 100, 46, 14))
self.stuff_departament.add_break_dialog.break_type_label.setText("Type")
self.stuff_departament.add_break_dialog.break_comment_label = QtGui.QLabel(self.stuff_departament.add_break_dialog)
self.stuff_departament.add_break_dialog.break_comment_label.setGeometry(QtCore.QRect(10, 130, 46, 14))
self.stuff_departament.add_break_dialog.break_comment_label.setText("Comment")
QtCore.QObject.connect(self.stuff_departament.add_break_dialog.ok_button, QtCore.SIGNAL("clicked()"),self.add_break_ok_pressed)
QtCore.QObject.connect(self.stuff_departament.add_break_dialog.cancel_button, QtCore.SIGNAL("clicked()"),self.add_break_cancel_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
self.stuff_departament.add_break_dialog.show()
#*************************************************************************************************************************************
def click_delete_break (self):
print "'Delete break' button been pressed"
self.stuff_departament.delete_specialization_sure = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.delete_specialization_sure.setWindowTitle("Delete specialization")
self.stuff_departament.delete_specialization_sure.resize(213, 78)
self.stuff_departament.delete_specialization_sure.setMinimumSize(QtCore.QSize(213, 78))
self.stuff_departament.delete_specialization_sure.setMaximumSize(QtCore.QSize(213, 78))
self.stuff_departament.delete_specialization_sure.yes_button = QtGui.QPushButton(self.stuff_departament.delete_specialization_sure)
self.stuff_departament.delete_specialization_sure.yes_button.setGeometry(QtCore.QRect(20, 40, 75, 23))
self.stuff_departament.delete_specialization_sure.yes_button.setText("Yes")
self.stuff_departament.delete_specialization_sure.no_button = QtGui.QPushButton(self.stuff_departament.delete_specialization_sure)
self.stuff_departament.delete_specialization_sure.no_button.setGeometry(QtCore.QRect(120, 40, 75, 23))
self.stuff_departament.delete_specialization_sure.no_button.setText("No")
self.stuff_departament.delete_specialization_sure.are_you_sure_label = QtGui.QLabel(self.stuff_departament.delete_specialization_sure)
self.stuff_departament.delete_specialization_sure.are_you_sure_label.setGeometry(QtCore.QRect(70, 10, 81, 16))
self.stuff_departament.delete_specialization_sure.are_you_sure_label.setText("Are you sure???")
self.stuff_departament.delete_specialization_sure.show()
QtCore.QObject.connect(self.stuff_departament.delete_specialization_sure.yes_button, QtCore.SIGNAL("clicked()"),self.delete_specialization_sure_yes_pressed)
QtCore.QObject.connect(self.stuff_departament.delete_specialization_sure.no_button, QtCore.SIGNAL("clicked()"),self.delete_specialization_sure_no_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
#*************************************************************************************************************************************
def click_edit_break (self):
print "'Edit break' button been pressed"
self.stuff_departament.edit_break_dialog = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.edit_break_dialog.resize(201, 267)
self.stuff_departament.edit_break_dialog.setMinimumSize (QtCore.QSize(201,267))
self.stuff_departament.edit_break_dialog.setMaximumSize (QtCore.QSize(201,267))
self.stuff_departament.edit_break_dialog.setWindowTitle ("Edit break")
self.stuff_departament.edit_break_dialog.from_date = QtGui.QDateEdit(self.stuff_departament.edit_break_dialog)
self.stuff_departament.edit_break_dialog.from_date.setGeometry(QtCore.QRect(70, 20, 81, 22))
self.stuff_departament.edit_break_dialog.to_date = QtGui.QDateEdit(self.stuff_departament.edit_break_dialog)
self.stuff_departament.edit_break_dialog.to_date.setGeometry(QtCore.QRect(70, 60, 81, 22))
self.stuff_departament.edit_break_dialog.break_type = QtGui.QComboBox(self.stuff_departament.edit_break_dialog)
self.stuff_departament.edit_break_dialog.break_type.setGeometry(QtCore.QRect(60, 100, 121, 22))
self.stuff_departament.edit_break_dialog.break_comment = QtGui.QPlainTextEdit(self.stuff_departament.edit_break_dialog)
self.stuff_departament.edit_break_dialog.break_comment.setGeometry(QtCore.QRect(10, 150, 171, 64))
self.stuff_departament.edit_break_dialog.ok_button = QtGui.QPushButton(self.stuff_departament.edit_break_dialog)
self.stuff_departament.edit_break_dialog.ok_button.setGeometry(QtCore.QRect(20, 230, 75, 23))
self.stuff_departament.edit_break_dialog.ok_button.setText("Ok")
self.stuff_departament.edit_break_dialog.cancel_button = QtGui.QPushButton(self.stuff_departament.edit_break_dialog)
self.stuff_departament.edit_break_dialog.cancel_button.setGeometry(QtCore.QRect(110, 230, 75, 23))
self.stuff_departament.edit_break_dialog.cancel_button.setText("Cancel")
self.stuff_departament.edit_break_dialog.date_from_label = QtGui.QLabel(self.stuff_departament.edit_break_dialog)
self.stuff_departament.edit_break_dialog.date_from_label.setGeometry(QtCore.QRect(10, 20, 51, 16))
self.stuff_departament.edit_break_dialog.date_from_label.setText("Date from")
self.stuff_departament.edit_break_dialog.date_to_label = QtGui.QLabel(self.stuff_departament.edit_break_dialog)
self.stuff_departament.edit_break_dialog.date_to_label.setGeometry(QtCore.QRect(10, 60, 46, 14))
self.stuff_departament.edit_break_dialog.date_to_label.setText("Date to")
self.stuff_departament.edit_break_dialog.break_type_label = QtGui.QLabel(self.stuff_departament.edit_break_dialog)
self.stuff_departament.edit_break_dialog.break_type_label.setGeometry(QtCore.QRect(10, 100, 46, 14))
self.stuff_departament.edit_break_dialog.break_type_label.setText("Type")
self.stuff_departament.edit_break_dialog.break_comment_label = QtGui.QLabel(self.stuff_departament.edit_break_dialog)
self.stuff_departament.edit_break_dialog.break_comment_label.setGeometry(QtCore.QRect(10, 130, 46, 14))
self.stuff_departament.edit_break_dialog.break_comment_label.setText("Comment")
QtCore.QObject.connect(self.stuff_departament.edit_break_dialog.ok_button, QtCore.SIGNAL("clicked()"),self.edit_break_ok_pressed)
QtCore.QObject.connect(self.stuff_departament.edit_break_dialog.cancel_button, QtCore.SIGNAL("clicked()"),self.edit_break_cancel_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
self.stuff_departament.edit_break_dialog.show()
#*************************************************************************************************************************************
def click_add_spec (self):
print "'Add specialisation' button been pressed"
self.stuff_departament.add_specialization_dialog = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.add_specialization_dialog.resize(241, 200)
self.stuff_departament.add_specialization_dialog.setWindowTitle ("Add specialization")
self.stuff_departament.add_specialization_dialog.setMinimumSize(QtCore.QSize(241,200))
self.stuff_departament.add_specialization_dialog.setMaximumSize(QtCore.QSize(241,200))
self.stuff_departament.add_specialization_dialog.spec_label = QtGui.QLabel(self.stuff_departament.add_specialization_dialog)
self.stuff_departament.add_specialization_dialog.spec_label.setGeometry(QtCore.QRect(10, 20, 81, 16))
self.stuff_departament.add_specialization_dialog.spec_label.setText("Specialization")
self.stuff_departament.add_specialization_dialog.from_date_label = QtGui.QLabel(self.stuff_departament.add_specialization_dialog)
self.stuff_departament.add_specialization_dialog.from_date_label.setGeometry(QtCore.QRect(10, 50, 81, 16))
self.stuff_departament.add_specialization_dialog.from_date_label.setText("From Date")
self.stuff_departament.add_specialization_dialog.comment_label = QtGui.QLabel(self.stuff_departament.add_specialization_dialog)
self.stuff_departament.add_specialization_dialog.comment_label.setGeometry(QtCore.QRect(10, 80, 46, 14))
self.stuff_departament.add_specialization_dialog.comment_label.setText("Comment")
self.stuff_departament.add_specialization_dialog.from_date = QtGui.QDateEdit(self.stuff_departament.add_specialization_dialog)
self.stuff_departament.add_specialization_dialog.from_date.setGeometry(QtCore.QRect(90, 50, 81, 22))
self.stuff_departament.add_specialization_dialog.spec_combobox = QtGui.QComboBox(self.stuff_departament.add_specialization_dialog)
self.stuff_departament.add_specialization_dialog.spec_combobox.setGeometry(QtCore.QRect(90, 20, 131, 22))
self.stuff_departament.add_specialization_dialog.comment = QtGui.QPlainTextEdit(self.stuff_departament.add_specialization_dialog)
self.stuff_departament.add_specialization_dialog.comment.setGeometry(QtCore.QRect(10, 100, 211, 41))
self.stuff_departament.add_specialization_dialog.ok_button = QtGui.QPushButton(self.stuff_departament.add_specialization_dialog)
self.stuff_departament.add_specialization_dialog.ok_button.setGeometry(QtCore.QRect(20, 160, 75, 23))
self.stuff_departament.add_specialization_dialog.ok_button.setText("Ok")
self.stuff_departament.add_specialization_dialog.cancel_button = QtGui.QPushButton(self.stuff_departament.add_specialization_dialog)
self.stuff_departament.add_specialization_dialog.cancel_button.setGeometry(QtCore.QRect(150, 160, 75, 23))
self.stuff_departament.add_specialization_dialog.cancel_button.setText("Cancel")
self.stuff_departament.add_specialization_dialog.show()
QtCore.QObject.connect(self.stuff_departament.add_specialization_dialog.ok_button, QtCore.SIGNAL("clicked()"),self.add_specialization_ok_pressed)
QtCore.QObject.connect(self.stuff_departament.add_specialization_dialog.cancel_button, QtCore.SIGNAL("clicked()"),self.add_specialization_cancel_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
#*************************************************************************************************************************************
def click_delete_spec (self):
print "'Delete specialisation' button been pressed"
self.stuff_departament.delete_break_sure = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.delete_break_sure.setWindowTitle("Delete break")
self.stuff_departament.delete_break_sure.resize(213, 78)
self.stuff_departament.delete_break_sure.setMinimumSize(QtCore.QSize(213, 78))
self.stuff_departament.delete_break_sure.setMaximumSize(QtCore.QSize(213, 78))
self.stuff_departament.delete_break_sure.yes_button = QtGui.QPushButton(self.stuff_departament.delete_break_sure)
self.stuff_departament.delete_break_sure.yes_button.setGeometry(QtCore.QRect(20, 40, 75, 23))
self.stuff_departament.delete_break_sure.yes_button.setText("Yes")
self.stuff_departament.delete_break_sure.no_button = QtGui.QPushButton(self.stuff_departament.delete_break_sure)
self.stuff_departament.delete_break_sure.no_button.setGeometry(QtCore.QRect(120, 40, 75, 23))
self.stuff_departament.delete_break_sure.no_button.setText("No")
self.stuff_departament.delete_break_sure.are_you_sure_label = QtGui.QLabel(self.stuff_departament.delete_break_sure)
self.stuff_departament.delete_break_sure.are_you_sure_label.setGeometry(QtCore.QRect(70, 10, 81, 16))
self.stuff_departament.delete_break_sure.are_you_sure_label.setText("Are you sure???")
self.stuff_departament.delete_break_sure.show()
QtCore.QObject.connect(self.stuff_departament.delete_break_sure.yes_button, QtCore.SIGNAL("clicked()"),self.delete_break_sure_yes_pressed)
QtCore.QObject.connect(self.stuff_departament.delete_break_sure.no_button, QtCore.SIGNAL("clicked()"),self.delete_break_sure_no_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
#*************************************************************************************************************************************
def click_edit_spec (self):
print "'Edit specialisation' button been pressed"
self.stuff_departament.edit_specialization_dialog = QtGui.QDialog(self.stuff_departament)
self.stuff_departament.edit_specialization_dialog.resize(241, 200)
self.stuff_departament.edit_specialization_dialog.setWindowTitle ("Edit specialization")
self.stuff_departament.edit_specialization_dialog.setMinimumSize(QtCore.QSize(241,200))
self.stuff_departament.edit_specialization_dialog.setMaximumSize(QtCore.QSize(241,200))
self.stuff_departament.edit_specialization_dialog.spec_label = QtGui.QLabel(self.stuff_departament.edit_specialization_dialog)
self.stuff_departament.edit_specialization_dialog.spec_label.setGeometry(QtCore.QRect(10, 20, 81, 16))
self.stuff_departament.edit_specialization_dialog.spec_label.setText("Specialization")
self.stuff_departament.edit_specialization_dialog.from_date_label = QtGui.QLabel(self.stuff_departament.edit_specialization_dialog)
self.stuff_departament.edit_specialization_dialog.from_date_label.setGeometry(QtCore.QRect(10, 50, 81, 16))
self.stuff_departament.edit_specialization_dialog.from_date_label.setText("From Date")
self.stuff_departament.edit_specialization_dialog.comment_label = QtGui.QLabel(self.stuff_departament.edit_specialization_dialog)
self.stuff_departament.edit_specialization_dialog.comment_label.setGeometry(QtCore.QRect(10, 80, 46, 14))
self.stuff_departament.edit_specialization_dialog.comment_label.setText("Comment")
self.stuff_departament.edit_specialization_dialog.from_date = QtGui.QDateEdit(self.stuff_departament.edit_specialization_dialog)
self.stuff_departament.edit_specialization_dialog.from_date.setGeometry(QtCore.QRect(90, 50, 81, 22))
self.stuff_departament.edit_specialization_dialog.spec_combobox = QtGui.QComboBox(self.stuff_departament.edit_specialization_dialog)
self.stuff_departament.edit_specialization_dialog.spec_combobox.setGeometry(QtCore.QRect(90, 20, 131, 22))
self.stuff_departament.edit_specialization_dialog.comment = QtGui.QPlainTextEdit(self.stuff_departament.edit_specialization_dialog)
self.stuff_departament.edit_specialization_dialog.comment.setGeometry(QtCore.QRect(10, 100, 211, 41))
self.stuff_departament.edit_specialization_dialog.ok_button = QtGui.QPushButton(self.stuff_departament.edit_specialization_dialog)
self.stuff_departament.edit_specialization_dialog.ok_button.setGeometry(QtCore.QRect(20, 160, 75, 23))
self.stuff_departament.edit_specialization_dialog.ok_button.setText("Ok")
self.stuff_departament.edit_specialization_dialog.cancel_button = QtGui.QPushButton(self.stuff_departament.edit_specialization_dialog)
self.stuff_departament.edit_specialization_dialog.cancel_button.setGeometry(QtCore.QRect(150, 160, 75, 23))
self.stuff_departament.edit_specialization_dialog.cancel_button.setText("Cancel")
self.stuff_departament.edit_specialization_dialog.show()
QtCore.QObject.connect(self.stuff_departament.edit_specialization_dialog.ok_button, QtCore.SIGNAL("clicked()"),self.edit_specialization_ok_pressed)
QtCore.QObject.connect(self.stuff_departament.edit_specialization_dialog.cancel_button, QtCore.SIGNAL("clicked()"),self.edit_specialization_cancel_pressed)
QtCore.QMetaObject.connectSlotsByName(self.stuff_departament)
#*************************************************************************************************************************************
def init_table_view (self):
self.stuff_departament.model_interview = QStandardItemModel(0, 5)
self.stuff_departament.model_interview.setHeaderData(0, Qt.Horizontal, QVariant("Name"))
self.stuff_departament.model_interview.setHeaderData(1, Qt.Horizontal, QVariant("Addres"))
self.stuff_departament.model_interview.setHeaderData(2, Qt.Horizontal, QVariant("Date"))
self.stuff_departament.model_interview.setHeaderData(3, Qt.Horizontal, QVariant("Accept/Reject"))
self.stuff_departament.model_interview.setHeaderData(4, Qt.Horizontal, QVariant("Comment"))
self.stuff_departament.table_interview.setModel(self.stuff_departament.model_interview)
self.stuff_departament.table_interview.setColumnWidth(0,290)
self.stuff_departament.table_interview.setColumnWidth(1,260)
self.stuff_departament.table_interview.setColumnWidth(2,110)
self.stuff_departament.table_interview.setColumnWidth(3,90)
self.stuff_departament.table_interview.setColumnWidth(4,291)
self.stuff_departament.model_employer = QStandardItemModel(0, 4)
self.stuff_departament.model_employer.setHeaderData(0, Qt.Horizontal, QVariant("Name"))
self.stuff_departament.model_employer.setHeaderData(1, Qt.Horizontal, QVariant("Addres"))
self.stuff_departament.model_employer.setHeaderData(2, Qt.Horizontal, QVariant("From date"))
self.stuff_departament.model_employer.setHeaderData(3, Qt.Horizontal, QVariant("Comment"))
self.stuff_departament.table_employer.setModel(self.stuff_departament.model_employer)
self.stuff_departament.table_employer.setColumnWidth(0,290)
self.stuff_departament.table_employer.setColumnWidth(1,290)
self.stuff_departament.table_employer.setColumnWidth(2,90)
self.stuff_departament.table_employer.setColumnWidth(3,371)
self.stuff_departament.model_break = QStandardItemModel(0, 4)
self.stuff_departament.model_break.setHeaderData(0, Qt.Horizontal, QVariant("Begin date"))
self.stuff_departament.model_break.setHeaderData(1, Qt.Horizontal, QVariant("End date"))
self.stuff_departament.model_break.setHeaderData(2, Qt.Horizontal, QVariant("Type"))
self.stuff_departament.model_break.setHeaderData(3, Qt.Horizontal, QVariant("Comment"))
self.stuff_departament.table_break.setModel(self.stuff_departament.model_break)
self.stuff_departament.table_break.setColumnWidth(0,70)
self.stuff_departament.table_break.setColumnWidth(1,70)
self.stuff_departament.table_break.setColumnWidth(2,90)
self.stuff_departament.table_break.setColumnWidth(3,150)
self.stuff_departament.model_specialization = QStandardItemModel(0, 3)
self.stuff_departament.model_specialization.setHeaderData(0, Qt.Horizontal, QVariant("Specialization"))
self.stuff_departament.model_specialization.setHeaderData(1, Qt.Horizontal, QVariant("From date"))
self.stuff_departament.model_specialization.setHeaderData(2, Qt.Horizontal, QVariant("Comment"))
self.stuff_departament.table_specialization.setModel(self.stuff_departament.model_specialization)
self.stuff_departament.table_specialization.setColumnWidth(0,100)
self.stuff_departament.table_specialization.setColumnWidth(1,70)
self.stuff_departament.table_specialization.setColumnWidth(2,160)
#*************************************************************************************************************************************
def add_interview_ok_pressed (self):
print "'Ok add interview' button been pressed"
cursor.execute("SELECT max(id) FROM interview")
max_id = cursor.fetchone()[0]
max_id+=1
cursor.execute("SELECT max(address_id) FROM address")
max_address_id = cursor.fetchone()[0]
max_address_id+=1
surname = self.stuff_departament.add_interview_dialog.surname_lineedit.text()
name = self.stuff_departament.add_interview_dialog.name_lineedit.text()
patronym = self.stuff_departament.add_interview_dialog.patronym_lineedit.text()
comment = self.stuff_departament.add_interview_dialog.comment.toPlainText()
country = self.stuff_departament.add_interview_dialog.country_text.text()
city = self.stuff_departament.add_interview_dialog.city_text.text()
address1 = self.stuff_departament.add_interview_dialog.address1_text.text()
address2 = self.stuff_departament.add_interview_dialog.address2_text.text()
zip = int(self.stuff_departament.add_interview_dialog.zip_text.text())
phone = self.stuff_departament.add_interview_dialog.phone_text.text()
if address2!="":
cursor.execute ("INSERT INTO address (address_id,country,city,address1,address2,zip,phone) VALUES(%d,%s,%s,%s,%s,%d,%s)"%(max_address_id,country,city,address1,address2,zip,phone))
else:
cursor.execute("INSERT INTO address (address_id,country,city,address1,zip,phone) VALUES(%d,%s,%s,%s,%d,%s)"%(max_address_id,country,city,address1,zip,phone))
cursor.execute ("INSERT INTO interview (id,surname,name,patronym,address_id,comment,status) VALUES(%d,%s,%s,%s,%d,%s,%d)"%(max_id,surname,name,patronym,max_address_id,comment,0))
self.stuff_departament.add_interview_dialog.hide()
self.click_refresh_interview ()
def add_interview_cancel_pressed (self):
print "'Cansel add interview' button been pressef"
self.stuff_departament.add_interview_dialog.hide()
#*************************************************************************************************************************************
def edit_interview_ok_pressed (self):
print "'Ok edit interview' button been pressed"
self.stuff_departament.edit_interview_dialog.hide()
def edit_interview_cancel_pressed (self):
print "'Cansel edit interview' button been pressef"
self.stuff_departament.edit_interview_dialog.hide()
#*************************************************************************************************************************************
def delete_interview_sure_yes_pressed (self):
print "'Yes delete interview are you sure' button been pressed"
self.stuff_departament.delete_interview_sure.hide()
def delete_interview_sure_no_pressed (self):
print "'No delete interview are yot sure' button been pressed"
self.stuff_departament.delete_interview_sure.hide()
#*************************************************************************************************************************************
def accept_employer_sure_yes_pressed (self):
print "'Yes accept employer are you sure' button been pressed"
id = int(self.stuff_departament.accept_employer_sure.id.text())
cursor.execute ("SELECT status from interview WHERE id=%d"%id)
if cursor.fetchone()[0]==0:
cursor.execute ("UPDATE interview SET status=1 WHERE id=%d"%(id))
self.stuff_departament.accept_employer_sure.hide()
self.click_refresh_interview()
def accept_employer_sure_no_pressed (self):
print "'No accept employer are you sure' button been pressed"
self.stuff_departament.accept_employer_sure.hide()
#*************************************************************************************************************************************
def reject_employer_sure_yes_pressed (self):
print "'Yes reject employer are you sure' button been pressed"
self.stuff_departament.reject_employer_sure.hide()
def reject_employer_sure_no_pressed (self):
print "'No reject employer are you sure' button been pressed"
self.stuff_departament.reject_employer_sure.hide()
#*************************************************************************************************************************************
def edit_employer_ok_pressed (self):
print "'Edit employer ok' button been pressed"
self.stuff_departament.edit_employer_dialog.hide()
def edit_employer_cancel_pressed (self):
print "'Edit employer cancel' button been pressed"
self.stuff_departament.edit_employer_dialog.hide()
#*************************************************************************************************************************************
def add_break_ok_pressed (self):
print "'Add break ok' button been pressed"
self.stuff_departament.add_break_dialog.hide()
def add_break_cancel_pressed (self):
print "'Add break cancel' button been pressed"
self.stuff_departament.add_break_dialog.hide()
#*************************************************************************************************************************************
def delete_break_sure_yes_pressed (self):
print "'Delete break sure yes' button been pressed"
self.stuff_departament.delete_break_sure.hide()
def delete_break_sure_no_pressed (self):
print "'Delte break sure no' button been pressed"
self.stuff_departament.delete_break_sure.hide()
#*************************************************************************************************************************************
def edit_break_ok_pressed (self):
print "'Break edit ok' button been pressed"
self.stuff_departament.edit_break_dialog.hide()
def edit_break_cancel_pressed (self):
print "'Breaak edit cancel' button been pressed"
self.stuff_departament.edit_break_dialog.hide()
#*************************************************************************************************************************************
def add_specialization_ok_pressed (self):
print"'Add specialization ok' button been pressed"
self.stuff_departament.add_specialization_dialog.hide()
def add_specialization_cancel_pressed (self):
print"'Add specialization cancel' button been pressed"
self.stuff_departament.add_specialization_dialog.hide()
#*************************************************************************************************************************************
def delete_specialization_sure_yes_pressed (self):
print "'Delete specialization sure yes' button been pressed"
self.stuff_departament.delete_specialization_sure.hide()
def delete_specialization_sure_no_pressed (self):
print "'Delte specialization sure no' button been pressed"
self.stuff_departament.delete_specialization_sure.hide()
#*************************************************************************************************************************************
def edit_specialization_ok_pressed (self):
print"'Edit specialization ok' button been pressed"
self.stuff_departament.edit_specialization_dialog.hide()
def edit_specialization_cancel_pressed (self):
print"'Edit specialization cancel' button been pressed"
self.stuff_departament.edit_specialization_dialog.hide()
#*************************************************************************************************************************************
if __name__=="__main__":
app = QtGui.QApplication(sys.argv)
app.setStyle('Cleanlooks')
dbconnect = psycopg2.connect('dbname=baza user=vakula')
cursor = dbconnect.cursor()
main_w = QtGui.QWorkspace()
my_form = MainProgram()
my_form.DrawInterfase(main_w)
main_w.show()
app.exec_()