Creating some simple Maintain Table Screens

From OpenPetra Wiki
Revision as of 11:49, 17 December 2010 by Christiankatict (talk | contribs)
Jump to navigation Jump to search

Objective / Overview

openPETRA contains many screens which set up data that is used all over the application and which can be customised to address the specific situation of an office or organisation. These screens are called 'Maintain Table Screens' and the objective of this Project is to create such screens. A Maintain Table screen allows CRUD (Create, Read, Update, Delete [1]) operations for a specific system table/lookup table of openPETRA.

The creation of Maintain Table Screens involves quite a few manual steps, but there is hardly any source code that needs to be written because the openPETRA WinForms Generator generates >95% of the code!

Example:

Simple Maintain Table Screen

There is another Project which involves the creation of more complex Maintain Table screens.


Desired Outcome

Adding a few Maintain Table screens to openPETRA and in the course of doing that

  • learning about the client-side project structure
  • learning about our screen definition files (YAML files)
  • getting to know the openPETRA database structure documentation
  • getting to know the WinForms Generator


Solution

Follow the steps on the How-To: Creating a Maintain Table screen wiki page for each of the screens.

ChristianK created an example screen which can be taken as a blueprint for every new screen listed below. Go to this wiki page to see details about that.


Scope: Maintain Table Screens List

The screens below are all for the Personnel Module of openPETRA.

Note: The column 'Complexity' is not of importance to you, but for the openPETRA team who needs to see the screens in the context of the other Maintain Table screens (there are 115 of them...).

Screen Name Complexity Database Table CacheableDataTable Comment
AbilityLevel 2 pt_ability_level AbilityLevelList (*1) (*3) (*5)
ProfessionalAreas 2 pt_qualification_area QualificationAreaList (*1) (*3) (*A1)
QualificationLevels 2 pt_qualification_level QualificationLevelList (*1) (*3) (*5)
VisionAreas 2 pt_vision_area VisionAreaList (*1) (*3)
VisionLevels 2 pt_vision_level VisionLevelList (*1) (*3) (*5)
DriverStatus 2 pt_driver_status DriverStatusList (*1) (*3)
Positions 2 pt_position PositionList (*1) (*4) (*A2)
JobAssignmentTypes 2 pt_assignment_type JobAssignmentTypeList (*1) (*4)
LeavingCodes 2 pt_leaving_code LeavingCodeList (*1) (*4)
LanguageLevel 2 pt_language_level LanguageLevelList (*1) (*3) (*5) (*A3)
PassportTypes 2 pt_passport_type PassportTypeList (*1) (*3)
DocumentTypesCategory 2 pm_document_category DocumentTypeCategoryList (*1) (*3) (*A4)
ValuableItems 2 pt_valuable_item ValuableItemList (*1) (*3)
ApplicantStatus 2 pt_applicant_status ApplicantStatusList (*2) (*3)
Country_EventPreferenceLevels 2 pt_xyz_tbd_preference_level XyzTbdPreferenceLevelList (*2) (*3)

(15 Maintain Table Screens)

Key to Comments

  • (*1) = Screens should be listed under the 'General'-Heading in Menu Personnel->Setup.
  • (*2) = Screens should be listed under the 'Application-related'-Heading in Menu Personnel->Setup.
  • (*3) = Database Tables are found in the 'personnel'-DB table area.
  • (*4) = Database Tables are found in the 'units'-DB table area.
  • (*5) = Use the attribute '{Format=Integer}' for the TextBox for DB Field '*_level_i' to restrict data entered by users to numbers.
  • (*A1) = 'pt_qualification_flag_l' and 'pt_qualification_date_d' represent 'Unassignable' and 'Unassignable Date'.
  • (*A2) = 'pt_position_scope_c' should not go on the screen.
  • (*A3) = Field 'pt_language_comment_c': put its TextBox on a separate 'row'. Make it as wide as the screen.
  • (*A4) = 'pm_extendable_l' should not go on the screen.


Dealing With Errors When Saving Data

If you find that you get an error message when trying to save changed data in any Maintain Table Screen, have a look in the Client Log file (U:\openpetraorg\log\PetraClient.log) to see the actual exception (at the very end of the file). The most common cause of getting a problem at that point is that a certain field that is specified in the DB is not on the screen, and that DB field has the Constraint 'NOT NULL'. This will prevent saving, as openPETRA doesn't assign anything, not even NULL automatically to such fields, since they are not on the screen. The solution for that is to have a Method called 'GetDetailDataFromControlsManual' in the ManualCode.cs file. You can find an example implementation for it in the file U:\openpetraorg\csharp\ICT\Petra\Client\lib\MPersonnel\gui\setup\AbilityAreaSetup.ManualCode.cs. If this is not applicable or still doesn't solve the problem of not being able to save changed data, ask ChristianK, who should be able to help you.


Approval of Functionality and Program Code

TODO