コード例 #1
0
ファイル: RoomStatusReport.cs プロジェクト: vptcoder/SWEN-P01
        private void cbxStatus_SelectedIndexChanged(object sender, EventArgs e)
        {
            ArrayList list = new ArrayList();

            list = RoomDBManager.GetAllRoom();
            string output   = "";
            string selected = cbxStatus.SelectedItem.ToString();

            foreach (Room rm in list)
            {
                if (rm.status == "Vacant" && rm.status == selected)
                {
                    output += "Room ID: " + rm.roomid + Environment.NewLine;
                    output += "Booking ID: " + rm.bookingid + Environment.NewLine;
                    output += "Room Number: " + rm.roomno + Environment.NewLine;
                    output += "Room Type: " + rm.room_type + Environment.NewLine;
                    output += "Room Status: " + rm.status + Environment.NewLine;
                    output += "Room Rates: " + rm.room_rates + Environment.NewLine + Environment.NewLine;
                }
                else if (rm.status == "Occupied" && rm.status == selected)
                {
                    output += "Room ID: " + rm.roomid + Environment.NewLine;
                    output += "Booking ID: " + rm.bookingid + Environment.NewLine;
                    output += "Room Number: " + rm.roomno + Environment.NewLine;
                    output += "Room Type: " + rm.room_type + Environment.NewLine;
                    output += "Room Status: " + rm.status + Environment.NewLine;
                    output += "Room Rates: " + rm.room_rates + Environment.NewLine + Environment.NewLine;
                }
                rt.overrideHTML(output);
            }
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ArrayList list  = RoomDBManager.GetAllRoom();
            ArrayList list1 = BookingDBManager.GetAllBooking();

            Room rm = new Room();

            rm = RoomDBManager.GetRoomByDate(dtpStartDate.Text);
            Book bk = new Book();

            bk = BookingDBManager.GetbookingByID(rm.bookingid);

            string  output            = "";
            int     roomcount         = 0;
            int     occupiedroomcount = 0;
            decimal total             = 0;

            DateTime StartDate = dtpStartDate.Value;
            DateTime EndDate   = StartDate.AddDays(7);

            foreach (Book booking in list1)
            {
                foreach (Room room in list)
                {
                    char[] dateFmt  = booking.check_in_date.ToCharArray();
                    string fmtYear  = dateFmt[4].ToString() + dateFmt[5].ToString() + dateFmt[6].ToString() + dateFmt[7].ToString();
                    string fmtMonth = dateFmt[2].ToString() + dateFmt[3].ToString();
                    string fmtDay   = dateFmt[0].ToString() + dateFmt[1].ToString();

                    DateTime dd = new DateTime(Convert.ToInt32(fmtYear), Convert.ToInt32(fmtMonth), Convert.ToInt32(fmtDay));

                    char[] dateFmt1  = booking.check_out_date.ToCharArray();
                    string fmtYear1  = dateFmt1[4].ToString() + dateFmt1[5].ToString() + dateFmt1[6].ToString() + dateFmt1[7].ToString();
                    string fmtMonth1 = dateFmt1[2].ToString() + dateFmt1[3].ToString();
                    string fmtDay1   = dateFmt1[0].ToString() + dateFmt1[1].ToString();

                    DateTime dd1 = new DateTime(Convert.ToInt32(fmtYear1), Convert.ToInt32(fmtMonth1), Convert.ToInt32(fmtDay1));

                    if (StartDate >= dd)
                    {
                        roomcount = +booking.no_of_rooms;
                    }
                    if (room.status == "Occupied")
                    {
                        occupiedroomcount++;
                    }

                    total = +(occupiedroomcount / roomcount) * 100;
                }
            }

            output += "Statistics: " + Environment.NewLine;
            output += "Percentage of the rooms that are occupied over the total number of rooms: " + total + Environment.NewLine;

            rt.overrideHTML(output);
            wbOutput.DocumentText = rt.generateHTML(false);
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            ArrayList list          = BookingDBManager.GetAllBooking();
            string    output        = "";
            int       adultcount    = 0;
            int       childrencount = 0;
            int       totalcount    = 0;

            DateTime StartDate = dtpStartDate.Value;

            int totalNumberOfGuestInHotel = 0;
            int totalNumberOfChild        = 0;
            int totalNumberOfAdult        = 0;

            foreach (Book booking in list)
            {
                char[] dateFmt  = booking.check_in_date.ToCharArray();
                string fmtYear  = dateFmt[4].ToString() + dateFmt[5].ToString() + dateFmt[6].ToString() + dateFmt[7].ToString();
                string fmtMonth = dateFmt[2].ToString() + dateFmt[3].ToString();
                string fmtDay   = dateFmt[0].ToString() + dateFmt[1].ToString();

                DateTime dd = new DateTime(Convert.ToInt32(fmtYear), Convert.ToInt32(fmtMonth), Convert.ToInt32(fmtDay));

                char[] dateFmt1  = booking.check_out_date.ToCharArray();
                string fmtYear1  = dateFmt1[4].ToString() + dateFmt1[5].ToString() + dateFmt1[6].ToString() + dateFmt1[7].ToString();
                string fmtMonth1 = dateFmt1[2].ToString() + dateFmt1[3].ToString();
                string fmtDay1   = dateFmt1[0].ToString() + dateFmt1[1].ToString();

                DateTime dd1 = new DateTime(Convert.ToInt32(fmtYear1), Convert.ToInt32(fmtMonth1), Convert.ToInt32(fmtDay1));

                if (StartDate >= dd)
                {
                    adultcount                 = +booking.no_of_adults;
                    childrencount              = +booking.no_of_children;
                    totalcount                 = +booking.no_of_adults + booking.no_of_children;
                    totalNumberOfGuestInHotel += totalcount;
                    totalNumberOfChild        += childrencount;
                    totalNumberOfAdult        += adultcount;

                    output += "Guest ID: " + booking.guestid + Environment.NewLine;
                    output += "Number of adults: " + adultcount + Environment.NewLine;
                    output += "Number of children: " + childrencount + Environment.NewLine + Environment.NewLine;
                }
            }
            output += "In Summary: " + Environment.NewLine;
            output += "Total number of adults in hotel: " + totalNumberOfAdult + Environment.NewLine;

            output += "Total number of children in hotel: " + totalNumberOfChild + Environment.NewLine;

            output += "Total number of guests in hotel: " + totalNumberOfGuestInHotel + Environment.NewLine;


            rt.overrideHTML(output);
            wbOutput.DocumentText = rt.generateHTML(false);
        }
コード例 #4
0
ファイル: GeneralReport.cs プロジェクト: vptcoder/SWEN-P01
        private void btnPreview_Click(object sender, EventArgs e)
        {
            Room rm = new Room();

            rm = RoomDBManager.getRoomByRn(tbxRoomNoSearch.Text);
            Book bk = new Book();

            bk = BookingDBManager.GetbookingByID(rm.bookingid);
            Guest g = new Guest();

            g = GuestDBManager.GetGuestByID(bk.guestid);


            string output = "";

            char[] cd = Convert.ToString(bk.check_in_date).ToCharArray();
            string checkInDateFormatted = cd[0].ToString() + cd[1].ToString() + "-" + cd[2].ToString() + cd[3].ToString() + "-" + cd[4].ToString() + cd[5].ToString() + cd[6].ToString() + cd[7].ToString();

            char[] cd1 = Convert.ToString(bk.check_out_date).ToCharArray();
            string checkOutDateFormatted = cd1[0].ToString() + cd1[1].ToString() + "-" + cd1[2].ToString() + cd1[3].ToString() + "-" + cd1[4].ToString() + cd1[5].ToString() + cd1[6].ToString() + cd1[7].ToString();

            output += "Booking ID: " + Convert.ToString(bk.bookingid) + Environment.NewLine;
            output += "Guest ID: " + Convert.ToString(bk.guestid) + Environment.NewLine;
            output += "Name: " + g.name + Environment.NewLine;
            output += "Phone number: " + Convert.ToString(g.phone) + Environment.NewLine;
            output += "Email: " + g.email + Environment.NewLine;
            output += "Address: " + g.address + Environment.NewLine;
            output += "Postal Code: " + Convert.ToString(g.postalcode) + Environment.NewLine;
            output += "Country: " + g.country + Environment.NewLine;
            output += "Check in date: " + checkInDateFormatted + Environment.NewLine;
            output += "Check out date: " + checkOutDateFormatted + Environment.NewLine;
            output += "Number of adults: " + Convert.ToString(bk.no_of_adults) + Environment.NewLine;
            output += "Number of children: " + Convert.ToString(bk.no_of_children) + Environment.NewLine;
            output += "Payment Type: " + g.paymenttype + Environment.NewLine;

            rt.overrideHTML(output);
            wbOutput.DocumentText = rt.generateHTML(false);
        }
コード例 #5
0
        private void cbView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbView.SelectedItem == "Daily")
            {
                ArrayList list = new ArrayList();
                list = HousekeepingDBManager.GetAllHousekeeping();
                string output = "";

                foreach (Housekeeping hk in list)
                {
                    if (hk.housekeepingdate == dtpDate.Text)
                    {
                        output += "Housekeeping ID: " + hk.housekeepingid + Environment.NewLine;
                        output += "Housekeeping Type: " + hk.housekeepingtype + Environment.NewLine;
                        output += "Housekeeping Date: " + hk.housekeepingdate + Environment.NewLine;
                        output += "Housekeeping Time: " + hk.housekeepingtime + Environment.NewLine;
                        output += "Staff ID: " + hk.staffid + Environment.NewLine;
                        output += "Room ID: " + hk.roomid + Environment.NewLine + Environment.NewLine;
                    }
                    rt.overrideHTML(output);
                }
            }
            else if (cbView.SelectedItem == "Weekly")
            {
                ArrayList list = new ArrayList();
                list = HousekeepingDBManager.GetAllHousekeeping();
                string   output    = "";
                DateTime StartDate = dtpDate.Value;
                DateTime EndDate   = StartDate.AddDays(7);

                foreach (Housekeeping hk in list)
                {
                    char[] dateFmt  = hk.housekeepingdate.ToCharArray();
                    string fmtYear  = dateFmt[4].ToString() + dateFmt[5].ToString() + dateFmt[6].ToString() + dateFmt[7].ToString();
                    string fmtMonth = dateFmt[2].ToString() + dateFmt[3].ToString();
                    string fmtDay   = dateFmt[0].ToString() + dateFmt[1].ToString();

                    DateTime dd = new DateTime(Convert.ToInt32(fmtYear), Convert.ToInt32(fmtMonth), Convert.ToInt32(fmtDay));

                    if (StartDate <= dd && EndDate >= dd)
                    {
                        output += "Housekeeping ID: " + hk.housekeepingid + Environment.NewLine;
                        output += "Housekeeping Type: " + hk.housekeepingtype + Environment.NewLine;
                        output += "Housekeeping Date: " + hk.housekeepingdate + Environment.NewLine;
                        output += "Housekeeping Time: " + hk.housekeepingtime + Environment.NewLine;
                        output += "Staff ID: " + hk.staffid + Environment.NewLine;
                        output += "Room ID: " + hk.roomid + Environment.NewLine + Environment.NewLine;
                    }
                }
                rt.overrideHTML(output);
            }
            else if (cbView.SelectedItem == "Monthly")
            {
                ArrayList list = new ArrayList();
                list = HousekeepingDBManager.GetAllHousekeeping();
                string   output    = "";
                DateTime StartDate = dtpDate.Value;
                DateTime EndDate   = StartDate.AddDays(31);

                foreach (Housekeeping hk in list)
                {
                    char[] dateFmt  = hk.housekeepingdate.ToCharArray();
                    string fmtYear  = dateFmt[4].ToString() + dateFmt[5].ToString() + dateFmt[6].ToString() + dateFmt[7].ToString();
                    string fmtMonth = dateFmt[2].ToString() + dateFmt[3].ToString();
                    string fmtDay   = dateFmt[0].ToString() + dateFmt[1].ToString();

                    DateTime dd = new DateTime(Convert.ToInt32(fmtYear), Convert.ToInt32(fmtMonth), Convert.ToInt32(fmtDay));

                    if (StartDate <= dd && EndDate >= dd)
                    {
                        output += "Housekeeping ID: " + hk.housekeepingid + Environment.NewLine;
                        output += "Housekeeping Type: " + hk.housekeepingtype + Environment.NewLine;
                        output += "Housekeeping Date: " + hk.housekeepingdate + Environment.NewLine;
                        output += "Housekeeping Time: " + hk.housekeepingtime + Environment.NewLine;
                        output += "Staff ID: " + hk.staffid + Environment.NewLine;
                        output += "Room ID: " + hk.roomid + Environment.NewLine + Environment.NewLine;
                    }
                }
                rt.overrideHTML(output);
            }
        }