public void TienNghi_Load(int _TienNghiID)
 {
     TienNghiID = _TienNghiID;
     TienNghiClient = new TienNghiSVCClient();
     TienNghiClient.TienNghi_GetItemCompleted += new EventHandler<TienNghi_GetItemCompletedEventArgs>(TienNghiClient_TienNghi_GetItemCompleted);
     TienNghiClient.TienNghi_GetItemAsync(TienNghiID);
 }
        public void Phong_Load(int _PhongID)
        {
            LoaiPhongClient = new LoaiPhongSVCClient();
            LoaiPhongClient.LoaiPhong_GetItemsCompleted += new EventHandler<LoaiPhong_GetItemsCompletedEventArgs>(LoaiPhongClient_LoaiPhong_GetItemsCompleted);
            LoaiPhongClient.LoaiPhong_GetItemsAsync();

            TienNghiClient = new TienNghiSVCClient();
            TienNghiClient.TienNghi_GetItemsCompleted += new EventHandler<TienNghi_GetItemsCompletedEventArgs>(TienNghiClient_TienNghi_GetItemsCompleted);
            TienNghiClient.TienNghi_GetItemsAsync();

            if (_PhongID != 0)
            {
                PhongID = _PhongID;
                PhongClient = new PhongSVCClient();
                PhongClient.Phong_GetItemCompleted += new EventHandler<Phong_GetItemCompletedEventArgs>(PhongClient_Phong_GetItemCompleted);
                PhongClient.Phong_GetItemAsync(PhongID);
            }
        }
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     if (!String.IsNullOrEmpty(txtTienNghi.Text.Trim()))
     {
         TienNghiClient = new TienNghiSVCClient();
         if (TienNghiID == -1)
         {
             TienNghiClient.TienNghi_AddCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(TienNghiClient_TienNghi_AddCompleted);
             TienNghiClient.TienNghi_AddAsync(txtTienNghi.Text, 0);
         }
         else
         {
             TienNghiClient.TienNghi_EditCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(TienNghiClient_TienNghi_EditCompleted);
             TienNghiClient.TienNghi_EditAsync(TienNghiID, txtTienNghi.Text, 0);
         }
     }
     else
     {
         MessageBox.Show("Kiểm tra lại các trường bắt buộc nhập", "Thông báo", MessageBoxButton.OK);
     }
 }