Пример #1
0
		private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
			{
			ProgrammSchemaModell ProgrammSchemaModellHelper = new ProgrammSchemaModell();
			ProgrammSchemaModellHelper.InitializeMe();
			ProgrammSchemaModellHelper.ActualRing = ProgrammSchemaModellHelper.CreateNewRingInstance();
			ProgrammSchemaModellInstance = ProgrammSchemaModellHelper;
			}
Пример #2
0
		public MainWindow()
			{

#region (WPClientStartup) Standard RichClient Security and DataBase Startup

			String UserName = String.Empty;
#if DEBUG
			String[] Rollen = LoginHandler.SetDataAccessSecurity("Heinz", "monika");
#else
			String[] Rollen = LoginHandler.CheckUser(ref UserName);
#endif
			if (Rollen == null)
				{
				Close();
				return;
				}
			WPMediaApplicationState.Instance.Properties["Rollen"] = Rollen;
			WPMediaApplicationState.Instance.Properties["UserName"] = UserName;
			if (Directory.Exists("\\\\Webserver2\\WPMediaSender"))
				{
				Data.DbServer3_Connect_Direct();
				Application.Current.Properties["WPMediaNetworkEnvironment"] = true;
				}
			else
				{
				Data.DbServer3_Connect_OldWebService();
				Application.Current.Properties["WPMediaNetworkEnvironment"] = false;
				}


			if (!(WMB.WPMediaApplicationState.Instance.Properties["Rollen"] as String[]).Contains("Management"))
				return;
			#endregion

			DoDataStartup();
			if (ProgrammSchemaModellInstance != null)
				return;
			ProgrammSchemaModell programmSchemaModellHelper = new ProgrammSchemaModell();
			programmSchemaModellHelper.InitializeMe();
			programmSchemaModellHelper.dataContext.DefaultRangeFrom = DateTime.Now.Date;
			programmSchemaModellHelper.dataContext.DefaultRangeTo = DateTime.Now.Date.AddMinutes(1439);
			ProgrammSchemaModellInstance = programmSchemaModellHelper;
			SenderManagementModellInstance = new SenderManagementModell();
			MMSenderManagementModellInstance = new MMSenderManagementModell();
			MMUnitsManagementModellInstance = new MMUnitsManagementModell();
			InitializeComponent();
			}