My Hote PJ All Done

This commit is contained in:
2026-09-24 15:23:39 +09:00
parent 7d93413341
commit 93b50f47f0

View File

@@ -65,7 +65,7 @@ public class Reception {
// txtNights.setBounds(140, 140, 60, 25); // txtNights.setBounds(140, 140, 60, 25);
// frame.add(txtNights); // frame.add(txtNights);
// နေထိုင်မည့်ရက် (Nights) နေရာကို အောက်သို့ အနည်းငယ် ရွှေ့ပါ (ဥပမာ y = 180) // နေထိုင်မည့်ရက် (Nights) နေရာကို အောက်သို့ အနည်းငယ် ရွှေ့ပါ (ဥပမာ y = 180)
JLabel lblNights = new JLabel("Night STAY:"); JLabel lblNights = new JLabel("COUNT of NIGHT:");
lblNights.setBounds(30, 180, 350, 35); lblNights.setBounds(30, 180, 350, 35);
frame.add(lblNights); frame.add(lblNights);
@@ -83,14 +83,25 @@ public class Reception {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
try { try {
//Check guest name is fill or not
String name = txtName.getText(); String name = txtName.getText();
if (name.isEmpty()) { if (name.isEmpty()) {
JOptionPane.showMessageDialog(frame, "Please Enter Your Name!!", "Something Worng", JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(frame, "Please Enter Your Name!!", "Something Worng", JOptionPane.ERROR_MESSAGE);
return; 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()); int nights = Integer.parseInt(txtNights.getText());
Room selectedRoom; Room selectedRoom;
// String CKDate = txtDate.getText();
// Inheritance နှင့် Polymorphism ကို အသုံးပြု၍ အခန်းအဓိပ္ပါယ်သတ်မှတ်ခြင်း // Inheritance နှင့် Polymorphism ကို အသုံးပြု၍ အခန်းအဓိပ္ပါယ်သတ်မှတ်ခြင်း
if (rbStandard.isSelected()) { if (rbStandard.isSelected()) {
@@ -100,7 +111,7 @@ public class Reception {
} }
// Reservation Object ဖန်တီးခြင်း // Reservation Object ဖန်တီးခြင်း
String checkInDate = txtDate.getText(); // String checkInDate = txtDate.getText();
Reservation reservation = new Reservation(name, selectedRoom, checkInDate,nights ); Reservation reservation = new Reservation(name, selectedRoom, checkInDate,nights );
// 予約完了 နှင့် 予約情報 ကို ပေါင်းစပ်ပြသခြင်း // 予約完了 နှင့် 予約情報 ကို ပေါင်းစပ်ပြသခြင်း