HDR*PowerBuilder0600^U7RAPIDS data entry and reporting library - All windows for modules, reference tables and reporting module.FRE*BpNOD* C ENT*0600R4#-b?&w_emission_factor_a.srwENT*0600;>Aw_emission_factor_a.winENT*0600l]AA w_device.winENT*0600y-b?w_emission_factor_base.srwENT*0600 6-b? w_device.srwENT*0600N.>Aw_emission_factor_base.winENT*06007AA w_data.winENT*0600s:-b?w_emission_factor_c.srwENT*0600 :-b?" w_data.srwENT*0600AAw_emission_factor_c.winENT*0600AAw_connect.winENT*06003$=-b?(w_emission_factor_f.srwENT*0600 @<-b?w_connect.srwENT*0600:o;BAw_emission_factor_f.winENT*0600NBAw_cal_protocol.winENT*0600~m@-b?w_emission_factor_g.srwENT*0600 W?-b?w_cal_protocol.srwENT*0600jBAw_emission_factor_g.winENT*0600|BAu_dw_plain.udoENT*0600 @-b? w_emission_factor_p.srwENT*0600 @-b?u_dw_plain.sruENT*0600M$BAw_emission_factor_p.winENT*0600 RBAu_dw_permit_condition.udoENT*0600D-b?&w_emission_factor_s.srwENT*06008 6A-b?!u_dw_permit_condition.sruENT*0600۽BAw_emission_factor_s.winENT*0600?A u_dw_loc.udoENT*0600~$E-b?w_emission_growth_factor.srwENT*0600 j"-b?d u_dw_loc.sruENT*0600CLCAw_emission_growth_factor.winENT*06006!CAu_dw_group_src.udoENT*0600EF-b?<w_emission_saf.srwENT*0600 E-b?*u_dw_group_src.sruENT*0600 nTCAw_emission_saf.winENT*0600 p$CAu_dw_group_pro.udoENT*0600^@O-b? w_geo.srwENT*0600 F-b?+u_dw_group_pro.sruENT*0600dDA w_geo.winENT*0600DqDAu_dw_group_mat.udoENT*0600ZU-b? w_legal.srwENT*0600t O-b?-u_dw_group_mat.sruENT*0600TEA w_legal.winENT*0600J&CAu_dw_group_geo.udoENT*0600k-b?w_master_detail.srwENT*0600:I-b?/u_dw_group_geo.sruENT*0600R >Aw_master_detail.winENT*0600Tl"@Au_dw_group_dev.udoENT*06001V-b?w_material.srwENT*0600G /-b?+u_dw_group_dev.sruENT*0600EAw_material.winENT*0600f@Au_dw_group.udoENT*0600<TX-b? w_permit.srwENT*0600n./-b?)u_dw_group.sruENT*0600ƧEA w_permit.winENT*0600^ >Au_dw_contact.udoENT*0600@_-b?w_process.srwENT*0600-b?Mu_dw_contact.sruENT*0600*FAw_process.winENT*0600"!H`-b?w_product_profile.srwENT*0600f FAw_product_profile.winENT*0600I3FAu_dw_act_str.udoENT*0600$a-b?;u_dw_act_str.sruENT*0600f1FAu_dw_act_src.udoENT*0600$5ZA!w_reference.srwENT*0600Fb-b?;u_dw_act_src.sruENT*0600 ,-b?8u_dw_activity.sruENT*0600?Au_dw_activity.udoNOD*|8ENT*0600n.AAw_reference.winENT*0600J*#d-b?w_scc_ams_material.srwENT*0600b 4_GAw_scc_ams_material.winENT*0600*nee-b?w_security.srwENT*0600z GAw_security.winENT*0600-k-b? w_source.srwENT*0600 GA w_source.winENT*0600FdF@w_speciation_profile.srwENT*06000pr-b? w_stream.srwENT*0600\ HA w_stream.winENT*06001:s-b?Xw_use_type.srwENT*0600 3HAw_use_type.winENT*06008fHAw_scc_speciation_lookup.winENT*06002<t-b?'w_scc_speciation_lookup.srwENT*0600u-b?)w_rpt_airs.srwENT*0600dB*IAw_rpt_airs.winENT*0600 x-b? w_rpt_qc.srwENT*0600IA w_rpt_qc.winENT*0600* (z-b?Lw_rpt_sas.srwENT*0600!DJAw_rpt_sas.winENT*0600h4JAw_speciation_profile.winNOD*8ENT*060011EAu_dw_act_pro.udoENT*0600 Y-b?<u_dw_act_pro.sruENT*06000DAu_dw_act_leg.udoENT*0600P-b?:u_dw_act_leg.sruENT*0600.vCAu_dw_act_geo.udoENT*06002OH-b??u_dw_act_geo.sruENT*06001@Au_dw_act_dev.udoENT*0600--b?;u_dw_act_dev.sruENT*0600FAstr_use_type.strENT*0600~b-b?&str_use_type.srsENT*0600xFAstr_stream_context.strENT*0600vb-b?str_stream_context.srsENT*0600p|FAstr_connect_context.strENT*0600nb-b?str_connect_context.srsENT*0600hBFA str_act.strENT*0600fb-b? str_act.srsENT*0600HoFAnvo_locations.udoENT*0600(c-b?=nvo_locations.sruDAT**Non-visual user object for handling city, county, state dddw.forward global type nvo_locations from nonvisualobject end type end forward global type nvo_locations from nonvisualobject end type global nvo_locations nvo_locations type variables string is_city_orig_sql; string is_county_orig_sql; end variables forward prototypes public subroutine uf_get_orig_sql (datawindow pdw_obj) public subroutine uf_itemchange_on_city (datawindow pdw_obj) public subroutine uf_itemchange_on_couDAT*,nty (datawindow pdw_obj) public function boolean uf_validate_data (datawindow pdw_obj, string ps_col_name, string ps_entered_data) end prototypes public subroutine uf_get_orig_sql (datawindow pdw_obj);/////////////////////////////////////////////////////////////////////////// // // Function: uf_get_orig_sql // // Purpose: // // This function gets the original data source for // geographic_incorp_rid and geographic_county_rid DropDownDataWindows // // Arguments: // pdw_obj (dataDAT*.window/value) - datawindow where the city and county // dddw are on // // Returns : (none) // // DATE NAME REVISION // ---- ------------------------------------------------------------ // 8/16/94 SWJ INITIAL VERSION ///////////////////////////////////////////////////////////////////////// DataWindowChild dwc // For geographic_incorp_rid dddw if pdw_obj.GetChild("geographic_incorp_rid", dwc) = -1 then MessageBox("uf_get_orig_sql", "Application Error:~nCity - " + & "NotDAT*0 a DataWindowChild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) is_city_orig_sql = dwc.Describe("DataWindow.Table.Select") // For geographic_county_rid dddw if pdw_obj.GetChild("geographic_county_rid", dwc) = -1 then MessageBox("uf_get_orig_sql", "Application Error:~nCounty - " + & "Not a DataWindowChild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) is_county_orig_sql = dwc.Describe("DataWindow.Table.Select") enDAT*2d subroutine public subroutine uf_itemchange_on_city (datawindow pdw_obj);/////////////////////////////////////////////////////////////////////////// // // Function: uf_itemchange_on_city // // Purpose: // // This function displays the county and state based on the // selected city. // // Arguments: // pdw_obj (datawindow/value) - current datawindow // // Returns : (none) // // DATE NAME REVISION // ---- ------------------------------------------------------------ /DAT*4/ 8/16/94 SWJ INITIAL VERSION ///////////////////////////////////////////////////////////////////////// DataWindowChild dwc long ll_parent_rid, ll_row_num // Display the county for the selected city if pdw_obj.GetChild("geographic_incorp_rid", dwc) = -1 then MessageBox("uf_itemchange_on_city", "Application Error:~nCity - " + & "Not a DataWindowChild.~nContact your technical support.") return end if ll_parent_rid = dwc.GetItemNumber(dwc.GetRow(), "parent_rid") pdw_obj.SetItemDAT*6(pdw_obj.GetRow(), "geographic_county_rid", ll_parent_rid) // Display state name for the selected city and county if pdw_obj.GetChild("geographic_county_rid", dwc) = -1 then MessageBox("uf_itemchange_on_city", "Application Error:~nCounty - " + & "Not a DataWindowChild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) ll_row_num = dwc.Find("rid = " + String(ll_parent_rid), 1, dwc.RowCount()) ll_parent_rid = dwc.GetItemNumber(ll_row_num, "parent_rid") pdw_oDAT*8bj.SetItem(pdw_obj.GetRow(), "geographic_state_rid", ll_parent_rid) end subroutine public subroutine uf_itemchange_on_county (datawindow pdw_obj);/////////////////////////////////////////////////////////////////////////// // // Function: uf_itemchange_on_county // // Purpose: // // This function displays the city and state and retrieves a list of // cities based on the selected county. // // Arguments: // pdw_obj (datawindow/value) - current datawindow // // Returns : (none)DAT*: // // DATE NAME REVISION // ---- ------------------------------------------------------------ // 8/16/94 SWJ INITIAL VERSION ///////////////////////////////////////////////////////////////////////// DataWindowChild dwc long ll_rid, ll_parent_rid, ll_null string ls_sql_stmnt, ls_err // Display state name for the selected county if pdw_obj.GetChild("geographic_county_rid", dwc) = -1 then MessageBox("uf_itemchange_on_county", "Application Error:~nCounty - " + & "Not a DataDAT*<WindowChild.~nContact your technical support.") return end if ll_rid = dwc.GetItemNumber(dwc.GetRow(), "rid") ll_parent_rid = dwc.GetItemNumber(dwc.GetRow(), "parent_rid") pdw_obj.SetItem(pdw_obj.GetRow(), "geographic_state_rid", ll_parent_rid) // Get a list of cities for the selected county if pdw_obj.GetChild("geographic_incorp_rid", dwc) = -1 then MessageBox("uf_itemchange_on_county", "Application Error:~nCity - " + & "Not a DataWindowChild.~nContact your technical support."DAT*>) return end if dwc.SetTransObject(SQLCA) // Change data source for dwc ls_sql_stmnt = "DataWindow.Table.Select=~"" + is_city_orig_sql + & " AND RAP_GEOGRAPHIC_LOCATIONS_A.PARENT_RID = " + String(ll_rid) + "~"" ls_err = dwc.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("dwModify Failed", ls_err) return end if dwc.Retrieve() // Blank out the city field //dwc.InsertRow(0) SetNull(ll_null) pdw_obj.SetItem(pdw_obj.GetRow(), "geographic_incorp_rid", ll_null) if IsNuDAT*@ll(pdw_obj.GetItemNumber(pdw_obj.GetRow(), "geographic_county_rid")) then pdw_obj.SetItem(pdw_obj.GetRow(), "geographic_county_rid", ll_rid) end if end subroutine public function boolean uf_validate_data (datawindow pdw_obj, string ps_col_name, string ps_entered_data);/////////////////////////////////////////////////////////////////////////// // // Function: uf_validate_data // // Purpose: // // This function validates city or county data user entered. // // Arguments: // pdw_oDAT*Bbj (datawindow/value) - current datawindow // ps_col_name (string/value) - column name for dddw // ps_entered_data (string/value) - data entered by user // // Returns : Boolean // TRUE - if data found in the list of dddw // FALSE - if data not found in the list of dddw or any // error occurs // // DATE NAME REVISION // ---- ------------------------------------------------------------ // 8/17/94 SWJ INITIAL VERSION /////////////////////////////////////////DAT*D//////////////////////////////// DataWindowChild dwc string ls_col_text // Allow city or county to be blank-out if ps_entered_data = '' or IsNull(ps_entered_data) then return TRUE end if if ps_col_name = 'geographic_incorp_rid' then ls_col_text = 'City' else ls_col_text = 'County' end if // Get the handle of the child datawindow if pdw_obj.GetChild(ps_col_name, dwc) = -1 then MessageBox("uf_validate_data", "Application Error:~n" + ls_col_text + & " - Not a DataWindowChDAT*Fild.~nContact your technical support.") return FALSE end if dwc.SetTransObject(SQLCA) // If value from GetText() = the value in rid field, do not perform // dwFind because that data is entered by clicking a value from dddw list if IsNumber(ps_entered_data) then //if ps_entered_data = String(dwc.GetItemNumber(dwc.GetRow(), "rid")) then return TRUE end if // Check to see if data entered by user is in the dddw list if dwc.Find("name = " + ps_entered_data, 1, dwc.RowCount()) < 0 thDAT*!en MessageBox('Column - ' + ls_col_text, 'Sorry! Not a valid ' + & ls_col_text) return FALSE else return TRUE end if end function on nvo_locations.create TriggerEvent( this, "constructor" ) end on on nvo_locations.destroy TriggerEvent( this, "destructor" ) end on DAT*Ja@K)b?FAa@a@t`a@a&`@`@a0j@j@a>k@k@QJl@l@a^m@m@qj@@az@@a@@@@^@^@qgrn@n@q@q@ nvo_locationsnonvisualobjectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtransactionsqlca2 nvo_locations  DAT*L pdw_objuf_get_orig_sqluf_itemchange_on_cityuf_itemchange_on_countyps_col_nameps_entered_datauf_validate_data+create+destroyr  QCdatawindow.im   NZBCdatawindow.SSQ$0< x _initsrcnonvisualobjectnvo_locationsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtDAT*4ransaction, urr_acpi@envi!ildesc/il@age9ch@listGre@witeSon@powgtr@ pros @ so l@ dev lo@proc nd@e @# @@ N 8)(81<d8008@8[DAT*Pp@)b?>A#*p@7p@.@@3\@\@>[@[@Jc@c@WU@U@h@@t@@~@@@@@@@@^@^@@@0@0@n@n@+`@@@*@*@v@v@F@F@Q#q@q@/Q!5p@ 5">L X w_emission_factor_basew_single_tablemeDAT*RnuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderUntitled7  Emission FactorFIRE.ICO*7 datawindowchildvalid7  keycodemessagepointergs_databasef_get_emis_fact_ridf_get_sequencetraDAT*Tnsactionsqlcaw_filterf_dddw_searchf_validate_codeselect scc_ams_code from rap_processes where rid =0 23\=A=Af_look_upf_retrieve_codesu23(\=Atd,=A0t   (, d h 2 w_emission_facDAT*Vtor_base  H wparamlparam+highlight_dddwwf_check_requiredpl_cur_rowwf_check_specialwf_check_ridkeykeyflags+dwnkey+dwescape+wparam+lparam+open+ue_open_filter_win+create+destroy+key+keyflagsrowdwodata+itemchanged+xpos+ypos+row+dwo+rbuttondown+itemfocuschanged+dwnprocessenter+data+editchanged+itemerror,x  LULBe8BLwae LCkeycode.ULinae DAT*X QLLCdwobject.Sh@LIILCdwobject.LLCdwobject.**(8`x0DAT*ZTx x _initsrcw_single_tablew_emission_factor_basemenuwindowtypewindowstatewindowobjecttoolbaralignmentw_single_table`st_no_record_greyst_no_record_greyfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_single_table`st_no_record_whitest_no_record_whitew_single_table`dw_2dw_2dwobjectw_single_table`dw_1dw_1w_single_table`r_1r_1linestyledatawindows_rec_holderdatawindowchildkeycodemDAT*\essagepointertransactionw_filter@ 7@<@G@S@`@q@@ @d@ @ @@@ @ @@@  @@(<@@A@J@@DAT*^^ c v es!z@@@!7@<@@@@@      !b% @*.DAT*` . {1{1 x$1D0$8$9)L8,^1l,T$Dd" +wparam+lparam::message< @\( il_selected_row7idwc_dw_child 87selectDAT*brow@ 0 8 L T /:F@@8$)$81<N94$)<81<9D$)X81)t8#9|$8)88"8080:)@@8$)8 $)8$$8DAT*d)88@$)T89\$8d)p88"808x0:)@@8$)8$)8$8d)8$)89$8)88"808 0:)@@88$)@8H$)P8XDAT*> $8)`8h$)p89x$8)88"8080:)@@8$)8$)8$8)8$)89$8J$8808,0@8H$)P8X$)`8h$8)p8DAT*global type str_act from structure datetime start_date_time datetime end_date_time string method_type string ref_code string ref_type end type DAT*j`@K)b?FA `@`@t_`@aj@j@a(k@k@a4l@l@QHm@m@aT@@qd@@aq@@a~@@^@^@ str_actstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2   x structurestr_actmailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewiDAT*ltemtreeviewitemconnectioninfopowerobject ur@r_coexilrevi@ent(sc@ion4e@windHst@itemTte@nnecdow@jectq@~ 1@R @ 2  2 D start_date_timeend_date_timemethod_typeref_coderef_typed  &DAT*V ^@2  ;      DAT*global type str_connect_context from structure string device_id string device_name string source_id string source_name long device_rid long source_rid end type DAT*r`@K)b?FA `@`@t^`@a&j@j@a4k@k@a@l@l@QTm@m@a`@@qp@@a}@@a@@^@^@ str_connect_contextstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2   x structurestr_connect_contextmailrecipientenvironmentmailfiledescriptionmailmessagedDAT*tatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject ur@r_stxtlrec&ir@ntm4cr@onm@d@indoTtv@tem`em@nectpwe@ect}@ @ h@@ 2  2 J device_iddevice_namesource_idsource_namedevice_ridsource_ridx DAT*   ( 4?    DAT*global type str_stream_context from structure string source_id string source_name string device_id string device_name string process_id string process_name long source_rid long device_rid long process_rid end type DAT*z`@K)b?FA `@`@t]`@a%j@j@a3k@k@a?l@l@qSm@m@_@@qo@@a|@@a@@^@^@ str_stream_contextstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2   x structurestr_stream_contextmailrecipientenvironmentmailfiledescriptionmailmessagedatDAT*|awindowchildlistviewitemtreeviewitemconnectioninfopowerobject e_@strlrient%nt@lfil3on@lmes?in@hildSte@eevi_ne@ninfoec@|@ @ @  2  2 n source_idsource_namedevice_iddevice_nameprocess_idprocess_namesource_riddevice_ridprocDAT*ess_rid h ct en( de4 ag? liLwiWpb      DAT*Structure to hold an array of use typeglobal type str_use_type from structure string use_type[] string group_name[] integer dimension[] integer upper_bound string action end type DAT*`@K)b?FA `@`@t\`@aj@j@a-k@k@a9l@l@qMm@m@Y@@qi@@av@@a@@^@^@ str_use_typestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject D/ x#D/2 DAT*  x structurestr_use_typemailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject _r@s_colit_cue@els-co@s_sq9un@li_sMa@riccYa@ser_i@)v@ @ h@@ 2 DAT*) 2 c use_typesrc group_name dimensionesupper_boundaction,Dd-^@, -D8-^@P \ 111 DAT*User object for device activity snapshot and history views.forward global type u_dw_act_dev from u_dw_activity end type end forward global type u_dw_act_dev from u_dw_activity end type global u_dw_act_dev u_dw_act_dev type variables end variables forward prototypes public subroutine uf_reshape_dw () public subroutine uf_resize_detail () public subroutine uf_retrieve_parameter (long pl_ref_rid) end prototypes public subroutine uf_reshape_dw ();// Reshape the datawindows dw_DAT*act_query.Resize(dw_act_query.Width, 97) cb_select.Show() if is_view_style = "current" then dw_act_detail.Move(dw_act_detail.X, 150) dw_act_detail.Resize(dw_act_detail.Width, 949) dw_act_detail.BringToTop = TRUE dw_act_master.Border = FALSE elseif is_view_style = "history" then dw_act_detail.Move(dw_act_detail.X, 233) dw_act_detail.Resize(dw_act_detail.Width, 861) dw_act_master.BorderStyle = StyleLowered! dw_act_master.Border = TRUE end if end subroutine public subrDAT*outine uf_resize_detail ();dw_act_detail.Resize(dw_act_detail.Width, 861) end subroutine public subroutine uf_retrieve_parameter (long pl_ref_rid);string ls_code, ls_desc, ls_unit_code, ls_value_type, ls_material_code, & ls_sql_stmnt integer counter, li_seq_no // Retrieve data for parameter in dw_act_detail //if pl_ref_rid = 0 then ls_sql_stmnt = "select distinct rap_metric_maps.code, " + & "view_prompt_name, rap_metric_maps.unit_code, " + & "rap_metric_maps.value_type, rap_meDAT*tric_maps.material_code, " + & "rap_metric_maps.view_sequence_no " + & "from rap_metric_maps, rap_device_codes, rap_metrics " + & "where (rap_metric_maps.source_code = '@' or " + & "rap_metric_maps.source_code = '" + is_src_code + "') and " + & "(rap_device_codes.metric_map_code = rap_metric_maps.device_code) and " + & "rap_device_codes.code = '" + is_dev_code + "' and " + & "rap_metrics.code = rap_metric_maps.code and " + & "rap_metrics.level_type = 'DEV'" + & " oDAT*rder by rap_metric_maps.view_sequence_no, " + & "rap_metric_maps.material_code, rap_metric_maps.value_type" //else // // ls_sql_stmnt = "select distinct rap_metric_maps.code, " + & // "view_prompt_name, rap_metric_maps.unit_code, " + & // "rap_activities.value_type, rap_activities.material_code, " + & // "rap_metric_maps.view_sequence_no " + & // "from rap_metric_maps, rap_device_codes, rap_activities " + & // "where (rap_metric_maps.source_code = '@' or " + & // "rap_metriDAT*c_maps.source_code = '" + is_src_code + "') and " + & // "(rap_device_codes.metric_map_code = rap_metric_maps.device_code) and " + & // "rap_device_codes.code = '" + is_dev_code + "' and " + & // "rap_activities.metric_code = rap_metric_maps.code and " + & // "rap_activities.value_type = rap_metric_maps.value_type and " + & // "rap_activities.ref_rid = " + String(pl_ref_rid) + & // " union select distinct rap_metric_maps.code, " + & // "view_prompt_name, rap_metric_maps.unit_code, DAT*" + & // "rap_activities.value_type, rap_activities.material_code, " + & // "rap_metric_maps.view_sequence_no " + & // "from rap_metric_maps, rap_device_codes, rap_activities " + & // "where (rap_metric_maps.source_code = '@' or " + & // "rap_metric_maps.source_code = '" + is_src_code + "') and " + & // "(rap_device_codes.metric_map_code = rap_metric_maps.device_code) and " + & // "rap_device_codes.code = '" + is_dev_code + "' and " + & // "rap_activities.metric_code = rap_metricDAT*_maps.code and " + & // "rap_metric_maps.view_prompt_name not in (select distinct rap_metric_maps.view_prompt_name " + & // "from rap_metric_maps, rap_device_codes, rap_activities " + & // "where (rap_metric_maps.source_code = '@' or " + & // "rap_metric_maps.source_code = '" + is_src_code + "') and " + & // "(rap_device_codes.metric_map_code = rap_metric_maps.device_code) and " + & // "rap_device_codes.code = '" + is_dev_code + "' and " + & // "rap_activities.metric_code = rap_metDAT*ric_maps.code and " + & // "rap_activities.value_type = rap_metric_maps.value_type and " + & // "rap_activities.ref_rid = " + String(pl_ref_rid) + ") and " + & // "rap_activities.ref_rid = " + String(pl_ref_rid) + & // " union select distinct rap_metric_maps.code, " + & // "view_prompt_name, rap_metric_maps.unit_code, " + & // "rap_metric_maps.value_type, rap_metric_maps.material_code, " + & // "rap_metric_maps.view_sequence_no " + & // "from rap_metric_maps, rap_device_codes " +DAT* & // "where (rap_metric_maps.source_code = '@' or " + & // "rap_metric_maps.source_code = '" + is_src_code + "') and " + & // "(rap_device_codes.metric_map_code = rap_metric_maps.device_code) and " + & // "rap_device_codes.code = '" + is_dev_code + "' and " + & // "rap_metric_maps.code not in (select distinct metric_code from " + & // "rap_activities where ref_rid = " + String(pl_ref_rid) + & // ") order by 6, 5, 4" // //end if declare metricCursor dynamic cursor for sqlsa;DAT* if f_db_error(SQLCA, "Fail on declaring dynamic cursor metricCursor." + & " Contact your technical support.") = 1 then return end if prepare sqlsa from :ls_sql_stmnt; if f_db_error(SQLCA, "Fail on preparing sqlsa." + & " Contact your technical support.") = 1 then return end if open dynamic metricCursor; if f_db_error(SQLCA, "Fail on open dynamic cursor metricCursor. " + & "Contact your technical support.") = 1 then return end if fetch metricCursor into :ls_code, :lDAT*s_desc, :ls_unit_code, & :ls_value_type, :ls_material_code, :li_seq_no; counter = 1 do while sqlca.sqlcode = 0 dw_act_detail.InsertRow(0) // Prefill these columns from the rap_metrics and rap_metric_maps tables dw_act_detail.SetItem(counter, "metric_desc", ls_desc) dw_act_detail.SetItem(counter, "unit_code", ls_unit_code) dw_act_detail.SetItem(counter, "metric_code", ls_code) dw_act_detail.SetItem(counter, "value_unit_code", ls_unit_code) // // Always display the first DAT*value type for the case of the multiple // // activity data for the same metric code in the sql statement. // // The following code fixes the problem. // if Not IsNull(ls_value_type) then // select distinct value_type // into :ls_value_type // from rap_metric_maps // where code = :ls_code and view_prompt_name = :ls_desc; // if f_db_error(SQLCA, "Fail on selecting value_type from rap_metric_maps table." + & // " Contact your technical support.") = 1 then // return // end if DAT* // end if dw_act_detail.SetItem(counter, "value_type", ls_value_type) dw_act_detail.SetItem(counter, "material", ls_material_code) if ls_material_code = '@' then dw_act_detail.SetItem(counter, 'material_code', SetNull(ls_material_code)) else dw_act_detail.SetItem(counter, "material_code", ls_material_code) end if dw_act_detail.SetItem(counter, 'view_seq_no', li_seq_no) // Prefill these columns from the variables dw_act_detail.SetItem(counter, "metric_level_type"DAT*, is_level) dw_act_detail.SetItem(counter, "ref_rid", il_ref_rid) dw_act_detail.SetItem(counter, "user_id", gs_user_id) // Change the row status programatically dw_act_detail.SetItemStatus(counter, 0, Primary!, NotModified!) dw_act_detail.SetItemStatus(counter, 0, Primary!, DataModified!) dw_act_detail.SetItemStatus(counter, 0, Primary!, NotModified!) counter = counter + 1 fetch metricCursor into :ls_code, :ls_desc, :ls_unit_code, & :ls_value_type, :ls_material_code, DAT*:li_seq_no; loop close metricCursor; if f_db_error(SQLCA, "Fail on close metricCursor cursor " + & "~nContact your technical support.") = 1 then return end if end subroutine on u_dw_act_dev.create call u_dw_activity::create end on on u_dw_act_dev.destroy call u_dw_activity::destroy end on type dw_act_master from u_dw_activity`dw_act_master within u_dw_act_dev int Width=2841 end type type r_1 from u_dw_activity`r_1 within u_dw_act_dev int X=8 int Y=129 int Width=288DAT*1 int Height=109 end type DAT*g@)b?@A=g@<g@#X@X@/c@c@<@@H@@Q^@^@@@@@@@@@@@0@0@q_`@@@aaroXs@s@qkly$_q@q@Qec%a`X u_dw_act_devu_dw_activityuserobjectswindowobjectborderstyledwobjectpowerobjectActivity data for the above date ranged_activity_detailfontcharsetfontpitchfontfamilySelect data in the spDAT*ecified date range MS Sans SerifSelectalignmentfillpatternNo records present. Use Insert to create new activity data.Specify date range to select activity datad_activity_queryHistory of activity datad_activity_masterlinestylestr_actdatawindowchild< &validnull< ߁< hdynamicstagingareasqlsa,metriccursor|r@ADAT*transactionsqlcaf_db_error|@A@Ags_user_idl@A0r x   ( l x 2 u_dw_act_dev  Y uf_reshape_dwuf_resize_detailpl_ref_riduf_retrieve_parameter+create+destroy QDAT*'QL  x4 _initsrcu_dw_activityu_dw_act_devuserobjectswindowobjectborderstyleu_dw_activity`dw_act_detaildw_act_detaildwobjectpowerobjectu_dw_activity`cb_selectcb_selectfontcharsetfontpitchfontfamilyu_dw_activity`st_no_recordst_no_recordalignmentfillpatternu_dw_activity`dw_act_querydw_act_queryu_dw_activity`st_current_headingst_current_headingu_dw_activity`dw_act_masterdw_act_masteru_dw_activity`r_1r_1linestyleu_dw_activity`r_2r_2u_DAT*dw_activity`ln_1ln_1u_dw_activity`ln_2ln_2str_actdatawindowchilddynamicstagingareatransaction ienit_ti@bjecereci,ro@tma8ri@nmaEda@ndowQviemtmmecti{er@ctwwi@@_nam_n@is_o s_@vityivdw_f_sule_ du@w_fr le@ii_diiDAT*_yi, r_am_c9 prs_coZ m ; 8ctaw! @!<< segetwct**** **@@@(@    DAT*    ! # % &!J> ?!{4 -. {4. {2 DAT*    $ $0$1a)@8T$)d8|$8,$$$1)8$$$1)8$9}$$9},$84<$D$L$1)T8DAT*\$d$l$1])t8|$:@$9}<Xt  ( H   d  dw_act_query$$width(resize8cb_selectH"show\is_view_stylel1currentdw_act_detail!!xmoveh@!!(8!bringtotop dw_act_master&borderNDAT*l1history!!!!(8&borderstyle@&  0 @ T d |            $ , < D L T \ d l t |    B$ $0$1])@8d H dDAT*w_act_detail!!width(resize8  0 @ $88/z%8]z&8z&8z&8z&8z&L$z&8Tz&8\z&8z&$z&8z&8z&8z&8#z&8Pz&,88z%81<,,,88z%81<@ ,,88z%81<DAT* , (1},@$1X$1)l8t$<8|6)8$<86)8$<86)8$<86)8$<86)8 $<86) 88(,$<84@8)DDAT*g@)b?@A/g@g@d?g@qX@X@!*c@c@q7@@aC`@`@aMj@j@![k@k@qgl@l@{m@m@@@@@@@@@^@^@@@@@q@@Q@@Q#@@a-Y@Y@8@@C@@On@n@`Z@@c@@`m0@0@$ep@p@aM"p@AM?%Xq@q@def&sjOp@Pj_d'epcp@`p_d(iy8p@`yt)2Wp@DAT*`re*iUp@p+@@v@v@- u_dw_groupuserobjectuserobjectswindowobjectborderstylestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject? <9picturebuttonfontcharsetfontpitchfontfamilyalignmentvtextalignstatictextfillpatterndatawindowdwobjectrectanglelinestyle? zDAT*window? Xg add.bmpArialremove.bmp... Group MemberMS Sans Serif... Selection ListSource group member recordsSource selection listw_mdi_maintransactionsqlcaw_geow_sourcew_devicew_processw_materialdwitemstatusmessagef_highlight_rowx2 u_dw_group   uf_saveuf_check_pendingpdw_objuf_assign_active_dwp_ref_riduf_retrieve_group_memberp_parent_riduf_retriDAT*eve_select_listuf_undo_dw_grouppl_cur_rowpl_selected_rowuf_setitem_on_dw_groupuf_setitem_on_dw_select_listflagsxposypos+mousemovewparamlparam+save+select_one+select_all+validate_delete+add_row+create+destroy+flags+xpos+ypos+clicked+wparam+lparam+row+dwo+getfocus+losefocusrowdwod B@!QCdatawindow.=QL`QHQLL LUIIele DAT*  LUL         L^dLIILCdwobject. (8Hd| DAT*$<Tl4 x  _initsrcuserobjectu_dw_groupuserobjectswindowobjectborderstylestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectpicturebuttonpb_addfontcharsetfontpitchfontfamilyalignmentvtextalignpb_removestatictextst_group_memberfillpatternst_selection_listdatawindowdw_groupdwobjectdw_select_listrectDAT*angler_1linestyler_2windoww_mdi_maintransactionw_geow_sourcew_devicew_processw_materialdwitemstatusmessage @ '@ 3@@@ L@V@ d@p@s@!q _@q@ %@ge @d") E=@_act ar@te_tMN@E="rie@er_i(N"raps.@DAT*e") E=@_actmm@text NA@lz@ *@5ctaw!E@Qc@!nw<@ se@getwct******@ @@p@@ !@#@%@'@)tr@2DAT*st+an@r_bu,re@ !# 9. .!... .  y+ y*  DAT*  $#9,8 0)@89}H$\$)l81<, , 9}t9},8|0)8: F V d# lb_resultw_mdi_mainsqlca<@% @&8 ib_obj_modified+Updating data...DAT*setmicrohelpZ1+dw_groupP%updatedd+Data updated successfullyevZ1 @ H \ l t   $8 08+0:)@:@@8}}1<)t8#91<)89}9JV j d$ li_messagebox_returncase7(DAT* ib_obj_modified+Group ViewData have been modified in the group view. Save current changes?uf_save1luf_undo_dw_group 6|+ t   , ,),84$)H88Pr,"d&8l,$x&8,&&8,(&8&,*DAT*"DX n dO pdw_objw_mdi_maincase6w_geow_sourcew_devicew_processw_material @% ""@'($@(1&@):(@*D*@+H iw_cur_winf-$getactivesheett7-$classname<w_geoidw_activeV1%w_sourceV1%w_deviceV1%w_processb@V1%DAT*Bw_materialV1% , 4 H d x    b($, )@8H$P$)d84d p_ref_ridsqlca( @&l0 il_ref_ridf,dw_groupshe%settransobjects^0%,retrieve2X ( @ H P d d p_parent_ridDAT*User object for geographic activity snapshot and history views.forward global type u_dw_act_geo from u_dw_activity end type end forward global type u_dw_act_geo from u_dw_activity int Height=913 end type global u_dw_act_geo u_dw_act_geo type variables end variables forward prototypes public subroutine uf_reshape_dw () public subroutine uf_resize_detail () public subroutine uf_retrieve_parameter (long pl_ref_rid) public subroutine uf_retrieve_dw_act_detail (string sql_statemenDAT*t) public subroutine uf_retrieve_current () public subroutine uf_retrieve_history () public subroutine uf_select_dates (ref datetime pdt_start, ref datetime pdt_end) public function long uf_count_act () public function long uf_retrieve_dw_act_master () end prototypes public subroutine uf_reshape_dw ();// Reshape the datawindows dw_act_query.Resize(dw_act_query.Width, 97) cb_select.Show() if is_view_style = "current" then dw_act_detail.Move(dw_act_detail.X, 150) dw_act_detail.ResiDAT*ze(dw_act_detail.Width, 765) dw_act_detail.BringToTop = TRUE dw_act_master.Border = FALSE elseif is_view_style = "history" then dw_act_detail.Move(dw_act_detail.X, 233) dw_act_detail.Resize(dw_act_detail.Width, 677) dw_act_master.BorderStyle = StyleLowered! dw_act_master.Border = TRUE end if end subroutine public subroutine uf_resize_detail ();dw_act_detail.Resize(dw_act_detail.Width, 677) end subroutine public subroutine uf_retrieve_parameter (long pl_ref_rid);stringDAT* ls_code, ls_desc, ls_unit_code, ls_value_type, ls_material_code, & ls_sql_stmnt integer counter, li_seq_no // Ag profile if w_geo.is_use_type_list <> '' then // Retrieve data for parameter in dw_act_detail ls_sql_stmnt = 'select code, view_prompt_name, unit_code, value_type, ' + & 'material_code, view_sequence_no from rap_metric_maps ' + & 'where use_type in (' + w_geo.is_use_type_list + ') ' + & 'order by view_sequence_no' declare agMetricCursor dynamic cursor for sDAT*qlsa; if f_db_error(SQLCA, "Fail on declare dynamic cursor agMetricCursor. " + & "Contact your technical support.") = 1 then return end if prepare sqlsa from :ls_sql_stmnt; if f_db_error(SQLCA, "Fail on preparing sqlsa. " + & "Contact your technical support.") = 1 then return end if open dynamic agMetricCursor; if f_db_error(SQLCA, "Fail on open dynamic cursor agMetricCursor. " + & "Contact your technical support.") = 1 then return end if fetch agMetriDAT*cCursor into :ls_code, :ls_desc, :ls_unit_code, & :ls_value_type, :ls_material_code, :li_seq_no; counter = 1 do while sqlca.sqlcode = 0 dw_act_detail.InsertRow(0) // Prefill these columns from the rap_metrics and rap_metric_maps tables dw_act_detail.SetItem(counter, "view_seq_no", li_seq_no) dw_act_detail.SetItem(counter, "metric_desc", ls_desc) dw_act_detail.SetItem(counter, "unit_code", ls_unit_code) dw_act_detail.SetItem(counter, "metric_code", ls_codeDAT*) dw_act_detail.SetItem(counter, "value_unit_code", ls_unit_code) dw_act_detail.SetItem(counter, "value_type", ls_value_type) dw_act_detail.SetItem(counter, "material", ls_material_code) if ls_material_code = '@' then dw_act_detail.SetItem(counter, 'material_code', SetNull(ls_material_code)) else dw_act_detail.SetItem(counter, "material_code", ls_material_code) end if // Prefill these columns from the variables dw_act_detail.SetItem(counter, "metDAT*ric_level_type", is_level) dw_act_detail.SetItem(counter, "ref_rid", il_ref_rid) dw_act_detail.SetItem(counter, "user_id", gs_user_id) counter = counter + 1 fetch agMetricCursor into :ls_code, :ls_desc, :ls_unit_code, & :ls_value_type, :ls_material_code, :li_seq_no; loop close agMetricCursor; if f_db_error(SQLCA, "Fail on close agMetricCursor cursor. " + & "Contact your technical support.") = 1 then return end if else // declare metricCursor cursDAT*or for // select rap_metrics.code, rap_metrics.name, rap_metrics.unit_code // from rap_metrics // where rap_metrics.level_type = 'GEO' // order by rap_metrics.code; declare metricCursor cursor for select rap_metric_maps.code, rap_metric_maps.view_prompt_name, rap_metrics.unit_code, rap_metric_maps.view_sequence_no from rap_metrics, rap_metric_maps where rap_metrics.code = rap_metric_maps.code and rap_metrics.level_type = 'GEO' and use_type = 'DESCRIPTIVDAT*E INFORMATION AND CODES' order by rap_metric_maps.view_sequence_no; if f_db_error(SQLCA, "Fail on declare metricCursor cursor. " + & "Contact your technical support.") = 1 then return end if open metricCursor; if f_db_error(SQLCA, "Fail on open metricCursor cursor. " + & "Contact your technical support.") = 1 then return end if fetch metricCursor into :ls_code, :ls_desc, :ls_unit_code, :li_seq_no; counter = 1 do while sqlca.sqlcode = 0 dw_act_detaDAT*il.InsertRow(0) // Prefill these columns from the rap_metrics and rap_metric_maps tables dw_act_detail.SetItem(counter, "view_seq_no", li_seq_no) dw_act_detail.SetItem(counter, "metric_desc", ls_desc) dw_act_detail.SetItem(counter, "unit_code", ls_unit_code) dw_act_detail.SetItem(counter, "metric_code", ls_code) dw_act_detail.SetItem(counter, "value_unit_code", ls_unit_code) // dw_act_detail.SetItem(counter, "value_type", ls_value_type) // dw_act_detail.SetItem(DAT*counter, "material", ls_material_code) // Prefill these columns from the variables dw_act_detail.SetItem(counter, "metric_level_type", is_level) dw_act_detail.SetItem(counter, "ref_rid", il_ref_rid) dw_act_detail.SetItem(counter, "user_id", gs_user_id) counter = counter + 1 fetch metricCursor into :ls_code, :ls_desc, :ls_unit_code, :li_seq_no; // fetch metricCursor into :ls_code, :ls_desc, :ls_unit_code, & // :ls_value_type, :ls_material_code, :li_seq_no; DAT*loop close metricCursor; if f_db_error(SQLCA, "Fail on close metricCursor cursor. " + & "Contact your technical support.") = 1 then return end if end if end subroutine public subroutine uf_retrieve_dw_act_detail (string sql_statement);// Purpose: Using dynamic SQL statement to retrieve activity data long ll_rid, ll_row_num, ll_total_row datetime ldt_start_date_time, ldt_end_date_time, ldt_creation_date_time, & ldt_min_start, ldt_max_end string ls_metric_code, ls_useDAT*r_id, ls_value, ls_comments, & ls_confidential_flag, ls_data_code, ls_material_code, & ls_method_type, ls_reference_code, ls_reference_type, & ls_value_type, ls_value_unit_code, ls_dwfind decimal{11} ldec_value_amt integer counter SetNull(ldt_min_start) SetNull(ldt_max_end) // Clear the datawindow buffer (except parameter column) first uf_clear_detail() declare metricCursor dynamic cursor for sqlsa; if f_db_error(SQLCA, "Fail on declaring dynamic cursor " + & "~nContact DAT*your technical support.") = 1 then return end if prepare sqlsa from :sql_statement; if f_db_error(SQLCA, "Fail on preparing sqlsa" + & "~nContact your technical support.") = 1 then return end if open dynamic metricCursor; if f_db_error(SQLCA, "Fail on open dynamic cursor " + & "~nContact your technical support.") = 1 then return end if fetch metricCursor into :ll_rid, :ldt_creation_date_time, :ls_metric_code, & :ldt_start_date_time, :ls_user_id, :ls_value, :ls_commentsDAT*, :ls_confidential_flag, & :ls_data_code, :ldt_end_date_time, :ls_material_code, :ls_method_type, & :ls_reference_code, :ls_reference_type, :ldec_value_amt, & :ls_value_type, :ls_value_unit_code; counter = 1 do while sqlca.sqlcode = 0 ls_dwfind = "metric_code = '" + ls_metric_code + "'" if Not IsNull(ls_material_code) then ls_dwfind = ls_dwfind + " and (material = '" + ls_material_code + & "' or material = '@')" else ls_dwfind = ls_dwfind + " and (IsNull(material))" DAT* end if ll_row_num = dw_act_detail.Find(ls_dwfind, 1, dw_act_detail.RowCount()) if ll_row_num = 0 then // Comment this out temporarily because we don't have all data filled out // in the rap_metric_maps table yet. SWJ // MessageBox("Application Error", "No metric code - " + ls_metric_code + & // " found~nContact your technical support") elseif ll_row_num < 0 then MessageBox("Application Error", "Error finding metric code - " + & ls_metric_code + "~nContact your technical suDAT*pport") else dw_act_detail.SetItem(ll_row_num, "rid", ll_rid) dw_act_detail.SetItem(ll_row_num, "creation_date_time", ldt_creation_date_time) dw_act_detail.SetItem(ll_row_num, "metric_level_type", is_level) dw_act_detail.SetItem(ll_row_num, "ref_rid", il_ref_rid) dw_act_detail.SetItem(ll_row_num, "start_date_time", ldt_start_date_time) dw_act_detail.SetItem(ll_row_num, "user_id", ls_user_id) dw_act_detail.SetItem(ll_row_num, "value", ls_value) dw_act_detail.SetItem(ll_roDAT*w_num, "comments", ls_comments) dw_act_detail.SetItem(ll_row_num, "confidential_flag", ls_confidential_flag) dw_act_detail.SetItem(ll_row_num, "data_code", ls_data_code) dw_act_detail.SetItem(ll_row_num, "end_date_time", ldt_end_date_time) if (Not IsNull(ls_material_code)) or ls_material_code <> '' then dw_act_detail.SetItem(ll_row_num, "material_code", ls_material_code) end if dw_act_detail.SetItem(ll_row_num, "method_type", ls_method_type) dw_act_detail.SetItem(ll_row_numDAT*, "reference_code", ls_reference_code) dw_act_detail.SetItem(ll_row_num, "reference_type", ls_reference_type) dw_act_detail.SetItem(ll_row_num, "value_amt", ldec_value_amt) dw_act_detail.SetItem(ll_row_num, "value_type", ls_value_type) dw_act_detail.SetItem(ll_row_num, "old_value", ls_value) if Not IsNull(ls_value_unit_code) then dw_act_detail.SetItem(ll_row_num, "unit_code", ls_value_unit_code) dw_act_detail.SetItem(ll_row_num, "value_unit_code", ls_value_unit_code) end ifDAT* end if fetch metricCursor into :ll_rid, :ldt_creation_date_time, :ls_metric_code, & :ldt_start_date_time, :ls_user_id, :ls_value, :ls_comments, :ls_confidential_flag, & :ls_data_code, :ldt_end_date_time, :ls_material_code, :ls_method_type, & :ls_reference_code, :ls_reference_type, :ldec_value_amt, & :ls_value_type, :ls_value_unit_code; counter = counter + 1 loop close metricCursor; if f_db_error(SQLCA, "Fail on close dynamic cursor " + & "~nContact your technical suppoDAT*rt.") = 1 then return end if if is_view_style = 'current' then ll_total_row = dw_act_detail.RowCount() for ll_row_num = 1 to ll_total_row ldt_start_date_time = dw_act_detail.GetItemDateTime(ll_row_num, 'start_date_time') ldt_end_date_time = dw_act_detail.GetItemDateTime(ll_row_num, 'end_date_time') if ldt_start_date_time < ldt_min_start or & (IsNull(ldt_min_start) and Not IsNull(ldt_start_date_time)) then ldt_min_start = ldt_start_date_time end if if ldt_end_daDAT* te_time > ldt_max_end or & (IsNull(ldt_max_end) and Not IsNull(ldt_end_date_time)) then ldt_max_end = ldt_end_date_time end if next if Not(IsNull(ldt_min_start) or IsNull(ldt_max_end)) then st_current_heading.Text = "Showing activity data from " + & String(ldt_min_start, "mm/dd/yyyy") + " to " + String(ldt_max_end, "mm/dd/yyyy") elseif Not IsNull(ldt_min_start) then st_current_heading.Text = "Showing activity data from " + & String(ldt_min_start, "mm/dd/yyyy") elsDAT* e st_current_heading.Text = '' end if end if // NOT WORKING //uf_set_row_status() end subroutine public subroutine uf_retrieve_current ();// Purpose: Construct SQL statement for dw_act_detail (activity data // current view string ls_sql_statement // Construct select statement for dw_act_detail if w_geo.is_use_type = 'on' then ls_sql_statement = "Select rid, creation_date_time, metric_code, " + & "start_date_time, user_id, value, " + & "comment_text, confidentiaDAT*l_flag, data_code, end_date_time, " + & "material_code, method_type, reference_code, reference_type, " + & "value_amt, value_type, value_unit_code from rap_activities where " + & "ref_rid = " + String(il_ref_rid) + " and metric_level_type = '" + & is_level + "' and metric_code in (select code from " + & "rap_metric_maps where use_type in (" + w_geo.is_use_type_list + & "))" else ls_sql_statement = "Select rid, creation_date_time, metric_code, " + & "start_date_time, user_idDAT*, value, " + & "comment_text, confidential_flag, data_code, end_date_time, " + & "material_code, method_type, reference_code, reference_type, " + & "value_amt, value_type, value_unit_code from rap_activities where " + & "ref_rid = " + String(il_ref_rid) + " and metric_level_type = '" + & is_level + "'" end if // Get the retrieval arguments from dw_act_query and build the rest of // the where clause for SQL statement if IsNull(istr_act.start_date_time) then ls_sql_statemenDAT*t = ls_sql_statement + " and ((start_date_time is null)" else ls_sql_statement = ls_sql_statement + " and (start_date_time >= " + & f_compare_date_time(SQLCA, istr_act.start_date_time) end if if IsNull(istr_act.end_date_time) then ls_sql_statement = ls_sql_statement + " and (end_date_time is null))" else ls_sql_statement = ls_sql_statement + " and (end_date_time <= " + & f_compare_date_time(SQLCA, istr_act.end_date_time) + & " or end_date_time is null))" end if // Call thiDAT*s function to retrieve data for dw_act_detail uf_retrieve_dw_act_detail(ls_sql_statement) end subroutine public subroutine uf_retrieve_history ();// Purpose: Construct SQL statement for dw_act_detail (activity data // history view string ls_sql_statement datetime ldt_start_date_time, ldt_end_date_time // Construct select statement for dw_act_detail if w_geo.is_use_type = 'on' then ls_sql_statement = "Select rid, creation_date_time, metric_code, " + & "start_date_time, user_DAT*id, value, " + & "comment_text, confidential_flag, data_code, end_date_time, " + & "material_code, method_type, reference_code, reference_type, " + & "value_amt, value_type, value_unit_code from rap_activities where " + & "ref_rid = " + String(il_ref_rid) + " and metric_level_type = '" + & is_level + "' and metric_code in (select code from " + & "rap_metric_maps where use_type in (" + w_geo.is_use_type_list + & "))" else ls_sql_statement = "Select rid, creation_date_time, mDAT*etric_code, " + & "start_date_time, user_id, value, " + & "comment_text, confidential_flag, data_code, end_date_time, " + & "material_code, method_type, reference_code, reference_type, " + & "value_amt, value_type, value_unit_code from rap_activities where " + & "ref_rid = " + String(il_ref_rid) + " and metric_level_type = '" + & is_level + "'" end if // Get the retrieval arguments from dw_act_master and build the rest of // the where clause for SQL statement ldt_start_daDAT*te_time = dw_act_master.GetItemDateTime(dw_act_master.GetRow(), & "start_date_time") ldt_end_date_time = dw_act_master.GetItemDateTime(dw_act_master.GetRow(), & "end_date_time") ls_sql_statement = ls_sql_statement + " and start_date_time = " + & f_compare_date_time(SQLCA, ldt_start_date_time) if IsNull(ldt_end_date_time) then ls_sql_statement = ls_sql_statement + " and end_date_time is null" else ls_sql_statement = ls_sql_statement + " and end_date_time = " + & f_compare_dateDAT*_time(SQLCA, ldt_end_date_time) end if // Call this function to retrieve data for dw_act_detail uf_retrieve_dw_act_detail(ls_sql_statement) // Make select button visible cb_select.Show() end subroutine public subroutine uf_select_dates (ref datetime pdt_start, ref datetime pdt_end);DateTime ldt_max_start string ls_sql if w_geo.is_use_type = 'on' then ls_sql = "select min(start_date_time), max(end_date_time), max(start_date_time)" + & " from rap_activities where ref_rid DAT*= " + String(il_ref_rid) + " and " + & "metric_level_type = '" + is_level + "' and metric_code in " + & "(select code from rap_metric_maps " + & "where use_type in (" + w_geo.is_use_type_list + "))" declare dateCursor dynamic cursor for sqlsa; if f_db_error(SQLCA, "Fail on declaring dynamic cursor dateCursor" + & "~nContact your technical support.") = 1 then return end if prepare sqlsa from :ls_sql; if f_db_error(SQLCA, "Fail on preparing sqlsa" + & "~nContact youDAT* r technical support.") = 1 then return end if open dynamic dateCursor; if f_db_error(SQLCA, "Fail on open dynamic cursor dateCursor" + & "~nContact your technical support.") = 1 then return end if fetch dateCursor into :pdt_start, :pdt_end, :ldt_max_start; if f_db_error(SQLCA, "Fail on fetch cursor dateCursor" + & "~nContact your technical support.") = 1 then return end if close dateCursor; if f_db_error(SQLCA, "Fail on close dynamic cursor dateCursor" + DAT*"& "~nContact your technical support.") = 1 then return end if else select min(start_date_time), max(end_date_time), max(start_date_time) into :pdt_start, :pdt_end, :ldt_max_start from rap_activities where ref_rid = :il_ref_rid and metric_level_type = :is_level and metric_code in (select code from rap_metric_maps where use_type = 'DESCRIPTIVE INFORMATION AND CODES'); end if if f_db_error(SQLCA, "Fail on selecting the earliest start date time, " + & "the latest end daDAT*$te time, and the latest start date time. " + & " Contact your technical support.") = 1 then return end if if Not IsNull(pdt_end) then if ldt_max_start > pdt_end then pdt_end = ldt_max_start end if end if end subroutine public function long uf_count_act ();long ll_count string ls_sql if w_geo.is_use_type = 'on' then ls_sql = "select count(rid) from rap_activities where ref_rid = " + & String(il_ref_rid) + " and metric_level_type = '" + is_level + "' and " + & "metrDAT*&ic_code in (select code from rap_metric_maps " + & "where use_type in (" + w_geo.is_use_type_list + "))" declare actCursor dynamic cursor for sqlsa; if f_db_error(SQLCA, "Fail on declaring dynamic cursor actCursor" + & "~nContact your technical support.") = 1 then return -1 end if prepare sqlsa from :ls_sql; if f_db_error(SQLCA, "Fail on preparing sqlsa" + & "~nContact your technical support.") = 1 then return -1 end if open dynamic actCursor; if f_db_error(SQLCADAT*(, "Fail on open dynamic cursor actCursor" + & "~nContact your technical support.") = 1 then return -1 end if fetch actCursor into :ll_count; if f_db_error(SQLCA, "Fail on fetch actCursor" + & "~nContact your technical support.") = 1 then return -1 end if close actCursor; if f_db_error(SQLCA, "Fail on close dynamic cursor actCursor" + & "~nContact your technical support.") = 1 then return -1 end if else select count(rid) into :ll_count from rap_aDAT**ctivities where ref_rid = :il_ref_rid and metric_level_type = :is_level and metric_code in (select code from rap_metric_maps where use_type = 'DESCRIPTIVE INFORMATION AND CODES'); end if if f_db_error(SQLCA, "Fail on performing count function on rap_activities table. " + & " Contact your technical support.") = 1 then return -1 end if return ll_count end function public function long uf_retrieve_dw_act_master ();// Retrieve data for dw_act_master if w_geo.is_use_typeDAT*, = 'on' then dw_act_master.DataObject = 'd_activity_master_ag' dw_act_master.SetTransObject(SQLCA) return dw_act_master.Retrieve(il_ref_rid, is_level, istr_act.start_date_time, istr_act.end_date_time, & w_geo.istr_use_type.use_type) else return dw_act_master.Retrieve(il_ref_rid, is_level, istr_act.start_date_time, istr_act.end_date_time) end if end function on u_dw_act_geo.create call u_dw_activity::create end on on u_dw_act_geo.destroy call u_dw_activity::destroy end on DAT* type dw_act_detail from u_dw_activity`dw_act_detail within u_dw_act_geo int Height=629 end type type r_1 from u_dw_activity`r_1 within u_dw_act_geo int Y=129 int Height=109 end type DAT*0g@)b?CA=g@dPg@q#X@X@a/c@c@!<@@qH@@1Q^@^@1@@@@@@@@@@0@0@q_`@@@aaroXOp@pXly$_^s@s@Qqec%aq@q@&h` \`@m p u_dw_act_geou_dw_activityuserobjectswindowobjectborderstyledwobjectpowerobjectActivity data for the above date ranged_activity_detailfontchDAT*2arsetfontpitchfontfamilySelect data in the specified date range MS Sans SerifSelectalignmentfillpatternNo records present. Use Insert to create new activity data.Specify date range to select activity datad_activity_queryHistory of activity datad_activity_masterlinestylestr_actdatawindowchildP ,avalidnulloP mP  w_geodynamicstagingareasqlsa,agmetriccursorDAT*4xCAtransactionsqlcaf_db_error$CA$CAgs_user_idtCA,select rap_metric_maps.code , rap_metric_maps.view_prompt_name , rap_metrics.unit_code , rap_metric_maps.view_sequence_no from rap_metrics , rap_metric_maps where rap_metrics.code =rap_metric_maps.cDAT*6ode and rap_metrics.level_type ='GEO' and use_type ='DESCRIPTIVE INFORMATION AND CODES' order by rap_metric_maps.view_sequence_no metriccursor CAPCACA, CA CA0 LDAT*8CACAf_compare_date_time,datecursor"CA"CAdeCAselect min ( start_date_time ) , max ( end_date_time ) , max ( start_date_time ) from rap_activities where ref_rid =0 and metric_level_type =' ' andDAT*: metric_code in ( select code from rap_metric_maps where use_type ='DESCRIPTIVE INFORMATION AND CODES' ) tuCA CA,actcursorj ` CAj CA CAselect count ( rid ) from rap_activities where ref_rid =0 and metric_levelDAT*<_type =' ' and metric_code in ( select code from rap_metric_maps where use_type ='DESCRIPTIVE INFORMATION AND CODES' ) 89QT CA $ CAstr_use_type0x ~  $ 0 t    P X      L p    0 h DAT*>    ( ` f t      $ ( 2 u_dw_act_geo  uf_reshape_dwuf_resize_detailpl_ref_riduf_retrieve_parametersql_statementuf_retrieve_dw_act_detailuf_retrieve_currentuf_retrieve_historypdt_startpdt_enduf_select_datesuf_count_actuf_retrieve_dw_act_master+create+destroyL Q_r'QLHQSDAT*@QRWRWL , xG _initsrcu_dw_activityu_dw_act_geouserobjectswindowobjectborderstyleu_dw_activity`dw_act_detaildw_act_detaildwobjectpowerobjectu_dw_activity`cb_selectcb_selectfontcharsetfontpitchfontfamilyu_dw_activity`st_no_recordst_no_recordalignmentfillpatternu_dw_activity`dw_act_querydw_act_queryu_dw_activity`st_current_headingst_current_headingu_dw_activity`dw_act_masterdw_act_masteru_dw_activity`r_1r_1linestyleu_dw_acDAT*Btivity`r_2r_2u_dw_activity`ln_1ln_1u_dw_activity`ln_2ln_2str_actdatawindowchildw_geodynamicstagingareatransactionstr_use_type  _rl_seu@titeou_set,_s@t_li8t_@p_soEf_@ieveQsteatem{ta@dex_to@inde55127@@0 @08` j@DAT*D 8@0, 9 Z @m ; 8! @!P<idME 8@@@@.@:@  DAT*F      ! # % &! J>  ?!{4 -. {4. DAT*H{2       $ $0$1a)@8T$)d8|$8,$$$1)8$$$1)8$9}$$9DAT*~"},$84<$D$L$1)T8\$d$l$1)t8|$:@$9}<Xt  ( H   d  dw_act_query$$width(resize8cb_selectH"show\is_view_stylel1currentdw_act_detail!!xmoveh@DAT*Lg@)b?CA?g@Qg@"X@X@.c@c@;@@G@@S@@]@@h@@rY@Y@}^@^@@@a@@q0@0@%p@p@q@q@ Op@P ec!a& u_dw_group_geou_dw_groupuserobjectswindowobjectborderstylefontcharsetfontpitchfontfamilyalignmentvtextalignpowerobjectArialadd.bmpremove.bmpfillpatternMS Sans Serif... Group Member... Selection ListdwobDAT*NjectSource group member recordsSource selection listlinestylewindowQ tIQ h Q tGeographic Location Group MemberGeographic Location Selection Listd_geo_groupd_geo_loc_names_for_grouptransactionsqlcaw_geo,T|2 u_dw_group_geo  pl_cur_rowpl_selected_rowuf_setitem_on_dw_groupuf_setitem_on_dw_select_lisDAT*Ptp_geo_typep_parent_riduf_retrieve_select_list+create+destroyZ QLLWbQSLQ$< x _initsrcu_dw_groupu_dw_group_geouserobjectswindowobjectborderstyleu_dw_group`pb_addpb_addfontcharsetfontpitchfontfamilyalignmentvtextalignpowerobjectu_dw_group`pb_removepb_removeu_dw_group`st_group_memberst_group_memberfillpatternu_dw_group`st_selection_listst_selection_DAT*Rlistu_dw_group`dw_groupdw_groupdwobjectu_dw_group`dw_select_listdw_select_listu_dw_group`r_1r_1linestyleu_dw_group`r_2r_2windowtransactionw_geo urr_coex@ilrevient+sc@ion7e@windDst@itemPtennecbowjecti@u@@s@%@ge @ @(  DAT*T( @atlose cl+cli0 testroD erM @V p apiv! @!Q<@8 %@z@     DAT*V   ! #:/ /!... . y+ y*  $8L$8DAT*XT)h8)x8$8$8)8)8$8$8J 8;)8$8$P$)X8Jd# pl_cur_rowpl_selected_row(`x dw_group%rap_geographic_locations_namedw_select_list:&namegetitemstringYsetitemPp%rap_geogDAT*Zraphic_locations_type:&typeYPp%rap_group_members_child_ref_rid:&ridgetitemnumber Op%rap_group_members_parent_ref_ridil_ref_ridE,Op L h x           P X $8 0$88)d8)t8|$8$8)8)8$8DAT*\$8J8;)8Jd# pl_cur_rowpl_selected_row(` dw_select_list&namedw_groupat%%rap_geographic_locations_namegetitemstringVsetitemPl&type%%rap_geographic_locations_type$VPl&rid%%rap_group_members_child_ref_ridgetitemnumberbe Ol 0 d t |  DAT*^      6$8$<$P8X0|$,)8$)8$8$80,$,$)88)888@@8$0R8G0L$,)T8\$6)d8l$t8|0DAT*`$,)8$$6)8  4 Xx*<@#R$r&(*+d? p_geo_typep_parent_ridls_second_geo_typesqlcaw_geod  3@ 9@! is_geo_type..COUNTYdw_select_listp_+&dataobjectsDd_geo_loc_names_for_county_group+&settransobject^+DAT*b&retrieve2.CITY+&Dd_geo_loc_names_for_city_groupdw_1. . getrow group_typegetitemstring'REGION0+&^+&2+&Dd_geo_loc_names_for_group+&^+&.2  < P |          8 L T \ d l t      DAT*"8d  create8d  destroy7892 e uf_setitem_on_dw_groupuf_setitem_on_dw_select_listuf_retrieve_select_list+create+destroyd <T\2  heightis_geo_type(] DAT*fp@)b?DAT9p@Op@@@#\@\@.[@[@:c@c@GU@U@X@@d@@n@@y@@@@Q@@^@^@a@@Q0@0@Qn@n@a +`@aL@@`Z`@`@qdj@j@rk@k@~l@l@m@m@@@@@@@@@;g@X@X@Pg@'_`@]Qg@lp@p@@@`a@\`@0*@*@v@DAT*hv@)WF@F@dPo =g@"p@<Z!bp0O?Pq@q@\[,7?g@p@ ]S@@  @  d" 3 |K b q      0  H 3@P CoDAT*j_ ep@ ` @ w_geow_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitledO p_commandbuttonstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectiDAT*loninfou_dw_locuserobjectsO validu_dw_act_geostr_actO xnullu_dw_group_geowindowiO 'rectangleGeographicGEO.ICOO @ NATIONnvo_locationsstr_use_typeocO ^keycodeRelated information (freeform view)Related information (tabular view)General informationd_geo_locShow parent informationParentShow membeDAT*nr informationStateShow group informationGroupShow activity current viewActivityShow location informationLocationLocation informationO O 4 O messagepointerf_menu_behavegl_geo_ridu_dw_activityw_mdi_mainf_validate_geo_locf_validate_actf_validate_srcf_check_dates_nttransactionsqlcaselect distinct parent_type from rap_geographic_members where child_type =' ' JMDAT*pbCACAf_db_erroru_dw_group $,4select type , name from rap_geographic_types , rap_geographic_members where rap_geographic_types.type =rap_geographic_members.child_type and parent_type =' ' Bchildtypenamecur^TCATCADAT*rCAf_highlight_buttonw_filtergb_filterselect parent_rid from rap_geographic_locations where rid =0 ;<0CA?l4CAf_get_sequencegs_user_idf_check_dup_actf_getgeoriddwitemstatusgs_inifilef_window_countf_window_closef_dddw_searchf_retrieve_codesf_retrieve_metric_codesf_retrieve_group_typesf_get_unit_sqlf_retrieve_unit_codesf_act_dddw_retrievef_look_upf_dDAT*telete_geo_locf_set_value_amtf_validate_codegl_cur_rowgb_double_clickm_main_menuselect a.parent_rid from rap_geographic_locations a , rap_geographic_locations b where b.rid =0 and b.parent_rid =a.rid ^_Ov DA4 | DAJM bDA2, DA;<h DDAT*vA A l DAw_use_type$0tT|   B HT Z T X   04 l p v |     , 0 h l   2 w_geo 26 wparamlparam+current_view+historDAT*xy_view+highlight_dddwwf_check_requiredwf_draw_dw2wf_row_changedwf_set_varwf_set_btnswf_detail_viewwf_select_onewf_undo_uop_eventp_screenp_dwp_windowwf_dropdowndw_objwf_retrieve_city_dddwwf_retrieve_county_dddwpb_enablewf_enable_btnwf_check_ridps_stylewf_clear_prev_styleas_levelal_ridwf_get_from_rms+dwescapekeykeyflags+dwnkey+set_column+ue_get_from_rms+wparam+lparam+open+activate+closequery+close+flags+xpos+ypos+clicked+create+destroy+key+keyflagsrowdwDAT*zodata+editchanged+itemfocuschanged+add_row+currentrow+rowfocuschangedxposypos+rbuttondown+delete_row+itemchanged+dwnprocessenter+itemerror+doubleclicked+validate_delete+rowsinserted+rowsupdated+rowsdeleted+updateend+row+dwo+data+losefocus+retrievestart@P  LUL  BQQQSSCdatawindow.Cwindow.QCdatawindow.reQBDAT*|BCdatawindow.3QSPYQSLLzV~ LCkeycode.U zV~ zV~   LUII#LLCdwobject.SLLCdwobject.( PLLmrLIILCdwobject.mrDAT*~ ###mr mr ##P#   DAT*LLLL# $<X$H`x0HX(L|<Hl x _initsrcw_master_detDAT*ailw_geomenuwindowtypewindowstatewindowobjecttoolbaralignmentw_master_detail`st_no_record_whitest_no_record_whitefontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_master_detail`st_no_record_greyst_no_record_greyw_master_detail`dw_3dw_3dwobjectw_master_detail`dw_2dw_2w_master_detail`dw_1dw_1w_master_detail`r_1r_1linestylew_master_detail`r_2r_2datawindows_rec_holdercommandbuttoncb_parentstructuremailrecipientenvironmentmailfiledescriptionDAT*mailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfocb_membercb_groupcb_activitycb_locationcb_member_2u_dw_locuo_locuserobjectsu_dw_loc`st_no_record_whiteu_dw_loc`st_no_record_greyu_dw_loc`dw_loc_detailu_dw_loc`dw_loc_masteru_dw_loc`r_1u_dw_loc`r_2u_dw_act_geouo_actu_dw_act_geo`dw_act_detailu_dw_act_geo`cb_selectu_dw_act_geo`st_no_recordu_dw_act_geo`dw_act_queryu_dw_act_geo`st_current_headingu_dw_act_geo`dw_act_masteru_dw_act_geo`r_1u_dw_act_geo`r_2u_dw_actDAT*_geo`ln_1u_dw_act_geo`ln_2str_actu_dw_group_geouo_groupu_dw_group_geo`pb_addu_dw_group_geo`pb_removeu_dw_group_geo`st_group_memberu_dw_group_geo`st_selection_listu_dw_group_geo`dw_groupu_dw_group_geo`dw_select_listu_dw_group_geo`r_1u_dw_group_geo`r_2windowrectangler_buttonsnvo_locationsstr_use_typekeycodemessagepointeru_dw_activityw_mdi_maintransactionu_dw_groupw_filterdwitemstatusm_main_menuw_use_type@!DAT*'@,@7@C@P@a@@ @ @ @ @ @/_seq4m@=trescR unitW "8l coMS!q  DAT*ss@!O<t_@ence_d@ecsb_@erwourcef_@_seada@ode@p@@ @@/@<@I8@z%X&b8z&kw@@DAT*B *x@7>Yp !-"H#$1%&J'%@"- 0@<(E)$[*lb_rt+stt_pa,<-њDAT*.P/<0n end !@"@!1 tup+$@9%@F&8@}N'P@V)<@^,$@l-@w3@6@8@?@P@R@    DAT*    " $",-./02 41 51 61 71 81 9 1; <: = : >: ?: @: A: B: C: DDAT*: E!:H IG JG KG LG MG NG OG PGS r)_*. .  {4  {5 {5  !-!-DAT*!-!-!-!-1@3 6!:J> ?!G:/ /!R       )8#D,(01>,($$:F@@8<8D0X$DAT*6`$6|$68$,+$6$680808080)8$)8$9}$$)(8,.@H$6,(1,(P$D^ x $@^d8 +wparam+lparam::messagegl_geo_ridw_mdi_maind DAT*(@W"+@-.@ZX wf_check_pending}is_style_state,3currentis_stateL2,3is_enlarge_stateh4uo_actw?;is_levelmerQ,3uf_prepare_dwrC?;show ?;bringtotop ?;dw_act_detailLE!setfocusJis_act_style޵0+,3 $ < X ` |       DAT*    ( @ H P  )8#D,(01>,($$:F@@8<8D0X$6`$6|$68$,+$6$680808080)8$)8$9},. $6,(1,($DAT*D^ x $@^d8 +wparam+lparam::messagegl_geo_ridw_mdi_maind (@W"+@-.@Z$ wf_check_pending}is_style_state,3historyis_stateL2,3is_enlarge_stateh4uo_act?;is_levelQ,3uf_prepare_dwC?;show?;bringtotop is_act_stylede:+,3DAT* $ < X ` |             x$1D0$8$9)L8,(^1l,(T$ Dd" +wparam+lparam::message< (@W\( il_selected_rowGidwc_dw_child> H(Gselectrow@ 0DAT* 8 L T $)$81<494$)<81<h9L$)T81<9\$d$)t88#9|$)81"$8$8"$$6808080808#9DAT*$1@88$1o@o88$8#n9$8 08508H08]08#9p$8#994h0f<dn!"#')d itotalrow( x dw_1DAT*. accepttextdw_2,-dw_3D,. . getrowl,-rowcount^@4is_current_btn@ZActivityZDimensions@,-is_levelQZMemberZSource,-,-begin_operation_dateend_operation_dateBegin Operation DateEnd Operation Date,- $ 4 < L T \ d t |         DAT* p ,8$) 84$)<8L$)T8d$9)x8$9)8$)81$)81$8J8$8 ($80t8$)H8P$)X8`$t$$0$$6DAT*8$$6$,4)8$8\4$68<D$11)X808`h$11)p808x0$11)8$$)8|$)8$$)8$8$)$DAT*User object for legal activity snapshot and history views.forward global type u_dw_act_leg from u_dw_activity end type end forward shared variables end variables global type u_dw_act_leg from u_dw_activity int Width=2898 int Height=1108 end type global u_dw_act_leg u_dw_act_leg type variables end variables forward prototypes public subroutine uf_reshape_dw () public subroutine uf_resize_detail () public subroutine uf_retrieve_parameter (long pl_ref_rid) end prototypes DAT* public subroutine uf_reshape_dw ();// Reshape the datawindows dw_act_query.Resize(dw_act_query.Width, 97) cb_select.Show() if is_view_style = "current" then dw_act_detail.Move(dw_act_detail.X, 150) dw_act_detail.Resize(dw_act_detail.Width, 765) dw_act_detail.BringToTop = TRUE dw_act_master.Border = FALSE elseif is_view_style = "history" then dw_act_detail.Move(dw_act_detail.X, 233) dw_act_detail.Resize(dw_act_detail.Width, 677) dw_act_master.BorderStyle = StyleLowered! DAT* dw_act_master.Border = TRUE end if end subroutine public subroutine uf_resize_detail ();dw_act_detail.Resize(dw_act_detail.Width, 861) end subroutine public subroutine uf_retrieve_parameter (long pl_ref_rid);string ls_code, ls_desc, ls_unit_code, ls_value_type, ls_material_code, & ls_sql_stmnt integer counter, li_seq_no // Retrieve data for parameter in dw_act_detail ls_sql_stmnt = "select distinct rap_metric_maps.code, " + & "view_prompt_name, rap_metric_maps.unit_code, " +DAT* & "rap_metric_maps.value_type, rap_metric_maps.material_code, " + & "rap_metric_maps.view_sequence_no " + & "from rap_metric_maps, rap_metrics " + & "where rap_metrics.code = rap_metric_maps.code and " + & "rap_metrics.level_type = 'LEG'" + & " order by rap_metric_maps.view_sequence_no, " + & "rap_metric_maps.material_code, rap_metric_maps.value_type" declare metricCursor dynamic cursor for sqlsa; if f_db_error(SQLCA, "Fail on declaring dynamic cursor metricCursor." + & " ContDAT*act your technical support.") = 1 then return end if prepare sqlsa from :ls_sql_stmnt; if f_db_error(SQLCA, "Fail on preparing sqlsa." + & " Contact your technical support.") = 1 then return end if open dynamic metricCursor; if f_db_error(SQLCA, "Fail on open dynamic cursor metricCursor. " + & "Contact your technical support.") = 1 then return end if fetch metricCursor into :ls_code, :ls_desc, :ls_unit_code, & :ls_value_type, :ls_material_code, :li_seq_no; counterDAT* = 1 do while sqlca.sqlcode = 0 dw_act_detail.InsertRow(0) // Prefill these columns from the rap_metrics and rap_metric_maps tables dw_act_detail.SetItem(counter, 'view_seq_no', li_seq_no) dw_act_detail.SetItem(counter, "metric_desc", ls_desc) dw_act_detail.SetItem(counter, "unit_code", ls_unit_code) dw_act_detail.SetItem(counter, "metric_code", ls_code) dw_act_detail.SetItem(counter, "value_unit_code", ls_unit_code) // // Always display the first value type for the case DAT*of the multiple // // activity data for the same metric code in the sql statement. // // The following code fixes the problem. // if Not IsNull(ls_value_type) then // select distinct value_type // into :ls_value_type // from rap_metric_maps // where code = :ls_code and view_prompt_name = :ls_desc; // if f_db_error(SQLCA, "Fail on selecting value_type from rap_metric_maps table." + & // " Contact your technical support.") = 1 then // return // end if // end if dw_act_deDAT*tail.SetItem(counter, "value_type", ls_value_type) dw_act_detail.SetItem(counter, "material", ls_material_code) if ls_material_code = '@' then dw_act_detail.SetItem(counter, 'material_code', SetNull(ls_material_code)) else dw_act_detail.SetItem(counter, "material_code", ls_material_code) end if // Prefill these columns from the variables dw_act_detail.SetItem(counter, "metric_level_type", is_level) dw_act_detail.SetItem(counter, "ref_rid", il_ref_rid) dw_act_detaiDAT*l.SetItem(counter, "user_id", gs_user_id) // Change the row status programatically dw_act_detail.SetItemStatus(counter, 0, Primary!, NotModified!) dw_act_detail.SetItemStatus(counter, 0, Primary!, DataModified!) dw_act_detail.SetItemStatus(counter, 0, Primary!, NotModified!) counter = counter + 1 fetch metricCursor into :ls_code, :ls_desc, :ls_unit_code, & :ls_value_type, :ls_material_code, :li_seq_no; loop close metricCursor; if f_db_error(SQLCA, "Fail on close metricDAT*Cursor cursor " + & "~nContact your technical support.") = 1 then return end if end subroutine on u_dw_act_leg.create call u_dw_activity::create end on on u_dw_act_leg.destroy call u_dw_activity::destroy end on type dw_act_detail from u_dw_activity`dw_act_detail within u_dw_act_leg int Height=829 end type type dw_act_master from u_dw_activity`dw_act_master within u_dw_act_leg int Width=2841 end type type r_1 from u_dw_activity`r_1 within u_dw_act_leg int X=8 int Y=1DAT* 29 int Height=109 end type DAT*g@)b?DA=g@$Tg@q#X@X@q/c@c@a<@@aH@@Q^@^@1@@q@@@@@@@@0@0@q_`@@@aaroXs@s@qkly%_q@q@Qec&`_d_X u_dw_act_legu_dw_activityuserobjectswindowobjectborderstyledwobjectpowerobjectActivity data for the above date ranged_activity_detailfontcharsetfontpitchfontfamilySelect data in the spDAT*ecified date range MS Sans SerifSelectalignmentfillpatternNo records present. Use Insert to create new activity data.Specify date range to select activity datad_activity_queryHistory of activity datad_activity_masterlinestylestr_actdatawindowchildT X̐validnull_T dT dynamicstagingareasqlsa,metriccursor?|rDADAT*transactionsqlcaf_db_error|DADAgs_user_idlDA0r x   ( l x 2 u_dw_act_leg  Y uf_reshape_dwuf_resize_detailpl_ref_riduf_retrieve_parameter+create+destroy QDAT*_r'QL  x= _initsrcu_dw_activityu_dw_act_leguserobjectswindowobjectborderstyleu_dw_activity`dw_act_detaildw_act_detaildwobjectpowerobjectu_dw_activity`cb_selectcb_selectfontcharsetfontpitchfontfamilyu_dw_activity`st_no_recordst_no_recordalignmentfillpatternu_dw_activity`dw_act_querydw_act_queryu_dw_activity`st_current_headingst_current_headingu_dw_activity`dw_act_masterdw_act_masteru_dw_activity`r_1r_1linestyleu_dw_activity`r_2r_2u_DAT*dw_activity`ln_1ln_1u_dw_activity`ln_2ln_2str_actdatawindowchild_sharsrcdynamicstagingareatransaction @c@@G,@@8@@EY@@}Q@ama0@{p@@@q@qsngares@d") E=@_act ar@te_tMNE="rieer_i (N@"rap s.@e") DAT*E=_act, mmtext9 NA2Z end m rnend    u! @ty!T<rw loexw+rdsupd de@d+uro@nt+drentcu@nged1st@    DAT*     ! # % &!$J> ?!{4 -. {4. {2DAT*     $ $0$1a)@8T$)d8|$8,$$$1)8$$$1)8$9}$$9},$84<$DAT*D$L$1)T8\$d$l$1)t8|$:@$9}<Xt  ( H   d  dw_act_query$$width(resize8cb_selectH"show\is_view_stylel1currentdw_act_detail!!xmove!!(8!bringtotopDAT* dw_act_master&borderNl1history!!!!(8&borderstyle@&  0 @ T d |            $ , < D L T \ d l t |    B$ $0$1])@8DAT*d H dw_act_detail!!width(resize8  0 @ $88/z%8]z&8z&8z&8z&8z&80z&8]z&,88z%81<,,,88z%81< ,,88+z%81<6 , (DAT*1},L$18d$1)x8$<8)8$<86)8$<86)8$<86)8$<86)8$<8 6),84$<8<6)H88PhT$<8\@8)lDAT*<%8t$<8\6)|8$<8$6)8$<8$)8$<8,6)8$<1:@:@)8$<1:@:@)$8,$<1:@:@)481<R} , xv ,,8<DAT*p@)b?EAF9p@Sp@ @@%\@\@0[@[@<c@c@IU@U@Z@@f@@p@@{@@@@a@@q^@^@@@0@0@n@n@ +`@L@@@Z`@`@dj@j@rk@k@a~l@l@qm@m@a@@@@@@@@QTg@`X@X@_`@a+@@5:g@ @*@*@)v@v@)I1F@F@A9AlG=g@DAT*`U"p@pUseL`o8q@q@Mp@ N  ~@@  p@p@t)+ru8ngN^nb3@zQ w_legalw_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmeDAT*ntfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitledS xcommandbuttonstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfou_dw_act_leguserobjectsstr_actS ;validnullrectangleu_dw_contactpS $޵newLegalLEDAT*GAL.ICOS S |5keycodeRelated information (freeform view)GEO.ICORelated information (tabular view)General informationd_legal_entityShow member informationChildrenShow group informationSourceShow activity current viewActivitydwcS S lParentShow location informationContactmessagepointerf_menu_behaveu_dw_activityw_mdi_mainf_validate_actDAT*f_validate_legal_relationf_check_dates_nttransactionsqlcaf_highlight_buttonw_filtergb_filterf_get_sequencegs_user_idf_check_dup_actdwitemstatusselect parent_rid from rap_legal_entities where rid =0 56!B DA0HDAf_db_errorgb_double_clickf_dddw_searchf_retrieve_codesf_act_dddw_retrievewindowf_retrieve_metric_codesf_get_unit_sqlf_retrieve_unit_codesf_set_value_amtf_valiDAT*date_codef_delete_leg_entgl_cur_rowm_main_menu56 EAEA56 EAOLEA$DBH       L P 2 w_legal (DAT* wparamlparam+current_view+history_view+highlight_dddwwf_check_requiredwf_draw_dw2wf_row_changedwf_set_varwf_set_btnswf_detail_viewwf_select_onewf_undo_uopb_enablewf_enable_btndw_objwf_check_ridps_stylewf_clear_prev_styleas_levelal_ridwf_get_from_rmswf_retrieve_data+dwescapekeykeyflags+dwnkey+set_column+ue_get_from_rms+wparam+lparam+open+activate+closequery+close+create+destroy+key+keyflagsrowdwodata+editchanged+itemfocuschanged+itemchangedDAT*+delete_row+add_row+dwnprocessenter+itemerrorxposypos+doubleclicked+constructor+currentrow+rowfocuschanged+row+dwo+data+validate_delete+clicked  LUL  BQQBBCdatawindow.QSQSLQLL2H6 LCkeycode.U 2H6 2H6  DAT*LLCdwobject.SLLCdwobject.d ld l!&LIILCdwobject.rd ld lGLLdiDAT*n d l$<Xh0H|@X 8\t x _initsrcw_master_detailw_legalmenuwindowtypewindowstatewindowobjectDAT*toolbaralignmentw_master_detail`st_no_record_whitest_no_record_whitefontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_master_detail`st_no_record_greyst_no_record_greyw_master_detail`dw_3dw_3dwobjectw_master_detail`dw_2dw_2w_master_detail`dw_1dw_1w_master_detail`r_1r_1linestylew_master_detail`r_2r_2datawindows_rec_holdercommandbuttoncb_childrenstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewDAT*\itemconnectioninfocb_sourcecb_activityu_dw_act_leguo_actuserobjectsu_dw_act_leg`dw_act_detailu_dw_act_leg`cb_selectu_dw_act_leg`st_no_recordu_dw_act_leg`dw_act_queryu_dw_act_leg`st_current_headingu_dw_act_leg`dw_act_masteru_dw_act_leg`r_1u_dw_act_leg`r_2u_dw_act_leg`ln_1u_dw_act_leg`ln_2str_actrectangler_buttonsu_dw_contactuo_contactu_dw_contact`st_no_record_whiteu_dw_contact`st_no_record_greyu_dw_contact`dw_contact_masteru_dw_contact`dw_contact_detailu_dw_contact`r_1u_dDAT*User object for process activity snapshot and history views.forward global type u_dw_act_pro from u_dw_activity end type end forward global type u_dw_act_pro from u_dw_activity end type global u_dw_act_pro u_dw_act_pro type variables end variables forward prototypes public subroutine uf_reshape_dw () public subroutine uf_resize_detail () public subroutine uf_retrieve_parameter (long pl_ref_rid) end prototypes public subroutine uf_reshape_dw ();// Reshape the datawindows dwDAT*_act_query.Resize(dw_act_query.Width, 97) cb_select.Show() if is_view_style = "current" then dw_act_detail.Move(dw_act_detail.X, 150) dw_act_detail.Resize(dw_act_detail.Width, 949) dw_act_detail.BringToTop = TRUE dw_act_master.Border = FALSE elseif is_view_style = "history" then dw_act_detail.Move(dw_act_detail.X, 233) dw_act_detail.Resize(dw_act_detail.Width, 861) dw_act_master.BorderStyle = StyleLowered! dw_act_master.Border = TRUE end if end subroutine publicDAT* subroutine uf_resize_detail ();dw_act_detail.Resize(dw_act_detail.Width, 861) end subroutine public subroutine uf_retrieve_parameter (long pl_ref_rid);string ls_code, ls_desc, ls_unit_code, ls_value_type, ls_material_code, & ls_sql_stmnt integer counter, li_seq_no // Retrieve data for parameter in dw_act_detail //if pl_ref_rid = 0 then ls_sql_stmnt = "select distinct rap_metric_maps.code, " + & "view_prompt_name, rap_metric_maps.unit_code, " + & "rap_metric_maps.value_type, rDAT*ap_metric_maps.material_code, " + & "rap_metric_maps.view_sequence_no from rap_metric_maps, " + & "rap_process_codes, rap_metrics where (rap_metric_maps.source_code = '@' or " + & "rap_metric_maps.source_code = '" + is_src_code + "') and " + & "(rap_metric_maps.device_code = '@' or " + & "rap_metric_maps.device_code = '" + is_dev_code + "') and " + & "rap_process_codes.metric_map_code = rap_metric_maps.process_code and " + & "rap_process_codes.code = '" + is_pro_code + "' anDAT*d " + & "rap_metrics.code = rap_metric_maps.code and " + & "rap_metrics.level_type = 'PRO'" + & " order by rap_metric_maps.view_sequence_no, " + & "rap_metric_maps.material_code, rap_metric_maps.value_type" //else // // ls_sql_stmnt = "select distinct rap_metric_maps.code, " + & // "view_prompt_name, rap_metric_maps.unit_code, " + & // "rap_activities.value_type, rap_activities.material_code, " + & // "rap_metric_maps.view_sequence_no from rap_metric_maps, " + & // "rap_DAT*process_codes, rap_activities " + & // "where (rap_metric_maps.source_code = '@' or " + & // "rap_metric_maps.source_code = '" + is_src_code + "') and " + & // "(rap_metric_maps.device_code = '@' or " + & // "rap_metric_maps.device_code = '" + is_dev_code + "') and " + & // "rap_process_codes.metric_map_code = rap_metric_maps.process_code and " + & // "rap_process_codes.code = '" + is_pro_code + "' and " + & // "rap_activities.metric_code = rap_metric_maps.code and " + & // "rap_acDAT*tivities.value_type = rap_metric_maps.value_type and " + & // "rap_activities.ref_rid = " + String(pl_ref_rid) + & // " union select distinct rap_metric_maps.code, " + & // "view_prompt_name, rap_metric_maps.unit_code, " + & // "rap_activities.value_type, rap_activities.material_code, " + & // "rap_metric_maps.view_sequence_no from rap_metric_maps, " + & // "rap_process_codes, rap_activities " + & // "where (rap_metric_maps.source_code = '@' or " + & // "rap_metric_maps.source_codeDAT* = '" + is_src_code + "') and " + & // "(rap_metric_maps.device_code = '@' or " + & // "rap_metric_maps.device_code = '" + is_dev_code + "') and " + & //