public OrderDetailImpl(Order order, Product product, Double unitPrice, Int32 quantity) { markNew(); m_Order = new ToOneRelation(typeof(Order), "OrderID", null); m_Product = new ToOneRelation(typeof(Product), "ProductID", null); m_Product.Object = product; m_UnitPrice = unitPrice; m_Quantity = quantity; m_Order.Object = order; }
public OrderImpl(Person person, DateTime orderDate, DateTime shippedDate, String orderState) { markNew(); m_Person = new ToOneRelation(typeof(Person), "PersonID", null); m_OrderDetails = new ToManyRelation(typeof(OrderDetail), "OrderID", null, true); m_ShippedDate = shippedDate; m_OrderState = orderState; m_OrderDate = orderDate; m_Person.Object = person; }
public AddressImpl(Person person, String city, String street, String postalCode, String phone, String email) { markNew(); m_Person = new ToOneRelation(typeof(Person), "PersonID", null); m_Email = email; m_Street = street; m_City = city; m_Phone = phone; m_Person.Object = person; m_PostalCode = postalCode; }
internal EmployeeImpl( Key id, Timestamp timestamp, params DictionaryEntry[] parameters) { markClean(); m_id = id; m_timestamp = timestamp; FieldInfo fInfo; Type thisType = this.GetType(); Type domainObjectType = typeof(Employee); IEnumerator enumerator = parameters.GetEnumerator(); while(enumerator.MoveNext()) { if(((DictionaryEntry)enumerator.Current).Value != null) { if(((DictionaryEntry)enumerator.Current).Value.GetType() == typeof(ToOneRelation)) { if((String)((DictionaryEntry)enumerator.Current).Key == "ReportsTo") { m_ReportsTo = (ToOneRelation)((DictionaryEntry)enumerator.Current).Value; continue; } } if(((DictionaryEntry)enumerator.Current).Value.GetType() == typeof(ToManyRelation)) { if((String)((DictionaryEntry)enumerator.Current).Key == "ReportedBy") { m_ReportedBy = (ToManyRelation)((DictionaryEntry)enumerator.Current).Value; continue; } if((String)((DictionaryEntry)enumerator.Current).Key == "EmployeeTerritories") { m_EmployeeTerritories = (ToManyRelation)((DictionaryEntry)enumerator.Current).Value; continue; } } } if(this.GetType().GetProperty((String)((DictionaryEntry)enumerator.Current).Key) != null) { string variable = "m_" + (String)((DictionaryEntry)enumerator.Current).Key; if((fInfo = thisType.GetField(variable, BindingFlags.DeclaredOnly|BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Instance)) != null) { fInfo.SetValue(this, ((DictionaryEntry)enumerator.Current).Value); } } } }
public EmployeeImpl() { markNew(); m_ReportsTo = new ToOneRelation(typeof(Employee), "ReportsTo", null); }
public EmployeeTerritoryImpl() { markNew(); m_Employee = new ToOneRelation(typeof(Employee), "EmployeeID", null); m_Territory = new ToOneRelation(typeof(Territory), "TerritoryID", null); }