Пример #1
0
        private void BtnDat_Click(object sender, RoutedEventArgs e)
        {
            UserControl usc = null;

            if (lblTinhTrang.Content.ToString() == "Hết phòng")
            {
                usc = new PayScreen(connectData, maPhong, false);
                Global.mainNavigate.Children.Add(usc);
                return;
            }

            usc = new BookRoom(connectData, maPhong);
            Global.mainNavigate.Children.Add(usc);
        }
Пример #2
0
        private void Book_Click(object sender, RoutedEventArgs e)
        {
            if (dpkDayEnd.Text.Length > 7 && dpkDayEnd.SelectedDate.Value.Date <= dpkDayBegin.SelectedDate.Value.Date)
            {
                MessageBox.Show("Vui lòng chọn ngày trả phòng hơn ngày thuê.");
                return;
            }
            if (listCustomer.Count == 0)
            {
                MessageBox.Show("Vui lòng nhập thông tin khách hàng");
                return;
            }
            if (!KTcountSDT())
            {
                MessageBox.Show("Vui lòng nhập Số điện thoại( ít nhất phải có 1 SDT của khách hàng).");
                return;
            }

            valuedayStart = dpkDayBegin.Text;


            Global.listCustomer  = listCustomer;
            Global.room          = room;
            Global.valuedayStart = valuedayStart;
            Global.valuedayEnd   = valuedayEnd;
            Global.note          = txtGhichu.Text;

            UserControl usc = null;

            if (dpkDayEnd.Text.Length > 7)                      //đủ thông tin qua thanh toán
            {
                Global.songay = (int)((dpkDayEnd.SelectedDate.Value.Date - dpkDayBegin.SelectedDate.Value.Date).TotalDays + 1);

                usc = new PayScreen(connectData, "", true);
                Global.mainNavigate.Children.Add(usc);
                return;
            }

            connectData.setBookRoom(listCustomer, room, formatDate(valuedayStart), valuedayEnd, txtGhichu.Text, 0, -1, true);
            usc = new ListRoom(connectData);
            Global.listCustomer  = null;
            Global.room          = null;
            Global.valuedayStart = "";
            Global.valuedayEnd   = "";
            Global.songay        = 0;
            Global.note          = "";
            Global.mainNavigate.Children.Add(usc);
        }