protected void customerSearchByHttpBtn_Click(object sender, EventArgs e)
 {
     CarRentalService.ICustomerService client  = new CarRentalService.CustomerServiceClient("WSHttpBinding_ICustomerService");
     CarRentalService.CustomerRequest  request = new CarRentalService.CustomerRequest();
     request.LicenseKey = "secret";
     request.CustomerId = Convert.ToInt32(customerIdTxt.Text);
     CarRentalService.CustomerInfo customer = null;
     try
     {
         customer          = client.GetCustomer(request);
         txtFirstName.Text = customer.FirstName;
         txtLastName.Text  = customer.LastName;
         txtMobile.Text    = customer.Mobile;
         txtEmail.Text     = customer.Email;
         customerTypeDropDownList.SelectedValue = ((int)customer.CustomerType).ToString();
         if (customer.CustomerType == CarRentalService.CustomerType.ContractCustomer)
         {
             txtDiscount.Text   = customer.Discount.ToString();
             trdiscount.Visible = true;
         }
         else
         {
             txtDiscount.Visible = false;
         }
         lblMessageUpdateCustomer.Text = "Customer Found";
     }
     catch (Exception ex)
     {
         lblMessageUpdateCustomer.Text = "Customer Not Found";
         client   = new CarRentalService.CustomerServiceClient("WSHttpBinding_ICustomerService");
         customer = null;
     }
 }
 protected void btnDeleteCustomer_Click(object sender, EventArgs e)
 {
     CarRentalService.ICustomerService client  = new CarRentalService.CustomerServiceClient("WSHttpBinding_ICustomerService");
     CarRentalService.CustomerRequest  request = new CarRentalService.CustomerRequest();
     request.LicenseKey = "secret";
     request.CustomerId = Convert.ToInt32(deleteCustomerTxt.Text);
     client.DeleteCustomer(request);
     deleteMessage.Text = "Customer is deleted";
 }
        protected void searchingBookingBtn_Click(object sender, EventArgs e)
        {
            CarRentalService.ICarRentalService client  = new CarRentalService.CarRentalServiceClient("WSHttpBinding_ICarRentalService");
            CarRentalService.IBookingService   client1 = new CarRentalService.BookingServiceClient("WSHttpBinding_IBookingService");
            CarRentalService.ICustomerService  client2 = new CarRentalService.CustomerServiceClient("WSHttpBinding_ICustomerService");

            CarRentalService.BookingRequest  request         = new CarRentalService.BookingRequest();
            CarRentalService.CustomerRequest customerRequest = new CarRentalService.CustomerRequest();
            CarRentalService.CarRequest      carRequest      = new CarRentalService.CarRequest();
            request.LicenseKey = "secret";
            request.BookingId  = Convert.ToInt32(txtReturningCar.Text);

            CarRentalService.BookingInfo booking = client1.GetBooking(request);
            customerRequest.LicenseKey = "secret";
            customerRequest.CustomerId = booking.CustomerId;

            carRequest.CarId      = booking.CarId;
            carRequest.LicenseKey = "secret";

            CarRentalService.CustomerInfo customer = client2.GetCustomer(customerRequest);
            CarRentalService.CarInfo      car      = client.GetCar(carRequest);

            startTimeTxt.Text  = booking.StartTime.ToString();
            returnTimeTxt.Text = booking.ReturnTime.ToString();

            customerFirstNameTxt.Text = customer.FirstName;
            customerLastNameTxt.Text  = customer.LastName;
            customerEmailTxt.Text     = customer.Email;

            carRegisterNumberTxt.Text = car.RegisterNumber;
            carBrandTxt.Text          = car.Brand;
            carModelTxt.Text          = car.Model;
            carYearTxt.Text           = car.Year.ToString();
            carDayRentTxt.Text        = car.DayRent.ToString();
            lblMessageReturning.Text  = "Booking found";
        }