Example: Simple Maintain Table Screen

From OpenPetra Wiki
Revision as of 05:00, 18 December 2010 by Christiankatict (talk | contribs)
Jump to navigation Jump to search

Example Screen

The example screen can be found here:

   U:\openpetraorg\csharp\ICT\Petra\Client\lib\MPersonnel\gui\setup\AbilityAreaSetup.yaml
   U:\openpetraorg\csharp\ICT\Petra\Client\lib\MPersonnel\gui\setup\AbilityAreaSetup.ManualCode.cs

That's how it looks like:

Simple Maintain Table Screen Example

When copying the example screen as a starting point for the individual Maintain Table screens the layout does not need to be changed because it is identical for all of the screens. There is only one exception to that: the width of the TextBox for the 'Code' (=the first TextBox in the Detail Panel) as the number of characters which can be entered there is varying for each of the screens [see DB definition 'varchar(X)', where X is the number of characters allowed]:

  • don't specify a width if the varchar value is greater than 10, we will go with the default with (which is 150 pixel) in this case;
  • if the varchar value is lower than 10: specify a width that allows the number of characters to be displayed ('Width=xxx'.
  • For the screens which are marked with '(*5)' in the 'Comment' column: make the 'Code' TextBox as wide as needed for displaying two-digit numbers (the maximum value is '99' for those TextBoxes).

Methods in the ManualCode.cs file

  • 'RunOnceOnActivationManual': This Method needs to be in the ManualCode.cs file but you don't need to change anything in that Method.
  • 'EnableDisableUnassignableDate': This Method needs to be in the ManualCode.cs file but you don't need to change anything in that Method.
  • 'GetDetailDataFromControlsManual': This method needs to be left out of all ManualCode.cs files except for the ManualCode.cs files of screens where this manual assignment is needed (for instance in screen 'Positions').

See this wiki section for an explanation of these Methods.