Creating some simple Maintain Table Screens

From OpenPetra Wiki
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.

Notes:

  • The corresponding Bug (=Feature Request) is Bug #202.
  • The Bazaar Branch in which the development is to happen is called 'dev_0000202_studentsJ2011_simple_mt'.

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

For details about what is expected of the screens that are produced refer to section 'Approval of Functionality and Program Code' below!


Solution

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

You can read the Overview once, then skip Step 1 and the first sections of Step 2 and start straight at the section under the heading 'Copying the screen definitions file' since the information which you need for copying an existing screen definitions file is already given here.

Example Screen

ChristianK and WolfgangB created two example screens for two different scenarios which can be taken as a blueprint for every new screen listed below. Go to this wiki page to see details about that.

Finding DB Tables Definitions

The definitions for the openPETRA DB Tables which are used in the screens can be found here.


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 it is important for the openPETRA team who needs to see those screens in the context of the other Maintain Table screens (there are 115 of them...).

Screen Name Complexity Database Table CacheableDataTable Comment Assigned To Approved
ProfessionalAreas 2 pt_qualification_area QualificationAreaList (*1) (*3) (*A1) Seth YES
QualificationLevels 2 pt_qualification_level QualificationLevelList (*1) (*3) (*5) Chadd YES
VisionAreas 2 pt_vision_area VisionAreaList (*1) (*3) Ashley YES
VisionLevels 2 pt_vision_level VisionLevelList (*1) (*3) (*5) Austin YES
DriverStatus 2 pt_driver_status DriverStatusList (*1) (*3) Paul YES
Positions 2 pt_position PositionList (*1) (*4) (*A2) Andrew YES
JobAssignmentTypes 2 pt_assignment_type JobAssignmentTypeList (*1) (*4) Tom (not committed) / AlanP
LeavingCodes 2 pt_leaving_code LeavingCodeList (*1) (*4) Darci YES
LanguageLevel 2 pt_language_level LanguageLevelList (*1) (*3) (*5) (*A3) Austin YES
PassportTypes 2 pt_passport_type PassportTypeList (*1) (*3) Ashley YES
DocumentTypesCategory 2 pm_document_category DocumentTypeCategoryList (*1) (*3) (*A4) Paul YES
ValuableItems 2 pt_valuable_item ValuableItemList (*1) (*3) Austin YES
ApplicantStatus 2 pt_applicant_status ApplicantStatusList (*2) (*3) Ashley YES
Country_EventPreferenceLevels 2 pt_xyz_tbd_preference_level XyzTbdPreferenceLevelList (*2) (*3) Chadd YES

(14 Maintain Table Screens)


Additional Maintain Table Screens (added after J-Term 2011)

The screens below are for different Modules of openPETRA.

Be sure to create the screens in the correct C# Project (and directory):

  • Partner Module screens go in Project Ict.Petra.Client.MPartner.Gui.Setup
  • Personnel Module screens go in Project Ict.Petra.Client.MPersonnel.Gui.Setup
  • Finance Module screens go in Project Ict.Petra.Client.MFinance.Gui.Setup

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

Partner Module

Screen Name Complexity Database Table CacheableDataTable Comment Assigned To Approved
LocalDataOptionListNames 1 p_data_label_lookup_category DataLabelLookupCategoryList (*10) (*11) (*A5) (*A6) AlanP

Personnel Module

Screen Name Complexity Database Table CacheableDataTable Comment Assigned To Approved
LeadershipRating 2 pt_leadership_rating LeadershipRatingList (*2) (*3) AlanP
OrganisationContact 2 pt_contact ContactList (*2) (*3)
PartyType 2 pt_party_type PartyTypeList (*2) (*3)
TransportTypes 2 pt_travel_type TransportTypeList (*2) (*3)
ArrivalDeparturePoints 2 pt_arrival_point ArrivalDeparturePointList (*2) (*3) AlanP

Finance Module

Screen Name Complexity Database Table CacheableDataTable Comment Assigned To Approved
MethodOfPayment 1 a_method_of_payment MethodOfPaymentList (*20) (*23) (*A7) (*A8) ChristopherT YES
CostCenterTypes 1 a_cost_centre_types CostCentreTypesList (*21) (*24) (*A9) (*A10) ChristopherT YES
MotivationGroup 1 a_motivation_group MotivationGroupList (*22) (*23) (*A10) (*A11) (*A12) AlanP

Conference Module

Screen Name Complexity Database Table CacheableDataTable Comment Assigned To Approved
ConferenceCostTypes 1 pc_cost_type ConferenceCostTypeList (*25) AlanP


(9 additional 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.
  • (*10) = Screens should be listed under the 'Local Partner Data-related'-Heading in Menu Partner->Setup.
  • (*11) = Database Tables are found in the 'partner'-DB table area.
  • (*20) = Screens should be listed under the 'Cross-Ledger Setup'-Heading in Menu Ledger->Setup.
  • (*21) = Screens should be listed under the 'GL Setup'-Heading in Menu Ledger->Setup.
  • (*22) = Screens should be listed under the 'Gift Setup'-Heading in Menu Ledger->Setup.
  • (*23) = Database Tables are found in the 'gift'-DB table area.
  • (*24) = Database Tables are found in the 'account'-DB table area.
  • (*25) = Database Tables are found in the 'conference'-DB table area. Cacheable table has yet to be created as part of enum TCacheableConferenceTablesEnum.
  • (*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.
  • (*A5) = 'p_extendable_l' should not go on the screen.
  • (*A6) = 'p_category_code_c' should have Label 'List Name'; 'p_category_desc_c' should have Label 'Description'.
  • (*A7) = 'a_method_of_payment_code_c' should have Label 'Method of Payment', 'a_method_of_payment_desc_c' should have Label 'Description'; 'a_special_method_of_pmt_lc' should have Label 'Special Method of Payment'.
  • (*A8) = 'a_method_of_payment_type_c' and 'a_process_to_call_c' should not go on the screen.
  • (*A9) = 'a_cost_centre_type_c' should have Label 'Type'; 'a_cc_description_c' should have Label 'Description'.
  • (*A10) = 'a_ledger_number_i' should not go on the screen.
  • (*A11) = 'a_restricted_l' should not go on the screen.
  • (*A12) = 'a_motivation_group_description_c' should have Label 'Description'; 'a_motivation_group_desc_local_c' should have Label 'Description (local)'; 'a_group_status_l' should have Label 'Assignable'.

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

  • Demonstrate the new Maintain Table screen in openPETRA.
    • Adding of new values needs to work.
    • Changing of existing values needs to work.
    • If ComboBoxes are used in the screen: ComboBoxes need to show correct values.
    • Formatting needs to be correct in the Grid Columns and in the data entry fields.
    • Data in all the fields needs to be saved and retrieved correctly.
    • Screen Layout needs to conform to the general layout scheme of Maintain Table screens (both in the Grid and the Details sections).
      • Show the example screen to ChristianK and Prof. Nurkkala and proof that the layout of the new screen follows the layout of the example very closely.
  • A check will be done to see if the instructions in the 'Comment' column of the table above were followed.
  • The program code in the *.ManualCode.cs will be reviewed by ChristianK and Prof. Nurkkala.