public static void SaveData(ProductionDomainContext source, ProductionDomainContext target) { foreach (var item in source.Kpis) { target.Kpis.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.SimulationWorkschedules) { target.SimulationWorkschedules.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.StockExchanges) { target.StockExchanges.Add(item.CopyProperties()); } target.SaveChanges(); }
public static void LoadData(ProductionDomainContext source, ProductionDomainContext target) { foreach (var item in source.ArticleTypes) { target.ArticleTypes.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.Units) { target.Units.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.MachineGroups) { target.MachineGroups.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.Machines) { target.Machines.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.MachineTools) { target.MachineTools.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.Articles) { target.Articles.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.Stocks) { target.Stocks.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.WorkSchedules) { target.WorkSchedules.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.ArticleBoms) { target.ArticleBoms.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.BusinessPartners) { target.BusinessPartners.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.ArticleToBusinessPartners) { target.ArticleToBusinessPartners.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.Orders) { target.Orders.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.OrderParts) { target.OrderParts.Add(item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.SimulationConfigurations) { target.SimulationConfigurations.Add(item.CopyProperties()); } target.SaveChanges(); }
public static void LoadData(ProductionDomainContext source, ProductionDomainContext target) { foreach (var item in source.ArticleTypes) { target.ArticleTypes.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.Units) { target.Units.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.ResourceSkills) { target.ResourceSkills.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.ResourceTools) { target.ResourceTools.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.Resources) { target.Resources.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.ResourceSetups) { target.ResourceSetups.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.Articles) { target.Articles.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.Stocks) { target.Stocks.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.Operations) { target.Operations.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.ArticleBoms) { target.ArticleBoms.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.BusinessPartners) { target.BusinessPartners.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.ArticleToBusinessPartners) { target.ArticleToBusinessPartners.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.CustomerOrders) { target.CustomerOrders.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.CustomerOrderParts) { target.CustomerOrderParts.Add(entity: item.CopyProperties()); } target.SaveChanges(); foreach (var item in source.ProductionOrders) { target.ProductionOrders.Add(entity: item.CopyProperties()); } target.SaveChanges(); }