Example #1
0
 /// <summary>
 /// Create a new Customer object.
 /// </summary>
 /// <param name="customerID">Initial value of the CustomerID property.</param>
 /// <param name="companyName">Initial value of the CompanyName property.</param>
 public static Customer CreateCustomer(global::System.String customerID, global::System.String companyName)
 {
     Customer customer = new Customer();
     customer.CustomerID = customerID;
     customer.CompanyName = companyName;
     return customer;
 }
Example #2
0
File: Order.cs Project: akapet/MCPD
        private void FixupCustomer(Customer previousValue, bool skipKeys = false)
        {
            if (IsDeserializing)
            {
                return;
            }

            if (previousValue != null && previousValue.Orders.Contains(this))
            {
                previousValue.Orders.Remove(this);
            }

            if (Customer != null)
            {
                if (!Customer.Orders.Contains(this))
                {
                    Customer.Orders.Add(this);
                }

                CustomerID = Customer.CustomerID;
            }
            else if (!skipKeys)
            {
                CustomerID = null;
            }

            if (ChangeTracker.ChangeTrackingEnabled)
            {
                if (ChangeTracker.OriginalValues.ContainsKey("Customer")
                    && (ChangeTracker.OriginalValues["Customer"] == Customer))
                {
                    ChangeTracker.OriginalValues.Remove("Customer");
                }
                else
                {
                    ChangeTracker.RecordOriginalValue("Customer", previousValue);
                }
                if (Customer != null && !Customer.ChangeTracker.ChangeTrackingEnabled)
                {
                    Customer.StartTracking();
                }
            }
        }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Customers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCustomers(Customer customer)
 {
     base.AddObject("Customers", customer);
 }