Creating some simple Maintain Table Screens: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
Line 76: Line 76:


===Additional Maintain Table Screens (added after J-Term 2011)===
===Additional Maintain Table Screens (added after J-Term 2011)===
The screens below are again all for the Personnel Module of openPETRA.
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...).
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===
{| style="width:100%" border="1"
! Screen Name || Complexity || Database Table || CacheableDataTable || Comment || Assigned To || Approved
|-
| Relationship || 2 || p_relation || RelationList || (*10) (*13)
|-
| LocalDataOptionListNames || 1 || p_data_label_lookup_category || DataLabelLookupCategoryList || (*11) (*13)
|-
| LocalDataOptions || 2 || p_data_label_lookup || DataLabelLookupList || (*11) (*13)
|}
===Personnel Module===
{| style="width:100%" border="1"
{| style="width:100%" border="1"
! Screen Name || Complexity || Database Table || CacheableDataTable || Comment || Assigned To || Approved
! Screen Name || Complexity || Database Table || CacheableDataTable || Comment || Assigned To || Approved
Line 93: Line 110:
| ArrivalDeparturePoints || 2 || pt_arrival_point || ArrivalDeparturePointList || (*2) (*3)
| ArrivalDeparturePoints || 2 || pt_arrival_point || ArrivalDeparturePointList || (*2) (*3)
|}
|}
(5 additional Maintain Table Screens)


===Finance Module===
{| style="width:100%" border="1"
! Screen Name || Complexity || Database Table || CacheableDataTable || Comment || Assigned To || Approved
|-
| MethodOfPayment || 1 || a_method_of_payment  || MethodOfPaymentList ||
|-
| CostCenterTypes || 1 || a_cost_centre_types || CostCentreTypesList ||
|-
| MotivationGroup || 1 || a_motivation_group || MotivationGroupList ||
|-
|}
(11 additional Maintain Table Screens)


===Key to Comments===
===Key to Comments===

Revision as of 12:03, 16 February 2011

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
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
Relationship 2 p_relation RelationList (*10) (*13)
LocalDataOptionListNames 1 p_data_label_lookup_category DataLabelLookupCategoryList (*11) (*13)
LocalDataOptions 2 p_data_label_lookup DataLabelLookupList (*11) (*13)

Personnel Module

Screen Name Complexity Database Table CacheableDataTable Comment Assigned To Approved
LeadershipRating 2 pt_leadership_rating LeadershipRatingList (*2) (*3)
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)

Finance Module

Screen Name Complexity Database Table CacheableDataTable Comment Assigned To Approved
MethodOfPayment 1 a_method_of_payment MethodOfPaymentList
CostCenterTypes 1 a_cost_centre_types CostCentreTypesList
MotivationGroup 1 a_motivation_group MotivationGroupList


(11 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.
  • (*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

  • 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.