未能找到类型或命名空间名称“RoomServiceClient”(是否缺少 using 指令或程序集引用?)
E:\cs\RoomReservation\RoomReservationClient\MainWindow.xaml.cs
服务引用也添加了,名称是RoomReservationService
搞来搞去还是出错。
书上是第1342页(第七版)using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using RoomReservationData.RoomReservationService;namespace RoomReservationData
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }        private void OnReserveRoom(object sender, RoutedEventArgs e)
        {
            var reservation = new RoomReservations()
            {
                RoomName = textRoom.Text,
                Event = textEvent.Text,
                Contact = textContact.Text,
                StartDate = DateTime.Parse(textStartTime.Text),
                EndDate = DateTime.Parse(textEndTime.Text)
            };            var client = new RoomServiceClient();
            bool reserved = client.ReserveRoom(reservation);
            client.Close();
            if (reserved)
                MessageBox.Show("reservation ok");
        }
    }
}