Creating some simple Maintain Table Screens: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
(Created page with '==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 …')
 
No edit summary
Line 7: Line 7:
Example:
Example:
[[File:Maintain_Table_Screens_-_simple_example.png|350px|thumb|center|Simple Maintain Table Screen]]  
[[File:Maintain_Table_Screens_-_simple_example.png|350px|thumb|center|Simple Maintain Table Screen]]  
There is [[Creating some more advanced Maintain Table Screens | another Project]] which involves the creation of more complex Maintain Table screens.




Line 19: Line 21:
==Solution==
==Solution==
Follow the steps on the [[How-To: Creating a Maintain Table screen]] wiki page for each of the screens.
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 [[Example: Simple Maintain Table Screen|wiki page]] to see details about that.




== Scope: Maintain Table Screens List ==
== Scope: Maintain Table Screens List ==
The screens below are all for the Personnel Module of openPETRA.
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...).


{| style="width:100%" border="1"
{| style="width:100%" border="1"
Line 30: Line 36:
|-
|-
| ProfessionalAreas || 2 || pt_qualification_area || QualificationAreaList || (*1) (*3) (*A1)
| 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===
===Key to Comments===
Line 38: Line 70:
* (*3) = Database Tables are found in the 'personnel'-DB table area.
* (*3) = Database Tables are found in the 'personnel'-DB table area.
* (*4) = Database Tables are found in the 'units'-DB table area.
* (*4) = Database Tables are found in the 'units'-DB table area.
* (*5) = Use the attribute '<code>{Format=Integer}</code>' for the TextBox for DB Field '<code>*_level_i</code>' to restrict data entered by users to numbers only.
* (*5) = Use the attribute '<code>{Format=Integer}</code>' for the TextBox for DB Field '<code>*_level_i</code>' to restrict data entered by users to numbers.


* (*A1) = '<code>pt_qualification_flag_l</code>' and <code>'pt_qualification_date_d</code>' represent 'Unassignable' and 'Unassignable Date'.
* (*A1) = '<code>pt_qualification_flag_l</code>' and <code>'pt_qualification_date_d</code>' represent 'Unassignable' and 'Unassignable Date'.
Line 44: Line 76:
* (*A3) = Field '<code>pt_language_comment_c</code>': put its TextBox on a separate 'row'. Make it as wide as the screen.
* (*A3) = Field '<code>pt_language_comment_c</code>': put its TextBox on a separate 'row'. Make it as wide as the screen.
* (*A4) = '<code>pm_extendable_l</code>' should not go on the screen.
* (*A4) = '<code>pm_extendable_l</code>' 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 '<code>GetDetailDataFromControlsManual</code>' 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==
==Approval of Functionality and Program Code==
TODO
TODO

Revision as of 11:49, 17 December 2010

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