コード例 #1
0
ファイル: FormCheckIn.cs プロジェクト: Brfranca/HotelSystem
        private void btnSeachReservation_Click(object sender, EventArgs e)
        {
            FormSearchReservation frmSearchReservation = new FormSearchReservation();

            frmSearchReservation.ShowDialog();
            _room        = frmSearchReservation.room;
            _client      = frmSearchReservation.client;
            _reservation = frmSearchReservation.reservation;
            SelectClient();
            SelectRoom();
            SelectDate();
        }
コード例 #2
0
ファイル: FormCheckIn.cs プロジェクト: Brfranca/HotelSystem
        private void btnSelectClient_Click(object sender, EventArgs e)
        {
            FormSearchClient frmSearchClient = new FormSearchClient();

            frmSearchClient.ShowDialog();
            _client = frmSearchClient.client;
            for (int i = 0; i < _checkInBLL.GetByActiveState().Data.Count; i++)
            {
                if (_checkInBLL.GetByActiveState().Data[i].ClientID == _client.ID)
                {
                    MessageBox.Show("Esse cliente já efetuou o check in.");
                    return;
                }
            }

            if (_client.ID != 0)
            {
                SelectClient();
            }
            for (int i = 0; i < _reservationBLL.GetByActiveState().Data.Count; i++)
            {
                if (_reservationBLL.GetByActiveState().Data[i].ClientID == _client.ID)
                {
                    DialogResult result = MessageBox.Show("Você possui uma reserva, deseja fazer o check in dessa reserva?", "", MessageBoxButtons.YesNo);
                    if (result == DialogResult.Yes)
                    {
                        FormSearchReservation frmSearchReservation = new FormSearchReservation(_client.CPF);
                        frmSearchReservation.ShowDialog();
                        _room               = frmSearchReservation.room;
                        _client             = frmSearchReservation.client;
                        _reservation        = frmSearchReservation.reservation;
                        _reservation.Active = false;
                        Response response = _reservationBLL.Update(_reservation);
                        if (!response.Success)
                        {
                            MessageBox.Show(response.Message);
                            return;
                        }
                        SelectClient();
                        SelectRoom();
                        SelectDate();
                    }
                }
            }
        }
コード例 #3
0
        private void btnSeachReservation_Click_1(object sender, EventArgs e)
        {
            FormSearchReservation frmSearchReservation = new FormSearchReservation();

            frmSearchReservation.ShowDialog();
            _reservation = frmSearchReservation.reservation;
            _room        = frmSearchReservation.room;
            _client      = frmSearchReservation.client;
            if (_reservation.ID == 0)
            {
                return;
            }
            SelectRoom();
            SelectClient();
            SelectDate();
            btnReservationRegister.Text = "Editar";
            btnDelete.Visible           = true;
        }