-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRecordShow.java
More file actions
74 lines (62 loc) · 1.94 KB
/
RecordShow.java
File metadata and controls
74 lines (62 loc) · 1.94 KB
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
import java.sql.SQLException;
import java.util.Scanner;
import DS.Misc;
public class RecordShow implements ClassSkeleton {
Scanner inp;
SQLQueries sql;
int user_id;
RecordShow(Scanner inp, SQLQueries sql, int user_id) {
this.inp = inp;
this.sql = sql;
this.user_id = user_id;
}
// start Recoding after inserting programme name and time id
void recordShow() throws SQLException {
System.out.print("Enter channel number: ");
int channel_id = inp.nextInt();
sql.record(user_id, inp, channel_id);
}
// Here you can view all Recoding
void viewRecording() throws SQLException {
sql.viewMyrecording(user_id);
}
// you can delete recording by recording id
void deleteRecordById() throws SQLException {
System.out.print("Enter recording id you want to delete: ");
int record_id = inp.nextInt();
sql.deleteRecordById(record_id, user_id);
}
public void printMenu() {
System.out.println("1) Record");
System.out.println("2) View Recordings");
System.out.println("3) Delete Recordings");
System.out.println("4) Exit");
}
public void main() throws SQLException {
int index = 0;
Misc.cls();
while (index != 4) {
index = Misc.checkInt(inp, "Enter choice: ");
switch (index) {
case 1:
Misc.cls();
recordShow();
break;
case 2:
Misc.cls();
viewRecording();
break;
case 3:
Misc.cls();
deleteRecordById();
break;
case 4:
Misc.cls();
break;
default:
System.out.println("Enter valid choice!");
break;
}
}
}
}