예제 #1
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     using (CustomerSTEServiceClient proxy = new CustomerSTEServiceClient())
     {
         var cust = new OrderIT.Model.STE.Customer()
         {
             Name           = CustomerName.Text,
             BillingAddress = new OrderIT.Model.STE.AddressInfo()
             {
                 Address = BillingAddress.Text,
                 City    = BillingCity.Text,
                 Country = BillingCountry.Text,
                 ZipCode = BillingZipCode.Text
             },
             ShippingAddress = new OrderIT.Model.STE.AddressInfo()
             {
                 Address = ShippingAddress.Text,
                 City    = ShippingCity.Text,
                 Country = ShippingCountry.Text,
                 ZipCode = ShippingZipCode.Text
             },
         };
         var id = proxy.CreateCustomerUsingSTE(cust);
         MessageBox.Show("Customer created with id " + id);
     }
 }
예제 #2
0
 private void btnRetrieveById_Click(object sender, EventArgs e)
 {
     using (CustomerSTEServiceClient proxy = new CustomerSTEServiceClient())
     {
         _customer            = proxy.ReadCustomerUsingSTE(Convert.ToInt32(CustomerId.Text));
         CustomerName.Text    = _customer == null ? String.Empty :_customer.Name;
         CustomerId.Tag       = _customer == null ? null :_customer.Version;
         BillingAddress.Text  = _customer == null ? String.Empty :_customer.BillingAddress.Address;
         BillingCity.Text     = _customer == null ? String.Empty :_customer.BillingAddress.City;
         BillingCountry.Text  = _customer == null ? String.Empty :_customer.BillingAddress.Country;
         BillingZipCode.Text  = _customer == null ? String.Empty :_customer.BillingAddress.ZipCode;
         ShippingAddress.Text = _customer == null ? String.Empty :_customer.ShippingAddress.Address;
         ShippingCity.Text    = _customer == null ? String.Empty :_customer.ShippingAddress.City;
         ShippingCountry.Text = _customer == null ? String.Empty :_customer.ShippingAddress.Country;
         ShippingZipCode.Text = _customer == null ? String.Empty :_customer.ShippingAddress.ZipCode;
         if (_customer == null)
         {
             MessageBox.Show("UserID doesn't exist");
         }
     }
 }
예제 #3
0
 public void UpdateSTE(OrderIT.Model.STE.Customer customer)
 {
     base.Channel.UpdateSTE(customer);
 }