internal void SetUpContact(Contact value)
 {
     Contact = value;
     storeContact = FindStoreContactForContact();
 }
 public override void Persisting()
 {
     if (Customer.IsStore())
     {
         contact = StoreContact.Contact;
     }
     base.Persisting();
 }
Example #3
0
 public Employee CreateNewEmployeeFromContact(Contact contactDetails) {
     var _Employee = NewTransientInstance<Employee>();
     _Employee.ContactDetails = contactDetails;
     return _Employee;
 }
Example #4
0
 public void AddToContacts(Contact contact)
 {
     base.AddObject("Contacts", contact);
 }
Example #5
0
 public static Contact CreateContact (int contactID , bool nameStyle , string firstName , string lastName , int emailPromotion , string passwordHash , string passwordSalt , global::System.Guid rowguid , global::System.DateTime modifiedDate)
 {
     Contact contact = new Contact();
     contact.ContactID = contactID;
     contact.NameStyle = nameStyle;
     contact.FirstName = firstName;
     contact.LastName = lastName;
     contact.EmailPromotion = emailPromotion;
     contact.PasswordHash = passwordHash;
     contact.PasswordSalt = passwordSalt;
     contact.rowguid = rowguid;
     contact.ModifiedDate = modifiedDate;
     return contact;
 }
        private StoreContact FindStoreContactForContact(Contact contact, Customer customer) {
            IQueryable<StoreContact> query = from obj in NakedObjectsFramework.Persistor.Instances<StoreContact>()
                                             where obj.Contact.ContactID == contact.ContactID && obj.Store.CustomerId == customer.CustomerId
                                             select obj;

            return query.FirstOrDefault();
        }