Esempio n. 1
0
        private void DrawRooms()
        {
            Panel_ListRoom.Controls.Clear();
            BS_Layer.BLRoom blp = new BS_Layer.BLRoom();

            var tbRooms = blp.LoadRoom();

            int   floor      = 1;
            int   row        = 0;
            int   col        = 0;
            Label floorStart = new Label();

            Panel_ListRoom.Controls.Add(floorStart);
            floorStart.Text     = "Floor 1";
            floorStart.Width    = 45;
            floorStart.Height   = 15;
            floorStart.Location = new Point(5, 95);
            foreach (var room in tbRooms)
            {
                if (room.OnFloor != floor)
                {
                    row++;
                    col   = 0;
                    floor = room.OnFloor;
                    Label floorNew = new Label();
                    Panel_ListRoom.Controls.Add(floorNew);
                    floorNew.Text     = "Floor " + floor.ToString();
                    floorNew.Width    = 45;
                    floorNew.Height   = 15;
                    floorNew.Location = new Point(5, 90 * row + 85);
                }
                Button A = new Button();
                Panel_ListRoom.Controls.Add(A);
                A.Text = "Room " + room.RoomID.ToString() + "\n " + room.Name.ToString();
                if (room.Status == 0)
                {
                    A.BackColor = Color.White;
                }
                else
                {
                    if (room.Status == 1)
                    {
                        A.BackColor = Color.LightGoldenrodYellow;
                    }
                    else
                    {
                        A.BackColor = Color.LightBlue;
                    }
                }
                A.Size     = new Size(90, 90);
                A.Location = new Point(90 * col + 50, 90 * row + 50);
                A.Click   += delegate(object sender, EventArgs e) { Click_Detail(sender, e, room.RoomID, this.Employee); };
                col++;
            }
        }
Esempio n. 2
0
        private void InitializerBooking()
        {
            Booking_RadioButton_Ever.Checked            = true;
            Booking_Panel_NewCustomer.Enabled           = false;
            this.DateTimePicker_AppointmentDate.MinDate = DateTime.Today;

            this.Booking_TextBox_CustomerName.ResetText();
            this.Booking_TextBox_Address.ResetText();
            this.Booking_TextBox_PhoneNumber.ResetText();
            this.Booking_TextBox_IdentityCard.ResetText();
            LoadCustomerDataBookingTable();
            Booking_DataGridView_DetailOfBooking.Rows[0].Cells[0].Value = Booking_Datagridview_ListOfCustomer.Rows[0].Cells[0].Value;
            Booking_DataGridView_DetailOfBooking.Rows[0].Cells[1].Value = Booking_Datagridview_ListOfCustomer.Rows[0].Cells[1].Value;
            Booking_DataGridView_DetailOfBooking.Rows[0].Cells[2].Value = this.Room_ID;
            BS_Layer.BLRoom bl = new BS_Layer.BLRoom();
            Booking_DataGridView_DetailOfBooking.Rows[0].Cells[3].Value = bl.FindRoom(this.Room_ID).ElementAt(0).Type;
            Booking_DataGridView_DetailOfBooking.Rows[0].Cells[4].Value = DateTimePicker_AppointmentDate.Value.Date;
        }
Esempio n. 3
0
        private void InitializerCheckin()
        {
            this.DateTimePicker_AppointmentDate.MinDate = DateTime.Today;

            Checkin_RadioButton_HaveBooking.Checked = true;
            Checkin_Panel_CreateNewCustomer.Enabled = false;
            Checkin_Panel_SelectCustomer.Enabled    = false;

            this.Checkin_Textbox_CustomerName.ResetText();
            this.Checkin_Textbox_Address.ResetText();
            this.Checkin_Textbox_PhoneNumber.ResetText();
            this.Checkin_Textbox_IdentityCard.ResetText();
            LoadCustomerDataCheckinTable();
            LoadBookingList();
            Checkin_DataGridView_Detail.Rows[0].Cells[0].Value = Checkin_Datagridview_ListOfCustomer.Rows[0].Cells[0].Value;
            Checkin_DataGridView_Detail.Rows[0].Cells[1].Value = Checkin_Datagridview_ListOfCustomer.Rows[0].Cells[1].Value;
            Checkin_DataGridView_Detail.Rows[0].Cells[2].Value = this.Room_ID;
            BS_Layer.BLRoom bl = new BS_Layer.BLRoom();
            Checkin_DataGridView_Detail.Rows[0].Cells[3].Value = bl.FindRoom(this.Room_ID).ElementAt(0).Type;
            Checkin_DataGridView_Detail.Rows[0].Cells[4].Value = Checkin_DateTimePicker_Today.Value.Date;
        }
Esempio n. 4
0
        private void Detail_Load(object sender, EventArgs e)
        {
            BS_Layer.BLRoom bl   = new BS_Layer.BLRoom();
            var             Room = bl.FindRoom(Room_ID).ElementAt(0);

            switch (Room.Status)
            {
            case 0:
            {
                Button_Checkout.Enabled = false;
                tabControl_Main.TabPages.Clear();
                tabControl_Main.TabPages.Add(tabPage_Booking);
                InitializerBooking();
                break;
            }

            case 1:
            {
                Button_Booking.Enabled = false;
                Button_Checkin.Enabled = false;
                tabControl_Main.TabPages.Clear();
                tabControl_Main.TabPages.Add(tabPage_CheckOut);
                InitializerCheckout();
                break;
            }

            case 2:
            {
                Button_Booking.Enabled  = false;
                Button_Checkout.Enabled = false;
                tabControl_Main.TabPages.Clear();
                tabControl_Main.TabPages.Add(tabPage_Checkin);
                InitializerCheckin();
                break;
            }
            }
        }