コード例 #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();
     }
 }
コード例 #2
0
        public JsonResult Update(RoomDTO dto)
        {
            var manager = this.GetManagerFor<IRoomManager>();
            var result = manager.Update(dto);
            var resultDTO = new RoomDTO(result);

            return Json(resultDTO);
        }
コード例 #3
0
        public JsonResult Get(int id, IEnumerable<string> query)
        {
            var queries = new Query[] { };

            if (query != null)
            {
                queries = query.Select(q => new Query { Name = q }).ToArray();
            }

            var manager = this.GetManagerFor<IRoomManager>();
            var result = manager.GetById(id);
            var resultDTO = new RoomDTO(queries, result);

            return Json(resultDTO);
        }