public PersonImpl(String name, String password) { markNew(); m_Addresses = new ToManyRelation(typeof(Address), "PersonID", null, true); m_Orders = new ToManyRelation(typeof(Order), "PersonID", null, true); m_Password = password; m_Name = name; }
public ProductImpl(String productName, Double quantityPerUnit, Double unitPrice, String category) { markNew(); m_OrderDetails = new ToManyRelation(typeof(OrderDetail), "ProductID", null, true); m_UnitPrice = unitPrice; m_Category = category; m_ProductName = productName; m_QuantityPerUnit = quantityPerUnit; }
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; }
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); } } } }