-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCar.java
More file actions
125 lines (107 loc) · 4.13 KB
/
Copy pathCar.java
File metadata and controls
125 lines (107 loc) · 4.13 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
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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package car;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.naming.spi.DirStateFactory.Result;
import java.sql.Statement;
import java.util.Scanner;
/**
*
* @author Ammad
*/
public class Car {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws SQLException, IOException {
// TODO code application logic here
System.out.println(connection.connect());
Scanner input=new Scanner(System.in);
clearcon clearscreen=new clearcon();
customer cust=new customer();
System.out.println("Welcome to Car Rental Management System ");
System.out.println("1) Sign up \n2) Login");
char action= (char)System.in.read();
if(action=='1'){
System.out.print("Your First Name: ");
String fname=input.next();
System.out.print("Your Last Name: ");
String lname=input.next();
System.out.print("Your Phone No: ");
String phone=input.next();
System.out.print("Your Resedential Address: ");
String address=input.next();
System.out.print("Your CNIC: ");
String cnic=input.next();
System.out.print("Your Account Password: ");
String pass=input.next();
Boolean status= cust.Signup(fname, lname, phone, address, cnic, pass);
if(status==true)
{
System.out.println("Congratulations Your Account has been Created.");
}
else{
System.out.println("Please Check your Details");
}
}
if(action=='2'){
System.out.print("Enter your Username: ");
String username=input.next();
System.out.print("Enter your Password: ");
String password=input.next();
clearscreen.clear();
System.out.println(cust.login(username, password));
while(true){
// clearscreen.threeclear();
if(customer.id!=0){
System.out.println("1: Show my Details");
System.out.println("2: Book a car now");
System.out.println("3: My Transactions");
char login_action= (char)System.in.read();
if(login_action=='1'){
cust.show_details();
System.out.println("press 0 for update your record");
int action2= input.nextInt();
if(action2==0){
System.out.print("Your First Name:");
String fname=input.next();
System.out.print("Your Last Name:");
String lname=input.next();
System.out.print("Your Phone No");
String phone=input.next();
System.out.print("Your Resedential Address");
String address=input.next();
System.out.print("Your CNIC");
String cnic=input.next();
System.out.print("Your Account Password");
String pass=input.next();
Boolean status= cust.Update(fname, lname, phone, address, cnic, pass);
if(status==true)
{
System.out.println("Your Account Details has been updated");
continue;
}
else{
System.out.println("Please Fill all fields");
continue;
}
}
if(action2==9){
continue;
}
}
if(login_action=='2'){
cars_data cars=new cars_data();
cars.show_vehicle();
cars.vehicle_ids();
}
}
}
}
}
}