public static void SetWindowsGeometry (Window WorkingWindow, TableLayoutDefinition LayoutDefinition) { Screen StartingScreen = Screen.PrimaryScreen; WorkingWindow.MinWidth = StartingScreen.WorkingArea.Width * 0.1; WorkingWindow.MinHeight = StartingScreen.WorkingArea.Height * 0.1; WorkingWindow.Width = StartingScreen.WorkingArea.Width * 0.6; WorkingWindow.Height = StartingScreen.WorkingArea.Height * 0.7; if ((LayoutDefinition != null) && ((LayoutDefinition.StartingPosition.X != -1) && (LayoutDefinition.StartingPosition.Y != -1))) { WorkingWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.Manual; WorkingWindow.Top = LayoutDefinition.StartingPosition.Y; WorkingWindow.Left = LayoutDefinition.StartingPosition.X; } if ((LayoutDefinition != null) && ((LayoutDefinition.StartingSize.Width != 0) && (LayoutDefinition.StartingSize.Height != 0))) { WorkingWindow.Width = LayoutDefinition.StartingSize.Width; WorkingWindow.Height = LayoutDefinition.StartingSize.Height; } else { WorkingWindow.SizeToContent = SizeToContent.WidthAndHeight; } if ((LayoutDefinition != null) && (LayoutDefinition.AllFontSize != -1)) WorkingWindow.FontSize = LayoutDefinition.AllFontSize; }
public void FillDefaultsFromExtendedProperties () { if (String.IsNullOrEmpty (FillSqlStatement)) { IsTreeStructuredTable = DataBase.IsTreeViewStructuredTable (TableName); if (IsTreeStructuredTable) { FillSqlStatement = DataBase.GetTableDefinitionEntry (TableName, WCFStandardsNS.WCFStandardClientSchema.SQL_TABLE_PROPERTY_SQL_FILL); } else { FillSqlStatement = DataBase.GetTableDefinitionEntry (TableName, WCFStandardsNS.WCFStandardClientSchema.SQL_TABLE_PROPERTY_SQL_FILL); } } if (String.IsNullOrEmpty (InsertSqlStatement)) { InsertSqlStatement = DataBase.GetTableDefinitionEntry (TableName, WCFStandardsNS.WCFStandardClientSchema.SQL_TABLE_PROPERTY_SQL_INSERT); } if (String.IsNullOrEmpty (DeleteSqlStatement)) { DeleteSqlStatement = DataBase.GetTableDefinitionEntry (TableName, WCFStandardsNS.WCFStandardClientSchema.SQL_TABLE_PROPERTY_SQL_DELETE); } if (String.IsNullOrEmpty (ReadableSqlStatement)) { ReadableSqlStatement = DataBase.GetTableDefinitionEntry (TableName, WCFStandardsNS.WCFStandardClientSchema.SQL_TABLE_PROPERTY_SQL_READABLE); } if (String.IsNullOrEmpty (LayoutDefinitionsPropertyToken)) LayoutDefinitionsPropertyToken = "DefaultLayout_" + TableName; if (WMB.WPMediaApplicationState.Instance.Properties.ContainsKey (LayoutDefinitionsPropertyToken) == false) { CVM.TableLayoutDefinition LocalLayoutDefinition = new TableLayoutDefinition (LayoutDefinitionsPropertyToken); LocalLayoutDefinition.LayoutDefintionName = LayoutDefinitionsPropertyToken; WMB.WPMediaApplicationState.Instance.Properties [LayoutDefinitionsPropertyToken] = LocalLayoutDefinition; } }
public static void DoClosingProcessing (Window WorkingWindow, TableLayoutDefinition LayoutDefinition) { if (LayoutDefinition != null) { LayoutDefinition.StartingPosition = new Point (WorkingWindow.Left, WorkingWindow.Top); LayoutDefinition.StartingSize = new Size (WorkingWindow.Width, WorkingWindow.Height); } }
public bool SetData(WCFStandardsNS.WCFStandards DataBase, Object Sender, String Bereich, DataSet SchemaDataSet, TableLayoutDefinition TableLayoutDefinitions) { m_CommonUserInterface.SkipThisColumns = SkipThisColumns; m_CommonUserInterface.InsertSqlStatement = InsertSqlStatement; m_CommonUserInterface.DeleteSqlStatement = DeleteSqlStatement; m_CommonUserInterface.FillSqlStatement = FillSqlStatement; m_CommonUserInterface.ReadableSqlStatement = ReadableSqlStatement; if (CheckTheSelectionFillStatementCall != null) m_CommonUserInterface.CheckTheSelectionFillStatementCall += new CheckTheSelectionFillStatementEvent (m_CommonUserInterface_CheckTheSelectionFillStatementCall); bool ReturnCode = m_CommonUserInterface.SetData (DataBase, Sender, Bereich, SchemaDataSet, TableLayoutDefinitions); m_CommonUserInterface.ProcessModifyKeyTableCall += ProcessModifyKeyTableCall; m_CommonUserInterface.GetReadableTextForEntryCall += new GetReadableTextForEntryEvent (m_CommonUserInterface_GetReadableTextForEntryCall); m_CommonUserInterface.DoIndividualDataCheckBeforeUpdateCall += new DoIndividualDataCheckBeforeUpdateEvent (m_CommonUserInterface_DoIndividualDataCheckBeforeUpdateCall); m_CommonUserInterface.HandleShowAndEditListBoxEntry_MouseRightButtonUpCall += new HandleShowAndEditListBoxEntry_MouseRightButtonUpEvent (m_CommonUserInterface_HandleShowAndEditListBoxEntry_MouseRightButtonUpCall); m_CommonUserInterface.CloseRequestedCall += new CloseRequested (m_CommonUserInterface_CloseRequestedCall); m_TableLayoutDefinition = m_CommonUserInterface.LayoutDefinition; return ReturnCode; }
public bool SetData(WCFStandardsNS.WCFStandards ParentsDataBase, ControlUserData UserDataParameter, DataSet SchemaDataSet, TableLayoutDefinition TableLayoutDefinition, DataRow RowToProcess, String Title) { m_TableHelper = new CVM.TableUserControlHelper (); m_TableHelper.DataBase = ParentsDataBase; m_Bereich = ""; m_SchemaDataSet = SchemaDataSet; LayoutDefinition = TableLayoutDefinition; DataBase = ParentsDataBase; m_ActiveID = RowToProcess ["ID"].ToString (); m_RefreshmentRoutine = UserDataParameter.m_RefreshFunctionName; m_PrimaryKeyName = UserDataParameter.m_PrimaryKeyName; m_TableHelper.TableName = UserDataParameter.m_TableName; m_ProcessingDataSet = null; UserData = UserDataParameter; SetRowToProcess (RowToProcess, Title, UserDataParameter.m_UpdateAble); if (LayoutDefinition == null) { m_TableHelper.LayoutDefinitionsPropertyToken = "CommonUserInterfaceWindow_"; LayoutDefinition = m_TableHelper.LayoutDefinition; } return true; }
public bool SetData(WCFStandardsNS.WCFStandards ParentsDataBase, ControlUserData UserDataParameter, DataSet SchemaDataSet, TableLayoutDefinition TableLayoutDefinition, String RecordIDToProcess) { m_TableHelper = new CVM.TableUserControlHelper (); m_TableHelper.DataBase = ParentsDataBase; m_Bereich = ""; m_SchemaDataSet = SchemaDataSet; LayoutDefinition = TableLayoutDefinition; DataBase = ParentsDataBase; m_ActiveID = RecordIDToProcess; m_RefreshmentRoutine = UserDataParameter.m_RefreshFunctionName; m_PrimaryKeyName = UserDataParameter.m_PrimaryKeyName; m_TableHelper.TableName = UserDataParameter.m_TableName; m_ProcessingDataSet = DataBase.GetCommonDataSet ( "Select * from " + UserDataParameter.m_TableName + " where " + m_PrimaryKeyName + " = '" + m_ActiveID + "'"); if (UserDataParameter.m_UpdateAble) SetRowToProcess (m_ProcessingDataSet.Tables [0].Rows [0], "Bitte ändern Sie ggf. diese \"" + UserData.m_TableName + "\" Daten", UserDataParameter.m_UpdateAble); else SetRowToProcess (m_ProcessingDataSet.Tables [0].Rows [0], "", UserData.m_UpdateAble); if (LayoutDefinition == null) { m_TableHelper.LayoutDefinitionsPropertyToken = "CommonUserInterfaceWindow_"; LayoutDefinition = m_TableHelper.LayoutDefinition; } return true; }
public bool SetData (WCFStandardsNS.WCFStandards ParentsDataBase, Object Sender, String Bereich, DataSet SchemaDataSet, TableLayoutDefinition TableLayoutDefinition) { m_TableHelper = new CVM.TableUserControlHelper (); m_TableHelper.DataBase = ParentsDataBase; m_Bereich = Bereich; m_SchemaDataSet = SchemaDataSet; LayoutDefinition = TableLayoutDefinition; DataBase = ParentsDataBase; if (Sender.GetType () == typeof (ListBox)) { ListBox ListBoxToProcess = (ListBox)Sender; UserData = (ControlUserData)ListBoxToProcess.Tag; if (ListBoxToProcess.SelectedIndex == -1) { return false; } m_ActiveID = ((ListBoxItem)ListBoxToProcess.Items [ListBoxToProcess.SelectedIndex]).Tag.ToString (); } if (Sender.GetType () == typeof (DataGrid)) { DataGrid DataGridToProcess = (DataGrid) Sender; UserData = (ControlUserData)DataGridToProcess.Tag; if (DataGridToProcess.SelectedIndex == -1) { return false; } m_ActiveID = ((DataRowView)DataGridToProcess.SelectedItems [0]).Row ["ID"].ToString (); } if (Sender.GetType () == typeof (TreeView)) { TreeView TreeViewToProcess = (TreeView)Sender; UserData = (ControlUserData)TreeViewToProcess.Tag; if (TreeViewToProcess.SelectedItem == null) { return false; } m_ActiveID = ((TreeViewItem)TreeViewToProcess.SelectedItem).Tag.ToString (); } m_RefreshmentRoutine = UserData.m_RefreshFunctionName; m_PrimaryKeyName = UserData.m_PrimaryKeyName; m_TableHelper.TableName = UserData.m_TableName; if (String.IsNullOrEmpty (m_ActiveID)) { if (GetMissingIDToModifyCall != null) m_ActiveID = GetMissingIDToModifyCall (UserData.m_TableName, Sender); if (String.IsNullOrEmpty (m_ActiveID)) { MessageBox.Show ("In der Tabelle \"" + UserData.m_TableName + "\" war keine ID zum starten der Änderungen zu finden"); return false; } } m_ProcessingDataSet = DataBase.GetCommonDataSet ( "Select * from " + UserData.m_TableName + " where " + m_PrimaryKeyName + " = '" + m_ActiveID + "'"); if (UserData.m_UpdateAble) SetRowToProcess (m_ProcessingDataSet.Tables [0].Rows [0], "Bitte ändern Sie ggf. diese \"" + UserData.m_TableName + "\" Daten", UserData.m_UpdateAble); else SetRowToProcess (m_ProcessingDataSet.Tables [0].Rows [0], "", UserData.m_UpdateAble); if (LayoutDefinition == null) { m_TableHelper.LayoutDefinitionsPropertyToken = "CommonUserInterfaceWindow_"; LayoutDefinition = m_TableHelper.LayoutDefinition; } return true; }