Ejemplo n.º 1
0
 private static Order CreateOrder(List<LineItem> productList, BLHCustomer customer)
 {
     Order order = new Order();
     order.CustomerNumber = customer.CustomerID;
     order.FirstName = customer.FirstName;
     order.LastName = customer.LastName;
     order.ZipCode = customer.Zip;
     string productListAsString = CreateProductList(productList);
     order.ProductList = productListAsString;
     order.ShippingCost = GetShippingCost("");
     order.TotalCost = GetProductTotals(productList) + order.ShippingCost;
     return order;
 }
Ejemplo n.º 2
0
 private void AddCustomer()
 {
     BLHCustomer newCustomer = new BLHCustomer();
     newCustomer.FirstName = FirstNameTb.Text;
     newCustomer.LastName = LastNameTb.Text;
     newCustomer.Address = AddressTb.Text;
     newCustomer.Apt = AptTb.Text;
     newCustomer.City = CityTb.Text;
     newCustomer.State = StateTb.Text;
     newCustomer.Zip = ZipCodeTb.Text;
     newCustomer.Phone = PhoneTb.Text;
     newCustomer.Email = EmailTb.Text;
     newCustomer.AVS = AVSTb.Text;
     newCustomer.Birthday = BirthdayTb.Text;
     manager.AddCustomer(newCustomer);
 }
Ejemplo n.º 3
0
 public void ViewCustomer(BLHCustomer customer)
 {
     CustomerIDTb.Text = customer.CustomerID.ToString();
     FirstNameTb.Text = customer.FirstName;
     LastNameTb.Text = customer.LastName;
     AddressTb.Text = customer.Address;
     AptTb.Text = customer.Apt;
     CityTb.Text = customer.City;
     StateTb.Text = customer.State;
     ZipCodeTb.Text = customer.Zip;
     PhoneTb.Text = customer.Phone;
     EmailTb.Text = customer.Email;
     AVSTb.Text = customer.AVS;
     BirthdayTb.Text = customer.Birthday;
     List<Order> orderHistory = Order.FindOrdersByCustomer(customer.CustomerID).ToList();
     OrderHistoryDg.ItemsSource = orderHistory;
 }
 /// <summary>
 /// Create a new BLHCustomer object.
 /// </summary>
 /// <param name="customerID">Initial value of the CustomerID property.</param>
 /// <param name="firstName">Initial value of the FirstName property.</param>
 /// <param name="lastName">Initial value of the LastName property.</param>
 /// <param name="address">Initial value of the Address property.</param>
 /// <param name="city">Initial value of the City property.</param>
 /// <param name="state">Initial value of the State property.</param>
 /// <param name="zip">Initial value of the Zip property.</param>
 /// <param name="phone">Initial value of the Phone property.</param>
 public static BLHCustomer CreateBLHCustomer(global::System.Int32 customerID, global::System.String firstName, global::System.String lastName, global::System.String address, global::System.String city, global::System.String state, global::System.String zip, global::System.String phone)
 {
     BLHCustomer bLHCustomer = new BLHCustomer();
     bLHCustomer.CustomerID = customerID;
     bLHCustomer.FirstName = firstName;
     bLHCustomer.LastName = lastName;
     bLHCustomer.Address = address;
     bLHCustomer.City = city;
     bLHCustomer.State = state;
     bLHCustomer.Zip = zip;
     bLHCustomer.Phone = phone;
     return bLHCustomer;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the BLHCustomers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBLHCustomers(BLHCustomer bLHCustomer)
 {
     base.AddObject("BLHCustomers", bLHCustomer);
 }
Ejemplo n.º 6
0
 public void AddCustomer(BLHCustomer customer)
 {
     Customers.BLHCustomers.AddObject(customer);
     Customers.SaveChanges();
 }
Ejemplo n.º 7
0
 private BLHCustomer CreateCustomerFromLine(string line)
 {
     BLHCustomer customer = new BLHCustomer();
     string[] splitCustomer = line.Split(',');
     customer.FirstName = splitCustomer[0];
     customer.LastName = splitCustomer[1];
     customer.Address = splitCustomer[2];
     customer.Apt = splitCustomer[3];
     customer.City = splitCustomer[4];
     customer.State = splitCustomer[5];
     customer.Zip = splitCustomer[6];
     customer.Phone = splitCustomer[7];
     customer.Email = splitCustomer[8];
     customer.AVS = splitCustomer[9];
     customer.Birthday = splitCustomer[10];
     return customer;
 }