示例#1
0
		private void GenerateFileAccessRing_Click(object sender, RoutedEventArgs e)
			{
			Cursor = Cursors.Wait;
//			IRingManager MVCInterface = null;

			RingPlayerDb player = new RingPlayerDb();
			player.Set_DbProxy(new DbEntitiesAccess.Proxys.DbServer3
				.DirectHsServerSqlConnector()
				{ Catalog = RingPlayerDb.NativeName });
			player.LoadSchema();
			player.SetHasBeenLoaded();
			RingMetaData ringMetaData = player.RingMetaDatas.NewRow();
			ringMetaData.SenderId = SelectedSender.Id;
			//ringMetaData.ComputerId = Guid.NewGuid();
			//ringMetaData.ComputerName = Environment.MachineName;
			//ringMetaData.Description = $"{Process.GetCurrentProcess().ProcessName} created Ring";
			//ringMetaData.CreatorNameId = $"ich";
			//ringMetaData.RingId = 1;
			//ringMetaData.StatusNumber = 100;
			ringMetaData.CreationDate = DateTime.Now;
			ringMetaData.Table.Add(ringMetaData);
			ringMetaData.Table.AcceptChanges();
//			MVCInterface.Generate(dataContext, SelectedSender.NameId, ringMetaData);
			RingPlayerDb dataSet = ringMetaData.DataSet;
			RingPlayerDb.SetInstance(this, dataSet);
			Cursor = Cursors.Arrow;
			}
示例#2
0
		public RingGenerator(MMSender targetSender, DateTime targetDate)
			{
			RingPlayerDb playerDb = new RingPlayerDb();
			playerDb.Set_DbProxy(new DirectHsServerSqlConnector() {Catalog = RingPlayerDb.NativeName});
			playerDb.LoadSchema();

			TargetRing = playerDb.RingMetaDatas.NewRow();
			TargetRing.SenderId = targetSender.Id;
			//TargetRing.ComputerId = Guid.NewGuid();
			//TargetRing.ComputerName = Environment.MachineName;
			//TargetRing.RingId = 1;
			//TargetRing.CreatorNameId = CsGlobal.Os.Info.ComputerName + " " + CsGlobal.Os.Info.CurrentUser;
			TargetRing.CreationDate = DateTime.Now;
//			TargetRing.TransferTime = null;
			//TargetRing.Status = RingMetaDataStates.Created;
			TargetRing.Table.Rows.Add(TargetRing);

			SourceSender = targetSender;
			TargetDate = targetDate;

			Init();
			}
示例#3
0
		public void TesMMUnitTimingFunctions()
			{
			Data.DbServer3.MultiMedia.LoadAll_IfHasNotBeenLoaded();
			DistributionRoot DistributionRootInstance 
				= new DistributionRoot
				(Data.DbServer3.MultiMedia, DateTime.Now);
			DistributionRootInstance.PreloadAllForAllTodayAndTomorrowMMunitsIfNotHasBeenLoaded();
			Dictionary<MMSlot, Dictionary<MMUnit, List<MMUnitTiming>>> ToDayAndTomorrowInvolvedMMUnitsPerMMSlot
				= DistributionRootInstance.ToDayAndTomorrowInvolvedMMUnitsPerMMSlot;
			Debug.WriteLine($"");
			Debug.WriteLine($"ToDayAndTomorrowInvolvedMMUnitsPerMMSlot");

			foreach (MMSlot mmSlot in ToDayAndTomorrowInvolvedMMUnitsPerMMSlot.Keys)
				{
				if (!mmSlot.NameId.Contains("Kauf"))
					continue;
				Debug.WriteLine($"{mmSlot.NameId}");
				foreach (MMUnit mmUnit in ToDayAndTomorrowInvolvedMMUnitsPerMMSlot[mmSlot].Keys)
					{
					Debug.WriteLine($"\t{mmUnit.NameId}");
					foreach (MMUnitTiming mmUnitTiming in ToDayAndTomorrowInvolvedMMUnitsPerMMSlot[mmSlot][mmUnit])
						{
						Debug.WriteLine($"\t\t{mmUnitTiming.FreiText}");						}
						}
				}

			Debug.WriteLine($"");
			Debug.WriteLine($"TodayActiveMMUnitsPerMMSlo");

			foreach (MMSlot mmSlot in DistributionRootInstance.TodayActiveMMUnitsPerMMSlot.Keys)
				{
				if (!mmSlot.NameId.Contains("Kauf"))
					continue;
				Debug.WriteLine($"{mmSlot.NameId}");
				foreach (MMUnit mmUnit in ToDayAndTomorrowInvolvedMMUnitsPerMMSlot[mmSlot].Keys)
					{
					Debug.WriteLine($"\t{mmUnit.NameId}");
					foreach (MMUnitTiming mmUnitTiming in ToDayAndTomorrowInvolvedMMUnitsPerMMSlot[mmSlot][mmUnit])
						{
						Debug.WriteLine($"\t\t{mmUnitTiming.FreiText}");
						}
					}
				}

			Debug.WriteLine($"");
			Debug.WriteLine($"TomorrowActiveMMUnitsPerMMSlot");

			foreach (MMSlot mmSlot in DistributionRootInstance.TomorrowActiveMMUnitsPerMMSlot.Keys)
				{
				if (!mmSlot.NameId.Contains("Kauf"))
					continue;
				Debug.WriteLine($"{mmSlot.NameId}");
				foreach (MMUnit mmUnit in ToDayAndTomorrowInvolvedMMUnitsPerMMSlot[mmSlot].Keys)
					{
					Debug.WriteLine($"\t{mmUnit.NameId}");
					foreach (MMUnitTiming mmUnitTiming in ToDayAndTomorrowInvolvedMMUnitsPerMMSlot[mmSlot][mmUnit])
						{
						Debug.WriteLine($"\t\t{mmUnitTiming.FreiText}");
						}
					}
				}
			MMSender mmSender = Data.DbServer3.MultiMedia.MMSenders.FindOrLoad_via_NameId("Haus");
			RingPlayerDb ActuallPlayerDb = new RingPlayerDb();
			ActuallPlayerDb.Set_DbProxy(new DirectHsServerSqlConnector(){ Catalog = RingPlayerDb.NativeName });
			ActuallPlayerDb.LoadSchema();
			ActuallPlayerDb.SetHasBeenLoaded();

			RingMetaData testRingMetaData = ActuallPlayerDb.RingMetaDatas.NewRow();
			testRingMetaData.SenderId = mmSender.Id;
			//ringMetaData.ComputerId = Guid.NewGuid();
			//ringMetaData.ComputerName = Environment.MachineName;
			testRingMetaData.TargetDate = DateTime.Now;
			testRingMetaData.CreationDate = DateTime.Now;
			testRingMetaData.Id = 1;

			//AddOnRingDistribution.DataCollector.BalancerUsage balancerUsage
			//	= new AddOnRingDistribution.DataCollector.BalancerUsage(mmSender, testRingMetaData, DateTime.Now)
			//	{
			//	TodaysActiveMMUnitsPerMMSlot = DistributionRootInstance.TodayActiveMMUnitsPerMMSlot,
			//	TomorrowsActiveMMUnitsPerMMSlot = DistributionRootInstance.TomorrowActiveMMUnitsPerMMSlot
			//	};
			//balancerUsage.LoadActuallBalancers(mmSender);
			//RingUpdater ringUpdater = new RingUpdater(mmSender, testRingMetaData, DateTime.Now)
			//	{
			//	DistributionRootInstance = DistributionRootInstance,
			//	TodaysBalancers = balancerUsage.TodaysBalancersPerSender[mmSender]
			//	};

			}