private void btnCreate_Click(object sender, RoutedEventArgs e) { h_Name = tbxName.Text; WCF = new WebService.Service1Client(); WCF.checkAccAsync(h_Name); WCF.checkAccCompleted += new EventHandler <checkAccCompletedEventArgs>(WCF_checkAccCompleted); }
private void btnDeleteInfo_Click(object sender, RoutedEventArgs e) { selected = false; WCF = new WebService.Service1Client(); WCF.DeleteAccommodationAsync(Convert.ToInt32(lblHiddenID.Content)); WCF.DeleteAccommodationCompleted += new EventHandler <DeleteAccommodationCompletedEventArgs>(WCF_DeleteAccommodationCompleted); }
private void btnSearch_Click(object sender, RoutedEventArgs e) { h_Name = tbxSearch.Text; WCF = new WebService.Service1Client(); WCF.retrieveHotelAsync(h_Name); WCF.retrieveHotelCompleted += new EventHandler <retrieveHotelCompletedEventArgs>(WCF_retrieveHotelCompleted); }
void loadDictionary() { lbxSearch.ItemsSource = null; WCF = new WebService.Service1Client(); WCF.retrieveDictionaryAsync(); WCF.retrieveDictionaryCompleted += new EventHandler <retrieveDictionaryCompletedEventArgs>(WCF_retrieveDictionaryCompleted); }
void WCF_UpdateAccommodationCompleted(object sender, WebService.UpdateAccommodationCompletedEventArgs e) { if (e.Result == true) { MessageBox.Show("Hotel Information Updated Successfully!", "Update Hotel Info", MessageBoxButton.OK); btnUpdate.IsEnabled = false; btnDelete.IsEnabled = false; WCF = new WebService.Service1Client(); WCF.retrieveHotelAsync(lblName.Content.ToString()); WCF.retrieveHotelCompleted += new EventHandler <retrieveHotelCompletedEventArgs>(WCF_retrieveHotelCompleted); } else { MessageBox.Show("Unable to update hotel information!", "Update Hotel Info", MessageBoxButton.OK); } }
private void btnUpdateInfo_Click(object sender, RoutedEventArgs e) { acc = new Accommodation(); LowPrice = Convert.ToDouble(tbxUpdatePrice.Text); HighPrice = Convert.ToDouble(tbxupdatehighprice.Text); if (LowPrice < HighPrice) { acc.HID = Convert.ToInt32(lblHiddenID.Content); acc.H_Name = lblName.Content.ToString(); acc.H_Address = tbxUpdateAddress.Text; acc.Low_price = LowPrice; acc.H_Latitude = Convert.ToDouble(tbxUpdateLatitude.Text); acc.H_Longitude = Convert.ToDouble(tbxUpdateLongitude.Text); acc.H_descript = tbxUpdateDescription.Text; acc.H_Facilities = tbxUpdateFacilities.Text; acc.High_price = HighPrice; if (bytes != null) { acc.H_Img = bytes; } else { acc.H_Img = prevBytes; } selected = false; WCF = new WebService.Service1Client(); WCF.UpdateAccommodationAsync(acc); WCF.UpdateAccommodationCompleted += new EventHandler <UpdateAccommodationCompletedEventArgs>(WCF_UpdateAccommodationCompleted); } else { MessageBox.Show("The value of low price cannot be more than the value of high price!", "Error Message", MessageBoxButton.OK); } }
void WCF_checkAccCompleted(object sender, WebService.checkAccCompletedEventArgs e) { if (e.Result == true) { MessageBox.Show("Identical Data found!", "Insert", MessageBoxButton.OK); } else { string oFac = ""; h_Address = tbxAddress.Text; LowPrice = Convert.ToDouble(tbxinlowPrice.Text); h_Latitude = Convert.ToDouble(tbxLatitude.Text); h_Longitude = Convert.ToDouble(tbxLongitude.Text); h_descript = tbxDescription.Text; HighPrice = Convert.ToDouble(tbxinHighPrice.Text); img = bytes; acc = new Accommodation(); if (LowPrice < HighPrice) { acc.H_Name = h_Name; acc.H_Address = h_Address; acc.H_Latitude = h_Latitude; acc.H_Longitude = h_Longitude; acc.H_descript = h_descript; if (chkSwim.IsChecked == true) { checkSwim = chkSwim.Content.ToString(); } if (chkShopping.IsChecked == true) { checkShop = chkShopping.Content.ToString(); } if (chkRestaurants.IsChecked == true) { checkRestaurant = chkRestaurants.Content.ToString(); } if (chkKids.IsChecked == true) { checkKid = chkKids.Content.ToString(); } if (chkJacuzzi.IsChecked == true) { checkJacuzzi = chkJacuzzi.Content.ToString(); } if (chkFitness.IsChecked == true) { checkFitness = chkFitness.Content.ToString(); } if (chkConference.IsChecked == true) { checkCon = chkConference.Content.ToString(); } if (!tbxFacilities.Text.Equals("")) { oFac = tbxFacilities.Text; } h_Facilities = checkSwim; h_Facilities += " " + checkShop; h_Facilities += " " + checkRestaurant; h_Facilities += " " + checkKid; h_Facilities += " " + checkJacuzzi; h_Facilities += " " + checkFitness; h_Facilities += " " + checkCon; h_Facilities += " " + oFac; acc.H_Facilities = h_Facilities; acc.H_Img = img; acc.Low_price = LowPrice; acc.High_price = HighPrice; WCF = new WebService.Service1Client(); WCF.InsertAccommodationAsync(acc); WCF.InsertAccommodationCompleted += new EventHandler <InsertAccommodationCompletedEventArgs>(WCF_InsertAccommodationCompleted); } else { MessageBox.Show("The value of low price cannot be more than the value of high price!", "Error Message", MessageBoxButton.OK); } } }