public GeodatalovDataset NewGeodatalovDataset(GeodatalovDatasetViewModel geodatalovViewModel, string parentregister, string registername) { var geodatalovDataset = new GeodatalovDataset(); geodatalovDataset.SystemId = Guid.NewGuid(); geodatalovDataset.Name = geodatalovViewModel.Name; geodatalovDataset.Seoname = RegisterUrls.MakeSeoFriendlyString(geodatalovDataset.Name); geodatalovDataset.Description = geodatalovViewModel.Description; geodatalovDataset.SubmitterId = _registerService.GetOrganizationIdByUserName(); geodatalovDataset.OwnerId = geodatalovViewModel.OwnerId; geodatalovDataset.DateSubmitted = DateTime.Now; geodatalovDataset.Modified = DateTime.Now; geodatalovDataset.RegisterId = _registerService.GetRegisterId(parentregister, registername); geodatalovDataset.VersioningId = _registerItemService.NewVersioningGroup(geodatalovDataset); geodatalovDataset.VersionNumber = 1; geodatalovDataset.StatusId = "Submitted"; geodatalovDataset.Uuid = geodatalovViewModel.Uuid; geodatalovDataset.Notes = geodatalovViewModel.Notes; geodatalovDataset.SpecificUsage = geodatalovViewModel.SpecificUsage; geodatalovDataset.ProductSheetUrl = geodatalovViewModel.ProductSheetUrl; geodatalovDataset.PresentationRulesUrl = geodatalovViewModel.PresentationRulesUrl; geodatalovDataset.ProductSpecificationUrl = geodatalovViewModel.ProductSpecificationUrl; geodatalovDataset.MetadataUrl = geodatalovViewModel.MetadataUrl; geodatalovDataset.DistributionFormat = geodatalovViewModel.DistributionFormat; geodatalovDataset.DistributionUrl = geodatalovViewModel.DistributionUrl; geodatalovDataset.DistributionArea = geodatalovViewModel.DistributionArea; geodatalovDataset.WmsUrl = geodatalovViewModel.WmsUrl; geodatalovDataset.ThemeGroupId = geodatalovViewModel.ThemeGroupId; geodatalovDataset.DatasetThumbnail = geodatalovViewModel.DatasetThumbnail; geodatalovDataset.DokStatusId = "Proposal"; geodatalovDataset.UuidService = geodatalovViewModel.UuidService; GetDeliveryStatuses(geodatalovViewModel, geodatalovDataset); geodatalovDataset.InspireTheme = geodatalovViewModel.InspireTheme; geodatalovDataset.Dok = geodatalovViewModel.Dok; geodatalovDataset.NationalDataset = geodatalovViewModel.NationalDataset; geodatalovDataset.Plan = geodatalovViewModel.Plan; geodatalovDataset.Geodatalov = geodatalovViewModel.Geodatalov; geodatalovDataset.MetadataStatusId = _datasetDeliveryService.CreateDatasetDelivery(geodatalovViewModel.MetadataStatusId, geodatalovViewModel.MetadataNote); geodatalovDataset.ProductSpesificationStatusId = _datasetDeliveryService.CreateDatasetDelivery(geodatalovViewModel.WmsStatusId, geodatalovViewModel.WmsNote); geodatalovDataset.SosiDataStatusId = _datasetDeliveryService.CreateDatasetDelivery(geodatalovViewModel.WmsStatusId, geodatalovViewModel.WmsNote); geodatalovDataset.GmlDataStatusId = _datasetDeliveryService.CreateDatasetDelivery(geodatalovViewModel.WmsStatusId, geodatalovViewModel.WmsNote); geodatalovDataset.WmsStatusId = _datasetDeliveryService.CreateDatasetDelivery(geodatalovViewModel.WmsStatusId, geodatalovViewModel.WmsNote); geodatalovDataset.WfsStatusId = _datasetDeliveryService.CreateDatasetDelivery(geodatalovViewModel.WfsStatusId, geodatalovViewModel.WfsNote); geodatalovDataset.AtomFeedStatusId = _datasetDeliveryService.CreateDatasetDelivery(geodatalovViewModel.AtomFeedStatusId, geodatalovViewModel.AtomFeedNote); geodatalovDataset.CommonStatusId = _datasetDeliveryService.CreateDatasetDelivery(geodatalovViewModel.WmsStatusId, geodatalovViewModel.WmsNote); _dbContext.GeodatalovDatasets.Add(geodatalovDataset); _dbContext.SaveChanges(); return(geodatalovDataset); }
public MareanoDataset NewMareanoDataset(MareanoDatasetViewModel MareanoViewModel, string parentregister, string registername) { var MareanoDataset = new MareanoDataset(); MareanoDataset.SystemId = Guid.NewGuid(); MareanoDataset.Name = MareanoViewModel.Name; MareanoDataset.Seoname = RegisterUrls.MakeSeoFriendlyString(MareanoDataset.Name); MareanoDataset.Description = MareanoViewModel.Description; MareanoDataset.SubmitterId = _registerService.GetOrganizationIdByUserName(); MareanoDataset.OwnerId = MareanoViewModel.OwnerId; MareanoDataset.DateSubmitted = DateTime.Now; MareanoDataset.Modified = DateTime.Now; MareanoDataset.RegisterId = _registerService.GetRegisterId(parentregister, registername); MareanoDataset.VersioningId = _registerItemService.NewVersioningGroup(MareanoDataset); MareanoDataset.VersionNumber = 1; MareanoDataset.StatusId = "Submitted"; MareanoDataset.Uuid = MareanoViewModel.Uuid; MareanoDataset.Notes = MareanoViewModel.Notes; MareanoDataset.SpecificUsage = MareanoViewModel.SpecificUsage; MareanoDataset.ProductSheetUrl = MareanoViewModel.ProductSheetUrl; MareanoDataset.PresentationRulesUrl = MareanoViewModel.PresentationRulesUrl; MareanoDataset.ProductSpecificationUrl = MareanoViewModel.ProductSpecificationUrl; MareanoDataset.MetadataUrl = MareanoViewModel.MetadataUrl; MareanoDataset.DistributionFormat = MareanoViewModel.DistributionFormat; MareanoDataset.DistributionUrl = MareanoViewModel.DistributionUrl; MareanoDataset.DistributionArea = MareanoViewModel.DistributionArea; MareanoDataset.WmsUrl = MareanoViewModel.WmsUrl; MareanoDataset.ThemeGroupId = MareanoViewModel.ThemeGroupId; MareanoDataset.DatasetThumbnail = MareanoViewModel.DatasetThumbnail; MareanoDataset.DokStatusId = "Proposal"; MareanoDataset.UuidService = MareanoViewModel.UuidService; GetDeliveryStatuses(MareanoViewModel, MareanoDataset); MareanoDataset.MetadataStatusId = _datasetDeliveryService.CreateDatasetDelivery(MareanoViewModel.MetadataStatusId, MareanoViewModel.MetadataNote); MareanoDataset.ProductSpesificationStatusId = _datasetDeliveryService.CreateDatasetDelivery(MareanoViewModel.WmsStatusId, MareanoViewModel.WmsNote); MareanoDataset.SosiDataStatusId = _datasetDeliveryService.CreateDatasetDelivery(MareanoViewModel.WmsStatusId, MareanoViewModel.WmsNote); MareanoDataset.GmlDataStatusId = _datasetDeliveryService.CreateDatasetDelivery(MareanoViewModel.WmsStatusId, MareanoViewModel.WmsNote); MareanoDataset.WmsStatusId = _datasetDeliveryService.CreateDatasetDelivery(MareanoViewModel.WmsStatusId, MareanoViewModel.WmsNote); MareanoDataset.WfsStatusId = _datasetDeliveryService.CreateDatasetDelivery(MareanoViewModel.WfsStatusId, MareanoViewModel.WfsNote); MareanoDataset.AtomFeedStatusId = _datasetDeliveryService.CreateDatasetDelivery(MareanoViewModel.AtomFeedStatusId, MareanoViewModel.AtomFeedNote); MareanoDataset.CommonStatusId = _datasetDeliveryService.CreateDatasetDelivery(MareanoViewModel.WmsStatusId, MareanoViewModel.WmsNote); MareanoDataset.Grade = GetGrade(MareanoDataset); _dbContext.MareanoDatasets.Add(MareanoDataset); _dbContext.SaveChanges(); return(MareanoDataset); }
public InspireDataset NewInspireDataset(InspireDatasetViewModel inspireDatasetViewModel, string parentregister, string registername) { var inspireDataset = new InspireDataset(); inspireDataset.SystemId = Guid.NewGuid(); inspireDataset.Name = inspireDatasetViewModel.Name; inspireDataset.Seoname = RegisterUrls.MakeSeoFriendlyString(inspireDataset.Name); inspireDataset.Description = inspireDatasetViewModel.Description; inspireDataset.SubmitterId = _registerService.GetOrganizationIdByUserName(); inspireDataset.OwnerId = inspireDatasetViewModel.OwnerId; inspireDataset.DateSubmitted = DateTime.Now; inspireDataset.Modified = DateTime.Now; inspireDataset.RegisterId = _registerService.GetRegisterId(parentregister, registername); inspireDataset.VersioningId = _registerItemService.NewVersioningGroup(inspireDataset); inspireDataset.VersionNumber = 1; inspireDataset.StatusId = "Submitted"; inspireDataset.Uuid = inspireDatasetViewModel.Uuid; inspireDataset.Notes = inspireDatasetViewModel.Notes; inspireDataset.SpecificUsage = inspireDatasetViewModel.SpecificUsage; inspireDataset.ProductSheetUrl = inspireDatasetViewModel.ProductSheetUrl; inspireDataset.PresentationRulesUrl = inspireDatasetViewModel.PresentationRulesUrl; inspireDataset.ProductSpecificationUrl = inspireDatasetViewModel.ProductSpecificationUrl; inspireDataset.MetadataUrl = inspireDatasetViewModel.MetadataUrl; inspireDataset.DistributionFormat = inspireDatasetViewModel.DistributionFormat; inspireDataset.DistributionUrl = inspireDatasetViewModel.DistributionUrl; inspireDataset.DistributionArea = inspireDatasetViewModel.DistributionArea; inspireDataset.WmsUrl = inspireDatasetViewModel.WmsUrl; inspireDataset.ThemeGroupId = inspireDatasetViewModel.ThemeGroupId; inspireDataset.DatasetThumbnail = inspireDatasetViewModel.DatasetThumbnail; inspireDataset.DokStatusId = "Proposal"; inspireDataset.UuidService = inspireDatasetViewModel.UuidService; GetDeliveryStatuses(inspireDatasetViewModel, inspireDataset); inspireDataset.InspireThemes = inspireDatasetViewModel.InspireThemes; inspireDataset.InspireDeliveryMetadataId = _datasetDeliveryService.CreateDatasetDelivery(inspireDatasetViewModel.MetadataStatusId, inspireDatasetViewModel.MetadataNote); inspireDataset.InspireDeliveryMetadataServiceId = _datasetDeliveryService.CreateDatasetDelivery(inspireDatasetViewModel.MetadataServiceStatusId, inspireDatasetViewModel.MetadataServiceNote); inspireDataset.InspireDeliveryDistributionId = _datasetDeliveryService.CreateDatasetDelivery(inspireDatasetViewModel.DistributionStatusId, inspireDatasetViewModel.DistributionNote); inspireDataset.InspireDeliveryWmsId = _datasetDeliveryService.CreateDatasetDelivery(inspireDatasetViewModel.WmsStatusId, inspireDatasetViewModel.WmsNote); inspireDataset.InspireDeliveryWfsId = _datasetDeliveryService.CreateDatasetDelivery(inspireDatasetViewModel.WfsStatusId, inspireDatasetViewModel.WfsNote); inspireDataset.InspireDeliveryAtomFeedId = _datasetDeliveryService.CreateDatasetDelivery(inspireDatasetViewModel.AtomFeedStatusId, inspireDatasetViewModel.AtomFeedNote); inspireDataset.InspireDeliveryWfsOrAtomId = _datasetDeliveryService.CreateDatasetDelivery(inspireDatasetViewModel.WfsOrAtomStatusId, inspireDatasetViewModel.WfsOrAtomNote); inspireDataset.InspireDeliveryHarmonizedDataId = _datasetDeliveryService.CreateDatasetDelivery(inspireDatasetViewModel.HarmonizedDataStatusId, inspireDatasetViewModel.HarmonizedDataNote); inspireDataset.InspireDeliverySpatialDataServiceId = _datasetDeliveryService.CreateDatasetDelivery(inspireDatasetViewModel.SpatialDataServiceStatusId, inspireDatasetViewModel.SpatialDataServiceNote); _dbContext.InspireDatasets.Add(inspireDataset); _dbContext.SaveChanges(); return(inspireDataset); }