Beispiel #1
0
        public static Address CreateSavedAddress(ContactPerson contactPerson)
        {
            Address address = CreateUnsavedAddress(contactPerson);

            address.Save();
            return(address);
        }
Beispiel #2
0
        public static ContactPerson CreateSavedContactPerson(string surname)
        {
            ContactPerson cp = CreateUnsavedContactPerson(surname);

            cp.Save();
            return(cp);
        }
Beispiel #3
0
        public static Address CreateSavedAddress(ContactPerson contactPerson, string firstLine)
        {
            Address address = CreateUnsavedAddress(contactPerson, firstLine);

            address.Save();
            return(address);
        }
Beispiel #4
0
        public static Car CreateSavedCar(string regno, ContactPerson owner)
        {
            Car car = CreateUnsavedCar(regno, owner);

            car.Save();
            return(car);
        }
Beispiel #5
0
        private static ContactPerson CreateUnsavedContactPerson(string surname, string firstName)
        {
            ContactPerson cp = new ContactPerson();

            cp.FirstName = firstName;
            cp.Surname   = surname;
            return(cp);
        }
Beispiel #6
0
        public static ContactPerson CreateSavedContactPerson()
        {
            new Engine(); new Car();
            ContactPerson cp = CreateUnsavedContactPerson();

            cp.Save();
            return(cp);
        }
Beispiel #7
0
        public static Engine CreateEngineWithCarWithContact(out string surname, out string regno, out string engineNo)
        {
            regno    = TestUtil.GetRandomString();
            engineNo = TestUtil.GetRandomString();
            surname  = TestUtil.GetRandomString();
            ContactPerson owner = ContactPerson.CreateSavedContactPerson(surname);
            Car           car   = Car.CreateSavedCar(regno, owner);

            return(CreateSavedEngine(car, engineNo));
        }
Beispiel #8
0
        private static Car CreateUnsavedCar(string regno, ContactPerson owner)
        {
            Car car = new Car();

            if (owner != null)
            {
                car.OwnerID = owner.ContactPersonID;
            }
            car.CarRegNo = regno;
            return(car);
        }
Beispiel #9
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 primary Key</param>
        /// <returns>The loaded business object</returns>
        /// <exception cref="BusObjDeleteConcurrencyControlException">
        ///  if the object has been deleted already</exception>
        public static ContactPerson GetContactPerson(IPrimaryKey id)
        {
            //ContactPerson myContactPerson = null;
            //if (BusinessObjectManager.Instance.Contains(id))
            //{
            //    myContactPerson = (ContactPerson) BusinessObjectManager.Instance[id];
            //}

            //if (myContactPerson == null)
            //{
            ContactPerson myContactPerson = BORegistry.DataAccessor.BusinessObjectLoader.GetBusinessObject <ContactPerson>(id);

//            }
            return(myContactPerson);
        }
Beispiel #10
0
 private static Address CreateUnsavedAddress(ContactPerson contactPerson)
 {
     return CreateUnsavedAddress(contactPerson.ContactPersonID);
 }
Beispiel #11
0
 private static Address CreateUnsavedAddress(ContactPerson contactPerson, string firstLine)
 {
     return CreateUnsavedAddress(contactPerson.ContactPersonID, firstLine);
 
 }
Beispiel #12
0
 public static Address CreateSavedAddress(ContactPerson contactPerson)
 {
     Address address = CreateUnsavedAddress(contactPerson);
     address.Save();
     return address;
 }
Beispiel #13
0
 public static Address CreateSavedAddress(ContactPerson contactPerson, string firstLine)
 {
     Address address = CreateUnsavedAddress(contactPerson, firstLine);
     address.Save();
     return address;
 }
Beispiel #14
0
 public static Car CreateSavedCar(string regno, ContactPerson owner)
 {
     Car car = CreateUnsavedCar(regno, owner);
     car.Save();
     return car;
 }
Beispiel #15
0
 private static Address CreateUnsavedAddress(ContactPerson contactPerson, string firstLine)
 {
     return(CreateUnsavedAddress(contactPerson.ContactPersonID, firstLine));
 }
Beispiel #16
0
 private static Car CreateUnsavedCar(string regno, ContactPerson owner)
 {
     Car car = new Car();
     if (owner != null) car.OwnerID = owner.ContactPersonID;
     car.CarRegNo = regno;
     return car;
 }
Beispiel #17
0
 private static Address CreateUnsavedAddress(ContactPerson contactPerson)
 {
     return(CreateUnsavedAddress(contactPerson.ContactPersonID));
 }
Beispiel #18
0
 private static ContactPerson CreateUnsavedContactPerson(string surname, string firstName)
 {
     ContactPerson cp = new ContactPerson();
     cp.FirstName = firstName;
     cp.Surname = surname;
     return cp;
 }