Ejemplo n.º 1
0
        protected async Task <Guid> ProcessVenue(string lookupId, Guid?countryGuid)
        {
            var lookupVenueSearch = await Provider.GetLookupVenue(ImportSite, lookupId);

            if (lookupVenueSearch != null)
            {
                return(lookupVenueSearch.VenueGuid);
            }
            else
            {
                var venueGuid = Guid.NewGuid();

                Provider.Add(new Venue()
                {
                    PrimaryKey = venueGuid
                });

                var venueV = VenueV.CreateNew <VenueV>(User.GetUserId());
                venueV.HeaderKey     = venueGuid;
                venueV.VenueName     = lookupId;
                venueV.CountryGuid   = (Guid)countryGuid;
                venueV.EffectiveFrom = Date.LowDate;
                venueV.EffectiveTo   = Date.HighDate;

                Provider.Add(venueV);

                Provider.Add(new LookupVenue()
                {
                    PrimaryKey = Guid.NewGuid(),
                    ImportSite = ImportSite,
                    VenueGuid  = venueGuid,
                    LookupId   = lookupId
                });

                Provider.SaveChanges();

                return(venueGuid);
            }
        }