Exemplo n.º 1
0
        public static ContactPersonCompositeKey CreateSavedContactPerson()
        {
            ContactPersonCompositeKey contact = CreateUnsavedContactPerson();

            contact.Save();
            return(contact);
        }
Exemplo n.º 2
0
        public static ContactPersonCompositeKey CreateUnsavedContactPerson()
        {
            ContactPersonCompositeKey contact = new ContactPersonCompositeKey();

            contact.PK1Prop1 = TestUtil.GetRandomString();
            contact.PK1Prop2 = TestUtil.GetRandomString();
            return(contact);
        }
Exemplo n.º 3
0
        /// <summary>
        /// returns the ContactPerson identified by id.
        /// </summary>
        /// <remarks>
        /// If the Contact person is already leaded then an identical copy of it will be returned.
        /// </remarks>
        /// <param name="id">The object Value</param>
        /// <returns>The loaded business object</returns>
        /// <exception cref="BusObjDeleteConcurrencyControlException">
        ///  if the object has been deleted already</exception>
        public static ContactPersonCompositeKey GetContactPersonCompositeKey(IPrimaryKey id)
        {
            //ContactPersonCompositeKey myContactPerson =
            //    (ContactPersonCompositeKey) BOLoader.Instance.GetLoadedBusinessObject(id);
            //if (myContactPerson == null)
            //{
            ContactPersonCompositeKey myContactPerson =
                BORegistry.DataAccessor.BusinessObjectLoader.GetBusinessObject <ContactPersonCompositeKey>(id);

//            }
            return(myContactPerson);
        }
 public static ContactPersonCompositeKey CreateUnsavedContactPerson()
 {
     ContactPersonCompositeKey contact = new ContactPersonCompositeKey();
     contact.PK1Prop1 = TestUtil.GetRandomString();
     contact.PK1Prop2 = TestUtil.GetRandomString();
     return contact;
 }
Exemplo n.º 5
0
 public void Test_HashCode_CompositeKey_Edited()
 {
     //---------------Set up test pack-------------------
     ClassDef.ClassDefs.Clear();
     BORegistry.DataAccessor = new DataAccessorInMemory();
     new Car();
     ContactPersonCompositeKey contactPerson = new ContactPersonCompositeKey();
     contactPerson.Save();
     object originalHashCodeAfterSave = contactPerson.ID.GetHashCode();
     //---------------Execute Test ----------------------
     contactPerson.PK1Prop1 = TestUtil.GetRandomString();
     contactPerson.Save();
     object hashCodeAfterSecondSaving = contactPerson.ID.GetHashCode();
     //---------------Test Result -----------------------
     Assert.AreEqual(originalHashCodeAfterSave, hashCodeAfterSecondSaving);
 }