0
1
00:00:04,985 --> 00:00:07,137
Hello again. In previous lecture we created
1

2
00:00:07,137 --> 00:00:09,767
our add book window, right.
2

3
00:00:09,767 --> 00:00:11,602
It's time to create now, in this lecture
3

4
00:00:11,602 --> 00:00:13,978
we are going to create our add member window.
4

5
00:00:13,978 --> 00:00:16,275
And it will be very simple because it's very similar
5

6
00:00:16,275 --> 00:00:18,150
to that one, the first one.
6

7
00:00:18,150 --> 00:00:20,567
So to do that what I need to do firstly
7

8
00:00:21,527 --> 00:00:24,040
I need to go to find my add member button, right.
8

9
00:00:24,040 --> 00:00:24,957
Add main.py
9

10
00:00:26,274 --> 00:00:30,545
And here, add member button is here, right.
10

11
00:00:30,545 --> 00:00:35,212
And here what I need to do here? I need to use here command
11

12
00:00:36,172 --> 00:00:38,422
is equal to self.addMember
12

13
00:00:41,228 --> 00:00:42,961
and after that that what I need to do?
13

14
00:00:42,961 --> 00:00:47,961
I need to copy this name and create my definition here.
14

15
00:00:48,033 --> 00:00:51,033
I say def_addMember and self, right.
15

16
00:00:52,259 --> 00:00:54,009
Here what I will say?
16

17
00:00:55,584 --> 00:00:56,917
Let's say member
17

18
00:00:58,283 --> 00:00:59,200
is equal to
18

19
00:01:00,133 --> 00:01:01,716
addmember.AddMember
19

20
00:01:06,341 --> 00:01:10,649
I didn't create my Python file and also my class.
20

21
00:01:10,649 --> 00:01:13,980
That's why here we getting error, right.
21

22
00:01:13,980 --> 00:01:17,426
So what I need to do firstly? I need to go here.
22

23
00:01:17,426 --> 00:01:22,275
And actually here let's create our Python file first.
23

24
00:01:22,275 --> 00:01:23,108
addmember
24

25
00:01:24,742 --> 00:01:29,242
and after that here I will say main import addmember, okay.
25

26
00:01:31,780 --> 00:01:34,328
And after that here what I need to do?
26

27
00:01:34,328 --> 00:01:36,157
Add book as I said very similar.
27

28
00:01:36,157 --> 00:01:39,336
So I can copy of all of these things.
28

29
00:01:39,336 --> 00:01:43,839
Okay: copy add book and here I will paste it here, okay.
29

30
00:01:43,839 --> 00:01:46,839
So what I need to? This is going to be
30

31
00:01:47,785 --> 00:01:48,618
AddMember
31

32
00:01:50,976 --> 00:01:54,643
and here our title will be Add Member, okay.
32

33
00:01:55,856 --> 00:01:58,591
And the frame: everything is same here
33

34
00:01:58,591 --> 00:02:01,424
but what I will say for Add Member
34

35
00:02:03,799 --> 00:02:05,922
and here addbook, for add book.
35

36
00:02:05,922 --> 00:02:10,422
Add person icon I will use that one, okay, add person.
36

37
00:02:11,334 --> 00:02:13,667
So here it will be addperson
37

38
00:02:16,410 --> 00:02:19,827
and after that here I will say Add Person
38

39
00:02:21,364 --> 00:02:24,618
and I need only two entries here.
39

40
00:02:24,618 --> 00:02:28,724
So the first I will keep these guys, okay
40

41
00:02:28,724 --> 00:02:32,264
but I will delete this page language.
41

42
00:02:32,264 --> 00:02:35,264
I also need buttons so now it's fine
42

43
00:02:36,188 --> 00:02:38,938
and lets delete these guys, okay.
43

44
00:02:40,846 --> 00:02:44,432
And after that what I need to do here for the name?
44

45
00:02:44,432 --> 00:02:47,807
We can give keep it name and this one is going to be phone
45

46
00:02:47,807 --> 00:02:52,724
because, remember we have only two fields at members table.
46

47
00:02:53,934 --> 00:02:57,351
First one is name, the other one is phone
47

48
00:02:58,950 --> 00:03:02,518
so here what I will say for the phone:
48

49
00:03:02,518 --> 00:03:05,601
we can say author and say here phone.
49

50
00:03:06,909 --> 00:03:08,096
Okay.
50

51
00:03:08,096 --> 00:03:10,413
And let's say here member name
51

52
00:03:10,413 --> 00:03:12,547
member name and phone.
52

53
00:03:12,547 --> 00:03:14,047
So I will say here
53

54
00:03:15,505 --> 00:03:16,338
phone
54

55
00:03:18,222 --> 00:03:21,055
and that one is going to be phone.
55

56
00:03:22,266 --> 00:03:24,766
And please enter phone number.
56

57
00:03:29,207 --> 00:03:31,707
Phone number and single quote.
57

58
00:03:34,382 --> 00:03:38,742
What is next? Let's also copy this phone text, okay.
58

59
00:03:38,742 --> 00:03:40,825
And I will paste it here.
59

60
00:03:42,108 --> 00:03:44,108
Entry phone and this one
60

61
00:03:45,645 --> 00:03:49,385
is phone again and the last one is also going to be phone.
61

62
00:03:49,385 --> 00:03:53,468
But here what I need to say? I need to say entry phone.get.
62

63
00:03:55,486 --> 00:04:00,153
And here like that. So name and let's remove these guys.
63

64
00:04:02,118 --> 00:04:05,103
I will say here simply phone, okay.
64

65
00:04:05,103 --> 00:04:07,353
And after that, what I need to say here?
65

66
00:04:07,353 --> 00:04:10,436
I need to use insert into members, okay,
66

67
00:04:11,634 --> 00:04:16,634
members, my table name and here member_name and member_phone
67

68
00:04:17,261 --> 00:04:19,594
So let's remove these guys.
68

69
00:04:20,728 --> 00:04:24,145
member_name and also member_phone, right.
69

70
00:04:28,792 --> 00:04:32,834
I have only two values so let's delete these guys.
70

71
00:04:32,834 --> 00:04:36,834
And after that here: execute and here our query.
71

72
00:04:38,077 --> 00:04:42,494
First one, and after that the other one will be phone
72

73
00:04:43,947 --> 00:04:46,864
And I will remove these guys, okay.
73

74
00:04:47,793 --> 00:04:50,543
I think everything looks fine so
74

75
00:04:54,069 --> 00:04:55,567
it looks like there is no problem.
75

76
00:04:55,567 --> 00:04:58,984
Add book, I will name it addMember, okay.
76

77
00:05:01,727 --> 00:05:05,060
This one is going to be addMember, okay.
77

78
00:05:06,621 --> 00:05:10,122
If I run my application I can see by the way.
78

79
00:05:10,122 --> 00:05:14,812
Here what we need to do? We need to check our table
79

80
00:05:14,812 --> 00:05:18,229
for the field's name and let me check it.
80

81
00:05:22,039 --> 00:05:23,622
Our library is here.
81

82
00:05:27,556 --> 00:05:29,723
And members, browse, data.
82

83
00:05:31,737 --> 00:05:33,070
Sorry, not here.
83

84
00:05:34,203 --> 00:05:39,203
Members and member ID, member name, member phone. Okay, fine
84

85
00:05:39,890 --> 00:05:42,000
and the table name is members, fine.
85

86
00:05:42,000 --> 00:05:44,391
Everything looks fine. So what I need to do?
86

87
00:05:44,391 --> 00:05:46,558
I need to run my main.py
87

88
00:05:48,223 --> 00:05:52,048
and here  add member, yep. Everything looks fine
88

89
00:05:52,048 --> 00:05:56,549
only I need to move this guy somewhere here, okay.
89

90
00:05:56,549 --> 00:05:59,549
So I need to change Y value for button
90

91
00:06:00,759 --> 00:06:05,214
Y value, let's say 120, I think will be fine.
91

92
00:06:05,214 --> 00:06:06,631
If I run it again
92

93
00:06:08,410 --> 00:06:10,636
add book, yes it's fine.
93

94
00:06:10,636 --> 00:06:13,636
So lets save, for example, for David
94

95
00:06:14,510 --> 00:06:19,177
and the phone number +7, something like that, okay.
95

96
00:06:20,375 --> 00:06:23,736
Add book Successfully added to database.
96

97
00:06:23,736 --> 00:06:27,319
Now, lets go back here. Show in Explorer
97

98
00:06:29,244 --> 00:06:30,161
and Library
98

99
00:06:33,273 --> 00:06:34,606
and here members
99

100
00:06:36,776 --> 00:06:39,720
right, and for this one I will say members.
100

101
00:06:39,720 --> 00:06:42,079
As you see now our record is here
101

102
00:06:42,079 --> 00:06:44,849
and everything looks very very well.
102

103
00:06:44,849 --> 00:06:47,932
And for now lets all see in the next.
