My Hote PJ All Done
This commit is contained in:
@@ -65,7 +65,7 @@ public class Reception {
|
||||
// txtNights.setBounds(140, 140, 60, 25);
|
||||
// frame.add(txtNights);
|
||||
// နေထိုင်မည့်ရက် (Nights) နေရာကို အောက်သို့ အနည်းငယ် ရွှေ့ပါ (ဥပမာ y = 180)
|
||||
JLabel lblNights = new JLabel("Night STAY:");
|
||||
JLabel lblNights = new JLabel("COUNT of NIGHT:");
|
||||
lblNights.setBounds(30, 180, 350, 35);
|
||||
frame.add(lblNights);
|
||||
|
||||
@@ -83,14 +83,25 @@ public class Reception {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
//Check guest name is fill or not
|
||||
String name = txtName.getText();
|
||||
if (name.isEmpty()) {
|
||||
JOptionPane.showMessageDialog(frame, "Please Enter Your Name!!", "Something Worng", JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
// ၂။ ဝင်ရောက်မည့်ရက် (Check-in Date) စစ်ဆေးခြင်း
|
||||
String checkInDate = txtDate.getText().trim();
|
||||
if (checkInDate.isEmpty() || checkInDate.equals("---")) {
|
||||
JOptionPane.showMessageDialog(frame, "Please Enter Check-in Date!!", "Something Wrong", JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
//Check How many stay night is null or not
|
||||
|
||||
int nights = Integer.parseInt(txtNights.getText());
|
||||
Room selectedRoom;
|
||||
|
||||
// String CKDate = txtDate.getText();
|
||||
|
||||
|
||||
// Inheritance နှင့် Polymorphism ကို အသုံးပြု၍ အခန်းအဓိပ္ပါယ်သတ်မှတ်ခြင်း
|
||||
if (rbStandard.isSelected()) {
|
||||
@@ -100,7 +111,7 @@ public class Reception {
|
||||
}
|
||||
|
||||
// Reservation Object ဖန်တီးခြင်း
|
||||
String checkInDate = txtDate.getText();
|
||||
// String checkInDate = txtDate.getText();
|
||||
Reservation reservation = new Reservation(name, selectedRoom, checkInDate,nights );
|
||||
|
||||
// 予約完了 နှင့် 予約情報 ကို ပေါင်းစပ်ပြသခြင်း
|
||||
|
||||
Reference in New Issue
Block a user