コード例 #1
0
        public static Address CreateSavedAddress(ContactPerson contactPerson)
        {
            Address address = CreateUnsavedAddress(contactPerson);

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

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

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

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

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

            cp.Save();
            return(cp);
        }
コード例 #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));
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #10
0
ファイル: Address.cs プロジェクト: kevinbosman/habanero
 private static Address CreateUnsavedAddress(ContactPerson contactPerson)
 {
     return CreateUnsavedAddress(contactPerson.ContactPersonID);
 }
コード例 #11
0
ファイル: Address.cs プロジェクト: kevinbosman/habanero
 private static Address CreateUnsavedAddress(ContactPerson contactPerson, string firstLine)
 {
     return CreateUnsavedAddress(contactPerson.ContactPersonID, firstLine);
 
 }
コード例 #12
0
ファイル: Address.cs プロジェクト: kevinbosman/habanero
 public static Address CreateSavedAddress(ContactPerson contactPerson)
 {
     Address address = CreateUnsavedAddress(contactPerson);
     address.Save();
     return address;
 }
コード例 #13
0
ファイル: Address.cs プロジェクト: kevinbosman/habanero
 public static Address CreateSavedAddress(ContactPerson contactPerson, string firstLine)
 {
     Address address = CreateUnsavedAddress(contactPerson, firstLine);
     address.Save();
     return address;
 }
コード例 #14
0
ファイル: Car.cs プロジェクト: kevinbosman/habanero
 public static Car CreateSavedCar(string regno, ContactPerson owner)
 {
     Car car = CreateUnsavedCar(regno, owner);
     car.Save();
     return car;
 }
コード例 #15
0
 private static Address CreateUnsavedAddress(ContactPerson contactPerson, string firstLine)
 {
     return(CreateUnsavedAddress(contactPerson.ContactPersonID, firstLine));
 }
コード例 #16
0
ファイル: Car.cs プロジェクト: kevinbosman/habanero
 private static Car CreateUnsavedCar(string regno, ContactPerson owner)
 {
     Car car = new Car();
     if (owner != null) car.OwnerID = owner.ContactPersonID;
     car.CarRegNo = regno;
     return car;
 }
コード例 #17
0
 private static Address CreateUnsavedAddress(ContactPerson contactPerson)
 {
     return(CreateUnsavedAddress(contactPerson.ContactPersonID));
 }
コード例 #18
0
ファイル: ContactPerson.cs プロジェクト: kevinbosman/habanero
 private static ContactPerson CreateUnsavedContactPerson(string surname, string firstName)
 {
     ContactPerson cp = new ContactPerson();
     cp.FirstName = firstName;
     cp.Surname = surname;
     return cp;
 }