public CustomerCollectionViewModel ShowCustomersWithAddressInRegion(CountryRegion region, [ContributedAction] IQueryable<Customer> customers) {
     throw new NotImplementedException();
     //List<Customer> cc = customers.Where(c => c.Addresses.Any(a => a.Address.StateProvince.CountryRegion == region)).ToList();
     //var ccvm = Container.NewViewModel<CustomerCollectionViewModel>();
     //ccvm.Customers = cc.ToList();
     //return ccvm;
 }
        private IList<StateProvince> StateProvincesForCountry(CountryRegion country) {
            var query = from obj in Container.Instances<StateProvince>()
                where obj.CountryRegion.CountryRegionCode == country.CountryRegionCode
                orderby obj.Name
                select obj;

            return query.ToList();
        }
        public CustomerCollectionViewModel ShowCustomersWithAddressInRegion(CountryRegion region, [ContributedAction] IQueryable <Customer> customers)
        {
            List <Customer> cc   = customers.Where(c => c.Addresses.Any(a => a.Address.StateProvince.CountryRegion == region)).ToList();
            var             ccvm = Container.NewViewModel <CustomerCollectionViewModel>();

            ccvm.Customers = cc.ToList();
            return(ccvm);
        }
Example #4
0
 public CustomerCollectionViewModel ShowCustomersWithAddressInRegion(CountryRegion region, [ContributedAction] IQueryable <Customer> customers)
 {
     throw new NotImplementedException();
     //List<Customer> cc = customers.Where(c => c.Addresses.Any(a => a.Address.StateProvince.CountryRegion == region)).ToList();
     //var ccvm = Container.NewViewModel<CustomerCollectionViewModel>();
     //ccvm.Customers = cc.ToList();
     //return ccvm;
 }
Example #5
0
        private IList <StateProvince> StateProvincesForCountry(CountryRegion country)
        {
            var query = from obj in Container.Instances <StateProvince>()
                        where obj.CountryRegion.CountryRegionCode == country.CountryRegionCode
                        orderby obj.Name
                        select obj;

            return(query.ToList());
        }
        public string Validate(CountryRegion countryRegion, StateProvince stateProvince) {
            IList<StateProvince> valid = StateProvincesForCountry(countryRegion);

            if (valid.Contains(stateProvince)) {
                return null;
            }

            return "Invalid region";
        }
Example #7
0
        private IList <StateProvince> StateProvincesForCountry(CountryRegion country, IQueryable <StateProvince> stateProvinces)
        {
            var query = from obj in stateProvinces
                        where obj.CountryRegion.CountryRegionCode == country.CountryRegionCode
                        orderby obj.Name
                        select obj;

            return(query.ToList());
        }
Example #8
0
        public string Validate(CountryRegion countryRegion, StateProvince stateProvince)
        {
            IList <StateProvince> valid = StateProvincesForCountry(countryRegion);

            if (valid.Contains(stateProvince))
            {
                return(null);
            }

            return("Invalid region");
        }
 public IList<Customer> ShowCustomersWithAddressInRegion(CountryRegion region, IQueryable<Customer> customers)
 {
     return customers.Where(c => c.Addresses.Any(a => a.Address.CountryRegion == region)).ToList();
 }
 public IList<StateProvince> ChoicesStateProvince(CountryRegion countryRegion) {
     return countryRegion != null ? StateProvincesForCountry(countryRegion) : new List<StateProvince>();
 }
Example #11
0
 public CustomerCollectionViewModel ShowCustomersWithAddressInRegion(CountryRegion region, IQueryable<Customer> customers) {
     List<Customer> cc = customers.Where(c => c.Addresses.Any(a => a.Address.StateProvince.CountryRegion == region)).ToList();
     var ccvm = Container.NewViewModel<CustomerCollectionViewModel>();
     ccvm.Customers = cc.ToList();
     return ccvm;
 }
 public static CountryRegion Updating(CountryRegion cr, IContext context) => cr with
Example #13
0
 public IList <StateProvince> ChoicesStateProvince(CountryRegion countryRegion)
 {
     return(countryRegion != null?StateProvincesForCountry(countryRegion) : new List <StateProvince>());
 }
 /// <summary>
 /// Create a new CountryRegion object.
 /// </summary>
 /// <param name="countryRegionCode">Initial value of the CountryRegionCode property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
 public static CountryRegion CreateCountryRegion(global::System.String countryRegionCode, global::System.String name, global::System.DateTime modifiedDate)
 {
     CountryRegion countryRegion = new CountryRegion();
     countryRegion.CountryRegionCode = countryRegionCode;
     countryRegion.Name = name;
     countryRegion.ModifiedDate = modifiedDate;
     return countryRegion;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the CountryRegions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCountryRegions(CountryRegion countryRegion)
 {
     base.AddObject("CountryRegions", countryRegion);
 }