Esempio n. 1
0
        private Country CreateCountry(string Name, string Code)
        {
            Country Country = ObjectSpace.FindObject <Country>(CriteriaOperator.Parse("Name=?", Name));

            if (Country == null)
            {
                Country      = ObjectSpace.CreateObject <Country>();
                Country.Name = Name;
                Country.Code = Code;
            }
            return(Country);
        }
Esempio n. 2
0
        private Customer CreateCustomer(string Name, string Code, Country Country)
        {
            Customer Customer = ObjectSpace.FindObject <Customer>(CriteriaOperator.Parse("Name=?", Name));

            if (Customer == null)
            {
                Customer         = ObjectSpace.CreateObject <Customer>();
                Customer.Name    = Name;
                Customer.Code    = Code;
                Customer.Country = Country;
            }
            return(Customer);
        }