// C:\SI\New\AppSrc\AuditListing.vw // Changed/Deleted Records // Use Dftable.pkg Use Dfentry.pkg Use AudInfo.DD Use AudDet.DD Use Dates.utl //Use Secuser.sl //Auto-Mate's Security table lookups - use yours here //Use Secviews.sl //Use Seclogin.sl Use Audfiles.sl Use AudFiles.vw Use dates.utl ACTIVATE_VIEW Activate_oAuditListing FOR oAuditListing Object oAuditListing Is A dbView Set Location to 2 3 Set Size to 316 559 Set Label to "Audit: Changed/Deleted Records" Set Border_Style to Border_Thick Property Date pdDateFrom 0 Property Date pdDateTo 0 Property String psTableName "" Property String psUser "" Property String psCurrentViewName "" Object oAudinfo_DD is a Audinfo_DataDictionary Procedure OnPostFind Integer eMessage Boolean bFound Forward Send OnPostFind eMessage bFound Send Beginning_of_Data of odbListAudDet End_Procedure Procedure OnConstrain Forward Send OnConstrain If (pdDateFrom(Self)>0) Constrain AudInfo.CDate ge (pdDateFrom(Self)) If (pdDateTo(Self)>0) Constrain AudInfo.CDate le (pdDateTo(Self)) If (psTableName(Self)>"") Constrain AudInfo.TableName eq (psTableName(Self)) If (psUser(Self)>"") Constrain AudInfo.User eq (psUser(Self)) If (psCurrentViewName(Self)>"") Constrain AudInfo as ((UpperCase(AudInfo.ViewName))=(Uppercase(psCurrentViewName(Self)))) End_Procedure End_Object // oAudinfo_DD Object oAuddet_DD Is A Auddet_DataDictionary Set DDO_Server To oAudinfo_DD Set Constrain_File To Audinfo.File_Number End_Object // oAuddet_DD Set Main_DD To oAudinfo_DD Set Server To oAudinfo_DD Set piMinSize to 250 559 Set Maximize_Icon to True //----------------------------------------------------------------------- // Create custom confirmation messages for save and delete // We must create the new functions and assign verify messages // to them. //----------------------------------------------------------------------- Function ConfirmDeleteHeader Returns Boolean Boolean bFail Get Confirm "Delete Entire Header and all detail?" to bFail Function_Return bFail End_Function // ConfirmDeleteHeader // Only confirm on the saving of new records Function ConfirmSaveHeader Returns Boolean Boolean bNoSave bHasRecord Handle hoSrvr Get Server to hoSrvr Get HasRecord of hoSrvr to bHasRecord If not bHasRecord Begin Get Confirm "Save this NEW header?" to bNoSave End Function_Return bNoSave End_Function // ConfirmSaveOrder // Define alternate confirmation Messages Set Verify_Save_MSG to GET_ConfirmSaveHeader Set Verify_Delete_MSG to GET_ConfirmDeleteHeader Procedure Activate_View Returns Integer Integer iRetVal Forward Get msg_Activate_View to iRetVal //Start the view in Reverse Date Order Set Ordering of odbListAudInfo to 5 Set pbReverseOrdering of odbListAudInfo to True Send OnClick of oButtonRefresh Procedure_Return iRetVal End_Procedure Object oGroupConstrain is a Group Set Size to 37 447 Set Location to 1 2 Set Label to "Constrain Info - Leave Form(s) Blank to NOT Constrain --- (Click the Refresh Button to see the most recent changes/deletions or apply Constraints)" Object oFormViewName is a Form Set Size to 13 133 Set Location to 20 7 Set Label to "View Name" Set Label_Justification_Mode to jmode_top Set Label_Col_Offset to 0 Set Capslock_State to True // Set Prompt_Object to SecViews_SL End_Object Object oFormTableName is a Form Set Size to 13 83 Set Location to 20 143 Set Prompt_Button_Mode to PB_PromptOn Set Label to "Table Name" Set Label_Justification_Mode to jmode_top Set Label_Col_Offset to 0 Set Prompt_Object to Audfiles_sl End_Object Object oFormUser is a Form Set Size to 13 61 Set Location to 20 229 Set Label to "User" Set Label_Justification_Mode to jmode_top Set Label_Col_Offset to 0 Set Capslock_State to True // Set Prompt_Object to SecLogin_sl End_Object Object oFormDateFrom is a Form Set Size to 13 55 Set Location to 20 293 Set Prompt_Button_Mode to PB_PromptOn Set Label to "Date From" Set Label_Justification_Mode to jmode_top Set Label_Col_Offset to 0 Set Prompt_Object to popup_calendar End_Object Object oFormDateTo is a Form Set Size to 13 55 Set Location to 20 351 Set Prompt_Button_Mode to PB_PromptOn Set Label to "Date To" Set Label_Justification_Mode to jmode_top Set Label_Col_Offset to 0 Set Prompt_Object to popup_calendar End_Object Object oButtonRefresh is a Button Set Size to 13 14 Set Location to 20 412 Set Label to "Refresh" Set Bitmap to "Refresh2.bmp" Set psToolTip to "Refresh Data" Procedure OnClick String sValue Get Value of oFormDateFrom to sValue Set pdDateFrom to sValue Get Value of oFormDateTo to sValue Set pdDateTo to sValue Get Value of oFormTableName to sValue Set psTableName to sValue Get Value of oFormUser to sValue Set psUser to sValue Get Value of oFormViewName to sValue Set psCurrentViewName to sValue Send Rebuild_Constraints of oAudinfo_DD Send Beginning_of_Data of odbListAudInfo End_Procedure End_Object Object oButtonClear is a Button Set Size to 13 14 Set Location to 20 429 Set Label to "Clear" Set Bitmap to "clra.bmp" Set psToolTip to "Clear Constraints" Procedure OnClick String sValue Set Value of oFormDateFrom to "" Set pdDateFrom to "" Set Value of oFormDateTo to "" Set pdDateTo to "" Set Value of oFormTableName to "" Set psTableName to "" Set Value of oFormUser to "" Set psUser to "" Set Value of oFormViewName to "" Set psCurrentViewName to "" Send Rebuild_Constraints of oAudinfo_DD Send Beginning_of_Data of odbListAudInfo End_Procedure End_Object End_Object Object odbListAudInfo is a DbList Set Location to 42 3 Set Size to 101 554 Begin_Row Entry_Item AudInfo.ViewName Entry_Item AudInfo.TableName Entry_Item AudInfo.User Entry_Item AudInfo.WorkStation Entry_Item AudInfo.CDate Entry_Item AudInfo.CTime Entry_Item AudInfo.Deleted Entry_Item AudInfo.RecordNumber Entry_Item AudInfo.RecordRowID End_Row Set Main_File to AudInfo.File_number Set Form_Width 0 to 123 Set Header_Label 0 to "View Name" Set Form_Width 1 to 65 Set Header_Label 1 to "Table Name" Set Form_Width 2 to 55 Set Header_Label 2 to "User" Set Form_Width 3 to 72 Set Header_Label 3 to "WorkStation" Set Form_Width 4 to 50 Set Header_Label 4 to "Date" Set Form_Width 5 to 45 Set Header_Label 5 to "Time" Set Form_Width 6 to 37 Set Header_Label 6 to "Deleted" Set Column_CheckBox_State 6 to True Set Form_Width 7 to 48 Set Header_Label 7 to "RecNum" Set Form_Width 8 to 58 Set Header_Label 8 to "RowID" Set Move_Value_Out_State to False Set Auto_Export_State to False Set GridLine_Mode to Grid_Visible_Both Set pbHeaderTogglesDirection to True Set peResizeColumn to rcAll Set peAnchors to anTopLeftRight Set CurrentRowColor to 12910591 Set CurrentCellColor to 65535 End_Object Object odbListAudDet is a dbList Set Size to 133 554 Set Location to 147 3 Begin_Row Entry_Item Auddet.Num Entry_Item Auddet.Fieldname Entry_Item Auddet.Oldvalue Entry_Item Auddet.Newvalue End_Row Set Main_file to Auddet.File_number Set Form_Width 0 to 36 Set Header_Label 0 to "#" Set Form_Width 1 to 130 Set Header_Label 1 to "Field Name" Set Form_Width 2 to 192 Set Header_Label 2 to "Old Value" Set Form_Width 3 to 192 Set Header_Label 3 to "New Value" Set Server to oAuddet_DD Set Ordering to 1 Set peResizeColumn to rcAll Set peAnchors to anAll Set Auto_Column_State to False Set Auto_Export_State to False Set Auto_Index_State to False Set Move_Value_Out_State to False Set GridLine_Mode to Grid_Visible_Both Set CurrentRowColor to 12910591 Set CurrentCellColor to 65535 End_Object Object oAudDet_OldValue is a dbForm Entry_Item AudDet.OldValue Set Server to oAuddet_DD Set Location to 284 41 Set Size to 13 555 Set Label to "Old Value:" Set peAnchors to anBottomLeftRight Set Form_Justification_Mode to Form_EditLeft Set Label_Col_Offset to 2 Set Label_Justification_Mode to JMode_Right End_Object Object oAudDet_NewValue is a dbForm Entry_Item AudDet.NewValue Set Server to oAuddet_DD Set Location to 299 41 Set Size to 13 555 Set Label to "New Value:" Set peAnchors to anBottomLeftRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to JMode_Right End_Object //------------------------------------------------------------------- // Table entry checking - attempt to save header record // before entering a table (this is called by table. Return // a non-zero if the save failed (i.e., do not enter table) //------------------------------------------------------------------- Function SaveHeader Returns Boolean Integer iRec Boolean bChanged bHasRecord Handle hoSrvr Get Server to hoSrvr // The Header DDO. Get HasRecord of hoSrvr to bHasRecord // Is there a record? Get Should_Save to bChanged // Are there any current changes? // If there is no record and no changes we have an error. If (not(bHasRecord) AND not(bChanged) ) Begin // no rec Send UserError "You must First Create & Save the Header" Function_Return True End // Attempt to Save the current Record // request_save_no_clear does a save without clearing. Send Request_Save_No_Clear // The save succeeded if there are now no changes, and we // have a saved record. Should_save tells us if we've got changes. // We must check the DDO's HasRecord property to see if // we have a record. If it is false, we had no save. Get Should_Save to bChanged // is a save still needed Get HasRecord of hoSrvr to bHasRecord // is there a record after the save? // if no record or changes still exist, return an error code of 1 If (not(bHasRecord) OR (bChanged)) begin Function_Return true End End_Function // SaveHeader Object oButtonFiles is a Button Set Size to 14 63 Set Location to 5 472 Set Label to "Tables to Audit" Set peAnchors to anTopRight Set psToolTip to "Open Tables to Audit View" Procedure OnClick Send Activate_oAudFiles End_Procedure End_Object Object oWSButtonCopyRecNum is a Button Set Size to 14 51 Set Location to 25 453 Set Label to "Copy RecNum" Set peAnchors to anTopRight Set psToolTip to "Copy Recnum to Clipboard" Procedure OnClick Integer iRecNum Get Field_Current_Value of oAudinfo_DD Field AudInfo.Recnum to iRecNum Direct_Output "Clipboard:" Write iRecNum Close_Output End_Procedure End_Object Object oWSButtonCopyRowID is a Button Set Size to 14 51 Set Location to 25 506 Set Label to "Copy RowID" Set peAnchors to anTopRight Set psToolTip to "Copy RowID to Clipboard" Procedure OnClick String sRowID Get Field_Current_Value of oAudinfo_DD Field AudInfo.RecordRowID to sRowID Direct_Output "Clipboard:" Write sRowID Close_Output End_Procedure End_Object End_Object // oAuditListing