Exemplo n.º 1
0
 private void btnReserve_Click(object sender, RoutedEventArgs e)
 {
     int numRecord = ListRoom.SelectedIndex + 1;
     if (numRecord == 0)
     {
         MessageBox.Show("Для бронювання виберіть параметри");
     }
     else
     {
         HotelServiceClient idRecord = new HotelServiceClient();
         int _idRecord = idRecord.GetId(numRecord);
         RoomDTO room = new RoomDTO();
         room = idRecord.GetRowById(_idRecord);
         ReserveRoom reserveRoom = new ReserveRoom();
         DateTime aaa = Convert.ToDateTime(mwDateFrom.Text);
         DateTime bbb = Convert.ToDateTime(mwDateTo.Text);
         string ccc = Convert.ToString(bbb - aaa);
         int price = room.Price;
         reserveRoom.txtBlockType.Text = room.Name;
         reserveRoom.rrDateFrom.Text = mwDateFrom.Text;
         reserveRoom.rrDateTo.Text = mwDateTo.Text;
         reserveRoom.txtBlockCost.Text = price.ToString() + " грн.";
         reserveRoom.txtBlockInfo.Text = "14:00 " + reserveRoom.rrDateFrom.Text + " - 12:00 " + reserveRoom.rrDateTo.Text;
         reserveRoom._IDRecord = _idRecord;
         reserveRoom.Show();
     }
 }
Exemplo n.º 2
0
        private void btnReserve_Click(object sender, RoutedEventArgs e)
        {
            int numRecord = ListRoom.SelectedIndex + 1;

            if (numRecord == 0)
            {
                MessageBox.Show("Для бронювання виберіть параметри");
            }
            else
            {
                HotelServiceClient idRecord = new HotelServiceClient();
                int     _idRecord           = idRecord.GetId(numRecord);
                RoomDTO room = new RoomDTO();
                room = idRecord.GetRowById(_idRecord);
                ReserveRoom reserveRoom = new ReserveRoom();
                DateTime    aaa         = Convert.ToDateTime(mwDateFrom.Text);
                DateTime    bbb         = Convert.ToDateTime(mwDateTo.Text);
                string      ccc         = Convert.ToString(bbb - aaa);
                int         price       = room.Price;
                reserveRoom.txtBlockType.Text = room.Name;
                reserveRoom.rrDateFrom.Text   = mwDateFrom.Text;
                reserveRoom.rrDateTo.Text     = mwDateTo.Text;
                reserveRoom.txtBlockCost.Text = price.ToString() + " грн.";
                reserveRoom.txtBlockInfo.Text = "14:00 " + reserveRoom.rrDateFrom.Text + " - 12:00 " + reserveRoom.rrDateTo.Text;
                reserveRoom._IDRecord         = _idRecord;
                reserveRoom.Show();
            }
        }