From 93b50f47f0d323955d472c7b9cee005855a716ec Mon Sep 17 00:00:00 2001 From: "h.hein" <26-h-kyaw-sakuracommunication@it-college.co.jp> Date: Thu, 24 Sep 2026 15:23:39 +0900 Subject: [PATCH] My Hote PJ All Done --- MyProject/src/hotelReservation/Reception.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/MyProject/src/hotelReservation/Reception.java b/MyProject/src/hotelReservation/Reception.java index 9834475..1e8e642 100644 --- a/MyProject/src/hotelReservation/Reception.java +++ b/MyProject/src/hotelReservation/Reception.java @@ -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 ); // 予約完了 နှင့် 予約情報 ကို ပေါင်းစပ်ပြသခြင်း