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 " + & // "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_metric_maps.view_prompt_name not in (select distinct rap_metric_maps.view_prompt_name " + & // "from rap_metric_maps, rap_proDAT*cess_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_activDAT*ities.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_process_codes " + & // "where (rap_metric_maps.source_cDAT*ode = '@' 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_metric_maps.code not in (select distinct metric_code from " + & // "rap_activities where ref_rid = " + String(pl_ref_rid) + & // ") ordDAT*er by 6, 5, 4" // //end if declare metricCursor dynamic cursor for sqlsa; 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 technicalDAT*  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; 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.SetItDAT* em(counter, "value_unit_code", ls_unit_code) // // Always display the first 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." + DAT*& // " Contact your technical support.") = 1 then // return // end if // 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 coDAT*lumns 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, & :ls_value_type, :ls_material_code, :li_seq_no; loop close metricCursor; if f_db_error(SQLCA, "Fail on close metricCursor cursor. " + & "Contact your technical support.") = 1 then return end if DAT*n end subroutine on u_dw_act_pro.create call u_dw_activity::create end on on u_dw_act_pro.destroy call u_dw_activity::destroy end on type dw_act_master from u_dw_activity`dw_act_master within u_dw_act_pro int Width=2841 end type type r_1 from u_dw_activity`r_1 within u_dw_act_pro int X=8 int Y=132 int Width=2881 int Height=103 end type DAT*g@)b?EA=g@Xg@#X@X@/c@c@<@@H@@Q^@^@@@@@@@@@@@0@0@q_`@@@aaroXs@s@qkly$_q@q@Qec%`pX u_dw_act_prou_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_actdatawindowchildX < validnullX 3X >dynamicstagingareasqlsa,metriccursor9|rEADAT*transactionsqlcaf_db_error|EAEAgs_user_idlEA0r x   ( l x 2 u_dw_act_pro  Y uf_reshape_dwuf_resize_detailpl_ref_riduf_retrieve_parameter+create+destroy QDAT*y'QL  x4 _initsrcu_dw_activityu_dw_act_prouserobjectswindowobjectborderstyleu_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 onectt_@onsaiipie,me@ailf8ti@ailmEaw@wchiQwitreemonioni{bj@rectan@tonrage@ @ @   @ @DAT*, dw_29 Z m $ _yro) ! @uf!X<nintwise )@@@(se@    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&L$z&8Tz&8\z&8z&$z&8Tz&8z&8z&($z&80z&87z&8dz&8z&8z&,88z%81<,,,8:8z%81<d ,,8S8~z%DAT*'81< , (1},$1 $1)8$<86)8$<86) 8$<86)(80$<886)H8P$<8X6)d8l$<8t6)88$<8DAT*,p@)b?FAU9p@Wp@"@@'\@\@2[@[@>c@c@KU@U@\@@h@@r@@}@@@@@@^@^@@@0@0@n@n@a+`@aP@@^`@`@hj@j@vk@k@al@l@am@m@q@@a@@@@@@Xg@X@X@_`@/Ng@>p@p@p@@zn@]`@*@*@uv@v@uQDAT*.}F@F@ata=g@@"p@<T4 q@q@U s+o)+noA?g@pL3@`L+WeXp@yX+Xuareek+ctz+rungPls@@aoprA islX4-CXY,misl}frm-,VDAT*0p@?Zdp@ [8 w_processw_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitledrbuW 8commandbuttonstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreevDAT*2iewitemconnectioninfou_dw_act_prouserobjectsstr_actW ovalidnullu_dw_group_prowindowpW :rectangleu_dddwProcessPROCESS.ICOW Tqstr_stream_contextW keycodeMember information (freeform view)Member information (tabular view)d_process_schedulesGeneral informationd_processShow group informationGroupShow activity current viewActivitDAT*4yOpen permit windowPermitOpen stream windowStreamW ВFactorW  @ Scheduled_source_ids_dddwd_device_ids_dddwmessagepointerf_menu_behavef_highlight_buttongd_process_ridu_dw_activityw_mdi_maingl_source_ridtransactionsqlcagl_device_ridgl_cur_rowf_validate_dev_prof_validate_actf_validate_pro_scheduleu_dw_groupm_main_menuw_filtergb_filterf_get_sequencegs_user_idf_check_dup_actf_get_pro_schedule_riddwitDAT*6emstatusgb_double_clickf_window_countf_window_closegs_scc_ams_codef_dddw_searchf_retrieve_metric_codesf_retrieve_group_typesf_get_unit_sqlf_retrieve_unit_codesf_act_dddw_retrievef_set_value_amtf_validate_codegs_materialf_look_upf_retrieve_codesw_permitw_stream(H 2 w_process - wparamlparam+current_view+history_view+highlight_dddwwf_retrieve_datawf_check_requiredwDAT*8f_draw_dw2wf_set_varwf_general_viewwf_detail_viewwf_select_onewf_undo_uowf_insert_okpb_enablewf_enable_btndw_objwf_check_ridps_stylewf_clear_prev_style+dwescapekeykeyflags+dwnkey+closedropdown+wparam+lparam+activate+open+close+flags+xpos+ypos+clicked+create+destroy+key+keyflagsrowdwodata+editchanged+itemfocuschanged+itemchanged+dwnprocessenter+add_row+itemerrorxposypos+rbuttondown+currentrow+rowfocuschanged+save+rowsinserted+rowsupdated+rowsdeleted+DAT*:updateend+row+dwo+data+rowcount+retrieveend+retrieve_data+getfocusl  LUL  QBQBBCdatawindow.erQSL_viP LCkeycode.UP P _ flLUIILLCdwobject.SLLCdwobject.8 DAT*<@8 @LIILCdwobject.+LL8 @3ANLLLLfkpDAT*>v8 @  $<XhLt4Xp,Dp$< x>DAT*@ _initsrcw_master_detailw_processmenuwindowtypewindowstatewindowobjecttoolbaralignmentw_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_groupstructuremailrecipienDAT*Btenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfocb_activitycb_permitcb_streamu_dw_act_prouo_actuserobjectsu_dw_act_pro`dw_act_detailu_dw_act_pro`cb_selectu_dw_act_pro`st_no_recordu_dw_act_pro`dw_act_queryu_dw_act_pro`st_current_headingu_dw_act_pro`dw_act_masteru_dw_act_pro`r_1u_dw_act_pro`r_2u_dw_act_pro`ln_1u_dw_act_pro`ln_2str_actcb_factoru_dw_group_prouo_groupu_dw_group_pro`pb_addu_dw_group_pro`pb_removeu_dw_group_pro`DAT*Dst_group_memberu_dw_group_pro`st_selection_listu_dw_group_pro`dw_groupu_dw_group_pro`dw_select_listu_dw_group_pro`r_1u_dw_group_pro`r_2windowrectangler_buttonscb_scheduleu_dddwdw_6dw_7str_stream_contextkeycodemessagepointeru_dw_activityw_mdi_maintransactionu_dw_groupm_main_menuw_filterdwitemstatusw_permitw_stream0@!+@0@;@G@T@DAT*$e@@ @$ @ @ @) @x, 38@RA V $1[ p !u  @!W<@,@DAT*HUser object for source activity snapshot and history views.forward global type u_dw_act_src from u_dw_activity end type end forward shared variables end variables global type u_dw_act_src from u_dw_activity int Width=2898 int Height=1108 end type global u_dw_act_src u_dw_act_src 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 prototypesDAT*J 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, 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!DAT*L 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 //if pl_ref_rid = 0 then ls_sql_stmnt = "select distinct rap_metric_maps.code, " + & "view_prompt_name,DAT*N 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_source_codes, rap_metrics " + & "where rap_source_codes.metric_map_code = rap_metric_maps.source_code and " + & "rap_source_codes.code = '" + is_src_code + "' and " + & "rap_metrics.code = rap_metric_maps.code and " + & "rap_metrics.level_type = 'SRC'" + & " order by rap_metric_maps.view_sequence_no, " +DAT*P & "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_source_codes, rap_activities " + & // "where rap_source_codes.metric_map_code = rap_metric_maps.source_code and " + & // "rap_source_codes.code = 'DAT*R" + is_src_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, " + & // "rap_activities.value_type, rap_activities.material_code, " + & // "rap_metric_maps.view_sequence_no " + & // "from rap_metric_maps, rap_source_codes, DAT*Trap_activities " + & // "where rap_source_codes.metric_map_code = rap_metric_maps.source_code and " + & // "rap_source_codes.code = '" + is_src_code + "' and " + & // "rap_activities.metric_code = rap_metric_maps.code and " + & // "rap_metric_maps.view_prompt_name not in (select distinct rap_metric_maps.view_prompt_name " + & // "from rap_metric_maps, rap_source_codes, rap_activities " + & // "where rap_source_codes.metric_map_code = rap_metric_maps.source_code and " + & // "rap_soDAT*Vurce_codes.code = '" + is_src_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) + ") 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, " + & //DAT*X "rap_metric_maps.view_sequence_no " + & // "from rap_metric_maps, rap_source_codes " + & // "where rap_source_codes.metric_map_code = rap_metric_maps.source_code and " + & // "rap_source_codes.code = '" + is_src_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; if f_db_error(SQLCA, "Fail DAT*Zon 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, :ls_desc, :ls_unit_code, & :lDAT*\s_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_code) dw_act_detail.SetItem(counter, "value_unit_code", ls_unit_code) /DAT*^/ // Always display the first 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 DAT*`then // return // end if // 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 // Prefill these columns from the variables dw_act_detail.SetItem(counter, "metric_level_type", is_level) dw_act_detail.DAT*bSetItem(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, :li_seq_no; loop close meDAT*dtricCursor; 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_src.create call u_dw_activity::create end on on u_dw_act_src.destroy call u_dw_activity::destroy end on type dw_act_detail from u_dw_activity`dw_act_detail within u_dw_act_src int Height=829 end type type dw_act_master from u_dw_activity`dw_act_master within u_dw_act_src int Width=2841 end type type r_1 from DAT*Wu_dw_activity`r_1 within u_dw_act_src int X=8 int Y=129 int Height=109 end type DAT*hg@)b?FA=g@[g@#X@X@/c@c@<@@H@@Q^@^@@@@@@@@@@@0@0@q_`@@@aaroXs@s@qkly%_q@q@Qec&`X u_dw_act_srcu_dw_activityuserobjectswindowobjectborderstyledwobjectpowerobjectActivity data for the above date ranged_activity_detailfontcharsetfontpitchfontfamilySelect data in the spDAT*jecified 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[  ?!{4 -. {4. {2DAT*v     $ $0$1a)@8T$)d8|$8,$$$1)8$$$1)8$9}$$9},$84<$DAT*xD$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*z 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&8:z&`$z&8hz&8oz&8z&8z&8z&,8"8Qz%81<,,,8r8Qz%81< ,,88z%81<dDAT*~ , (1},$1f$1)8 $<8)(80$<886)D8L$<8T6)`8h$<8p6)|8$<86)8$<86)8$<86)88$DAT**<8@8)8$<86)8$<84$6)<8D$<8L`$)h8p$<8x,6)8$<1:@:@)8$<1:@:@)8$<1:@:@)81<R} DAT*@ p@)b?>A7p@6p@3@@8\@\@C[@[@Oc@c@\U@U@m@@y@@@@@@@@a@@a^@^@@@ 0@0@n@n@q+`@q,@@ 5q@q@Ar. ) 6v@v@8 w_emission_factor_aw_emission_factor_basemenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfDAT*Report window for AIRS/AFS data converterforward global type w_rpt_airs from Window end type type dw_ref_code from u_dddw within w_rpt_airs end type type dw_state from u_dddw within w_rpt_airs end type type dw_county from u_dddw within w_rpt_airs end type type dw_criteria_group from datawindow within w_rpt_airs end type type cb_1 from commandbutton within w_rpt_airs end type type sle_trans_file from singlelineedit within w_rpt_airs end type type dw_toxic_group from datawindow withinDAT* w_rpt_airs end type type cbx_seg_pollutant_sip from checkbox within w_rpt_airs end type type cbx_seg_pollutant_annual from checkbox within w_rpt_airs end type type cbx_segment_general from checkbox within w_rpt_airs end type type cbx_general_point from checkbox within w_rpt_airs end type type cbx_mailing_label from checkbox within w_rpt_airs end type type cbx_general_stack from checkbox within w_rpt_airs end type type cbx_plant_general from checkbox within w_rpt_airs end type typeDAT* cbx_toxic from checkbox within w_rpt_airs end type type cbx_criteria from checkbox within w_rpt_airs end type type st_5 from statictext within w_rpt_airs end type type st_4 from statictext within w_rpt_airs end type type em_to_date from editmask within w_rpt_airs end type type em_from_date from editmask within w_rpt_airs end type type st_2 from statictext within w_rpt_airs end type type ddlb_mode from dropdownlistbox within w_rpt_airs end type type cb_browse_2 from commandbutton wDAT*ithin w_rpt_airs end type type cb_browse_1 from commandbutton within w_rpt_airs end type type sle_log_file from singlelineedit within w_rpt_airs end type type sle_report_file from singlelineedit within w_rpt_airs end type type st_rpt_msg from statictext within w_rpt_airs end type type st_1 from statictext within w_rpt_airs end type type cb_close from commandbutton within w_rpt_airs end type type cb_generate from commandbutton within w_rpt_airs end type type gb_3 from groupbox withiDAT*n w_rpt_airs end type type gb_7 from groupbox within w_rpt_airs end type type gb_6 from groupbox within w_rpt_airs end type type gb_5 from groupbox within w_rpt_airs end type type gb_2 from groupbox within w_rpt_airs end type type gb_1 from groupbox within w_rpt_airs end type type r_1 from rectangle within w_rpt_airs end type end forward global type w_rpt_airs from Window int X=32 int Y=268 int Width=2871 int Height=1440 boolean TitleBar=true long BackColor=12632256 booleanDAT* ControlMenu=true boolean MinBox=true boolean MaxBox=true boolean Resizable=true string Icon="AIRS.ICO" dw_ref_code dw_ref_code dw_state dw_state dw_county dw_county dw_criteria_group dw_criteria_group cb_1 cb_1 sle_trans_file sle_trans_file dw_toxic_group dw_toxic_group cbx_seg_pollutant_sip cbx_seg_pollutant_sip cbx_seg_pollutant_annual cbx_seg_pollutant_annual cbx_segment_general cbx_segment_general cbx_general_point cbx_general_point cbx_mailing_label cbx_mailing_label cbx_genDAT*eral_stack cbx_general_stack cbx_plant_general cbx_plant_general cbx_toxic cbx_toxic cbx_criteria cbx_criteria st_5 st_5 st_4 st_4 em_to_date em_to_date em_from_date em_from_date st_2 st_2 ddlb_mode ddlb_mode cb_browse_2 cb_browse_2 cb_browse_1 cb_browse_1 sle_log_file sle_log_file sle_report_file sle_report_file st_rpt_msg st_rpt_msg st_1 st_1 cb_close cb_close cb_generate cb_generate gb_3 gb_3 gb_7 gb_7 gb_6 gb_6 gb_5 gb_5 gb_2 gb_2 gb_1 gb_1 r_1 r_1 end type global w_rDAT*pt_airs w_rpt_airs type variables string is_invtype = 'BASE' string is_geinidir string is_sasdir string is_userdir boolean ib_sas_run string is_plant_general = 'O' string is_mailing_label = 'O' string is_general_stack = 'O' string is_general_point = 'O' string is_segment_general = 'O' string is_segment_pollutant_annual = 'O' string is_segment_pollutant_sip = 'O' datawindowchild dwc_state datawindowchild dwc_county end variables forward prototypes public function boolean wf_crDAT*eate_view () public function boolean wf_check_required () public subroutine wf_retrieve_county (long pl_parent_rid) public function boolean wf_write_geiniprm_file (string ps_dsn, string ps_uid) end prototypes public function boolean wf_create_view ();//// purpose: Creates a set of permanent views to be accessed by the User Interface //// when creating the setup to call the AIRS converter in SAS. // //string ls_state, ls_county, ls_view, ls_sql_stmnt, ls_where_state, ls_where_cDAT*ounty, & // ls_activity_link, ls_process_id_metrics, ls_stream_id_metrics, ls_sql_1, ls_sources, & // ls_ref_code, ls_where_ref_code, ls_toxic, ls_where_toxic, ls_criteria, & // ls_where_criteria, ls_where_material, ls_where_afs_segno //datetime ldt_from, ldt_to // //SetPointer(HourGlass!) // //// First, get reporting arguments from the window // //ls_stream_id_metrics = " ( 'ID STR AFS' ) " //ls_process_id_metrics = " ( 'ID SEG AFS', 'ID AFS SEG', 'ID PRO AFS' ) " //ls_sources = " ADAT*ND (rap_sources.type = 'F' ) " // //// Get state //ls_state = dw_state.GetItemString(1, 'name') //if Not (IsNull(ls_state) or ls_state = '') then // ls_where_state = " AND ( rap_sources.geographic_state_rid = " + ls_state + " )" //end if // //// Get county //ls_county = dw_county.GetItemString(1, 'name') //if Not (IsNull(ls_county) or ls_county = '') then // ls_where_county = " AND ( rap_sources.geographic_county_rid = " + ls_county + " )" //end if // //// Get from and to dates //ldDAT*t_from = DateTime(Date(em_from_date.Text)) //ldt_to = DateTime(Date(em_to_date.Text)) // //// Get reference code //if cbx_seg_pollutant_annual.Checked or cbx_seg_pollutant_sip.Checked then // ls_ref_code = dw_ref_code.GetItemString(1, 'ref_code') //end if //if Not (IsNull(ls_ref_code) or ls_ref_code = '') then // ls_where_ref_code = " AND ( rap_activities.reference_code = '" + ls_ref_code + "' )" //else // ls_where_ref_code = " AND ( rap_activities.reference_code IS NULL )" //end if //DAT*User object for stream activity snapshot and history views.forward global type u_dw_act_str from u_dw_activity end type end forward global type u_dw_act_str from u_dw_activity int Height=785 end type global u_dw_act_str u_dw_act_str 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 DAT*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, 617) 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, 529) dw_act_master.BorderStyle = StyleLowered! dw_act_master.Border = TRUE end if end subroutDAT*ine public subroutine uf_resize_detail ();dw_act_detail.Resize(dw_act_detail.Width, 529) 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.DAT*value_type, rap_metric_maps.material_code, " + & "rap_metric_maps.view_sequence_no " + & "from rap_metric_maps, rap_stream_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_metric_maps.process_code = '@' or " + & "rap_metric_maps.process_code = '" + is_pro_code + "') DAT*and " + & "rap_stream_codes.metric_map_code = rap_metric_maps.stream_code and " + & "rap_stream_codes.code = '" + is_str_code + "' and " + & "rap_metrics.code = rap_metric_maps.code and " + & "rap_metrics.level_type = 'STR'" + & " 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, " + & // DAT*"rap_activities.value_type, rap_activities.material_code, " + & // "rap_metric_maps.view_sequence_no " + & // "from rap_metric_maps, rap_stream_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_metric_maps.process_code = '@' or " + & // "rap_metric_maps.procDAT*ess_code = '" + is_pro_code + "') and " + & // "rap_stream_codes.metric_map_code = rap_metric_maps.stream_code and " + & // "rap_stream_codes.code = '" + is_str_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_stream_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_metric_maps.process_code = '@' or " + & // "rap_metric_maps.proceDAT*ss_code = '" + is_pro_code + "') and " + & // "rap_stream_codes.metric_map_code = rap_metric_maps.stream_code and " + & // "rap_stream_codes.code = '" + is_str_code + "' and " + & // "rap_activities.metric_code = rap_metric_maps.code and " + & // "rap_metric_maps.view_prompt_name not in (select distinct rap_metric_maps.view_prompt_name " + & // "from rap_metric_maps, rap_stream_codes, rap_activities " + & // "where (rap_metric_maps.source_code = '@' or " + & // "rap_metric_mapsDAT*.source_code = '" + is_src_code + "') and " + & // "(rap_metric_maps.device_code = '@' or " + & // "rap_metric_maps.device_code = '" + is_dev_code + "') and " + & // "(rap_metric_maps.process_code = '@' or " + & // "rap_metric_maps.process_code = '" + is_pro_code + "') and " + & // "rap_stream_codes.metric_map_code = rap_metric_maps.stream_code and " + & // "rap_stream_codes.code = '" + is_str_code + "' and " + & // "rap_activities.metric_code = rap_metric_maps.code and " + & // DAT* "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_stream_codes " + & // "where (rap_metricDAT*_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_metric_maps.process_code = '@' or " + & // "rap_metric_maps.process_code = '" + is_pro_code + "') and " + & // "rap_stream_codes.metric_map_code = rap_metric_maps.stream_code and " + & // "rap_stream_codes.code = '" + is_str_code + "' and " + & // "rap_metricDAT*_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; 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 returnDAT* 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; 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_DAT*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, 'view_seq_no', li_seq_no) // // Always display the first 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 //DAT* 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_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', SetNuDAT*ll(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_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, PrimaryDAT*!, 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 metricCursor cursor " + & "~nContact your technical support.") = 1 then return end if end subroutine on u_dw_act_str.create call u_dw_activity::create end on on u_dw_act_str.destroy call u_dw_actDAT*Tivity::destroy end on type dw_act_detail from u_dw_activity`dw_act_detail within u_dw_act_str int Height=509 end type type dw_act_master from u_dw_activity`dw_act_master within u_dw_act_str int X=33 end type type r_1 from u_dw_activity`r_1 within u_dw_act_str int X=11 int Y=129 int Width=2873 int Height=109 end type DAT*g@)b?FA=g@Zg@q#X@X@/c@c@q<@@aH@@aQ^@^@q@@a@@a@@@@@@0@0@q_`@@@aaroXs@s@qkly$_q@q@Qec%ge`^X u_dw_act_stru_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_actdatawindowchildZ #validnullZ Z Ԩdynamicstagingareasqlsa,metriccursor|rFADAT*transactionsqlcaf_db_error|FAFAgs_user_idlFA0r x   ( l x 2 u_dw_act_str  Y uf_reshape_dwuf_resize_detailpl_ref_riduf_retrieve_parameter+create+destroy QDAT*'QL  x4 _initsrcu_dw_activityu_dw_act_struserobjectswindowobjectborderstyleu_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 onectia@_protuailr,nv@ment8es@tionEge@awinQiswitemitonne{po@bjecio@d @_msg@Colu ia@dei9 aid m de@old_ @LDAT*ow, titrin9 >Z 8<m ) )Y! @!Z<$8 @@@()(t @    DAT*    ! # % &!J> ?!{4 -. {4. {2 DAT*    $ $0$1a)@8T$)d8|$8,$$$1)8$$$1i)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!!xmove!!(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 @ B$88/z%8]z&8z&8z&8z&8z&L$z&8Tz&8\z&8z&$z&8Tz&8z&8z&$z&8Tz&8z&8\z&$z&8z&8z&8z&8z&8 z&,8F8uz%81<R,,,88uz%81<DAT** ,,88z%81< , (1},$1$1)(80$<886)L8T$<8\6)h8p$<8x6)8$<86)8$<8)8$<86)DAT* //// Get criteria materials selected //if cbx_criteria.Checked then // ls_criteria = dw_criteria_group.GetItemString(1, 'material_code') //end if //if Not (ls_criteria = '' or IsNull(ls_criteria)) then // ls_where_criteria = '( rap_activities.material_code IN ' + & // '( SELECT code FROM rap_materials WHERE rid IN ' + & // '( SELECT child_ref_rid FROM rap_materials, rap_group_members ' + & // 'WHERE rap_materials.rid = rap_group_members.parent_ref_rid AND ' + & // "rap_materials.codDAT*e = '" + ls_criteria + "' ) ) )" //end if // //// Get toxic materials selected //if cbx_toxic.Checked then // ls_toxic = dw_toxic_group.GetItemString(1, 'material_code') //end if //if Not (ls_toxic = '' or IsNull(ls_toxic)) then // ls_where_toxic = '( rap_activities.material_code IN ' + & // '( SELECT code FROM rap_materials WHERE rid IN ' + & // '( SELECT child_ref_rid FROM rap_materials, rap_group_members ' + & // 'WHERE rap_materials.rid = rap_group_members.parent_ref_rid AND ' + DAT*& // "rap_materials.code = '" + ls_toxic + "' ) ) )" //end if // //if Not (ls_toxic = '' or IsNull(ls_toxic)) AND & //Not (ls_criteria = '' or IsNull(ls_criteria)) then // ls_where_material = ' AND ( ' + ls_where_toxic + ' OR ' + ls_where_criteria + ' ) ' //else // if Not (ls_toxic = '' or IsNull(ls_toxic)) then // ls_where_material = ' AND ' + ls_where_toxic // else // if Not (ls_criteria = '' or IsNull(ls_criteria)) then // ls_where_material = ' AND ' + ls_where_criteria // eDAT*nd if // end if //end if // //// Create all views. Drop the old view first. // //// Nations //ls_view = 'vrap_geini_nations' //ls_sql_stmnt = & // '( nat_rid, ' + & // 'name ) AS ' + & // 'SELECT rap_geographic_locations.rid, ' + & // 'rap_geographic_locations.name ' + & // 'FROM rap_geographic_locations ' + & // "WHERE ( rap_geographic_locations.type = 'NATION' )" // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// States //lsDAT*_view = 'vrap_geini_states' //ls_sql_stmnt = & // '( staterid, ' + & // 'nat_rid, ' + & // 'name ) AS ' + & // 'SELECT rap_geographic_locations.rid, ' + & // 'rap_geographic_locations.parent_rid, ' + & // 'rap_geographic_locations.name ' + & // 'FROM rap_geographic_locations ' + & // "WHERE ( rap_geographic_locations.type = 'STATE' )" // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// Counties //ls_view = 'vrap_geini_county_codes'DAT* //ls_sql_stmnt = & // '( cntyrid, ' + & // 'county, ' + & // 'strtdate, ' + & // 'enddate ) AS ' + & // 'SELECT DISTINCT rap_geographic_locations.rid, ' + & // 'rap_activities.value_amt, ' + & // 'rap_activities.start_date_time, ' + & // f_retrieve_date(SQLCA, 'rap_activities.end_date_time') + ' ' + & // 'FROM rap_activities, ' + & // 'rap_sources, ' + & // 'rap_geographic_locations ' + & // 'WHERE ( rap_activities.ref_rid = rap_geographic_locations.rid ) AND ' + DAT*& // '( rap_sources.geographic_county_rid = rap_geographic_locations.rid ) AND ' + & // "( rap_activities.metric_code = 'FIPS CODE' ) AND " + & // f_date_range('rap_activities', ldt_from, ldt_to) + & // ls_sources + & // ls_where_state // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// Cities //ls_view = 'vrap_geini_cities' //ls_sql_stmnt = & // '( cityrid, ' + & // 'cityname ) AS ' + & // 'SELECT rap_geographic_locations.rid, ' +DAT* & // 'rap_geographic_locations.name ' + & // 'FROM rap_geographic_locations ' + & //"WHERE ( rap_geographic_locations.type = 'CITY' )" // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// Sources //ls_view = 'vrap_geini_sources' //ls_sql_stmnt = & // '( staterid, ' + & // 'cntyrid, ' + & // 'srcid, ' + & // 'id_fac, ' + & // 'f_name, ' + & // 'f_addr, ' + & // 'cityrid, ' + & // 'loc_zip, ' + & // 'siccd1, ' + & // DAT* 'strtdate, ' + & // 'enddate ) AS ' + & // 'SELECT rap_sources.geographic_state_rid, ' + & // 'rap_sources.geographic_county_rid, ' + & // 'rap_sources.id, ' + & // 'rap_activities.value, ' + & // 'rap_sources.name, ' + & // 'rap_sources.location_line_1_addr, ' + & // 'rap_sources.geographic_locale_rid, ' + & // 'rap_sources.location_zip_code, ' + & // 'rap_sources.sic_code, ' + & // 'rap_activities.start_date_time, ' + & // f_retrieve_date(SQLCA, 'rap_activitiesDAT*.end_date_time') + ' ' + & // 'FROM rap_activities, ' + & // 'rap_sources ' + & // 'WHERE ( rap_activities.ref_rid = rap_sources.rid ) AND ' + & // "( rap_activities.metric_code IN ( 'ID FAC AFS', 'ID AFS FAC' ) ) AND " + & // f_date_range('rap_activities', ldt_from, ldt_to) + & // ls_sources + & // ls_where_state + & // ls_where_county // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// source activities //ls_view = 'vrap_geini_sourceDAT*_parameters' //ls_sql_stmnt = & // '( srcid, ' + & // 'metric, ' + & // 'value, ' + & // 'strtdate, ' + & // 'enddate ) AS ' + & // 'SELECT rap_sources.id, ' + & // 'rap_activities_a.metric_code, ' + & // 'rap_activities_a.value, ' + & // 'rap_activities_a.start_date_time, ' + & // f_retrieve_date(SQLCA, 'rap_activities_a.end_date_time') + ' ' + & // 'FROM rap_activities rap_activities_a, ' + & // 'rap_activities rap_activities_b, ' + & // 'rap_sources ' + & DAT*// 'WHERE ( rap_activities_a.ref_rid = rap_activities_b.ref_rid ) AND ' + & // '( rap_activities_a.ref_rid = rap_sources.rid ) AND ' + & // "( rap_activities_b.metric_code IN ( 'ID FAC AFS', 'ID AFS FAC' ) ) AND " + & // "( rap_activities_a.metric_code IN ( 'SNAC O3', 'SNAC CO' ) ) AND " + & // f_date_range('rap_activities_a', ldt_from, ldt_to) + ' AND ' + & // f_date_range('rap_activities_b', ldt_from, ldt_to) + & // ls_where_state + & // ls_where_county // //if not f_create_viDAT*ew(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// contacts //ls_view = 'vrap_geini_contacts' //ls_sql_stmnt = & // '( srcid, ' + & // 'm_name, ' + & // 'm_addr, ' + & // 'cityrid, ' + & // 'st_rid, ' + & // 'm_zip ) AS ' + & // 'SELECT rap_sources.id, ' + & // 'rap_contacts.name, ' + & // 'rap_contacts.mail_addr_line_1, ' + & // 'rap_contacts.mail_city_rid, ' + & // 'rap_contacts.mail_state_rid, ' + & // 'rap_contacts.mail_zip_code ' + & DAT*// 'FROM rap_activities, ' + & // 'rap_contacts, ' + & // 'rap_contact_reasons, ' + & // 'rap_sources ' + & // 'WHERE ( rap_activities.ref_rid = rap_contacts.ref_rid ) AND ' + & // '( rap_contacts.rid = rap_contact_reasons.contact_rid ) AND ' + & // '( rap_activities.ref_rid = rap_sources.rid ) AND ' + & // "( rap_activities.metric_code IN ( 'ID FAC AFS', 'ID AFS FAC' ) ) AND " + & // "( rap_contact_reasons.reason_code = 'EMISSION INVENT' ) AND " + & // f_date_range('rap_DAT*activities', ldt_from, ldt_to) + & // ls_sources + & // ls_where_state + & // ls_where_county // //if not cbx_mailing_label.Checked then // ls_sql_stmnt = ls_sql_stmnt + ' AND ( rap_activities.rid < 0 )' //end if // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// stacks //ls_view = 'vrap_geini_stacks' //ls_sql_stmnt = & // '( srcid, ' + & // 'stkid, ' + & // 'id_stk, ' + & // 'stkname, ' + & // 'strtdate, ' + & // 'enddatDAT*Base user object for activity snapshot and history viewsforward global type u_dw_activity from UserObject end type type dw_act_detail from u_dw_list within u_dw_activity end type type cb_select from commandbutton within u_dw_activity end type type st_no_record from statictext within u_dw_activity end type type dw_act_query from u_dw_freeform within u_dw_activity end type type st_current_heading from statictext within u_dw_activity end type type dw_act_master from u_dw_freeform within DAT*u_dw_activity end type type r_1 from rectangle within u_dw_activity end type type r_2 from rectangle within u_dw_activity end type type ln_1 from line within u_dw_activity end type type ln_2 from line within u_dw_activity end type end forward global type u_dw_activity from UserObject int Width=2903 int Height=1116 boolean Border=true long BackColor=12632256 long PictureMaskColor=25166016 long TabTextColor=33554432 long TabBackColor=67108864 event highlight_dddw pbm_custom33 dDAT*w_act_detail dw_act_detail cb_select cb_select st_no_record st_no_record dw_act_query dw_act_query st_current_heading st_current_heading dw_act_master dw_act_master r_1 r_1 r_2 r_2 ln_1 ln_1 ln_2 ln_2 end type global u_dw_activity u_dw_activity type variables long il_ref_rid; string is_level; string is_src_code; string is_dev_code; string is_pro_code; string is_str_code; string is_view_style; boolean ib_new_detail; str_act istr_act; boolean ib_no_insert; // John's string DAT*uis_msg_name string uis_msg_text string uis_old_value long uil_selected_row datawindowchild uidwc_dw_child string uis_child_name string uis_validation_table string uis_column_status = "valid" string uis_column_name string is_unit_sql = "null" end variables forward prototypes public function boolean uf_save () public function boolean uf_check_required () public subroutine uf_get_items () public function boolean uf_check_pending () public subroutine uf_undo_dw_act_detail () publicDAT* subroutine uf_retrieve_dw_act_detail (string sql_statement) public subroutine uf_retrieve_history () public subroutine uf_retrieve_current () public subroutine uf_clear_detail () public function boolean uf_check_rid () public subroutine uf_insert_row () public subroutine uf_set_row_status () public function boolean uf_close_off_prev_metric_rec (long rid_value, datetime date_time_value) public subroutine uf_reshape_dw () public subroutine uf_resize_detail () public subroutine uf_get_dateDAT*s () public subroutine uf_out_of_insert_mode () public subroutine uf_prepare_dw (long ref_rid, string level, string view_style, string source_code, string device_code, string process_code, string stream_code) public subroutine uf_add_row () public subroutine uf_retrieve_parameter (long pl_ref_rid) 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 () public function long uf_cheDAT*ck_prev_metric_rec (string metric_code_value, string material_code_value, datetime end_date_value) end prototypes on highlight_dddw;if uil_selected_row > 0 then uidwc_dw_child.SelectRow(uil_selected_row, TRUE) end if end on public function boolean uf_save ();// This function saves data into rap_activities table boolean bResult long ll_total_row, ll_row_num datetime ldt_start, ldt_end string ls_start, ls_start_date, ls_start_time, ls_end, ls_end_date, & ls_end_time SetPointeDAT*r(HourGlass!) if Not dw_act_detail.ib_obj_modified then return FALSE if Not uf_check_required() then return FALSE SetMicroHelp(w_mdi_main, "Updating data...") bResult = TRUE bResult = uf_check_rid() // NOT WORKING - external datawindow does not have update capability //if dw_act_detail.Update() = 1 then // commit; //else // rollback; // bResult = FALSE //end if // Reset modified and new record flags dw_act_detail.ib_obj_modified = FALSE ib_new_detail = FALSE if bResultDAT* then // Save start and end date time to the ini file ldt_start = dw_act_query.GetItemDateTime(1, "start_date_time") ls_start = String(ldt_start, "mm/dd/yyyy hh:mm:ss") ls_start_date = Left(ls_start, 10) ls_start_time = Right(ls_start, 8) SetProfileString(gs_iniFile, "activity insert", "start_date", ls_start_date) SetProfileString(gs_iniFile, "activity insert", "start_time", ls_start_time) ldt_end = dw_act_query.GetItemDateTime(1, "end_date_time") ls_end = String(ldt_end, "mmDAT* /dd/yyyy hh:mm:ss") ls_end_date = Left(ls_end, 10) ls_end_time = Right(ls_end, 8) SetProfileString(gs_iniFile, "activity insert", "end_date", ls_end_date) SetProfileString(gs_iniFile, "activity insert", "end_time", ls_end_time) SetMicroHelp(w_mdi_main, "Data updated successfully") else SetMicroHelp(w_mdi_main, "Data update failed") end if uf_out_of_insert_mode() return (bResult) end function public function boolean uf_check_required ();// This function performs thDAT* e validation check long ll_cur_row, ll_total_row datetime ldt_query_start, ldt_query_end, ldt_detail_start, ldt_detail_end string ls_value, ls_unit_code uf_get_items() dw_act_detail.AcceptText() ll_total_row = dw_act_detail.RowCount() for ll_cur_row = 1 to ll_total_row // The following 2 lines are not working stably. So, use value field to // determine if the row needs to be checked on the requirements //// if dw_act_detail.dwGetItemStatus(ll_cur_row, 0, Primary!) <> NotModiDAT*fied! then // if dw_act_detail.dwGetItemStatus(ll_cur_row, 0, Primary!) <> New! then ls_value = dw_act_detail.GetItemString(ll_cur_row, "value") if Not IsNull(ls_value) or ls_value <> '' then ldt_detail_start = & dw_act_detail.GetItemDateTime(ll_cur_row, "start_date_time") ldt_detail_end = & dw_act_detail.GetItemDateTime(ll_cur_row, "end_date_time") if is_view_style = "current" then // commented out by swj, 8/19/94. User may change them after applying // the default valDAT*ues from dw_act_query // // Apply the contents in the structure(values from dw_act_query) to // // dw_act_detail for start and end date if they are null // if IsNull(ldt_detail_start) then // dw_act_detail.SetItem(ll_cur_row, "start_date_time", istr_act.start_date_time) // end if // if IsNull(ldt_detail_end) then // dw_act_detail.SetItem(ll_cur_row, "end_date_time", istr_act.end_date_time) // end if elseif is_view_style = "history" then ldt_query_start = & DAT* dw_act_master.GetItemDateTime(dw_act_master.GetRow(), "start_date_time") ldt_query_end = & dw_act_master.GetItemDateTime(dw_act_master.GetRow(), "end_date_time") // Apply the contents in the dw_act_master to // dw_act_detail for start and end date if they are null if IsNull(ldt_detail_start) then dw_act_detail.SetItem(ll_cur_row, "start_date_time", ldt_query_start) end if if IsNull(ldt_detail_end) and & (ldt_query_end >= dw_act_detail.GetItemDateTime(ll_cuDAT*r_row, "start_date_time")) then dw_act_detail.SetItem(ll_cur_row, "end_date_time", ldt_query_end) end if end if ls_unit_code = dw_act_detail.GetItemString(ll_cur_row, "unit_code") dw_act_detail.SetItem(ll_cur_row, "value_unit_code", ls_unit_code) // Do the validation check on the dw_act_detail if Not f_validate_act(dw_act_detail, ll_cur_row, is_level, & is_src_code, is_dev_code, is_pro_code, is_str_code) then return FALSE end if end if next retDAT*urn TRUE end function public subroutine uf_get_items ();dw_act_query.AcceptText() // Get data user has entered from datawindow buffer and put them into // user object structure istr_act.start_date_time = dw_act_query.GetItemDateTime(1, "start_date_time") istr_act.end_date_time = dw_act_query.GetItemDateTime(1, "end_date_time") istr_act.method_type = dw_act_query.GetItemString(1, "method_type") istr_act.ref_code = dw_act_query.GetItemString(1, "reference_code") istr_act.ref_type = dw_DAT*act_query.GetItemString(1, "reference_type") end subroutine public function boolean uf_check_pending ();integer li_messagebox_return // Have any modifications been made to the datawindows if dw_act_detail.ib_obj_modified then li_messagebox_return = MessageBox("Activity Specific View", & "Data have been modified in this specific view.~nSave current changes?", Question!, YesNo!) choose case (li_messagebox_return) case 1 if Not uf_save() then return FALSE end if casDAT*e 2 // Undo the changes uf_undo_dw_act_detail() // Reset modified flag dw_act_detail.ib_obj_modified = FALSE ib_new_detail = FALSE ib_no_insert = FALSE // case 3 // return FALSE end choose end if return TRUE end function public subroutine uf_undo_dw_act_detail ();// This function uses dwGetNextModified to check if any row is modified. // If found, undo the changes by using ReselectRow function long rowNum, totalRow dw_act_detail.AcceptText() totalRow = DAT*dw_act_detail.RowCount() rowNum = 0 // For primary buffer do while rowNum <= totalRow rowNum = dw_act_detail.GetNextModified(rowNum, Primary!) if rowNum > 0 then dw_act_detail.ReselectRow(rowNum) else rowNum = totalRow + 1 end if loop 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_temprid, ll_total_row datetime ldt_start_date_time, ldtDAT*_end_date_time, ldt_creation_date_time, & ldt_min_start, ldt_max_end string ls_metric_code, ls_user_id, ls_value, ls_desc, 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, ls_act_value decimal{11} ldec_value_amt integer counter, li_seq_no SetNull(ldt_min_start) SetNull(ldt_max_end) // Clear the datawindow buffer (except parameter column) first uf_clearDAT* _detail() declare metricCursor dynamic cursor for sqlsa; if f_db_error(SQLCA, "Fail on declaring dynamic cursor " + & "~nContact 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 feDAT*"tch 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 = 1 do while sqlca.sqlcode = 0 ls_dwfind = "metric_code = '" + ls_metric_code + "'" if Not IsNull(ls_value_type) then ls_dwfind = ls_dwfind + " DAT*$and (value_type = '" + ls_value_type + & "' or IsNull(value_type))" else ls_dwfind = ls_dwfind + " and IsNull(value_type)" end if if Not IsNull(ls_material_code) then ls_dwfind = ls_dwfind + " and (material = '" + ls_material_code + & "' or material = '@')" end if ll_row_num = dw_act_detail.Find(ls_dwfind, 1, dw_act_detail.RowCount()) // If not found, insert a new row with view prompt name from rap_metrics // table if ll_row_num = 0 then ll_row_num DAT*&= dw_act_detail.InsertRow(0) select name into :ls_desc from rap_metrics where rap_metrics.code = :ls_metric_code; if f_db_error(SQLCA, "Fail on selecting name from " + & "rap_metrics table in uf_retrieve_dw_act_detail. " + & "Contact your technical support.") = 1 then close metricCursor; return end if select MIN(rid) into :ll_temprid from rap_metric_maps where code = :ls_metric_code; if f_db_error(SQLCA, "Fail on selecting minimum rid fromDAT*( " + & "rap_metric_maps table in uf_retrieve_dw_act_detail. " + & "Contact your technical support.") = 1 then close metricCursor; return end if select view_sequence_no into :li_seq_no from rap_metric_maps where rid = :ll_temprid; if f_db_error(SQLCA, "Fail on selecting view_sequence_no from " + & "rap_metric_maps table in uf_retrieve_dw_act_detail. " + & "Contact your technical support.") = 1 then close metricCursor; return end if //DAT** Prefill these columns from the rap_metric_maps tables dw_act_detail.SetItem(ll_row_num, 'view_seq_no', li_seq_no) dw_act_detail.SetItem(ll_row_num, "metric_desc", ls_desc) dw_act_detail.SetItem(ll_row_num, "metric_code", ls_metric_code) // If an error in the dwFind elseif ll_row_num < 0 then MessageBox("Application Error", "Error finding metric code - " + & ls_metric_code + ". Contact your technical support") close metricCursor; return // If it finds, but the datDAT*,awindow already contains info from a // previously found activity record, insert a new row with view prompt // name and view sequence number identical to what is contained in the // found row of the datawindow else ls_act_value = dw_act_detail.GetItemString(ll_row_num, "value") if Not (IsNull(ls_act_value) or ls_act_value = '') then li_seq_no = dw_act_detail.GetItemNumber(ll_row_num, "view_seq_no") ls_desc = dw_act_detail.GetItemString(ll_row_num, "metric_desc") ll_rowDAT*._num = dw_act_detail.InsertRow(0) dw_act_detail.SetItem(ll_row_num, 'view_seq_no', li_seq_no) dw_act_detail.SetItem(ll_row_num, "metric_desc", ls_desc) dw_act_detail.SetItem(ll_row_num, "metric_code", ls_metric_code) end if end if 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_DAT*0ref_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_row_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_materialDAT*2_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_num, "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, "olDAT*4d_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 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, :DAT*6ldec_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. " + & "Contact your technical support.") = 1 then return end if dw_act_detail.SetSort('view_seq_no A material_code A, value_type A') dw_act_detail.Sort() 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(llDAT*8_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_date_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 DAT*: 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") else st_current_heading.Text = '' end if end if //// NOT WORKING //uf_set_row_status() end subroutine public subroutine uf_retrieve_history ();// Purpose: Construct SQL statement for dw_act_dDAT*<etail (activity data // history view string ls_sql_statement datetime ldt_start_date_time, ldt_end_date_time // Construct select statement for dw_act_detail ls_sql_statement = "Select rid, creation_date_time, metric_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_riDAT*>d = " + String(il_ref_rid) + " and metric_level_type = '" + & is_level + "'" // Get the retrieval arguments from dw_act_master and build the rest of // the where clause for SQL statement ldt_start_date_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_dDAT*@ate_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_date_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_retrieve_current ();// Purpose: Construct SQL statemDAT*Bent for dw_act_detail (activity data // current view string ls_sql_statement // Construct select statement for dw_act_detail ls_sql_statement = "Select rid, creation_date_time, metric_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) + " anDAT*Dd metric_level_type = '" + & is_level + "'" // 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_statement = 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 +DAT*F " 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 this function to retrieve data for dw_act_detail uf_retrieve_dw_act_detail(ls_sql_statement) end subroutine public subroutine uf_clear_detail ();// This function clears the content of datawindow buffer except the // parameter column long ll_row_num, ll_total_row, ll_null DAT*H datetime ldt_null string ls_null decimal ldec_null SetNull(ll_null) SetNull(ls_null) SetNull(ldt_null) SetNull(ldec_null) ll_total_row = dw_act_detail.RowCount() for ll_row_num = 1 to ll_total_row dw_act_detail.SetItem(ll_row_num, "rid", ll_null) dw_act_detail.SetItem(ll_row_num, "creation_date_time", ldt_null) dw_act_detail.SetItem(ll_row_num, "metric_level_type", ls_null) dw_act_detail.SetItem(ll_row_num, "ref_rid", ll_null) dw_act_detail.SetItem(ll_row_num, "start_daDAT*Jte_time", ldt_null) dw_act_detail.SetItem(ll_row_num, "user_id", ls_null) dw_act_detail.SetItem(ll_row_num, "value", ls_null) dw_act_detail.SetItem(ll_row_num, "comments", ls_null) dw_act_detail.SetItem(ll_row_num, "confidential_flag", ls_null) dw_act_detail.SetItem(ll_row_num, "data_code", ls_null) dw_act_detail.SetItem(ll_row_num, "end_date_time", ldt_null) // material_code is conditionally prefilled now. swj, 12/19/95 // dw_act_detail.SetItem(ll_row_num, "material_code",DAT*L ls_null) dw_act_detail.SetItem(ll_row_num, "method_type", ls_null) dw_act_detail.SetItem(ll_row_num, "reference_code", ls_null) dw_act_detail.SetItem(ll_row_num, "reference_type", ls_null) dw_act_detail.SetItem(ll_row_num, "value_amt", ldec_null) // value_type is prefilled now. swj, 8/19/94 // dw_act_detail.SetItem(ll_row_num, "value_type", ls_null) next end subroutine public function boolean uf_check_rid ();// This function calls database-dependent function to get the sequDAT*Nence // number for rid long ll_row_num, ll_i, ll_rid_num, ll_rid, ll_rid_rtn, ll_act_rid decimal ld_value_amt datetime ldt_create, ldt_start, ldt_end string ls_value, ls_comm, ls_conf_flg, ls_data_code, ls_material_code, & ls_method_type, ls_ref_code, ls_ref_type, ls_value_type, & ls_value_unit_code, ls_create, ls_start, ls_end, ls_metric, & ls_old_value, ls_user_id dw_act_detail.AcceptText() ll_row_num = dw_act_detail.RowCount() for ll_i = 1 to ll_row_num // TheDAT*P following 2 lines are not working stably. So, use value field to // determine if the row needs to be saved // if dw_act_detail.dwGetItemStatus(ll_i, 0, Primary!) <> NotModified! or & // dw_act_detail.dwGetItemStatus(ll_i, 0, Primary!) <> New! then ls_value = dw_act_detail.GetItemString(ll_i, "value") ls_old_value = dw_act_detail.GetItemString(ll_i, "old_value") // See if the user blank out the value column // If the user blank out the value column, then delete the record if IsDAT*RNull(ls_value) and Not IsNull(ls_old_value) then ll_rid = dw_act_detail.GetItemNumber(ll_i, "rid") delete from rap_activities where rap_activities.rid = :ll_rid; if f_db_error(SQLCA, "Fail on deleting rap_activities record. " + & "Contact your technical support.") = 1 then rollback; return FALSE else commit; end if // If the user changes the value of the value column, // then insert or update the record elseif (Not IsNull(ls_value) or ls_value <> '') and DAT*T& (ls_value <> ls_old_value or IsNull(ls_old_value)) then // Get item from each column ll_rid = dw_act_detail.GetItemNumber(ll_i, "rid") ldt_start = dw_act_detail.GetItemDateTime(ll_i, "start_date_time") ldt_end = dw_act_detail.GetItemDateTime(ll_i, "end_date_time") ls_metric = dw_act_detail.GetItemString(ll_i, "metric_code") ls_value = dw_act_detail.GetItemString(ll_i, "value") ls_comm = dw_act_detail.GetItemString(ll_i, "comment_text") ls_conf_flg = dw_act_detail.GDAT*VetItemString(ll_i, "confidential_flag") ls_data_code = dw_act_detail.GetItemString(ll_i, "data_code") ls_material_code = dw_act_detail.GetItemString(ll_i, "material_code") ls_method_type = dw_act_detail.GetItemString(ll_i, "method_type") ls_ref_code = dw_act_detail.GetItemString(ll_i, "reference_code") ls_ref_type = dw_act_detail.GetItemString(ll_i, "reference_type") ld_value_amt = dw_act_detail.GetItemNumber(ll_i, "value_amt") ls_value_type = dw_act_detail.GetItemString(ll_i,DAT*X "value_type") ls_value_unit_code = dw_act_detail.GetItemString(ll_i, "unit_code") ldt_create = dw_act_detail.GetItemDateTime(ll_i, "creation_date_time") ls_user_id = dw_act_detail.GetItemString(ll_i, "user_id") // If rid column is null, get rid from the function and insert records if IsNull(dw_act_detail.GetItemNumber(ll_i, "rid")) then // Select the next available rid from the rid_storage in database ll_rid_num = f_get_sequence() if ll_rid_num = -1 then return FALSDAT*ZE end if dw_act_detail.SetItem(ll_i, "rid", ll_rid_num) //// NOT WORKING because the datawindow is an external dw // // Ask update function to generate an Insert statement // dw_act_detail.dwSetItemStatus(ll_i, 0, Primary!, NewModified!) ll_rid_rtn = uf_check_prev_metric_rec(ls_metric, ls_material_code, ldt_start) if ll_rid_rtn = -1 then return FALSE if Left(sqlca.dbms, 2) <> 'OR' then ll_act_rid = f_get_activity_rid(il_ref_rid, is_level, ldt_start, ldt_end, & lDAT*\s_metric, ls_value_type, ls_material_code, ls_data_code, & ls_ref_code) if ll_act_rid > 0 then MessageBox('Activity', 'Start Date Time, End Date Time, Metric Code, ' + & 'Value Type, Material Code, Data Code, and Reference Code ' + & 'must be unique in table rap_activities') return FALSE elseif ll_act_rid < 0 then return FALSE end if end if // Inserting records insert into rap_activities (rid, creation_date_time, metric_code, metric_level_typeDAT*^, ref_rid, 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) values (:ll_rid_num, :ldt_create, :ls_metric, :is_level, :il_ref_rid, :ldt_start, :ls_user_id, :ls_value, :ls_comm, :ls_conf_flg, :ls_data_code, :ldt_end, :ls_material_code, :ls_method_type, :ls_ref_code, :ls_ref_type, :ld_value_amt, :ls_value_type, :ls_value_uDAT*`nit_code); if f_db_error(SQLCA, "Fail on insert rap_activities record. " + & " Contact your technical support.") = 1 then rollback; return FALSE else if ll_rid_rtn > 0 then if uf_close_off_prev_metric_rec(ll_rid_rtn, ldt_start) then commit; else rollback; return FALSE end if else commit; end if end if // Otherwise, update records else //// NOT WORKING because the datawindow is an external dw // // Ask update function to gDAT*benerate an Update statement // dw_act_detail.dwSetItemStatus(ll_i, 0, Primary!, DataModified!) if Left(sqlca.dbms, 2) <> 'OR' then ll_act_rid = f_get_activity_rid(il_ref_rid, is_level, ldt_start, ldt_end, & ls_metric, ls_value_type, ls_material_code, ls_data_code, & ls_ref_code) if ll_act_rid > 0 and ll_act_rid <> ll_rid then MessageBox('Activity', 'Start Date Time, End Date Time, Metric Code, ' + & 'Value Type, Material Code, Data Code, and Reference Code ' + & DAT*d 'must be unique in table rap_activities') return FALSE elseif ll_act_rid < 0 then return FALSE end if end if update rap_activities set value = :ls_value, comment_text = :ls_comm, confidential_flag = :ls_conf_flg, data_code = :ls_data_code, end_date_time = :ldt_end, material_code = :ls_material_code, method_type = :ls_method_type, reference_code = :ls_ref_code, reference_type = :ls_ref_type, value_amt = :ld_value_amtDAT*f, value_type = :ls_value_type, value_unit_code = :ls_value_unit_code, creation_date_time = :ldt_create, user_id = :ls_user_id where rap_activities.rid = :ll_rid; if f_db_error(SQLCA, "Fail on update rap_activities record. " + & "Contact your technical support.") = 1 then rollback; return FALSE else commit; end if end if end if next return TRUE end function public subroutine uf_insert_row ();long ll_row_num, ll_total_row string ls_DAT*htoday, ls_start_date, ls_end_date, ls_start_time, ls_end_time datetime ldt_today date ld_start, ld_end time lt_start, lt_end SetPointer(HourGlass!) st_no_record.Hide() cb_select.Visible = FALSE dw_act_detail.Reset() uf_retrieve_parameter(0) dw_act_query.Reset() dw_act_query.InsertRow(0) dw_act_query.Resize(dw_act_query.Width, 200) dw_act_query.BringToTop = TRUE // Fill out start and end datetime by getting values from ini file ls_start_date = ProfileString(gs_iniFile, "actiDAT*jvity insert", "start_date", "not found") if ls_start_date = "not found" then MessageBox('Activity Insert', "Error finding " + gs_iniFile + ", activity insert section~n" + & "or start_date key in the ProfileString function.~n" + & "Contact you technical support.", StopSign!) return end if ls_start_time = ProfileString(gs_iniFile, "activity insert", "start_time", "not found") if ls_start_time = "not found" then MessageBox('Activity Insert', "Error finding " + gs_iniFile + ", activiDAT*lty insert section~n" + & "or start_time key in the ProfileString function.~n" + & "Contact you technical support.", StopSign!) return end if ls_end_date = ProfileString(gs_iniFile, "activity insert", "end_date", "not found") if ls_end_date = "not found" then MessageBox('Activity Insert', "Error finding " + gs_iniFile + ", activity insert section~n" + & "or end_date key in the ProfileString function.~n" + & "Contact you technical support.", StopSign!) return end if ls_endDAT*n_time = ProfileString(gs_iniFile, "activity insert", "end_time", "not found") if ls_end_time = "not found" then MessageBox('Activity Insert', "Error finding " + gs_iniFile + ", activity insert section~n" + & "or end_time key in the ProfileString function.~n" + & "Contact you technical support.", StopSign!) return end if if ls_start_date <> '' then ld_start = date(ls_start_date) lt_start = time(ls_start_time) dw_act_query.SetItem(1, "start_date_time", datetime(ld_start, lt_starDAT*pt)) end if if ls_end_date <> '' then ld_end = date(ls_end_date) lt_end = time(ls_end_time) dw_act_query.SetItem(1, "end_date_time", datetime(ld_end, lt_end)) end if uf_resize_detail() dw_act_detail.Move(dw_act_detail.X, 235) // dw_act_detail.BringToTop = TRUE // Clear the datawindow buffer except the metric description uf_clear_detail() // Get today date and time and get rid of microsecond ls_today = String(today(), "mm/dd/yyyy hh:mm:ss") ldt_today = DateTime(Date(LefDAT*rt(ls_today, 10)), Time(Right(ls_today, 8))) // Prefill column values ll_total_row = dw_act_detail.RowCount() for ll_row_num = 1 to ll_total_row // Prefill these columns from the variables 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_today) dw_act_detail.SetItem(ll_row_num, "user_id", gs_user_id) // NOT WORKING // // Change the row stDAT*tatus programatically // dw_act_detail.dwSetItemStatus(ll_row_num, 0, Primary!, NotModified!) //if dw_act_detail.dwGetItemStatus(ll_row_num, 0, Primary!) = NotModified! then //messagebox("notmodified", "in uf_set_row_status") //end if //if dw_act_detail.dwGetItemStatus(ll_row_num, 0, Primary!) = DataModified! then //messagebox("datamodified", "in uf_set_row_status") //end if //if dw_act_detail.dwGetItemStatus(ll_row_num, 0, Primary!) = NewModified! then //messagebox("newmodified", "in uf_DAT*vset_row_status") //end if //if dw_act_detail.dwGetItemStatus(ll_row_num, 0, Primary!) = New! then //messagebox("new", "in uf_set_row_status") //end if next ib_no_insert = TRUE dw_act_query.SetFocus() end subroutine public subroutine uf_set_row_status ();//// This function sets row status to NotModified for all rows in dw_act_detail // //// NOT WORKING //long ll_cur_row, ll_total_row // //ll_total_row = dw_act_detail.RowCount() // //for ll_cur_row = 1 to ll_total_row // // DAT*x// Change the row status programatically // dw_act_detail.dwSetItemStatus(ll_cur_row, 0, Primary!, NotModified!) ////if dw_act_detail.dwGetItemStatus(ll_cur_row, 0, Primary!) = NotModified! then ////messagebox("notmodified", "in uf_set_row_status") ////end if ////if dw_act_detail.dwGetItemStatus(ll_cur_row, 0, Primary!) = DataModified! then ////messagebox("datamodified", "in uf_set_row_status") ////end if ////if dw_act_detail.dwGetItemStatus(ll_cur_row, 0, Primary!) = NewModified! then /DAT*z///messagebox("newmodified", "in uf_set_row_status") ////end if ////if dw_act_detail.dwGetItemStatus(ll_cur_row, 0, Primary!) = New! then ////messagebox("new", "in uf_set_row_status") ////end if //next end subroutine public function boolean uf_close_off_prev_metric_rec (long rid_value, datetime date_time_value);// This function closes off the previous metric value update rap_activities set end_date_time = :date_time_value where rap_activities.rid = :rid_value; if f_db_error(SQDAT*|LCA, "Fail on updating rap_activities record. " + & "Contact your technical support.") = 1 then return FALSE else return TRUE end if end function public subroutine uf_reshape_dw ();// This function is performed in the descendant level end subroutine public subroutine uf_resize_detail ();// Perform this function in the descendant level end subroutine public subroutine uf_get_dates ();// This function gets the start and end date time from the ini file if it // is in history viDAT*~ew and from the database if it is in current view string ls_start_date, ls_start_time, ls_end_date, ls_end_time, ls_today date ld_start, ld_end time lt_start, lt_end datetime ldt_start, ldt_end if is_view_style = "history" then // Get the start and end date time from the ini file and put them on // dw_act_query st_current_heading.Hide() ls_start_date = ProfileString(gs_iniFile, "activity view", "start_date", "not found") if ls_start_date = "not found" then MessagDAT*eBox('Activity View', "Error finding " + gs_iniFile + ", activity view section~n" + & "or start_date key in the ProfileString function.~n" + & "Contact you technical support.", StopSign!) return end if ls_start_time = ProfileString(gs_iniFile, "activity view", "start_time", "not found") if ls_start_time = "not found" then MessageBox('Activity View', "Error finding " + gs_iniFile + ", activity view section~n" + & "or start_time key in the ProfileString function.~n" + &DAT* "Contact you technical support.", StopSign!) return end if ls_end_date = ProfileString(gs_iniFile, "activity view", "end_date", "not found") if ls_end_date = "not found" then MessageBox('Activity View', "Error finding " + gs_iniFile + ", activity view section~n" + & "or end_date key in the ProfileString function.~n" + & "Contact you technical support.", StopSign!) return end if ls_end_time = ProfileString(gs_iniFile, "activity view", "end_time", "not fouDAT*nd") if ls_end_time = "not found" then MessageBox('Activity View', "Error finding " + gs_iniFile + ", activity view section~n" + & "or end_time key in the ProfileString function.~n" + & "Contact you technical support.", StopSign!) return end if if ls_start_date <> '' then ld_start = date(ls_start_date) lt_start = time(ls_start_time) dw_act_query.SetItem(1, "start_date_time", datetime(ld_start, lt_start)) end if if ls_end_date <> '' then ld_end =DAT* date(ls_end_date) lt_end = time(ls_end_time) dw_act_query.SetItem(1, "end_date_time", datetime(ld_end, lt_end)) end if elseif is_view_style = "current" then // Get the earliest start and latest end date time from the database // put them on the static text st_current_heading and dw_act_query if il_ref_rid > 0 then uf_select_dates(ldt_start, ldt_end) else SetNull(ldt_start) SetNull(ldt_end) end if dw_act_query.SetItem(1, "start_date_time", ldt_startDAT*) if Not IsNull(ldt_end) then dw_act_query.SetItem(1, "end_date_time", ldt_end) end if if Not(IsNull(ldt_start) or IsNull(ldt_end)) then st_current_heading.Text = "Showing activity data from " + & String(ldt_start, "mm/dd/yyyy") + " to " + String(ldt_end, "mm/dd/yyyy") elseif Not IsNull(ldt_start) then st_current_heading.Text = "Showing activity data from " + & String(ldt_start, "mm/dd/yyyy") else st_current_heading.Text = '' end if st_current_headingDAT*.Show() end if end subroutine public subroutine uf_out_of_insert_mode ();// This function changes the display back to current or history view long ll_count SetPointer(HourGlass!) uf_reshape_dw() dw_act_query.Reset() dw_act_query.InsertRow(0) // Call function to put start and end date time on the dw_act_query uf_get_dates() // Clear the activity detail datawindow buffer dw_act_detail.SetRedraw(FALSE) dw_act_detail.Reset() // Perform an automatical retrieve based on DAT*the start and end date time // in dw_act_query. // Only perform the retrieve when il_ref_rid > 0 (This means that only // perform retrieve when the master record (e.i. dw_1 of w_geo) is not // a new insert row if il_ref_rid > 0 then uf_get_items() ll_count = uf_count_act() if ll_count = 0 then // if no activity data available, display the no record message st_no_record.Show() if is_view_style = "history" then dw_act_master.Reset() dw_act_master.SetFocus() DAT* end if else st_no_record.Hide() uf_retrieve_parameter(il_ref_rid) if is_view_style = "current" then // Call this function to retrieve data for dw_act_detail uf_retrieve_current() elseif is_view_style = "history" then dw_act_master.SetTransObject(SQLCA) // Retrieve data for dw_act_master if uf_retrieve_dw_act_master() > 0 then // Call this function to retrieve data for dw_act_detail uf_retrieve_history() else MessageBoxDAT*('Activity History View', 'No activity data between ' + & String(istr_act.start_date_time, "mm/dd/yyyy") + ' and ' + & String(istr_act.end_date_time, "mm/dd/yyyy")) end if end if end if // Reset ib_no_insert flag. swj, 8/19/94 ib_no_insert = FALSE end if dw_act_detail.SetRedraw(TRUE) end subroutine public subroutine uf_prepare_dw (long ref_rid, string level, string view_style, string source_code, string device_code, string process_code, string stream_code);DAT*// Purpose: Reshape all datawindows and retrieve metric info for // dw_act_detail long ll_count dw_act_detail.SetTransObject(SQLCA) // Store ref_rid, level and view_style into instance variable il_ref_rid = ref_rid is_level = level is_view_style = view_style is_src_code = source_code is_dev_code = device_code is_pro_code = process_code is_str_code = stream_code ib_no_insert = FALSE uf_reshape_dw() // Use InsertRow function to show the datawindow dw_act_query.SetTransDAT*Object(SQLCA) dw_act_query.InsertRow(0) // Call function to put start and end date time on the dw_act_query uf_get_dates() // Clear the activity detail datawindow buffer dw_act_detail.SetRedraw(FALSE) dw_act_detail.Reset() // Perform an automatical retrieve based on the start and end date time // in dw_act_query. // Only perform the retrieve when il_ref_rid > 0 (This means that only // perform retrieve when the master record (e.i. dw_1 of w_geo) is not // a new insert row if iDAT*l_ref_rid > 0 then uf_get_items() ll_count = uf_count_act() if ll_count = 0 then // ib_no_insert = FALSE // if no activity data available, display the no record message st_no_record.Show() if is_view_style = "history" then dw_act_master.Reset() dw_act_master.SetFocus() end if elseif ll_count > 0 then // commented out by swj, 8/19/94. also allow insert on current or // history view // ib_no_insert = TRUE st_no_record.Hide() uf_retrieve_parameter(DAT*il_ref_rid) if is_view_style = "current" then // Call this function to retrieve data for dw_act_detail uf_retrieve_current() elseif is_view_style = "history" then dw_act_master.SetTransObject(SQLCA) // Retrieve data for dw_act_master if uf_retrieve_dw_act_master() > 0 then // Call this function to retrieve data for dw_act_detail uf_retrieve_history() dw_act_master.SetFocus() else MessageBox('Activity History View', 'No activiDAT*ty data between ' + & String(istr_act.start_date_time, "mm/dd/yyyy") + ' and ' + & String(istr_act.end_date_time, "mm/dd/yyyy")) end if end if end if end if dw_act_detail.SetRedraw(TRUE) end subroutine public subroutine uf_add_row ();window lw_cur_win string ls_win_name if ib_no_insert then MessageBox('Insert', 'Already in insert mode') return end if // Get current active sheet for this mdi frame lw_cur_win = w_mdi_main.GetActiveSheet() // Get the DAT*name assigned to this active sheet ls_win_name = lw_cur_win.ClassName() choose case ls_win_name case 'w_geo' if w_geo.wf_check_pending() then il_ref_rid = gl_geo_rid // Make sure it's current uf_insert_row() dw_act_detail.ib_obj_modified = TRUE ib_new_detail = TRUE end if case 'w_legal' if w_legal.wf_check_pending() then il_ref_rid = w_legal.dw_1.GetItemNumber(w_legal.dw_1.GetRow(), 'rid') // Make sure it's current uf_insert_row() dw_act_detail.ib_objDAT*_modified = TRUE ib_new_detail = TRUE end if case 'w_source' if w_source.wf_check_pending() then is_src_code = w_source.is_source_code // Make sure it's current il_ref_rid = gl_source_rid // Make sure it's current uf_insert_row() dw_act_detail.ib_obj_modified = TRUE ib_new_detail = TRUE end if case 'w_device' if w_device.wf_check_pending() then is_dev_code = w_device.is_device_code // Make sure it's current il_ref_rid = gl_device_rid // Make sureDAT* it's current uf_insert_row() dw_act_detail.ib_obj_modified = TRUE ib_new_detail = TRUE end if case 'w_process' if w_process.wf_check_pending() then is_pro_code = w_process.is_process_code // Make sure it's current il_ref_rid = gd_process_rid // Make sure it's current uf_insert_row() dw_act_detail.ib_obj_modified = TRUE ib_new_detail = TRUE end if case 'w_stream' if w_stream.wf_check_pending() then is_str_code = w_stream.is_stream_code // MakDAT*e sure it's current il_ref_rid = w_stream.il_stream_rid // Make sure it's current uf_insert_row() dw_act_detail.ib_obj_modified = TRUE ib_new_detail = TRUE end if end choose end subroutine public subroutine uf_retrieve_parameter (long pl_ref_rid);// This function is performed in the descendant level end subroutine public subroutine uf_select_dates (ref datetime pdt_start, ref datetime pdt_end);DateTime ldt_max_start select min(start_date_time), max(end_date_time), DAT*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; if f_db_error(SQLCA, "Fail on selecting the earliest start date time, " + & "the latest end date 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 DAT*function long uf_count_act ();long ll_count select count(rid) into :ll_count from rap_activities where ref_rid = :il_ref_rid and metric_level_type = :is_level; 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 return dw_act_master.Retrieve(il_ref_rid, DAT*is_level, istr_act.start_date_time, istr_act.end_date_time) end function public function long uf_check_prev_metric_rec (string metric_code_value, string material_code_value, datetime end_date_value);// This function checks if the previous metric value exists. If it exists, // return the value of rid, otherwise, return 0 long ll_rid select rid into :ll_rid from rap_activities where ref_rid = :il_ref_rid and metric_level_type = :is_level and metric_code = :metric_code_value anDAT*d material_code = :material_code_value and end_date_time is null and start_date_time <= :end_date_value; if sqlca.sqlcode = 100 then return 0 else if f_db_error(SQLCA, "Fail on selecting rap_activities record. " + & " Contact your technical support.") = 1 then return -1 else return ll_rid end if end if end function on constructor;cb_select.Hide() end on on u_dw_activity.create this.dw_act_detail=create dw_act_detail this.cb_select=create cb_select thDAT*is.st_no_record=create st_no_record this.dw_act_query=create dw_act_query this.st_current_heading=create st_current_heading this.dw_act_master=create dw_act_master this.r_1=create r_1 this.r_2=create r_2 this.ln_1=create ln_1 this.ln_2=create ln_2 this.Control[]={this.dw_act_detail,& this.cb_select,& this.st_no_record,& this.dw_act_query,& this.st_current_heading,& this.dw_act_master,& this.r_1,& this.r_2,& this.ln_1,& this.ln_2} end on on u_dw_activity.destroy destroy(this.dDAT*w_act_detail) destroy(this.cb_select) destroy(this.st_no_record) destroy(this.dw_act_query) destroy(this.st_current_heading) destroy(this.dw_act_master) destroy(this.r_1) destroy(this.r_2) destroy(this.ln_1) destroy(this.ln_2) end on type dw_act_detail from u_dw_list within u_dw_activity event select_one pbm_custom21 event select_all pbm_custom22 event save pbm_custom23 event validate_delete pbm_custom24 event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=23 int Y=252 iDAT*nt Width=2848 int Height=840 int TabOrder=40 string Tag="Activity data for the above date range" string DataObject="d_activity_detail" end type on select_one;call u_dw_list::select_one;MessageBox("Filter on Activity", "Sorry! This function is not available") //uf_check_pending() end on on select_all;call u_dw_list::select_all;MessageBox("Show All on Activity", "Sorry! This function is not available") //uf_check_pending() end on on save;call u_dw_list::save; SetPointer(HourGlass!DAT*) uf_save() end on on validate_delete;call u_dw_list::validate_delete;MessageBox("Delete Activity", "Sorry! This function is not available") end on on dwescape;call u_dw_list::dwescape;string ls_col_name if uil_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then this.setitem(this.getrow(), uis_column_name, uis_old_value) f_dddw_search(this, uidwc_dw_child, uis_child_name, uil_selected_row) Parent.PostEvent("highlight_dddw") end if DAT* end if end on on dwnkey;call u_dw_list::dwnkey;string ls_col_name if keydown(keytab!) then if uil_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then this.setitem(this.getrow(), uis_column_name, & uidwc_dw_child.getitemstring(uil_selected_row, uis_child_name)) end if end if end if end on on add_row;call u_dw_list::add_row;uf_add_row() end on on getfocus;call u_dw_list::getfocus;window lw_active_sheet string DAT*lw_active_sheet_name // Put green focus around this datawindow r_1.Hide() r_2.Resize(This.Width + 25, This.Height + 25) r_2.Move(This.X - 10, This.Y - 10) r_2.Show() // Get current active sheet for this mdi frame lw_active_sheet = w_mdi_main.GetActiveSheet() // Get the name assigned to this active sheet lw_active_sheet_name = lw_active_sheet.ClassName() // Make this datawindow the active datawindow in that sheet choose case lw_active_sheet_name case "w_geo" w_geo.idw_activDAT*e = This case "w_legal" w_legal.idw_active = This case "w_source" w_source.idw_active = This case "w_device" w_device.idw_active = This case "w_process" w_process.idw_active = This case "w_stream" w_stream.idw_active = This end choose end on event itemfocuschanged;call super::itemfocuschanged;string ls_col_name DataWindowChild dwc ls_col_name = This.GetColumnName() choose case ls_col_name case "material_code", "data_code" f_retrieve_codes("ActivityDAT* View", This, ls_col_name, "code") case "method_type" f_retrieve_codes("Activity View", This, ls_col_name, "type") case "reference_type" f_retrieve_codes("Activity View", this, ls_col_name, "type") case 'reference_code' f_retrieve_codes('Activity View', This, ls_col_name, 'code') case "unit_code" window lw_window lw_window = w_mdi_main.getactivesheet() if is_unit_sql = "null" then is_unit_sql = f_get_unit_sql(lw_window, this) end if string DAT*ls_metric_code ls_metric_code = this.getitemstring(this.getrow(), "metric_code") f_retrieve_unit_codes(lw_window, this, is_unit_sql, ls_metric_code) end choose choose case ls_col_name case "material_code" uil_selected_row = 0 getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_child_name = "code" uis_validation_table = "rap_materials" uis_msg_name = "Column - Material Code" uis_msg_text = "Sorry! Not a valid material code" DAT* uis_old_value = dw_act_detail.getitemstring(dw_act_detail.getrow(), ls_col_name) case "unit_code" uil_selected_row = 0 getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_child_name = "code" uis_validation_table = "rap_units" uis_msg_name = "Column - Unit Code" uis_msg_text = "Sorry! Not a valid unit code" uis_old_value = dw_act_detail.getitemstring(dw_act_detail.getrow(), ls_col_name) case "method_type" uil_selected_row = 0 DAT* getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_child_name = "type" uis_validation_table = "rap_methods" uis_msg_name = "Column - Method Type" uis_msg_text = "Sorry! Not a valid method type" uis_old_value = dw_act_detail.getitemstring(dw_act_detail.getrow(), ls_col_name) case "reference_type" uil_selected_row = 0 getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_child_name = "type" uis_validatiDAT*on_table = "rap_reference_types" uis_msg_name = "Column - Reference Type" uis_msg_text = "Sorry! Not a valid reference type" uis_old_value = dw_act_detail.getitemstring(dw_act_detail.getrow(), ls_col_name) case "reference_code" uil_selected_row = 0 getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_child_name = "code" uis_validation_table = "rap_reference_codes" uis_msg_name = "Column - Reference Code" uis_msg_text = "Sorry! DAT*Not a valid reference code" uis_old_value = dw_act_detail.getitemstring(dw_act_detail.getrow(), ls_col_name) case "data_code" uil_selected_row = 0 getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_child_name = "code" uis_validation_table = "rap_data_codes" uis_msg_name = "Column - Data Code" uis_msg_text = "Sorry! Not a valid data code" uis_old_value = dw_act_detail.getitemstring(dw_act_detail.getrow(), ls_col_name) case else DAT* uis_column_name = "" end choose end event event itemchanged;call super::itemchanged; string ls_col_name, ls_unit_code ls_col_name = This.GetColumnName() choose case ls_col_name case "unit_code" ls_unit_code = This.GetText() This.SetItem(This.GetRow(), "value_unit_code", ls_unit_code) case "value" f_set_value_amt(This, This.GetText(), "value", "value_amt", This.GetRow()) end choose if ls_col_name = uis_column_name then if Not f_validate_code(This.GetText()DAT*, uis_child_name, uis_validation_table) then MessageBox(uis_msg_name, uis_msg_text) return 1 else uil_selected_row = uidwc_dw_child.GetRow() end if end if // Change the creation date and user id This.SetItem(This.GetRow(), 'creation_date_time', Today()) This.SetItem(This.GetRow(), 'user_id', gs_user_id) end event on editchanged;call u_dw_list::editchanged; string ls_col_name, ls_unit_code ls_col_name = This.GetColumnName() choose case ls_col_name case "unit_cDAT*ode" ls_unit_code = This.GetText() This.SetItem(This.GetRow(), "value_unit_code", ls_unit_code) case "value" f_set_value_amt(This, This.GetText(), "value", "value_amt", This.GetRow()) end choose if ls_col_name = uis_column_name then uil_selected_row = f_dddw_search(this, uidwc_dw_child, uis_child_name, uil_selected_row) if uil_selected_row > 0 then Parent.PostEvent("highlight_dddw") end if end if // Change the creation date and user id This.SetItem(This.GetRow(DAT*), 'creation_date_time', Today()) This.SetItem(This.GetRow(), 'user_id', gs_user_id) end on on losefocus;call u_dw_list::losefocus;// Hide the green focus r_2.Hide() end on event dwnprocessenter;string ls_col_name if uil_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then this.setitem(this.getrow(), uis_column_name, & uidwc_dw_child.getitemstring(uil_selected_row, uis_child_name)) end if end if //if uil_selected_row <> 0 tDAT*hen //if uis_column_name = "material_code" or uis_column_name = "unit_code" or uis_column_name = "method_type" then // //f_dddw_search(this, uidwc_dw_child, uis_child_name, uil_selected_row) // dw_act_detail.setitem(dw_act_detail.getrow(), uis_column_name, & // uidwc_dw_child.getitemstring(uil_selected_row, uis_child_name)) //// dw_act_detail.triggerevent(editchanged!) //end if //end if // dw_act_detail.triggerevent(editchanged!) //if uis_column_name = "material_code" and uis_coluDAT*mn_status <> "valid" then // messagebox(uis_msg_name, uis_msg_text) // this.setcolumn(uis_column_name) //else Send(Handle(This), 256, 9, Long(0,0)) return 1 //end if end event on delete_row;call u_dw_list::delete_row;ib_obj_modified = TRUE end on on first_row;call u_dw_list::first_row;This.ScrollToRow(1) end on on mousemove;call u_dw_list::mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on on last_row;call u_dw_list::last_row;This.ScrollToRow(This.RowCount()) end on DAT* on next_row;call u_dw_list::next_row;This.ScrollNextRow() end on on prev_row;call u_dw_list::prev_row;This.ScrollPriorRow() end on event itemerror;call super::itemerror;return 2 end event type cb_select from commandbutton within u_dw_activity int X=2546 int Y=24 int Width=247 int Height=84 int TabOrder=20 boolean Visible=false string Tag="Select data in the specified date range " string Text="Select" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamilDAT*y FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;DateTime ldt_start, ldt_end string ls_start, ls_end, ls_start_date, ls_start_time, & ls_end_date, ls_end_time SetPointer(HourGlass!) // Call this function to get all items in dw_act_query uf_get_items() // Check if start and end date time both get filled out by the user if IsNull(istr_act.start_date_time) and IsNull(istr_act.end_date_time) then MessageBox("Select", "Please fill out Start Date Time and EndDAT* Date Time") dw_act_query.SetColumn("start_date_time") return elseif IsNull(istr_act.start_date_time) then MessageBox("Select", "Please fill out Start Date Time") dw_act_query.SetColumn("start_date_time") return elseif IsNull(istr_act.end_date_time) then MessageBox("Select", "Please fill out End Date Time") dw_act_query.SetColumn("end_date_time") return end if // Make sure end date is greater than start date if istr_act.start_date_time > istr_act.end_date_time then DAT* MessageBox("Select", "Start Date Time must be before End Date Time") dw_act_query.SetColumn("start_date_time") return end if if is_view_style = "current" then // Call this function to retrieve data for dw_act_detail uf_retrieve_current() elseif is_view_style = "history" then dw_act_master.SetTransObject(SQLCA) // Retrieve data for dw_act_master if uf_retrieve_dw_act_master() > 0 then // Call this function to retrieve data for dw_act_detail uf_retrieve_history(DAT*) else MessageBox("Select", "No records found within this date range") dw_act_query.SetColumn("start_date_time") return end if end if // Save start and end date time to the ini file ldt_start = dw_act_query.GetItemDateTime(1, "start_date_time") ls_start = String(ldt_start, "mm/dd/yyyy hh:mm:ss") ls_start_date = Left(ls_start, 10) ls_start_time = Right(ls_start, 8) ldt_end = dw_act_query.GetItemDateTime(1, "end_date_time") ls_end = String(ldt_end, "mm/dd/yyyy hh:mm:DAT*ss") ls_end_date = Left(ls_end, 10) ls_end_time = Right(ls_end, 8) SetProfileString(gs_iniFile, "activity view", "start_date", ls_start_date) SetProfileString(gs_iniFile, "activity view", "start_time", ls_start_time) SetProfileString(gs_iniFile, "activity view", "end_date", ls_end_date) SetProfileString(gs_iniFile, "activity view", "end_time", ls_end_time) end on type st_no_record from statictext within u_dw_activity int X=649 int Y=540 int Width=1591 int Height=72 boolean VisibleDAT*=false boolean Enabled=false string Text="No records present. Use Insert to create new activity data." boolean FocusRectangle=false long TextColor=8388608 long BackColor=16777215 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type dw_act_query from u_dw_freeform within u_dw_activity event save pbm_custom23 event select_one pbm_custom24 event select_all pbm_custom25 event validate_delete pbm_custoDAT*m26 event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=0 int Y=24 int Width=2898 int Height=92 int TabOrder=10 string Tag="Specify date range to select activity data" string DataObject="d_activity_query" end type on save;call u_dw_freeform::save;uf_save() end on on select_one;call u_dw_freeform::select_one;MessageBox("Filter on Activity", "Sorry! This function is not available") end on on select_all;call u_dw_freeform::select_all;MessageBox("Show All on Activity", "SorrDAT*y! This function is not available") end on on validate_delete;call u_dw_freeform::validate_delete;MessageBox("Delete Activity", "Sorry! This function is not available") end on on dwescape;call u_dw_freeform::dwescape;string ls_col_name if uil_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then this.setitem(this.getrow(), uis_column_name, uis_old_value) f_dddw_search(this, uidwc_dw_child, uis_child_name, uil_selected_row) Parent.PostEDAT*vent("highlight_dddw") end if end if end on on dwnkey;call u_dw_freeform::dwnkey;string ls_col_name if keydown(keytab!) then if uil_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then this.setitem(this.getrow(), uis_column_name, & uidwc_dw_child.getitemstring(uil_selected_row, uis_child_name)) end if end if end if end on on getfocus;call u_dw_freeform::getfocus;window lw_active_sheet string lw_active_sheet_name DAT*// Get current active sheet for this mdi frame lw_active_sheet = w_mdi_main.GetActiveSheet() // Get the name assigned to this active sheet lw_active_sheet_name = lw_active_sheet.ClassName() // Make this datawindow the active datawindow in that sheet choose case lw_active_sheet_name case "w_geo" w_geo.idw_active = This case "w_legal" w_legal.idw_active = This case "w_source" w_source.idw_active = This case "w_device" w_device.idw_active = This case "w_process" DAT* w_process.idw_active = This case "w_stream" w_stream.idw_active = This end choose end on event itemchanged;call super::itemchanged;string ls_col_name ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then if Not f_validate_code(This.GetText(), uis_child_name, uis_validation_table) then MessageBox(uis_msg_name, uis_msg_text) return 1 else uil_selected_row = uidwc_dw_child.GetRow() end if end if end event on add_row;call u_dw_freeform::addDAT*_row;uf_add_row() end on on losefocus;call u_dw_freeform::losefocus;long ll_total_row, ll_row_num //datetime ldt_start, ldt_end //string ls_method_type, ls_ref_type, ls_ref_code // Only apply the values in the columns of this datawindow to the // dw_act_detail when the user is inserting the row if ib_new_detail then uf_get_items() // ldt_start = This.GetItemDateTime(1, "start_date_time") // ldt_end = This.GetItemDateTime(1, "end_date_time") // ls_method_type = This.GetItemSDAT*tring(1, "method_type") // ls_ref_type = This.GetItemString(1, "reference_type") // ls_ref_code = This.GetItemString(1, "reference_code") ll_total_row = dw_act_detail.RowCount() for ll_row_num = 1 to ll_total_row dw_act_detail.SetItem(ll_row_num, "start_date_time", istr_act.start_date_time) dw_act_detail.SetItem(ll_row_num, "end_date_time", istr_act.end_date_time) dw_act_detail.SetItem(ll_row_num, "method_type", istr_act.method_type) dw_act_detail.SetItem(ll_row_num, "DAT*reference_type", istr_act.ref_type) dw_act_detail.SetItem(ll_row_num, "reference_code", istr_act.ref_code) // NOT WORKING // // Change the row status programatically // dw_act_detail.dwSetItemStatus(ll_row_num, 0, Primary!, NotModified!) next end if end on event itemfocuschanged;call super::itemfocuschanged;string ls_col_name DataWindowChild dwc ls_col_name = This.GetColumnName() choose case ls_col_name case "method_type" f_retrieve_codes("Activity View", DAT*This, ls_col_name, "type") case "reference_type" f_retrieve_codes("Activity View", this, ls_col_name, "type") end choose choose case ls_col_name case "method_type" uil_selected_row = 0 // is_filt = "" getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_child_name = "type" uis_validation_table = "rap_methods" uis_msg_name = "Column - Method Type" uis_msg_text = "Sorry! Not a valid method type" uis_old_value = dw_act_query.DAT*getitemstring(dw_act_query.getrow(), ls_col_name) case "reference_type" uil_selected_row = 0 // is_filt = "" getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_child_name = "type" uis_validation_table = "rap_reference_types" uis_msg_name = "Column - Reference Type" uis_msg_text = "Sorry! Not a valid reference type" uis_old_value = dw_act_query.getitemstring(dw_act_query.getrow(), ls_col_name) case "reference_code" uil_selecteDAT*d_row = 0 // is_filt = "" getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_child_name = "code" uis_validation_table = "rap_reference_codes" uis_msg_name = "Column - Reference Code" uis_msg_text = "Sorry! Not a valid reference code" uis_old_value = dw_act_query.getitemstring(dw_act_query.getrow(), ls_col_name) case else uis_column_name = "" end choose end event on mousemove;call u_dw_freeform::mousemove;//string objNameStr, obDAT*jName // //objNameStr = This.dwGetObjectAtPointer() //objName = Left(objNameStr, Pos(objNameStr, "~t") - 1) SetMicroHelp(w_mdi_main, This.Tag) //Parent.Title = wTitle + " - " + This.Tag end on on editchanged;call u_dw_freeform::editchanged;string ls_col_name ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then uil_selected_row = f_dddw_search(this, uidwc_dw_child, uis_child_name, uil_selected_row) if uil_selected_row > 0 then Parent.PostEvent("highlighDAT*t_dddw") end if end if end on event itemerror;call super::itemerror;return 2 end event event dwnprocessenter;string ls_col_name if uil_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then this.setitem(this.getrow(), uis_column_name, & uidwc_dw_child.getitemstring(uil_selected_row, uis_child_name)) end if end if Send(Handle(This), 256, 9, Long(0,0)) return 1 end event type st_current_heading from statictext within u_dw_DAT*activity int X=32 int Y=24 int Width=2775 int Height=88 boolean Visible=false boolean Enabled=false boolean FocusRectangle=false long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type dw_act_master from u_dw_freeform within u_dw_activity event save pbm_custom21 event select_one pbm_custom22 event select_all pbm_custom23 event validate_delete pbm_custDAT*om24 int X=23 int Y=144 int Width=2839 int Height=72 string Tag="History of activity data" string DataObject="d_activity_master" end type on save;call u_dw_freeform::save;uf_save() end on on select_one;call u_dw_freeform::select_one;MessageBox("Filter on Activity", "Sorry! This function is not available") end on on select_all;call u_dw_freeform::select_all;MessageBox("Show All on Activity", "Sorry! This function is not available") end on on validate_delete;call u_dw_freeforDAT*m::validate_delete;MessageBox("Delete Activity", "Sorry! This function is not available") end on on getfocus;call u_dw_freeform::getfocus;window lw_active_sheet string lw_active_sheet_name // Put green focus around this datawindow r_1.Show() // Get current active sheet for this mdi frame lw_active_sheet = w_mdi_main.GetActiveSheet() // Get the name assigned to this active sheet lw_active_sheet_name = lw_active_sheet.ClassName() // Make this datawindow the active datawindow in tDAT*hat sheet choose case lw_active_sheet_name case "w_geo" w_geo.idw_active = This case "w_legal" w_legal.idw_active = This case "w_source" w_source.idw_active = This case "w_device" w_device.idw_active = This case "w_process" w_process.idw_active = This case "w_stream" w_stream.idw_active = This end choose end on on rowfocuschanged;call u_dw_freeform::rowfocuschanged;if This.RowCount() > 0 then uf_retrieve_history() end if end on on add_row;call u_dwDAT*_freeform::add_row;uf_add_row() end on on losefocus;call u_dw_freeform::losefocus;// Hide the green focus r_1.Hide() end on on mousemove;call u_dw_freeform::mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on on first_row;call u_dw_freeform::first_row;if uf_check_pending() then This.ScrollToRow(1) end if end on on prev_row;call u_dw_freeform::prev_row;if uf_check_pending() then This.ScrollPriorRow() end if end on on next_row;call u_dw_freeform::next_row;if uf_check_pDAT*ending() then This.ScrollNextRow() end if end on on last_row;call u_dw_freeform::last_row;if uf_check_pending() then This.ScrollToRow(This.RowCount()) end if end on type r_1 from rectangle within u_dw_activity int X=5 int Y=124 int Width=2885 int Height=112 boolean Visible=false boolean Enabled=false int LineThickness=12 long LineColor=32768 long FillColor=32768 end type type r_2 from rectangle within u_dw_activity int X=5 int Y=232 int Width=2885 int Height=956 bDAT*oolean Visible=false boolean Enabled=false int LineThickness=12 long LineColor=32768 long FillColor=32768 end type type ln_1 from line within u_dw_activity boolean Enabled=false int BeginX=5 int BeginY=120 int EndX=2898 int EndY=120 int LineThickness=4 long LineColor=33554432 end type type ln_2 from line within u_dw_activity boolean Enabled=false int BeginY=8 int EndX=2921 int EndY=8 int LineThickness=4 long LineColor=33554432 end type DAT*g@)b??AHg@g@=g@!X@X@-c@c@:@@F`@`@Pj@j@^k@k@jl@l@~m@m@@@q@@Q@@q@@a^@^@an@`@@a @@p@@q%@@/@@:@@@E@@O@@A[n@i@@@s0@0@}@@@_`@@*@*@ v@v@ )F@F@"p@+&? 1@n@n@Ks@DAT* s@a^+-nq@q@.tawcgahgowsss ep p@p@q Op@P gs0a 9p@` pi i Sp@p nt2 cp@` or3y _e w 8p@p as4   Wp@ 5  dp@ 6\j{X u_dw_activityuserobjectuserobjectswindowobjectborderstylestructuremailrecipientenvironmentDAT* mailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject= |u_dw_listdwobjectcommandbuttonfontcharsetfontpitchfontfamilystatictextalignmentfillpatternu_dw_freeformrectanglelinestylelinew_= thstr_actvalidnull= vkeycodeActivity data for the above date ranged_activity_detailSelect data in the specified date range SelectMS SansDAT* SerifNo records present. Use Insert to create new activity data.Specify date range to select activity datad_activity_queryHistory of activity datad_activity_mastermessagepointerw_mdi_maings_inifilef_validate_actdatawindowdynamicstagingareasqlsa,(metriccursornd?Atransactionsqlcaf_db_errorn?A DAT*?Aselect name from rap_metrics where rap_metrics.code =' ' 58h?A?Aselect MIN ( rid ) from rap_metric_maps where code =' ' 47V?A\?Aselect view_sequence_no from rap_metric_maps where rid =0 89 ?ADAT*H?A?Af_compare_date_timedelete from rap_activities where rap_activities.rid =0 56,?Af_get_sequencef_get_activity_ridinsert into rap_activities ( rid , creation_date_time , metric_code , metric_level_type , ref_rid , start_date_time , user_id , value , comment_text , confidential_flag , data_code , eDAT*nd_date_time , material_code , method_type , reference_code , reference_type , value_amt , value_type , value_unit_code ) values ( 0 , '2005-01-31 15:29:19.496000' , ' ' , ' ' , 0 , '2005-01-31 15:29:19.512000' , ' ' , ' ' , ' ' , ' ' , ' ' , '2005-01-31 15:29:19.512000' , ' ' , ' ' , ' ' , ' ' , 0 , ' ' , ' ' ) ;<?[^adgjkn~ ?Aupdate rap_activities set value =' ' , comment_text DAT*=' ' , confidential_flag =' ' , data_code =' ' , end_date_time ='2005-01-31 15:29:19.512000' , material_code =' ' , method_type =' ' , reference_code =' ' , reference_type =' ' , value_amt =0 , value_type =' ' , value_unit_code =' ' , creation_date_time ='2005-01-31 15:29:19.512000' , user_id =' ' where rap_activities.rid =0 !$58NQ_bt3O[^yz  ?Ags_user_idupdate rap_activities set end_date_time ='2005-DAT*01-31 15:29:19.543000' where rap_activities.rid =0 )E`akb ?Awindoww_geow_master_detailgl_geo_ridw_legalw_sourcegl_source_ridw_devicegl_device_ridw_processgd_process_ridw_streamselect min ( start_date_time ) , max ( end_date_time ) , max ( start_date_time ) from rap_activities where ref_rid =0 and metric_level_type =' ' tuon $ ?A DAT*?Aselect count ( rid ) from rap_activities where ref_rid =0 and metric_level_type =' ' 89QT8?A?Aselect rid from rap_activities where ref_rid =0 and metric_level_type =' ' and metric_code =' ' and material_code =' ' and end_date_time is null and start_date_time <= '2005-01-31 15:29:19.715000' ./GJ\_sv ?DAT*Aol ?Af_dddw_searchf_retrieve_codesf_get_unit_sqlf_retrieve_unit_codesf_set_value_amtf_validate_coded j|    0    V\     H L   ,0 ~ &   b l            DAT*$ 2 u_dw_activity   wparamlparam+highlight_dddwuf_saveuf_check_requireduf_get_itemsuf_check_pendinguf_undo_dw_act_detailsql_statementuf_retrieve_dw_act_detailuf_retrieve_historyuf_retrieve_currentuf_clear_detailuf_check_riduf_insert_rowuf_set_row_statusrid_valuedate_time_valueuf_close_off_prev_metric_recuf_reshape_dwuf_resize_detailuf_get_datesuf_out_of_insert_moderef_ridlevelview_stylesource_codedevice_coDAT* deprocess_codestream_codeuf_prepare_dwuf_add_rowpl_ref_riduf_retrieve_parameterpdt_startpdt_enduf_select_datesuf_count_actuf_retrieve_dw_act_mastermetric_code_valuematerial_code_valueend_date_valueuf_check_prev_metric_rec+select_one+select_all+save+validate_delete+dwescapekeykeyflags+dwnkey+wparam+lparam+constructor+create+destroy+key+keyflags+add_row+getfocusrowdwo+itemfocuschangeddata+itemchanged+row+dwo+data+editchanged+losefocus+dwnprocessenter+deletDAT*"e_row+first_row+flags+xpos+ypos+mousemove+last_row+next_row+prev_row+itemerror+clicked+currentrow+rowfocuschanged8h  LULBQtQS BLWzQLSSSSSSdetQLdQRWRWLGYmLSSWdw    DAT*$( LCkeycode.U    (      37LLCdwobject._sy37MLLCdwobject.S_di   LUII0DAT*&   37M37M 37 _di37MLL      (8TDAT*((@Xp $<Tl4`x Dh  xf _initsrcuserobjectu_dw_activityuserobjectswindowobjectborderstylestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlDAT**istviewitemtreeviewitemconnectioninfopowerobjectu_dw_listdw_act_detaildwobjectcommandbuttoncb_selectfontcharsetfontpitchfontfamilystatictextst_no_recordalignmentfillpatternu_dw_freeformdw_act_queryst_current_headingdw_act_masterrectangler_1linestyler_2lineln_1ln_2str_actkeycodemessagepointerw_mdi_maindatawindowdynamicstagingareatransactionwindoww_geow_master_detailw_legalw_sourcew_devicew_processw_streamL@DAT*,*@6@C@O@Y@g@s@ @ @ @ @ @raphn @p Meap@Locatiistp@o_lor_@p;@@('@2@=!J@TDAT*.@`@!n={<@@ @   f@.H@or@e !@ey"@ e&@r'@)@0@#1@)3@95@A7e@nd_dJ:DAT*0s_@rencS=in@lep]@io@ !#%&J> ?!{4-. {4.  {2  DAT*2  $ $      x$1D4$<$9)P8, ^1l, X$Dd" +wparam+lparam::message<  @)`( uil_selectedDAT*4_row8uidwc_dw_child$9 8selectrowD 4 < P X b:F@@8$0$#@9)L8#`9,#8T0)t89})8}$9}9}"$18)8580)@)81 o@o81@8DAT*6,$6808 06@8,$6808+06@88$18@)P8580)@)8 1 o@o8 1@8,$6808X0 6@8,$6808a0 6@8,#8j0)8@,#80)8)8  @ `DAT*8~!" #6$Z%~&()*H+l,-/13"7@9Rd bresultll_total_rowll_row_numldt_startldt_endls_startls_start_datels_start_timels_endls_end_datels_end_timew_mdi_maings_inifile( 2 : C Q _ f r ~#@+DAT*:$@x dw_act_detail!ib_obj_modified uf_check_required38Updating data...setmicrohelpZeuf_check_rid;|! ib_new_detail2dw_act_query$start_date_timegetitemdatetimemm/dd/yyyy hh:mm:ssactivity insertstart_datestart_time$end_date_timeend_dateend_timeData updated successfullyZeData update failed Zeuf_out_of_insert_modelnB 0 L tDAT*<       8 P    l)80$)D8L$)`81l\h$8p)8#8"X$8)8$8)8$8<|$8| $($)888)@8DAT*>H$P$)X88)`8h$85)x8$8)8!|$85)8$8)8$86)8$$6$6$6,$6@$68#X9b9 . PzDAT*@$8%X'+,.0N4|58:N>X@\dt ll_cur_rowll_total_rowldt_query_startldt_query_endldt_detail_startldt_detail_endls_valuels_unit_code 0 > O ^ g H( uf_get_items4dw_act_detaild !accepttextq8 !rowcount4T !valuegetitemstringvDAT*" !start_date_timegetitemdatetime !end_date_timeis_view_style1current1historydw_act_master5&&getrow0&&0 !setitemOp ! !Op !unit_codev !value_unit_codePp !is_level,is_src_code-is_dev_code .is_pro_code /is_str_code40 0 D L ` h   DAT*D 6 $)(80$)D810L$:@)d81l$1:@)8:@$)8$)8,1RL > L Z,d ll_row_numll_total_row(` DAT*F dw_group%accepttext%rowcount48%getnextmodifiedsT%getitemstatusropt%deleterow%reselectrow. ( 0 D L d l      d# pl_cur_rowpl_selected_row( d# pl_cur_rowpl_selected_row(DAT*H . *,*4L*Tp*x****$$$ $$$$$,$ |,BXn d 4 pb_add!pb_remove " st_group_member<#<st_selectDAT*Jion_list\$\dw_groupd%dw_select_list&r_1'!!r_2(##controlc@! "<#\$%&'!(# , 4L Tp x            $ , v$$$<$X$l$$DAT*L$$*8FT bd @ pb_add!pb_remove_r"st_group_member,#st_selection_listD$dw_group`%dw_select_listt&r_1'!r_2(# $ < X l     123456782 uf_saveuf_check_pendinguf_assign_active_dwuf_retrieve_group_memberuf_retrieve_select_listuf_unDAT*Ndo_dw_groupuf_setitem_on_dw_groupuf_setitem_on_dw_select_list+create+destroy !5Nf@w 2 widthheightborderbackcolorpicturemaskcolortabtextcolortabbackcolorpb_addpb_removest_group_memberst_selection_listdw_groupdw_select_listr_1r_2il_last_clicked_rowil_last_clicked_membeDAT*Pr_rowib_obj_modifiedil_ref_ridiw_cur_win &7DQ X b r    ! #$] o DAT*R @@1    @         ! #$12) x3G4(4DAT*m485D6`H7`d8FDND X, $6)$8,->1L,-,$$d0 +flags+xpos+yposw_mdi_main::messaged DAT*Vg@)b?@A?g@>g@"X@X@.c@c@;@@G@@S@@]@@h@@rY@Y@}^@^@@@@@0@0@%p@p@q@q@  @ u_dw_group_devu_dw_groupuserobjectswindowobjectborderstylefontcharsetfontpitchfontfamilyalignmentvtextalignpowerobjectArialadd.bmpremove.bmpfillpatternMS Sans Serif... Group Member... Selection ListdwobjectSource DAT*Xgroup member recordsSource selection listlinestylewindow> w> Y Device Group MemberDevice Selection Listd_dev_groupd_dev_names_for_grouptransactionsqlcagl_source_rid,T2 u_dw_group_dev  pl_cur_rowpl_selected_rowuf_setitem_on_dw_groupp_parent_riduf_retrieve_select_listuf_setitem_on_dw_select_list+create+destroyN DAT*ZQLL:QLQ$4 x _initsrcu_dw_groupu_dw_group_devuserobjectswindowobjectborderstyleu_dw_group`pb_addpb_addfontcharsetfontpitchfontfamilyalignmentvtextalignpowerobjectu_dw_group`pb_removepb_removeu_dw_group`st_group_memberst_group_memberfillpatternu_dw_group`st_selection_listst_selection_listu_dw_group`dw_groupdw_groupdwobjectu_dw_group`dw_select_listdw_select_listu_dw_group`r_1r_1DAT*\linestyleu_dw_group`r_2r_2windowtransaction@+@7@D@Pbi@u@@@ @d@ @g@g@g@g@  g@@g@ ?0 DDAT*^ M @V p ! @!><@wi@        ! #DAT*`9. .!... . y+ y*  d$8<$8D)X8)h8p$8x$8)8)8$8DAT*b$8)8)8$8$8J8;)$8,$84P$)X8J ,d# pl_cur_rowpl_selected_row(` dw_group%rap_devices_iddw_select_list+&idgetitemstringGsetitemP`%rap_devices_name+&nameGP`%rap_devices_codDAT*de+&code GP`%child_ref_rid+&ridgetitemnumber  O`%parent_ref_ridil_ref_rid@C,O` < X h p           $ , P X J$,)088$,)L8 d) p_parent_ridsqlcagl_source_rid<@ DAT*f@T dw_select_list&settransobjecte^ &retrievetit2@ 0 8 L 2$8 ,$84)T8)d8l$8t|$8)8)8$8$8)8)8$8$8J8;)8Jd# pl_cur_rowpl_seDAT*hlected_row($ dw_select_list&iddw_group#%rap_devices_idgetitemstringCsetitemP\&name#%rap_devices_nameCP\&code#%rap_devices_codeCP\&rid#%child_ref_ridgetitemnumber O\ , T d l |           8DAT*jd  create8d  destroy5782 e uf_setitem_on_dw_groupuf_retrieve_select_listuf_setitem_on_dw_select_list+create+destroyd7T\2  heighte] o eDAT* @@T1    @          # 7G0$5_ 4x8|LDAT*np@)b?AAT9p@8p@!@@&\@\@1[@[@=c@c@JU@U@[@@g@@q@@|@@@@A@@^@^@A@@0@0@An@n@+`@L@@0Z`@`@dj@j@rk@k@~l@l@m@m@@@@@A@@@@A:g@X@X@A';g@X<g@e_`@>g@p@p@@@n@$^`@`*@DAT*p*@bv@v@b6ajF@F@arpe =g@"p@=d  q@q@,e2?g@=3@=gIp@ IhR\kv$@@9&-)CWhrSp@ rDAT*rjzCp@ zkX w_devicew_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitled8 commandbuttonstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectiDAT*toninfou_dw_contactuserobjects8 յnullnewvalidu_dw_loc8 au_dw_act_devstr_act8 ɽu_dw_group_devwindow88 rectangleu_dddwDeviceDEVICE.ICO8 Wstr_connect_context8 pakeycodeMember information (freeform view)Member information (tabular view)General informationd_devDAT*viceShow process memberProcessShow group informationGroupShow activity current viewActivityShow location informationLocationOpen connection windowConnectionShow contact informationContact@8 ,rShow legal informationLegal8 \8 D8 d_source_ids_dddwmessagepointerf_menu_behavef_highlight_buttongl_device_ridu_dw_activityw_mdi_mainglDAT*x_source_ridgl_cur_rowf_validate_dev_prof_check_dates_ntf_validate_actf_validate_legal_relationtransactionsqlcau_dw_groupm_main_menuw_filtergb_filterf_get_sequencegs_user_idf_check_dup_actdwitemstatusf_window_countgb_double_clickf_window_closef_dddw_searchf_validate_codef_set_value_amtf_retrieve_metric_codesf_retrieve_group_typesf_get_unit_sqlf_retrieve_unit_codesf_act_dddw_retrievef_retrieve_codesf_look_upw_legalw_connect$0pDAT*z8(2 w_device ; wparamlparam+current_view+history_view+highlight_dddwwf_retrieve_datawf_check_requiredwf_draw_dw2wf_set_varwf_general_viewwf_detail_viewwf_select_onewf_undo_uowf_insert_okpb_enablewf_enable_btndw_objectwf_check_ridps_stylewf_clear_prev_style+dwescapekeykeyflags+dwnkey+wparam+lparam+open+activate+close+flags+xpos+ypos+clicked+create+destroy+closequeryDAT*|+key+keyflagsrowdwodata+itemchanged+editchanged+itemfocuschangedxposypos+rbuttondown+dwnprocessenter+add_row+getfocus+itemerror+doubleclicked+currentrow+rowfocuschanged+row+dwo+save+rowsinserted+rowsupdated+rowsdeleted+updateend+data+rowcount+retrieveend+retrieve_data8  LUL  QBQBBCdatawindow.erQSL_vi` LCkeycode.UDAT*~` ` S Z`LUIIekLLCdwobject.SasLLCdwobject.!`LIILCdwobject., 4DAT*)LL, 4Z`FK), 4VdqLLLLefa, 4FK,DAT* 4 $<XhLp Dh,P<Tx x _initsrcw_master_detailw_devicemenuwindowtypewindowstatewindowobjecttoolbDAT*aralignmentw_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_memberstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemcoDAT*nnectioninfocb_groupcb_activitycb_locationcb_connectioncb_contactu_dw_contactuo_contactuserobjectsu_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_dw_contact`r_2cb_legalu_dw_locuo_locu_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_devuo_actu_dw_act_dev`dw_act_detailu_dw_act_dev`cb_selectu_dw_act_dev`sDAT*t_no_recordu_dw_act_dev`dw_act_queryu_dw_act_dev`st_current_headingu_dw_act_dev`dw_act_masteru_dw_act_dev`r_1u_dw_act_dev`r_2u_dw_act_dev`ln_1u_dw_act_dev`ln_2str_actu_dw_group_devuo_groupu_dw_group_dev`pb_addu_dw_group_dev`pb_removeu_dw_group_dev`st_group_memberu_dw_group_dev`st_selection_listu_dw_group_dev`dw_groupu_dw_group_dev`dw_select_listu_dw_group_dev`r_1u_dw_group_dev`r_2windowrectangler_buttonsu_dddwdw_6str_connect_contextkeycodemessagepointeru_dw_activityw_mDAT*di_maintransactionu_dw_groupm_main_menuw_filterdwitemstatusw_legalw_connectp@!*@/@:@F@S@d@@ @w_gr ec@_lis ti@ist `d@oup wo@tu_w_ct_l ecstur_1li2dwDAT*up`r7do@" s@co_namU ist_sqZ vario !t   @!8< @ @@**@@@@p@N@O"p@@p@2S@T?p@@p@LX@Y[p@p@d]DAT*^pp@p@|@8@$86$<G)Xa@jq$ 1!@"$#:$)@%}&'DAT*6(P)8z%j*1+,ndse -<.lde, i/< @<!ls@is_s0 1!2"c op:3Y4z5pr}6<7<8ro"@#@9h($@:l_&ow@/ DAT* ' @(@,!*@6).)@7/X@8B7@rd N9@Y:@e<@8nB@{Pn@@n@R@        " $DAT*",-./02 41 51 61 71 81 9 1:< =; >; ?; @; A; B ;D EC F C GC HC IC JC KC LC MCDAT* N!CQ RP SP TP UP VP WP XP YP\^ m)\*. .  {4  {4 {4  !-!DAT*-!-!-!-!-1E7?!!-;@3 6!CJ> ?!P9. .![ ]y- '     )8#D,)01DAT*>,)$$:F@@8<8D0`8h0x$6$6$68$)8$$$$$)8$9}$ 9}($0$@$1)P8X$l9}t$|$$1<R$$1DAT*<R)8$$$1<Y}$$$1<Y}$$$$$1<R) 84$<$D$L$T$1<R)\8p$x$$$$1<R)8$$$$$1<R)DAT*8$$$$$1<R)8$$,$4$<$D$1<R)L8d$l$t$|$$1<R)8$$808$18)8$,-$6$66$68080),84$)DDAT*8L$T9}\$t$)8,0$6,)1,)$ D^x:Xv8x!"#h$%&p'( +V.01 2*6P7rdJ +wparam+lparamls_source_code::messagegl_device_ridw_mdi_mainx  ')@a1-@?0@d  DAT*wf_check_pending}is_style_state,3currentis_enlarge_stateL4detailis_stateo2,3L4r_1/"hidedw_1d. . xdw_6D^y@moveD^bringtotop .  . . width8resizeH. vscrollbar`/". 8. heightrH/". /" . cb_member8DAT*"8". cb_group$(9,(9,. cb_activityd:-d:-. cb_location;.;.. cb_contact=0=0. cb_legal4?:?:. cb_connectionT</T</. r_buttonsC\d:-onD^codegetitemstringuo_actADis_levelDAT*U,3is_device_codeVuf_prepare_dwCADshow<AD ADdw_act_detaild!setfocus|is_act_style+,3 $ < ` x                ( 0 @ P X l t |            DAT*        4 < D L T \ p x                 $ , 4 < D L d l t |           , 4 D L T \ t     dDAT*)8#D,)01>,)$$:F@@8<8D0`8h0x$6$6$68$$$$$)8$9}$9} $$$$1)48<$P9}\$d$l$1<Rt$DAT*$1<R)8$$$1<Y}$$$1<Y}$$$$$1<R)8$$$,$4$<$1<R)D8X$`$h$p$x$1<R)8$$$$$1<R)DAT*8$$$$$1<R)8 $$$$$,$1<R)48L$T$\$d$l$1<R)t8$$808$18)8$,-$6$66$68080)8$),DAT*84$<9},0T\$6,)J1X,)d$ D ^x<Z\ !L"#$T%&(:+h-.560dJ +wparam+lparamls_source_code::messagegl_device_ridw_mdi_mainx  ')@a1-@?0@dl wf_check_pending}is_DAT*style_state,3historyis_enlarge_stateL4detailis_stateo2,3L4dw_1. . x@dw_6D^ymove D^bringtotop . . . width8resize,. vscrollbarDr_1X/". . heightf|,X/". X/" . cb_member8"8". cb_group9,DAT*9,. cb_activityL:-L:-. cb_location;.;.. cb_contact=0=0. cb_legal$?:?:. cb_connection)<</<</. r_buttons|C\L:-onD^codegetitemstringuo_actADis_levelU,3is_device_codeVuf_prepare_dwCDAT*ADshow$AD is_act_styleD+,3 $ < ` x                $ 4 < P \ d l t                  $ , 4 < D X ` h p DAT*x                  $ , 4 L T \ d l t           , 4 < T \ d x$1D0$8$9)L8,)^1l,)T$Dd" +wpDAT*aram+lparam::message< )@a\( il_selected_rowJidwc_dw_child> K(Jselectrow@ 0 8 L T H ,11$,1)$814$,1)<81,21D$8L,2(@(8z'1T$)h8)x98$)8 $1DAT*)8$:NW@)8 : d t d0 dwcll_row_numgl_source_ridgl_cur_rowP ( 1@%2@p dw_6D^retrieve2dw_1,. 2,. rid = ,. rowcount4\findkp,. scrolltorow?D^insertrow(,. triggerevent  $ 4 < D TDAT* h x       $)$81<494$)<81<h9L$)T81<9\$)p81zx$$)88# 9$$)8808080808#z9$)81DAT*$68 $18$)88@$T$66l$68t08t08#9|8u|$8#9|8|$8#"9$808080808#|994h DAT*  pz "!|#d7 ll_cur_rowll_total_rowls_source_codecase20P /  dw_1. accepttextdw_2,-dw_3)D,. rowcount4d. . getrow@. . install_datedismantle_dateInstall DateDismantle Date,-4dis_state2activitydDAT*p@ZAAA,*p@Ap@#@@(\@\@3[@[@?c@c@LU@U@]@@i@@s@@~@@@@A@@^@^@A@@0@0@An@n@+`@1P@@```@`@jj@j@xk@k@!l@l@am@m@a@@@@@@@@@@ F@F@ + @ O q@q@[ + @@ v@v@ 8- p@DAT* .    w_referencew_single_tablemenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderUntitledctiA dropdownlistboxstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviDAT*ewitemtreeviewitemconnectioninfo P statictextReferenceREF.ICOA validA P Accuracy MethodsCalculation MethodsCoordinate Calculation TypesData CodesDevice CodesForm TypesGroup TypesLegal Entity TypesLegal Relationship CodesMeasurement CodesMethodsMetric LookupsMetric MapsMetricsModesOperating Daily SchedulesOperating DaysOperating HoursOperating MonthsOperatDAT*ing Weekly SchedulesOperating Yearly SchedulesProcess CodesReasonsReference TypesSCC AMS RelationshipsSource CodesStream CodesTier CodesUnitsUse TypesValue TypesAircraft CategoriesAircraft Default Time-in-ModeAircraft EnginesAircraft Emission FactorsSeason codesVehicle TypesArea Facility TypesVehicle CategoriesSurrogate CodesSCC/AMS Surrogate CodesSCC/AMS Default FactorsGeographic Equipment CountsGeographic SurrogatesConversion Lookup CodesEmission TypesRoadway TypesAreDAT*a Facility Roadway TypesA 0?0/7FRZ`z)6AGQ]q $<XnA 0?0DAT*/7FRZ`z)6AGQ]q $<XnTable:pointergs_databasef_get_metric_map_ridf_get_sequencetransactionsqlcaselect rid from rap_aircraft_engines where aircraDAT*ft_make =' ' and aircraft_model =' ' and engine_type =' ' :=RUgj a AA AAselect area_facility_type_rid from rap_area_facility_types where area_type =' ' and facility_type =' ' LOcf P AA AAselect rid from rap_vehicle_categories where vehicle_type =' ' and area_facility_typDAT*e_rid =0 ;>[\* 4 AAc AAdwitemstatusselect type from rap_geographic_locations where rid =0 56iV  AAn@ \ AAmessagew_filterf_retrieve_codesf_validate_codef_look_up((Xh         DAT*   V \   2 w_reference  wf_freeform_viewwf_check_requiredwf_check_pendingas_tableadw_objwf_assign_tablewf_check_rid+open+wparam+lparam+ue_open_filter_win+create+destroyrowdwo+itemfocuschangeddata+itemchanged+itemerrorxposypos+rbuttondown+modified0 QB<ESSCdatawindow.Lp xLULLLCDAT*dwobject.LLCdwobject.SLIILCdwobject. 8T| xg _initsrcw_single_tablew_referencemenuwindowtypewindowstatewindowobjecttoolbaralignmentw_single_table`st_no_record_greyst_no_record_greyfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_single_table`st_no_record_whitest_no_recoDAT*rd_whitew_single_table`dw_2dw_2dwobjectw_single_table`dw_1dw_1w_single_table`r_1r_1linestyledatawindows_rec_holderdropdownlistboxddlb_1structuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfostatictextst_1pointertransactiondwitemstatusmessagew_filter@ ,@1@<@H@U@DAT*f@@ @Sou io@stl in@> @w @>Y  De MrDe1tiist6p@v_na?ouansaS aourcX k ctaw!o@y@@!A@ <@@$DAT*8@@@@@ p@@ @%@0 5@="@I$@V%@^'@      !DAT*) b$ D*. . {/{/ G7%%(. .8080@8d 3 FreeFormSorry! This function is not ready1:F@@8$DAT*,$)@81<f9H$)\811 68d 8u "8 "8 "8 "8 "8 "8 "T$8)88"R8080:)@@8,$)@8H$)X8`$8)tDAT*8|$)89$8)88"P8080:)@@8$)8$)8$8)8$)8918 f$8$),88"f80840:)@@8L$)T8\$)dDAT*8l$8$)t8|$)89$8)88"d8080:)@@8$)8$)8$8)8$)89$8)88"b8080:)@@8 $)(80$)8DAT*8@$8)H8P$)X8918` v x$8)88"x8080:)@@8$)8$)8$8)8$)89$8)88"v8080:)@@8@$)HDAT*p@)b?AAAp@@p@@@ \@\@+[@[@7c@c@DU@U@U@@a@@k@@v@@@@q@@^@^@@@0@0@n@n@a+`@a@@ F@F@$"p@$#/q@q@;Q$AP[j( w_dataw_referencemenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillDAT*patternborderstylepowerobjectMS Sans SerifNo records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderAccuracy MethodsCalculation MethodsCoordinate Calculation TypesData CodesDevice CodesForm TypesGroup TypesLegal Entity TypesLegal Relationship CodesMeasurement CodesMethodsMetric LookupsMetric MapsMetricsModesOperating Daily SchedulesOperating DaysOperating HoursOperating MonthsOperating Weekly SchedulesOperating Yearly SchedulesProcesDAT*s CodesReasonsReference TypesSCC AMS RelationshipsSource CodesStream CodesTier CodesUnitsUse TypesValue TypesAircraft CategoriesAircraft Default Time-in-ModeAircraft EnginesAircraft Emission FactorsSeason codesVehicle TypesArea Facility TypesVehicle CategoriesSurrogate CodesSCC/AMS Surrogate CodesSCC/AMS Default FactorsGeographic Equipment CountsGeographic SurrogatesConversion Lookup CodesEmission TypesRoadway TypesArea Facility Roadway Types 0DAT*0%9Vany->Yt#4N[i})7Table:datawindowchildReference@ #REF.ICOvalidOther Data@DAT* \Legal EntitiesReference Codes@ hǾ@ hǾpointerw_mdi_maintransactionsqlcaf_del_ref_codef_del_recsf_get_sequenceT d2 w_data  wf_check_requiredas_tableadw_objwf_assign_tablepdw_objwf_deletesznamewf_getcurridwf_cascade_delwf_check_rid+create+destrDAT*oyd B#SSCdatawindow.;QCdatawindow.MLRSIQ 4P x _initsrcw_referencew_datamenuwindowtypewindowstatewindowobjecttoolbaralignmentw_reference`st_no_record_greyst_no_record_greyfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_reference`st_no_record_whitest_no_record_whitew_reference`dw_2dw_2dwobjectw_reference`dw_1dw_1w_reference`r_1r_1linestyleDAT*datawindows_rec_holderw_reference`ddlb_1ddlb_1w_reference`st_1st_1datawindowchildpointerw_mdi_maintransaction onect_c@ctioereci$ro@tma)ri@nma4da@ndow@vi@emtMm@ecti^erctt|o endfo@erobw@ @ wb@r.L @ @ @wobjDAT* %@.? !D T !X@b@m@!z @ <@`@@@     DAT*    ) d$ D*. . {/{/ G7%%. $,$)@81<L9DAT*H$)X8:F@@868`p$8x)88"8080:)@@8$)8$)8$8x)8$)$898,<$8D)L88"808T0:)@@8DAT*l$)t8|$)8$8D)8$)899 L n ">^ 8T t!"'d, ls_tablell_cur_rowls_col1case13P  $  is_current_table6dw_1$-accepttext4$-getrowPlegal entitiDAT*es$-namegetitemstring@}DataWindow ErrorSorry! Name is required!$-setfocus`@$-setrowQ$-setcolumn8H$-scrolltorow?reference codes$-codeere}Sorry! Code is required$-$-Q$-H$-? , @ H X p         $ < L l t |    DAT*p@)b?AA7p@Bp@3@@8\@\@C[@[@Oc@c@\U@U@m@@y@@@@@@@@a@@a^@^@@@ 0@0@n@n@q+`@q,@@ v@v@  w_emission_factor_cw_emission_factor_basemenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNoDAT* records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderdatawindowchildEmission FactorB `FIRE.ICOvalidGeneric Constants (Factors)CONST.ICOrB Bd_emission_factor_c_freeformd_emission_factor_cmessageL2 w_emission_factor_c  8 +open+create+destroy+wparam+lparam+add_row@ LQ 'DAT*LUL ' ( x _initsrcw_emission_factor_basew_emission_factor_cmenuwindowtypewindowstatewindowobjecttoolbaralignmentw_emission_factor_base`st_no_record_greyst_no_record_greyfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_emission_factor_base`st_no_record_whitest_no_record_whitew_emission_factor_base`dw_2dw_2dwobjectw_emission_factor_base`dw_1dw_1w_emission_factor_base`r_1r_1linestyleDAT*datawindows_rec_holderdatawindowchildmessagel ypglobn @ean (_adata<ob@ong Atr@leveLri@ourcXri@eviceri@rocevtrstreenototcs@ngares@f @ @ )@ @ @,*=Y"^@gDAT*#   !@@@!B@<@       b% @*. . {1DAT* {1 &88$0,$4$6)H8P$)d8,1,l$2d dB ancestorreturnvaluell_debug_num_retrieval_rows::message<8@t8 openis_factor_type 4Cdw_1&- 4DAT* retrieve2<&-setfocusX , 4 H P d l 8d  create8d  destroy&FGOwPxQyRzX&.2  +open+create+destroy<2  titlebartitleicon<DAT*] o.@   1 @@@    DAT*}&  x2  2  ] wpH      @DAT*p@)b?AA-9p@Cp@"@@'\@\@2[@[@>c@c@KU@U@\@@h@@ar@@}@@@@@@^@^@@@0@0@n@n@+`@P@@^`@`@hj@j@vk@k@l@l@qm@m@@@@@@@a@@@@n@@\*@*@v@v@Qil3i q@q@qw4 DAT* .<LF@F@T w_connectw_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitled_coC ٵcommandbuttonstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchDAT*ildlistviewitemtreeviewitemconnectioninforectangleu_dddwConnectionCONNECT.ICOC |validC P keycoded_connect_fromInput ConnectionsOutput Connectionsd_source_ids_dddwd_device_ids_dddwmessagegl_source_ridtransactionsqlcagl_device_ridgl_cur_rowf_window_countf_highlight_buttonf_window_closef_dddw_searchf_validate_codepointer(42 w_connect DAT* x wparamlparam+highlight_dddwwf_retrieve_datawf_undo_dw1wf_insert_ok+dwescapekeykeyflags+dwnkey+wparam+lparam+open+close+create+destroy+key+keyflags+xpos+ypos+row+dwo+doubleclickedrowdwodata+itemchanged+add_row+rowcount+retrieveend+itemfocuschanged+data+editchanged+itemerror+dwnprocessenter+clicked+retrieve_data+getfocusxposyposh  LULQBLZ2^ LCkeycode.UDAT*LIILCdwobject.eLLCdwobject.So wLLLLCdwobject. ns ns,P8\t xDAT* _initsrcw_master_detailw_connectmenuwindowtypewindowstatewindowobjecttoolbaralignmentw_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_fromstructuremailrecipienteDAT*nvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfocb_torectangler_connectionsu_dddwdw_4dw_5keycodemessagetransactionpointer8 s_or_t@_1!retr+@&0us@;@G@T@e @@ @ wb@r.L @ @DAT*  @wobj 38@A@V ;[ 8p s_g!u  pp@!C<ni@ntwise@getwct@w_sywash_h@@@@ctalt_@}!f_@DAT*"1@>@K@Z`@jx@@ @ #@!,@        "DAT*$ $",.01k' F*. . {2{2 {4   !-!-- /y- 'DAT*&/y- 'x$1D0$8$9)L8,!^1l,!T$Dd" +wparam+lparam::message< !@3\( il_selected_rowAidwc_dw_child B(Aselectrow@ 0 8 L T ,"1$,")$DAT*(814$8<)H81<1@8X$68`8z%@8,$)8,")81,%1$,%)81$,%)8$,&)$8,$1)@8H$1)P8X$1)`8h$:NW@)8DAT**:r Bb"d9 dwcgl_source_ridsqlcagl_device_ridgl_cur_rowd ( "@$@4 %@.&@ dw_4;0retrieve2dw_5,<1idgetchildo?titleP Application Error: Device Id - Not a DataWindowChild in device context. Contact your technical support.settransobject},<12DAT*,dw_1. 2. scrolltorow?,<1insertrow(4;0(4;0(4. triggerevent p $ 4 H X        $ , @ H P X ` h  B$)$8,$,%)@8d gl_device_rid%@H dw_1. accepttextDAT*.. retrieve424 $ , @ $) 88(B9}0$)888(9}" B d d lb_checkls_rid( @ dw_4;0gettextdw_5)<1  0 8 N &88 08 0DAT*080$,$)H8X$,$)`8p$,$)x8)8$$808$:W@)8,!41B,!$2Pp d, ancestorreturnvaluesqlca::message<$@4"!@3h openis_state 2connectiondw_1+. settransobject^DAT*28dw_4P;0^8dw_5h<1^8wf_retrieve_datamtr_connectionsin:.cb_from8"onf+. posteventra 0 H X ` p x       j8808,!P1^,!$6d& ancestorreturnvalue::message(!@3$ clDAT*4oseconnection ~ 8* 0*8P*Xh*p*$}1<R$1<R$1<R$1<R$1<R$(>Tj Ld icurrentDAT*6 createcb_from8""cb_to(9,(,r_connections@:.@.dw_4`;0`0dw_5x<1x1controlc@c@8"c@(9,c@@:.c@`;0c@x<1  0 8P Xh p            ^8$($@$DAT*8P$`$ .<Jd h( destroycb_from8"cb_to 9,r_connections0:.dw_4H;0dw_5X<1 ( @ P ` &FGOwPxQyS{T|o$&.2 +highlight_dddwwf_retrieve_datawf_undo_dw1wf_insert_ok+openf_window_countf_highlight_button+closef_window_close+create+destroyDAT**)5BH'W(jq)2 widthheighttitlebartitleiconcb_fromcb_tor_connectionsdw_4dw_5is_validation_tableis_column_statusis_msg_nameis_msg_textil_selected_rowidwc_dw_childis_column_nameis_old_valueis_child_name|R DAT*<p@)b?BA7p@Dp@3@@8\@\@C[@[@Oc@c@\U@U@m@@y@@@@@@@@a@@a^@^@@@ 0@0@n@n@q+`@q,@@ 5q@q@A ) Dv@v@8 w_emission_factor_fw_emission_factor_basemenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfDAT*>ontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderdatawindowchildEmission FactorD FIRE.ICOvalidSource-Specific Speciation FactorEMIS_FAC.ICO)D D d_emission_factor_f_freeformd_emission_factor_ftransactionsqlcaselect rap_processes.rid from rap_processes , rap_dDAT*@evices , rap_sources where rap_processes.device_rid =rap_devices.rid and rap_devices.source_rid =rap_sources.rid and rap_sources.id =' ' and rap_devices.id =' ' and rap_processes.id =' ' 6GBA|DBAf_db_errorgl_source_ridgl_device_ridgd_process_ridmessageselect id from rap_sources where rid =0 &' BA\$DAT*BBAselect id from rap_devices where rid =0 &'BABAselect id , scc_ams_code from rap_processes where rid =0 78v<BA|BAselect rap_devices.source_rid , rap_devices.rid from rap_processes , rap_devices where rap_processes.device_rid =rap_dDAT*Devices.rid and rap_processes.rid =0 BABA&'BA@BA&'|BABA78<BA0DAT*FBAlBApBAL6D |   $ \ `    v|       @ D |    0 4 lp   2 w_emission_factor_fDAT*H  } wf_dwmodifypl_cur_rowwf_check_special+open+create+destroy+wparam+lparam+add_row+currentrow+rowfocuschangedp( ByBLLQeG OLUL`LLfG O`  <Ld x _initsrcw_emission_factor_basew_emission_factor_fmenuwindowtypewindowstatewindowobjecttoolbaralignmentw_emission_factor_base`st_no_record_greyst_no_record_greyfontDAT*Jcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_emission_factor_base`st_no_record_whitest_no_record_whitew_emission_factor_base`dw_2dw_2dwobjectw_emission_factor_base`dw_1dw_1w_emission_factor_base`r_1r_1linestyledatawindows_rec_holderdatawindowchildtransactionmessageforwypglobn @ean (_adata<ob@ong Atr@leveLri@ourcXri@eviceri@rocevtrstreDAT*Lenototcs@ngares@_cur @hite et@tpit il@ignm tt@bord _n@cord_form*ecdw_l=w_ctanYneer_^ow@ec_hgagmdi_ ernsac mss !@@@!D@<@@ DAT*      c% C*. . {1{1 90d  $8)88DAT*Pp@)b?BA(9p@Ep@'@@,\@\@7[@[@Cc@c@PU@U@a@@m@@w@@@@@@!@@q^@^@@@0@0@ n@n@a+`@acln@@a*@*@ v@v@ #(F@F@0p@ 0%9Cq@q@OQ&U #:I@@VftDAT*R( w_cal_protocolw_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitledE /Calculation ProtocolCAL_PROT.ICO$E @ validdatawindowchildrE /d_method_mDAT*Tetric_freeformkeycoded_method_metricd_cal_protocolmessagepointerw_filtergb_filtertransactionsqlcaf_del_cal_protocolDelete from Rap_Method_Metrics Where Protocol_Rid =0 and record_group_no =0 and sequence_no =0 34JK]^hBAf_db_errorgs_databasef_get_cal_protocol_ridf_get_sequencedwitemstatusgs_scc_ams_codef_dddw_searchf_validate_codef_retrieve_codesf_look_up,x 2 w_cDAT*Val_protocol x wparamlparam+highlight_dddwwf_check_requiredwf_draw_dw2wf_select_onewf_cascade_deldw_objwf_check_rid+dwescapekeykeyflags+dwnkey+wparam+lparam+open+create+destroy+key+keyflagsrowdwodata+itemchanged+dwnprocessenter+itemfocuschanged+row+dwo+data+editchanged+itemerrorxposypos+clicked+xpos+ypos+rbuttondown+currentrow+rowfocuschanged,x  LULBQLeraBCdatawindow.DAT*X" LCkeycode.U" LLCdwobject.SLLCdwobject.l /4LIILCdwobject.BH [LL ,HDAT*Zl(h x _initsrcw_master_detailw_cal_protocolmenuwindowtypewindowstatewindowobjecttoolbaralignmentw_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_masterDAT*\_detail`r_1r_1linestylew_master_detail`r_2r_2datawindows_rec_holderdatawindowchildkeycodemessagepointerw_filtertransactiondwitemstatus  odpl_cch@spec!+ce+d0ar@lpar5w@rent@cu@ngedLur@id+Y_s@e_rij@chd+ef@cle_m@ge @8 @8 @8 @8 @8DAT*^@80#88;0=@[Fi[ mnr` _5u z!z  @!E<@id@ME@w_syw@ash_h@T@@@al "@ DAT*`       " $ j' B*. . {2{4 {4   DAT*bx$1D0$8$9)L8,^1l,T$Dd" +wparam+lparam::message< @#\( il_selected_row>idwc_dw_child ?!>selectrow@ 0 8 L T ?$)$81<494$)<81<DAT*dh9L$)T81<9\$)l8t$8|)88"8080:)@@8$)8$)8$8|)8$$)889@$8HJd8808l0:)@@8$)8$)8DAT*f$8H)8$)89$8)88"8080:)@@8$)8$) 8($8)088$)@89H$)\81d$8lJ|81"8080:DAT*h)@@8$)8$)8$8l)8$)89$8J81"8080:)@@8,$)48<$)D8L$8)T8\$)d89l$8t)88"8080DAT* :)@@8$)8$)8$8t)8$)89$8)88"808 0:)@@84$)<8D$)L8T$8)\8d$)l8994h  4Pp0DAT*lp@)b?BA7p@Fp@3@@8\@\@C[@[@Oc@c@\U@U@m@@y@@@@@@@@q@@^@^@@@ 0@0@n@n@a+`@a,@@ v@v@  w_emission_factor_gw_emission_factor_basemenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS SDAT*nans SerifNo records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderdatawindowchildEmission FactorF YFIRE.ICOvalidGeneric Emission FactorF Jd_emission_factor_freeformd_emission_factorgs_scc_ams_codemessageL2 w_emission_factor_g  Q wf_save+open+create+destroy+wparam+lparam+validate_delete+add_rowDAT*pt BLQ' /LUL' /' /' /,D\ x _initsrcw_emission_factor_basew_emission_factor_gmenuwindowtypewindowstatewindowobjecttoolbaralignmentw_emission_factor_base`st_no_record_greyst_no_record_greyfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_emission_factor_base`st_no_record_whitest_no_record_whitew_emission_factDAT*ror_base`dw_2dw_2dwobjectw_emission_factor_base`dw_1dw_1w_emission_factor_base`r_1r_1linestyledatawindows_rec_holderdatawindowchildmessagel onect_c@ctio(ereci<ro@tmaAri@nmaLda@ndowXvi@emtem@ectiverctto endfo@erobw@ @ 8@ @9 @ @DAT*t9*1=9Ywind^ol@messgctpoin ma  $!@@F@!F@<@       DAT*vb% @*. . {1{1 >$680@89.d 9 title Sorry! This window is read only. 2&88$0,$4$6)H8,8P,#!,8XDAT*x!\$8d,z%8uz&)98$)8$)8,1&,$2^ d6 ancestorreturnvaluegs_scc_ams_code::message<@,@X openis_factor_type 4Gdw_1&- 4retrieve2<@STREAM&-scc_ams_code = ' 'setfilterIx&-filterDAT*z&-setfocus  , 4 H \       8d  create8d  destroy&|FGOwPxQyRzX&.2 ' wf_save+open+create+destroyP2 DAT*X  titlebartitle(] o.@   1t @@@    DAT*~n@F)b?BAn@n@dGn@a@@a*@@a3`@`@q=j@j@aKk@k@aWl@l@qkm@m@aw@@a@@@@@@^@^@ u_dw_plaindatawindowborderstyledwobjectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 u_dw_plain    xDAT* _initsrcdatawindowu_dw_plainborderstyledwobjectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject,@'@3@<@F@T@`@t @ @ @ @ @, @DAT* y%2  2 ) widthheighttaborderlivescrollP^@!^@] o! @  @ @ DAT*p@)b?BA7p@Hp@3@@8\@\@C[@[@Oc@c@\U@U@m@@y@@@@@@@@@@a^@^@@@ 0@0@n@n@+`@,@@v@v@ w_emission_factor_pw_emission_factor_basemenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS SDAT*ans SerifNo records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderdatawindowchildEmission FactorH \ٵFIRE.ICOvalidGeneric Speciation FactorEMIS_PRO.ICOH d_emission_factor_p_freeformd_emission_factor_pgs_scc_ams_codemessageL2 w_emission_factor_p  ] wf_savewf_dwmodify+open+create+destroy+wparam+lDAT*param+validate_delete+add_rowt BLQ3 ;LUL3 ;3 ;3 ;,D\ x _initsrcw_emission_factor_basew_emission_factor_pmenuwindowtypewindowstatewindowobjecttoolbaralignmentw_emission_factor_base`st_no_record_greyst_no_record_greyfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_emission_factor_base`st_no_record_whitestDAT*_no_record_whitew_emission_factor_base`dw_2dw_2dwobjectw_emission_factor_base`dw_1dw_1w_emission_factor_base`r_1r_1linestyledatawindows_rec_holderdatawindowchildmessagel rcawinla@orde(bjstru<re@entAt@fileLn@messXnd@ildeem@evievecinfoct@v@@ @ @0 @0 @DAT*8 `@j*80=Y^@g@ ; 8 !@@@!H@<@       DAT*c% @*. . {1{1 >$680@89.d 9 title Sorry! This window is read only.  $8)<88D@81Yo@oDAT*88Iz%8z&8z&8z&8z&8,z&8Pz&8z&$8z%8z&)988H806@89$8z%8z&)$9888,06@899 (j> H!"#'d2 ls_orig_sells_sel_listls_new_sells_errPDAT*   + A0 dw_1-DataWindow.Table.Selectdescribej0FROM FROM rap_emission_factors, rap_scc_ams_speciation_codes, rap_speciation_profiles WHERE ( rap_emission_factors.profile_code = rap_scc_ams_speciation_codes.profile_code ) AND ( rap_scc_ams_speciation_codes.profile_code = rap_speciation_profiles.code ) AND ( rap_speciation_profiles.profile_type = ~'G~' ) AND ( rap_scc_ams_speciation_codesDAT* .scc_ams_code = :factor_type ) @-DataWindow.Table.Select = ''modifyzdwModify dw_1 Faileddw_2@,zdwModify dw_2 Failed <    $ 6 &88$0,,8&"~,$4$6)H8)\8#,1,d$l$,6)t8|$)8,1*,DAT*g@)b?BAg@g@Ig@)X@X@5c@c@AB@@N`@`@Xj@j@fk@k@rl@l@m@m@@@@@a@@a@@^@^@n@ @@qn@`!@@+0@0@5@@q@q@r.v@v@Wp@n@n@ u_dw_permit_conditionuserobjectuserobjectswindowobjectborderstylestructuremailrecipientenvironmentmailfiDAT*ledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectI u_dw_listdwobjectu_dw_freeformrectanglelinestylefillpatternI  TI  ad_permit_condition_metricsd_permit_conditionstransactionsqlcamessagew_processdatawindowDl2 u_dw_permit_condition  uf_saveuf_cheDAT*ck_requireduf_check_pendinguf_undo_dw_loc_detailuf_undo_dw_loc_masteruf_check_master_riduf_check_detail_riduf_retrieve_dw_permit_detailref_riduf_retrieve_dw_permit_masterwparamlparam+select_one+select_all+save+destructor+constructor+create+destroy+wparam+lparam+delete_row+last_row+add_row+first_row+getfocus+losefocus+flags+xpos+ypos+mousemove+next_row+prev_row+currentrow+rowfocuschanged+rowcount+retrieveend@ BQQLs DAT*LUL     L ' ' ' 'n u{LUII ' ' 'LL ' ' 'n u{ 'DAT* ' 8Ph@Xp( xt _initsrcuserobjectu_dw_permit_conditionuserobjectswindowobjectborderstylestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectu_dw_listdw_permit_detaildwobjectu_dw_freeformdw_pDAT*ermit_masterrectangler_1linestylefillpatternr_2transactionmessagew_processdatawindowX dtightti@icon_tis_o2s_@mn_n>ec@rowKil@_chiW_v@atioa_c@n_stog_@is_{l_@ce_r ce@ @ @_no_ te@no_r e@ngle2@dwong@ablewgle_r_@nestnd@_recDAT*taowch#e@age-anion1@;@GsoKig@W@_@@_qci@  :/  )! {1 {1  DAT*    9/d  9(d  9d  d  d  d  d  $$$)488<J`8DAT*|$,)8$)8F fd ll_ridsqlca(@@ dw_permit_master""getrow,permit_condition_ridgetitemnumber Qdw_permit_detailh!settransobject^h!retrieve2 $ 4 ` |    b0$,)H8P$X$DAT*)l8 4d ref_ridsqlca(@t0 il_ref_rida%dw_permit_masteretr"settransobjecti^8"%retrieve2` 0 H P X l 4,1(,$d ::message@  4,1(,$dDAT* ::message@  *$@*HT*\h*p$$$$ |,BXd h dw_permit_detail!dw_permit_master,",r_1P#Pr_2d$dcontrolxc@!,"P#d$ $@ HDAT*User object with contact and contact reason information (master-detail style)forward global type u_dw_contact from UserObject end type type st_no_record_white from statictext within u_dw_contact end type type st_no_record_grey from statictext within u_dw_contact end type type dw_contact_master from u_dw_freeform within u_dw_contact end type type dw_contact_detail from u_dw_list within u_dw_contact end type type r_1 from rectangle within u_dw_contact end type type r_2 from rectangle wiDAT*thin u_dw_contact end type end forward global type u_dw_contact from UserObject int Width=2852 int Height=916 boolean Border=true long BackColor=12632256 long PictureMaskColor=25166016 long TabTextColor=33554432 long TabBackColor=67108864 event filter pbm_custom02 event unfilter pbm_custom03 event highlight_dddw pbm_custom33 st_no_record_white st_no_record_white st_no_record_grey st_no_record_grey dw_contact_master dw_contact_master dw_contact_detail dw_contact_detail r_1 r_1 DAT*r_2 r_2 end type global u_dw_contact u_dw_contact type variables string is_nation_sql = "null" string is_state_sql = "null" string is_city_sql = "null" string uis_nation = "new" string uis_display_name string uis_orig_nation_sql string uis_orig_city_sql datawindowchild uidwc_dw_child string uis_data_name string uis_validation_table string uis_msg_name string uis_msg_text long uis_old_value string uis_column_name long uil_selected_row string uis_column_status = "valid" datawinDAT*dow uidw_active long il_ref_rid; string is_orig_sql; boolean ib_new_master; boolean ib_new_detail; boolean ib_delete; boolean ib_itemchanged = false long il_city_rid end variables forward prototypes public function boolean uf_save () public function boolean uf_check_required () public function boolean uf_check_pending () public subroutine uf_check_master_rid () public subroutine uf_check_detail_rid () public subroutine uf_retrieve_dw_contact_detail () public subroutine uf_retrievDAT*e_dw_contact_master (long ref_rid) public subroutine uf_undo_dw_contact_detail () public subroutine uf_undo_dw_contact_master () public subroutine uf_select_all (userobject uo_name) public subroutine uf_delete (datawindow dw_obj) public function long uf_cascade_del () public subroutine uf_select_one (string table_name) public subroutine uf_retrieve_locations (window p_win, datawindow p_dw, string p_col_name) public subroutine uf_set_default_sql (window p_win, datawindow p_dw) public functDAT*ion boolean uf_validate_location (datawindow pdw_obj, string ps_col_name, string ps_entered_data) public subroutine uf_find_county (long pl_city_rid) end prototypes event filter;integer curRow, totalRec string ls_total // Get total records and current row number before filtering totalRec = uidw_active.RowCount() curRow = uidw_active.GetRow() // Filter datawindow based on the criteria entered in w_filter uidw_active.SetFilter(gs_filt) uidw_active.Filter() if uidw_active.FiltereDAT*dCount() = totalRec then MessageBox(uidw_active.Title, "No rows match the selection criteria!", Information!) // Reselect all rows uidw_active.SetFilter('') uidw_active.Filter() uidw_active.ScrollToRow(curRow) uidw_active.TriggerEvent(Rowfocuschanged!) else // Turn total indicator on ls_total = "Total : " + String(uidw_active.RowCount() + uidw_active.FilteredCount()) uidw_active.Modify("total_index_t.Text='"+ls_total+"'") uidw_active.Modify("total_index_t.Color=RGB(rDAT*ed)") uidw_active.TriggerEvent(Rowfocuschanged!) end if end event on highlight_dddw;if uil_selected_row > 0 then uidwc_dw_child.SelectRow(uil_selected_row, TRUE) end if end on public function boolean uf_save (); // This function saves data into rap_contacts and // rap_contact_reasons tables boolean lb_result if not (dw_contact_master.ib_obj_modified or dw_contact_detail.ib_obj_modified) then return TRUE end if if Not uf_check_required() then return FALSE SetMicDAT*roHelp(w_mdi_main, "Updating data...") lb_result = TRUE if dw_contact_master.ib_obj_modified then uf_check_master_rid() if il_city_rid > 0 then dw_contact_master.SetItem(dw_contact_master.getrow(), 'mail_city_rid', il_city_rid) end if if dw_contact_master.Update() = 1 then if dw_contact_detail.ib_obj_modified then uf_check_detail_rid() if dw_contact_detail.Update() = 1 then commit; else rollback; lb_result = FALSE end if end if elsDAT*e rollback; lb_result = FALSE end if elseif dw_contact_detail.ib_obj_modified then uf_check_detail_rid() if dw_contact_detail.Update() = 1 then commit; else rollback; lb_result = FALSE end if end if // Reset modified and new record flags dw_contact_master.ib_obj_modified = FALSE dw_contact_detail.ib_obj_modified = FALSE ib_new_master = FALSE ib_new_detail = FALSE if lb_result then SetMicroHelp(w_mdi_main, "Data updated successfully") return (lb_result) DAT* end function public function boolean uf_check_required ();// This function performs the validation check long ll_cur_row, ll_total_row, ll_length string s string ls_role string ls_name dw_contact_master.AcceptText() dw_contact_detail.AcceptText() ll_cur_row = dw_contact_master.GetRow() ls_name = dw_contact_master.GetItemString(ll_cur_row, "name") ls_role = dw_contact_master.GetItemString(ll_cur_row, "role") if (isnull(ls_name) or ls_name = "") and (isnull(ls_role) or lDAT*s_role = "") then MessageBox("DataWindow Error", "Sorry! Must specify Name and/or Role", Information!) dw_contact_master.SetFocus() dw_contact_master.SetRow(ll_cur_row) dw_contact_master.SetColumn("name") dw_contact_master.ScrollToRow(ll_cur_row) return FALSE end if // The next 3 sections of code have been remarked out becuase there are now no edit masks // and users are allowed to enter any characters into the fields //s = dw_contact_master.GetItemString(ll_curDAT*_row, "mail_zip_code") //ll_length = len(trim(s)) //if not IsNull(s) then // if not ((ll_length = 5 or ll_length = 9) and IsNumber(s)) then // MessageBox("DataWindow Error", "Sorry! Length of zip code must be 5 or 9 digits", Information!) // dw_contact_master.SetFocus() // dw_contact_master.SetRow(ll_cur_row) // dw_contact_master.SetColumn("mail_zip_code") // dw_contact_master.ScrollToRow(ll_cur_row) // return FALSE // end if //end if //s = dw_contact_master.GetItemDAT*String(ll_cur_row, "phone_no") //ll_length = len(trim(s)) //if not IsNull(s) then // if not ((ll_length = 7 or ll_length = 10) and IsNumber(s)) then // MessageBox("DataWindow Error", "Sorry! Telephone number is invalid", Information!) // dw_contact_master.SetFocus() // dw_contact_master.SetRow(ll_cur_row) // dw_contact_master.SetColumn("phone_no") // dw_contact_master.ScrollToRow(ll_cur_row) // return FALSE // end if //end if //s = dw_contact_master.GetItemString(llDAT*_cur_row, "fax_no") //ll_length = len(trim(s)) //if not IsNull(s) then // if not ((ll_length = 7 or ll_length = 10) and IsNumber(s)) then // MessageBox("DataWindow Error", "Sorry! Invalid fax number", Information!) // dw_contact_master.SetFocus() // dw_contact_master.SetRow(ll_cur_row) // dw_contact_master.SetColumn("fax_no") // dw_contact_master.ScrollToRow(ll_cur_row) // return FALSE // end if //end if return TRUE end function public function boolean uf_check_peDAT*nding ();integer li_messagebox_return // Have any modifications been made to the datawindows if dw_contact_master.ib_obj_modified or dw_contact_detail.ib_obj_modified then li_messagebox_return = MessageBox("Contact View", & "Data have been modified in the contact view.~nSave current changes?", Question!, YesNo!) choose case (li_messagebox_return) case 1 if Not uf_save() then return FALSE end if case 2 // Undo the changes uf_undo_dw_contact_master() uf_undoDAT*_dw_contact_detail() // Reset modified flag dw_contact_master.ib_obj_modified = FALSE dw_contact_detail.ib_obj_modified = FALSE ib_new_master = FALSE ib_new_detail = FALSE // case 3 // return FALSE end choose end if return TRUE end function public subroutine uf_check_master_rid ();// This function calls database-dependent function to get the sequence // number for the rid on the master datawindow long ll_cur_row, ll_rid_num ll_cur_row = dw_contact_master.DAT*GetRow() if IsNull(dw_contact_master.GetItemNumber(ll_cur_row, "rid")) then // Select the next available rid from the rid_storage in database ll_rid_num = f_get_sequence() if ll_rid_num = -1 then return end if dw_contact_master.SetItem(ll_cur_row, "ref_rid", il_ref_rid) dw_contact_master.SetItem(ll_cur_row, "rid", ll_rid_num) end if end subroutine public subroutine uf_check_detail_rid ();// This function gets the sequence number for the rid on the detail // datawDAT*indow long ll_row_num, ll_cur_row, ll_rid_num // Get the rid of the master datawindow ll_rid_num = dw_contact_master.GetItemNumber(dw_contact_master.GetRow(), "rid") ll_row_num = dw_contact_detail.RowCount() for ll_cur_row = 1 to ll_row_num // If the rid attribute is null, this means the row is a new inserted row if IsNull(dw_contact_detail.GetItemNumber(ll_cur_row, "rap_contact_reasons_contact_rid")) then dw_contact_detail.SetItem(ll_cur_row, "rap_contact_reasons_contact_rDAT*id", ll_rid_num) end if next end subroutine public subroutine uf_retrieve_dw_contact_detail ();// Purpose: retrieve data for dw_contact_detail long ll_contact_rid if dw_contact_master.RowCount() = 0 then return ll_contact_rid = dw_contact_master.GetItemNumber(dw_contact_master.GetRow(), "rid") dw_contact_detail.SetTransObject(SQLCA) // Retrieve data for dw_contact_detail dw_contact_detail.Retrieve(ll_contact_rid) end subroutine public subroutine uf_retrieve_dw_contactDAT*_master (long ref_rid);// Purpose: Retrieve data for dw_contact_master // Store ref_rid into instance variable il_ref_rid = ref_rid dw_contact_master.SetTransObject(SQLCA) // Retrieve data for dw_contact_master dw_contact_master.Retrieve(il_ref_rid) //dw_contact_master.SetFocus() end subroutine public subroutine uf_undo_dw_contact_detail ();// This function uses dwGetNextModified to check if any row is modified. // If found, undo the changes by using ReselectRow function longDAT* rowNum, totalRow dw_contact_detail.AcceptText() totalRow = dw_contact_detail.RowCount() rowNum = 0 // For primary buffer do while rowNum <= totalRow rowNum = dw_contact_detail.GetNextModified(rowNum, Primary!) if rowNum > 0 then if dw_contact_detail.GetItemStatus(rowNum, 0, Primary!) = NewModified! then dw_contact_detail.DeleteRow(rowNum) else dw_contact_detail.ReselectRow(rowNum) end if else rowNum = totalRow + 1 end if loop // For filter buffer dDAT*o while rowNum <= totalRow rowNum = dw_contact_detail.GetNextModified(rowNum, Filter!) if rowNum > 0 then if dw_contact_detail.GetItemStatus(rowNum, 0, Filter!) = NewModified! then dw_contact_detail.DeleteRow(rowNum) else dw_contact_detail.ReselectRow(rowNum) end if else rowNum = totalRow + 1 end if loop end subroutine public subroutine uf_undo_dw_contact_master ();// This function checks if the current row is modified or new. // If new, delete the current roDAT*w; otherwise, undo the changes by // using ReselectRow function dw_contact_master.AcceptText() if ib_new_master then dw_contact_master.DeleteRow(dw_contact_master.GetRow()) else dw_contact_master.ReselectRow(dw_contact_master.GetRow()) end if uf_retrieve_dw_contact_detail() end subroutine public subroutine uf_select_all (userobject uo_name);//uo_name.triggerevent("unfilter") long ll_selected_row uidw_active.SetFilter('') uidw_active.Filter() // Unhighlighted the DAT*clicked row before unfiltering ll_selected_row = uidw_active.GetSelectedRow(0) uidw_active.SelectRow(ll_selected_row, FALSE) uidw_active.TriggerEvent(Rowfocuschanged!) // Turn total indicator off by changing the color to transparent uidw_active.Modify("total_index_t.Text='' total_index_t.Color=553648127") end subroutine public subroutine uf_delete (datawindow dw_obj);// This function will validate the delete, delete the current row. ib_delete = FALSE If MessageBox("ContaDAT*cts", "You are about to delete this record.~r~n" + & "Are you sure?", Exclamation!, YesNo!, 2) <> 1 then return end if SetPointer(HourGlass!) w_mdi_main.SetMicroHelp("Checking related records ...") dw_obj.TriggerEvent("delete_row") if not ib_delete then return if uf_cascade_del() > 0 then // Update the data if dw_obj.DeleteRow(0) = 1 then commit; dw_obj.ResetUpdate() w_mdi_main.SetMicroHelp("Row deleted successfully.") dw_obj.TriggerEvent(Rowfocuschanged!) elsDAT*e rollback; w_mdi_main.SetMicroHelp("Row not deleted.") end if else MessageBox("Contacts", "No records deleted.") end if //// This function will validate the delete, delete the current row. //// If there are any child records, it will prompt the user and stop the //// deletion (because the cascade deleting is not implemented yet); //// otherwise, it deletes the record and does an automatic //// update to the database. //// In the next version, the cascade deleting will be imDAT*plemented. // //ib_delete = FALSE // //If MessageBox("Contact", "You are about to delete this record.~r~n" + & // "Are you sure?", Exclamation!, YesNo!, 2) <> 1 then // return //end if // //SetPointer(HourGlass!) //w_mdi_main.SetMicroHelp("Validate the delete...") // //dw_obj.TriggerEvent("delete_row") //if not ib_delete then return // //if dw_obj.DeleteRow(0) = 1 then // // Update the data // if dw_obj.Update(TRUE, FALSE) = 1 then // commit; // dw_obj.dwResetUpdate() // DAT*w_mdi_main.SetMicroHelp("Row deleted successfully.") // dw_obj.TriggerEvent(Rowfocuschanged!) // else // rollback; // w_mdi_main.SetMicroHelp("Row not deleted.") // end if //else // MessageBox("Contact", "Could not delete row.") //end if end subroutine public function long uf_cascade_del ();// You should override this function in any decendent window. // that needs special handling string szName string szType long nRid long nCnt int nInd // Get the current datawindowDAT* object szName = uidw_active.DataObject if szName = "d_contact" then nRid = uidw_active.GetItemNumber(uidw_active.GetRow(), "RID") // Get the count of records involved nCnt = f_del_recs(nRid, szName, FALSE) // Get user verification if more than one record if nCnt > 1 then nInd = MessageBox(szName, "Deleting this record will also delete " & + String(nCnt - 1) + " child records.~r~nDo you want to continue?", & Question!, YesNo!, 2) else nInd =DAT* 1 end if if nInd = 1 then nCnt = f_del_recs(nRid, szName, TRUE) else nCnt = 0 end if else // Get code and rid to delete nRid = uidw_active.GetItemNumber(uidw_active.GetRow(), & "RAP_CONTACT_REASONS_CONTACT_RID") szName = uidw_active.GetItemString(uidw_active.GetRow(), & "RAP_CONTACT_REASONS_REASON_CODE") Delete from rap_contact_reasons where contact_rid = :nRid AND reason_code = :szName; if sqlca.sqlcode = 0 then nCnt = 1DAT* // Delete the contact reason end if return nCnt end function public subroutine uf_select_one (string table_name);SetPointer(HourGlass!) // Open the filter window with parameter - table name openwithparm(w_filter, table_name) // If filter flag is set to true, then trigger the filter event to perform // filter if gb_filter then gb_filter = FALSE This.TriggerEvent("filter") end if end subroutine public subroutine uf_retrieve_locations (window p_win, datawindow p_dDAT*w, string p_col_name);long ls_city, ls_nation, ls_state, ll_temp, ll_cur_row string ls_temp string ls_col_name ll_cur_row = p_dw.GetRow() if ll_cur_row <= 0 then return ls_col_name = p_dw.getcolumnname() ls_temp = p_dw.gettext() if len(trim(ls_temp)) = 0 then setnull(ll_temp) else ll_temp = long(ls_temp) end if choose case p_col_name case "mail_city_rid" if is_city_sql = "null" then is_city_sql = f_get_sql(p_win, p_dw, p_col_name) end if ls_state = DAT*p_dw.getitemnumber(ll_cur_row, "mail_state_rid") ls_nation = p_dw.getitemnumber(ll_cur_row, "mail_country_rid") f_retrieve_locations(p_win, p_dw, p_col_name, is_city_sql, ls_city, ls_state, ls_nation) case "mail_state_rid" if is_state_sql = "null" then is_state_sql = f_get_sql(p_win, p_dw, p_col_name) end if if not isnull(ls_temp) and ls_col_name = "mail_city_rid" and ib_itemchanged then ls_city = ll_temp else ls_city = p_dw.getitemnumber(ll_DAT*cur_row, "mail_city_rid") end if ls_nation = p_dw.getitemnumber(ll_cur_row, "mail_country_rid") f_retrieve_locations(p_win, p_dw, p_col_name, is_state_sql, ls_city, ls_state, ls_nation) case "mail_country_rid" if is_nation_sql = "null" then is_nation_sql = f_get_sql(p_win, p_dw, p_col_name) end if if not isnull(ls_temp) and ls_col_name = "mail_city_rid" and ib_itemchanged then ls_city = ll_temp else ls_city = p_dw.getitemnumber(ll_cur_row,DAT* "mail_city_rid") end if if not isnull(ls_temp) and ls_col_name = "mail_state_rid" and ib_itemchanged then ls_state = ll_temp else ls_state = p_dw.getitemnumber(ll_cur_row, "mail_state_rid") end if f_retrieve_locations(p_win, p_dw, p_col_name, is_nation_sql, ls_city, ls_state, ls_nation) end choose end subroutine public subroutine uf_set_default_sql (window p_win, datawindow p_dw);DataWindowChild dwc string ls_err, ls_new_sql string ls_sql = "DataWinDAT*dow.Table.Select=~"" if p_dw.GetChild("mail_city_rid", dwc) = -1 then MessageBox(p_win.title, "Application Error:~n City - " + & "Not a DataWindowChild.~nContact your technical support.") return end if if is_city_sql = "null" then is_city_sql = f_get_sql(p_win, p_dw, "mail_city_rid") end if ls_new_sql = ls_sql + is_city_sql + "~"" ls_err = dwc.Modify(ls_new_sql) if ls_err <> "" then MessageBox("Modify Failed", ls_err) return end iDAT*f dwc.SetTransObject(SQLCA) dwc.Retrieve() if p_dw.GetChild("mail_state_rid", dwc) = -1 then MessageBox(p_win.title, "Application Error:~n State - " + & "Not a DataWindowChild.~nContact your technical support.") return end if if is_city_sql = "null" then is_city_sql = f_get_sql(p_win, p_dw, "mail_state_rid") end if ls_new_sql = ls_sql + is_state_sql + "~"" messagebox("debug", ls_new_sql) ls_err = dwc.Modify(ls_new_sql) if ls_err <> DAT*"" then MessageBox("Modify Failed", ls_err) return end if dwc.SetTransObject(SQLCA) dwc.Retrieve() if p_dw.GetChild("mail_country_rid", dwc) = -1 then MessageBox(p_win.title, "Application Error:~n Nation - " + & "Not a DataWindowChild.~nContact your technical support.") return end if if is_city_sql = "null" then is_city_sql = f_get_sql(p_win, p_dw, "mail_country_rid") end if ls_new_sql = ls_sql + is_nation_sql + "~"" ls_err = dDAT*wc.Modify(ls_new_sql) if ls_err <> "" then MessageBox("Modify Failed", ls_err) return end if dwc.SetTransObject(SQLCA) dwc.Retrieve() end subroutine public function boolean uf_validate_location (datawindow pdw_obj, string ps_col_name, string ps_entered_data);// Function: uf_validate_location // // Purpose: To validate city, state or country data user entered. // // Scope: public // // Parameters: // pdw_obj (datawindow/value) - current datawindow //DAT* 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 // // Log: // When Who What // ------- --- -------------------------------------------- // 6/21/95 SWJ Initial version DataWindowChild dwc string ls_rid_col, ls_name_col, ls_col_text choose case ps_col_name case 'mDAT*ail_city_rid' // Allow city to be blank-out if ps_entered_data = '' or IsNull(ps_entered_data) then return TRUE end if ls_rid_col = 'city_rid' ls_name_col = 'rap_geographic_locations_city' // ls_name_col = 'city_county' ls_col_text = 'City' case 'mail_state_rid' // Allow state to be blank-out if ps_entered_data = '' or IsNull(ps_entered_data) then return TRUE end if ls_rid_col = 'state_rid' ls_name_col = 'rap_geographic_locations_state' ls_col_text =DAT* 'State' case 'mail_country_rid' ls_rid_col = 'country_rid' ls_name_col = 'rap_geographic_locations_nation' ls_col_text = 'Country' end choose // Get the handle of the child datawindow if pdw_obj.GetChild(ps_col_name, dwc) = -1 then MessageBox("uf_validate_location", "Application Error:~n" + ls_rid_col + & " - Not a DataWindowChild.~nContact your technical support.") return FALSE end if dwc.SetTransObject(SQLCA) // If value from GetText() = the value in rid field, do DAT*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(), ls_rid_col)) then return TRUE end if // Check to see if data entered by user is in the dddw list if dwc.Find(ls_name_col + " = " + ps_entered_data, 1, dwc.RowCount()) < 0 then MessageBox('Column - ' + ls_col_text, 'Sorry! Not a valid ' + ls_col_text) return FALSE else return TRUE end if end functionDAT* public subroutine uf_find_county (long pl_city_rid);// Function: uf_find_county // // Purpose: To update the county text field in dw_contact_master string ls_county select b.name into :ls_county from rap_geographic_locations a, rap_geographic_locations b where a.parent_rid = b.rid and a.rid = :pl_city_rid; if f_db_error(SQLCA, "Fail on selecting county name from " + & "rap_geographic_locations table. Contact your technical support.") = 1 then return end if dw_contaDAT*ct_master.SetItem(dw_contact_master.GetRow(), 'county_name', ls_county) end subroutine on u_dw_contact.create this.st_no_record_white=create st_no_record_white this.st_no_record_grey=create st_no_record_grey this.dw_contact_master=create dw_contact_master this.dw_contact_detail=create dw_contact_detail this.r_1=create r_1 this.r_2=create r_2 this.Control[]={ this.st_no_record_white,& this.st_no_record_grey,& this.dw_contact_master,& this.dw_contact_detail,& this.r_1,& this.r_2} enDAT*d on on u_dw_contact.destroy destroy(this.st_no_record_white) destroy(this.st_no_record_grey) destroy(this.dw_contact_master) destroy(this.dw_contact_detail) destroy(this.r_1) destroy(this.r_2) end on type st_no_record_white from statictext within u_dw_contact int X=651 int Y=737 int Width=1537 int Height=68 boolean Visible=false boolean Enabled=false string Text="No records present. Use Insert to create a new record." Alignment Alignment=Center! boolean FocusRectangle=falseDAT*  long TextColor=8388608 long BackColor=16777215 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type st_no_record_grey from statictext within u_dw_contact int X=651 int Y=244 int Width=1537 int Height=68 boolean Visible=false boolean Enabled=false string Text="No records present. Use Insert to create a new record." Alignment Alignment=Center! boolean FocusRectangle=false long TextColor=8388608 DAT*  long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type dw_contact_master from u_dw_freeform within u_dw_contact event save pbm_custom23 event select_all pbm_custom21 event select_one pbm_custom22 event dwescape pbm_dwescape event validate_delete pbm_custom24 event dwnkey pbm_dwnkey event gettext pbm_custom47 int X=18 int Y=17 int Width=2785 int Height=545 int TabOrder=10 DAT*string DataObject="d_contact" boolean Border=true BorderStyle BorderStyle=StyleLowered! end type on save;call u_dw_freeform::save;uf_save() end on on select_all;call u_dw_freeform::select_all; //uf_check_pending() if uf_check_pending() then uf_select_all(parent) end if end on on select_one;call u_dw_freeform::select_one;//uf_check_pending() if uf_check_pending() then uf_select_one("rap_contacts") end if end on event dwescape;call super::dwescape;string ls_col_name DDAT*ataWindowChild dwc if uil_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then this.setitem(this.getrow(), uis_column_name, uis_old_value) if ls_col_name = 'mail_city_rid' then il_city_rid = uis_old_value // uf_find_county(uis_old_value) This.GetChild("mail_city_rid_2", dwc) dwc.SetTransObject(SQLCA) dwc.Retrieve(il_city_rid) end if f_dddw_search(this, uidwc_dw_child, uis_display_name, uil_selected_row) Parent.PostEvent(DAT*"highlight_dddw") end if end if end event on validate_delete;call u_dw_freeform::validate_delete;uf_delete(This) end on event dwnkey;call super::dwnkey;string ls_col_name, ls_null, ls_temp long ll_cur_row, ll_null DataWindowChild dwc window lw_window if keydown(keytab!) then if uil_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then ll_cur_row = This.GetRow() this.setitem(ll_cur_row, uis_column_name, & uidwc_dw_chiDAT*ld.getitemnumber(uil_selected_row, uis_data_name)) SetNull(ll_null) SetNull(ls_null) lw_window = w_mdi_main.getactivesheet() choose case ls_col_name case "mail_city_rid" ls_temp = this.gettext() if not isnull(ls_temp) and len(trim(ls_temp)) <> 0 then This.GetChild("mail_city_rid", dwc) uf_retrieve_locations(lw_window, this, "mail_country_rid") this.setitem(ll_cur_row, "mail_country_rid", dwc.GetItemnumber(dwc.GetRow(), "country_DAT*rid")) uf_retrieve_locations(lw_window, this, "mail_state_rid") this.setitem(ll_cur_row, "mail_state_rid", dwc.GetItemnumber(dwc.GetRow(), "state_rid")) // Remember the city_rid. The value of city_rid will be lost before // save for some unknown reason il_city_rid = dwc.GetItemNumber(dwc.GetSelectedRow(0), 'city_rid') // // Update the county name // uf_find_county(il_city_rid) This.GetChild("mail_city_rid_2", dwc) dwc.SetTransObject(SQLCA) DAT* dwc.Retrieve(il_city_rid) else this.setitem(ll_cur_row, ls_col_name, ll_null) end if case "mail_state_rid" ls_temp = this.gettext() if not isnull(ls_temp) and len(trim(ls_temp)) <> 0 then This.GetChild("mail_state_rid", dwc) uf_retrieve_locations(lw_window, this, "mail_country_rid") this.setitem(ll_cur_row, "mail_country_rid", dwc.GetItemnumber(dwc.GetRow(), "country_rid")) // Blank out the city field // dwc.IDAT*nsertRow(0) This.SetItem(ll_cur_row, "mail_city_rid", ll_null) // // Blank out the county field // This.SetItem(ll_cur_row, 'county_name', ls_null) else this.setitem(ll_cur_row, ls_col_name, ll_null) // // Blank out the county field // This.SetItem(ll_cur_row, 'county_name', ls_null) // Blank out the city field This.SetItem(ll_cur_row, 'mail_city_rid', ll_null) end if end choose // if ls_col_name = 'mail_state_rid' then // // Blank oDAT*ut the city and county field // SetNull(ls_null) // SetNull(ll_null) // This.SetItem(ll_cur_row, 'mail_city_rid', ll_null) // This.SetItem(ll_cur_row, 'county_name', ls_null) // end if end if end if end if end event on gettext;call u_dw_freeform::gettext;this.accepttext() end on on losefocus;call u_dw_freeform::losefocus;// Hide the green focus r_1.Hide() end on on getfocus;call u_dw_freeform::getfocus;window lw_active_sheet string lw_active_sheet_name // Put DAT*green focus around this datawindow r_1.Show() // Get current active sheet for this mdi frame lw_active_sheet = w_mdi_main.GetActiveSheet() // Get the name assigned to this active sheet lw_active_sheet_name = lw_active_sheet.ClassName() // Make this datawindow the active datawindow in that sheet choose case lw_active_sheet_name case 'w_legal' w_legal.idw_active = This case "w_source" w_source.idw_active = This case "w_device" w_device.idw_active = This end choose uidDAT* w_active = this //DataWindowChild dwc // //if dw_contact_master.dwGetChild("mail_city_name", dwc) = -1 then // MessageBox(This.Title, "Application Error:~nCity - " + & // "Not a DataWindowChild.~nContact your technical support.") // return //end if // //dwc.SetTransObject(SQLCA) //uis_orig_city_sql = dwc.dwDescribe("DataWindow.Table.Select") // //if dw_contact_master.dwGetChild("mail_country_name", dwc) = -1 then // MessageBox(This.Title, "Application Error:~nCounty - " + & // "DAT*"Not a DataWindowChild.~nContact your technical support.") // return //end if // //dwc.SetTransObject(SQLCA) //uis_orig_nation_sql = dwc.dwDescribe("DataWindow.Table.Select") // THE FOLLOWING CODE WAS COMMENTED OUT TO OMIT THE FOLLOWING // DATAWINDOWS FROM BEING MODIFIED. THE DROP DOWN DATAWINDOWS // ASSOCIATED WITH NATION, STATE, AND CITY NO LONGER NEED OUTER // JOIN SQL STATEMENTS THAT ARE DBMS DEPENDANT - JNS - 10/24/94 //if LEFT(sqlca.dbms,2) = 'OR' then // this.dwModify("mail_DAT*$city_rid.DDDW.Name=d_city_state_nation_o") // this.dwModify("mail_state_rid.DDDW.Name=d_state_nation_o") // this.dwModify("mail_country_rid.DDDW.Name=d_nation_o") //end if end on event retrieveend;call super::retrieveend;long ll_city_rid DataWindowChild dwc // Only retrieve detail record when there are any master records // Otherwise, clean the contents of dw_contact_detail if This.RowCount() > 0 then st_no_record_grey.Hide() ll_city_rid = This.GetItemNumber(This.GetRow(), "maDAT*&il_city_rid") if ll_city_rid > 0 then // Get the county name This.GetChild("mail_city_rid_2", dwc) dwc.SetTransObject(SQLCA) dwc.Retrieve(ll_city_rid) end if // Call this function to retrieve data for dw_contact_detail uf_retrieve_dw_contact_detail() else // Display no record message st_no_record_grey.Show() dw_contact_detail.Reset() end if end event event rowfocuschanged;call super::rowfocuschanged;window lw_window long ll_rid, ll_cur_row, ll_city_rDAT*(id DataWindowChild dwc lw_window = w_mdi_main.getactivesheet() // Only retrieve detail record when there are any master records // Otherwise, clean the contents of dw_contact_detail this.accepttext() ll_cur_row = This.GetRow() if This.RowCount() > 0 and ll_cur_row > 0 then st_no_record_grey.Hide() if is_city_sql <> "null" then uf_retrieve_locations(lw_window, this, "mail_city_rid") end if if is_state_sql <> "null" then uf_retrieve_locations(lw_window, this,DAT** "mail_state_rid") end if if is_nation_sql <> "null" then uf_retrieve_locations(lw_window, this, "mail_country_rid") end if ll_city_rid = this.getitemnumber(ll_cur_row, "mail_city_rid") if not isnull(ll_city_rid) then this.setitem(ll_cur_row, "mail_city_rid", ll_city_rid) if ll_city_rid > 0 then // Get the county name This.GetChild("mail_city_rid_2", dwc) dwc.SetTransObject(SQLCA) dwc.Retrieve(ll_city_rid) end if end if ll_rid = this.DAT*,getitemnumber(ll_cur_row, "mail_state_rid") if not isnull(ll_rid) then this.setitem(ll_cur_row, "mail_state_rid", ll_rid) end if ll_rid = this.getitemnumber(ll_cur_row, "mail_country_rid") if not isnull(ll_rid) then this.setitem(ll_cur_row, "mail_country_rid", ll_rid) end if // Call this function to retrieve data for dw_contact_detail uf_retrieve_dw_contact_detail() else // This.InsertRow(0) // ib_new_master = TRUE st_no_record_grey.Show() dw_contact_dDAT*.etail.Reset() end if end event event itemchanged;call super::itemchanged;long ll_row_number, ll_null, ll_cur_row string ls_col_name, ls_null DataWindowChild dwc long ls_city, ls_state, ls_nation string ls_temp window lw_window lw_window = w_mdi_main.getactivesheet() setnull(ll_null) SetNull(ls_null) ls_col_name = This.GetColumnName() ll_cur_row = This.GetRow() if ls_col_name = 'mail_city_rid' or ls_col_name = 'mail_state_rid' then if Not uf_validate_location(This, ls_col_naDAT*0me, This.GetText()) then return 1 end if elseif ls_col_name = uis_column_name then // ls_city = this.getitemnumber(ll_cur_row, "mail_city_rid") // ls_state = this.getitemnumber(ll_cur_row, "mail_state_rid") // ls_nation = this.getitemnumber(ll_cur_row, "mail_country_rid") // if Not f_validate_location(This.GetText(), ls_col_name, ls_city, ls_state, ls_nation) then // if Not uf_validate_location(This, ls_col_name, This.GetText()) then if Not f_validate_code(This.GetText(), 'rid'DAT*2, 'rap_geographic_locations') then MessageBox(uis_msg_name, uis_msg_text) return 1 return else // il_selected_row = idwc_dw_child.GetRow() end if end if ib_itemchanged = true choose case ls_col_name case "mail_city_rid" ls_temp = this.gettext() if not isnull(ls_temp) and len(trim(ls_temp)) <> 0 then This.GetChild("mail_city_rid", dwc) uf_retrieve_locations(lw_window, this, "mail_country_rid") this.setitem(ll_cur_row, "mail_couDAT*4ntry_rid", dwc.GetItemnumber(dwc.GetRow(), "country_rid")) uf_retrieve_locations(lw_window, this, "mail_state_rid") this.setitem(ll_cur_row, "mail_state_rid", dwc.GetItemnumber(dwc.GetRow(), "state_rid")) // Remember the city_rid. The value of city_rid will be lost before // save for some unknown reason il_city_rid = dwc.GetItemNumber(dwc.GetSelectedRow(0), 'city_rid') // Update the county name // uf_find_county(il_city_rid) This.GetChild("mail_city_rid_2", dwc)DAT*6 dwc.SetTransObject(SQLCA) dwc.Retrieve(il_city_rid) else this.setitem(ll_cur_row, ls_col_name, ll_null) end if case "mail_state_rid" ls_temp = this.gettext() if not isnull(ls_temp) and len(trim(ls_temp)) <> 0 then This.GetChild("mail_state_rid", dwc) uf_retrieve_locations(lw_window, this, "mail_country_rid") this.setitem(ll_cur_row, "mail_country_rid", dwc.GetItemnumber(dwc.GetRow(), "country_rid")) // Blank out the city field /DAT*8/ dwc.InsertRow(0) This.SetItem(ll_cur_row, "mail_city_rid", ll_null) // Blank out the county field // This.SetItem(ll_cur_row, 'county_name', ls_null) else this.setitem(ll_cur_row, ls_col_name, ll_null) // Blank out the county field // This.SetItem(ll_cur_row, 'county_name', ls_null) // Blank out the city field This.SetItem(ll_cur_row, 'mail_city_rid', ll_null) end if ib_itemchanged = false // case "mail_country_rid" // ls_temp = this.gettext() // DAT*: if not isnull(ls_temp) and len(trim(ls_temp)) <> 0 then // this.setitem(ll_cur_row, "mail_city_rid", ll_null) // this.setitem(ll_cur_row, "mail_city_rid", ll_null) // end if end choose end event on add_row;call u_dw_freeform::add_row;if uf_check_pending() then st_no_record_grey.Hide() This.InsertRow(This.GetRow()) This.ScrollPriorRow() This.TriggerEvent(Rowfocuschanged!) ib_obj_modified = TRUE ib_new_master = TRUE il_city_rid = 0 end if end on evDAT*<ent itemfocuschanged;call super::itemfocuschanged;string ls_col_name long ls_city, ls_state, ls_nation window lw_window ls_col_name = this.getcolumnname() lw_window = w_mdi_main.getactivesheet() //uf_set_default_sql(lw_window, this) uf_retrieve_locations(lw_window, this, ls_col_name) if ls_col_name = "mail_city_rid" then uil_selected_row = 0 getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_display_name = "rap_geographic_locations_city" // uis_disDAT*>play_name = 'city_county' // uis_display_name = 'Lower(rap_geographic_locations_city)' + & // '+" - "+Lower(rap_geographic_locations_county)' uis_data_name = "city_rid" uis_validation_table = "rap_geographic_locations" uis_msg_name = "Column - City" uis_msg_text = "Sorry! Not a valid city" uis_old_value = this.getitemnumber(this.getrow(), ls_col_name) elseif ls_col_name = "mail_country_rid" then uil_selected_row = 0 getchild(ls_col_name, uidwc_dw_child) uis_column_name DAT*@= ls_col_name uis_display_name = "rap_geographic_locations_nation" uis_data_name = "country_rid" uis_validation_table = "rap_geographic_locations" uis_msg_name = "Column - Nation" uis_msg_text = "Sorry! Not a valid nation" uis_old_value = this.getitemnumber(this.getrow(), ls_col_name) elseif ls_col_name = "mail_state_rid" then uil_selected_row = 0 getchild(ls_col_name, uidwc_dw_child) uis_column_name = ls_col_name uis_display_name = "rap_geographic_locations_state" DAT*B uis_data_name = "state_rid" uis_validation_table = "rap_geographic_locations" uis_msg_name = "Column - State" uis_msg_text = "Sorry! Not a valid state" uis_old_value = this.getitemnumber(this.getrow(), ls_col_name) else uis_column_name = "" end if end event event dwnprocessenter;string ls_col_name, ls_null long ll_geo_rid, ll_null, ll_cur_row DataWindowChild dwc window lw_window if uil_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = uiDAT*Ds_column_name then ll_geo_rid = uidwc_dw_child.getitemnumber(uil_selected_row, uis_data_name) ll_cur_row = This.GetRow() this.setitem(ll_cur_row, uis_column_name, ll_geo_rid) if ls_col_name = 'mail_city_rid' then il_city_rid = ll_geo_rid // uf_find_county(ll_geo_rid) This.GetChild("mail_city_rid_2", dwc) dwc.SetTransObject(SQLCA) dwc.Retrieve(il_city_rid) lw_window = w_mdi_main.getactivesheet() This.GetChild("mail_city_rid", dwc) uf_retrieve_locations(lwDAT*F_window, this, "mail_country_rid") this.setitem(ll_cur_row, "mail_country_rid", dwc.GetItemnumber(dwc.GetRow(), "country_rid")) uf_retrieve_locations(lw_window, this, "mail_state_rid") this.setitem(ll_cur_row, "mail_state_rid", dwc.GetItemnumber(dwc.GetRow(), "state_rid")) elseif ls_col_name = 'mail_state_rid' then // Blank out the city and county field SetNull(ls_null) SetNull(ll_null) This.SetItem(ll_cur_row, 'mail_city_rid', ll_null) // This.SetItem(ll_cur_rDAT*How, 'county_name', ls_null) end if end if end if Send(Handle(This), 256, 9, Long(0,0)) return 1 end event on editchanged;call u_dw_freeform::editchanged;string ls_col_name ls_col_name = this.getcolumnname() if ls_col_name = uis_column_name then uil_selected_row = f_dddw_search(This, uidwc_dw_child, uis_display_name, uil_selected_row) if uil_selected_row > 0 then parent.PostEvent("highlight_dddw") end if end if end on event itemerror;call super::itemerror;retuDAT*Jrn 2 end event on delete_row;call u_dw_freeform::delete_row;// Set ib_delete to true in case there is not code in the descendent // the descendent is expected to do what ever validation is required // and then set ib_delete to true or false as required ib_delete = TRUE end on on mousemove;call u_dw_freeform::mousemove;//string objNameStr, objName // //objNameStr = This.dwGetObjectAtPointer() //objName = Left(objNameStr, Pos(objNameStr, "~t") - 1) SetMicroHelp(w_mdi_main, This.Tag)DAT*L //Parent.Title = wTitle + " - " + This.Tag end on on last_row;call u_dw_freeform::last_row;if uf_check_pending() then This.ScrollToRow(This.RowCount()) end if end on on first_row;call u_dw_freeform::first_row;if uf_check_pending() then This.ScrollToRow(1) end if end on on prev_row;call u_dw_freeform::prev_row;if uf_check_pending() then This.ScrollPriorRow() end if end on on next_row;call u_dw_freeform::next_row;if uf_check_pending() then This.ScrollNextRow() end iDAT*Nf end on type dw_contact_detail from u_dw_list within u_dw_contact event select_one pbm_custom21 event select_all pbm_custom22 event save pbm_custom23 event validate_delete pbm_custom24 int X=18 int Y=593 int Width=2785 int Height=292 int TabOrder=20 string DataObject="d_contact_reasons" boolean HScrollBar=false boolean HSplitScroll=false end type on select_one;call u_dw_list::select_one;//uf_check_pending() if uf_check_pending() then uf_select_one("rap_contact_reasons") DAT*P end if end on on select_all;call u_dw_list::select_all;//uf_check_pending() if uf_check_pending() then uf_select_all(parent) end if end on on save;call u_dw_list::save;uf_save() end on on validate_delete;call u_dw_list::validate_delete;uf_delete(This) end on on getfocus;call u_dw_list::getfocus;window lw_active_sheet string lw_active_sheet_name // Put green focus around this datawindow r_2.Show() // Get current active sheet for this mdi frame lw_active_sheet = w_mdDAT*Ri_main.GetActiveSheet() // Get the name assigned to this active sheet lw_active_sheet_name = lw_active_sheet.ClassName() // Make this datawindow the active datawindow in that sheet choose case lw_active_sheet_name case 'w_legal' w_legal.idw_active = This case "w_source" w_source.idw_active = This case "w_device" w_device.idw_active = This end choose uidw_active = this end on on rowfocuschanged;call u_dw_list::rowfocuschanged;if This.RowCount() = 0 then // Display DAT*Tno record message st_no_record_white.Show() else st_no_record_white.Hide() end if end on event itemchanged;call super::itemchanged;// If the user has selected/modified a reason code, update the description column // in the datawindow to contain the reason name DataWindowChild dwc if This.GetColumnName() = "rap_contact_reasons_reason_code" then // Get the handle of the child DataWindow if This.GetChild("rap_contact_reasons_reason_code", dwc) = -1 then MessageBox(This.TDAT*Vitle, "Application Error:~nReason Code - " + & "No DataWindowChild.~nContact your technical support.") return end if // copy from dddw to the current datawindow This.SetItem(This.GetRow(), "rap_reasons_name", & dwc.GetItemString(dwc.GetRow(), "name")) end if end event on retrieveend;call u_dw_list::retrieveend;if This.RowCount() = 0 then // Display no record message st_no_record_white.Show() else st_no_record_white.Hide() end if end on on add_row;call u_dw_liDAT*Xst::add_row;// User Event: add_row // Purpose: This event gets triggered when this datawindow is focus and // the user click on the insert menu item. // If there is no row in the master table, do not allow user to insert // any row in the detail table. if dw_contact_master.RowCount() = 0 then MessageBox("Insert", "Please provide contact information first") dw_contact_master.SetFocus() return elseif IsNull(dw_contact_master.GetItemNumber(dw_contact_master.GetRow(), "rid")) then DAT*Z MessageBox("Insert", "Please save contact information first") dw_contact_master.SetFocus() return end if st_no_record_white.Hide() This.InsertRow(This.GetRow()) This.ScrollPriorRow() ib_new_detail = TRUE end on on delete_row;call u_dw_list::delete_row;// Set ib_delete to true in case there is not code in the descendent // the descendent is expected to do what ever validation is required // and then set ib_delete to true or false as required ib_delete = TRUE end on on next_DAT*\row;call u_dw_list::next_row;This.ScrollNextRow() end on on losefocus;call u_dw_list::losefocus;// Hide the green focus r_2.Hide() end on on first_row;call u_dw_list::first_row;This.ScrollToRow(1) end on on mousemove;call u_dw_list::mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on on last_row;call u_dw_list::last_row;This.ScrollToRow(This.RowCount()) end on on prev_row;call u_dw_list::prev_row;This.ScrollPriorRow() end on type r_1 from rectangle within u_dw_contact intDAT*v Y=4 int Width=2824 int Height=577 boolean Visible=false boolean Enabled=false int LineThickness=13 long LineColor=32768 long FillColor=32768 end type type r_2 from rectangle within u_dw_contact int Y=577 int Width=2824 int Height=333 boolean Visible=false boolean Enabled=false int LineThickness=17 long LineColor=32768 long FillColor=32768 end type DAT*`g@)b?>A7g@g@:g@ X@X@,c@c@9@@E`@`@Oj@j@]k@k@il@l@}m@m@@@a@@q@@q@@a^@^@a@@`@@a@@@@$@@a.@@:n@0H@@aQn@[@@e0@0@@n@n@p@p@)*@*@MUv@v@Ust$_]"p@q]dw%ahq@q@qtta&tz r1@@aF@DAT*bF@-4p@ 4)=_2 GtyQT@_mSp@m*ucp@u@+~8p@~,H u_dw_contactuserobjectuserobjectswindowobjectborderstylestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject: <statictextfontcharsetfontpitchfontfamilyalignmentfillpattDAT*dernu_dw_freeformdwobjectu_dw_listrectanglelinestyle: Pnullnewvaliddatawindow: LwindowNo records present. Use Insert to create a new record.MS Sans Serifkeycoded_contactd_contact_reasonsgs_filtmessagew_mdi_maintransactionsqlcaf_get_sequencedwitemstatuspointerf_del_recsDelete from rap_contact_reasons where contact_rid =0 AND reason_code =' ' 34FIDAT*f>Aw_filtergb_filterf_get_sqlf_retrieve_locationsselect b.name from rap_geographic_locations a , rap_geographic_locations b where a.parent_rid =b.rid and a.rid =0 pqf>Ad,>Af_db_errorf_dddw_searchw_legalw_sourcew_devicef_validate_codep    2 u_dw_contact {DAT*h wparamlparam+filter+unfilter+highlight_dddwuf_saveuf_check_requireduf_check_pendinguf_check_master_riduf_check_detail_riduf_retrieve_dw_contact_detailref_riduf_retrieve_dw_contact_masteruf_undo_dw_contact_detailuf_undo_dw_contact_masteruo_nameuf_select_alldw_objuf_deleteuf_cascade_deltable_nameuf_select_onep_winp_dwp_col_nameuf_retrieve_locationsuf_set_default_sqlpdw_objps_col_nameps_entered_datauf_validate_locationpl_city_riduf_find_county+save+select_aDAT*jll+select_one+dwescape+validate_deletekeykeyflags+dwnkey+gettext+wparam+lparam+create+destroy+losefocus+getfocusrowcount+retrieveendcurrentrow+rowfocuschangedrowdwodata+itemchanged+add_row+itemfocuschanged+dwnprocessenter+row+dwo+data+editchanged+itemerror+delete_row+flags+xpos+ypos+mousemove+last_row+first_row+prev_row+next_row+currentrow+rowcount`  LUL  BQQLDAT*lQCuserobject.ta!QCdatawindow.L9QSdR"X!]QCwindow.Cdatawindow.SiR"X!QCwindow.Cdatawindow.w_!BCdatawindow.SS    #" LCkeycode.U     rDAT*nLLLLCdwobject.S< DLLCdwobject.< D %+LUII< D< D< D< Deq< D< D< DDAT*p< D %+< D< D$<XhP\t(@Xht 0Ht(@Xp x _initsrcuserobDAT*rjectu_dw_contactuserobjectswindowobjectborderstylestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectstatictextst_no_record_whitefontcharsetfontpitchfontfamilyalignmentfillpatternst_no_record_greyu_dw_freeformdw_contact_masterdwobjectu_dw_listdw_contact_detailrectangler_1linestyler_2datawindowwindowkeycodemessagew_mdi_maintransactiondwitemstatuspointerw_filterw_legalw_sourcew_deviDAT*tce@)@5@B@N@X@f@r@ @ @ @) )@ <@)@8@08@8@88 @8@ @@,8@>@DAT*v,LhitR!^@g@qcr!@<//@pply d on@@@@!@# @2.De&wN@ e'dw@esel)Nu@ en0se@rowN2Ro@1 4oo@ DAT*x E7?!. . {5{2       $)(8}0$)@8}H$,)\8d$)t8DAT*z|$)8<v$$680:)@@8$8)8$)8$<) 8$:NW@),8L84@$)H8P$)X8R(@(8z'`$8hz%8}z&)98$8)8$:NW@)8, f1t, $DAT*|& L l ,Prv*LdA wparamlparamcurrowtotalrecls_totalgs_filt::message & /@7 @$ uidw_active7!rowcount47!getrow87!setfilterIP7!filterl7!filteredcountda7! No rows match the selection critDAT*~eria!n7!ay_IP7!l7!scrolltorow?7!triggerevent@! Total : 7!47!7!total_index_t.Text=''modify0z7!total_index_t.Color=RGB(red)z7!  ( 0 @ H \ d t |            , @ H P X `     DAT*  x$1D4$<$9)P8, ^1l, X$Dd" +wparam+lparam::message<  @$`( uil_selected_row!5uidwc_dw_child$. 5selectrow!D 4 < P X !$4$P$X$"#>9)t8#^9DAT*,"8|0)89}$$)8$1$$)88$)$8,$)<81<D$L$)h8p$)x81<,$,$9},$9}<$$<)8$)81<*,$<,$9}$DAT*9}$9}9}9},"80)84 > ^|>Xj !#$%& '&(*)0.</Z0x135d# lb_resultw_mdi_mainsqlca<"@%$@& dw_contact_master#ib_obj_modified$dw_contact_detail<$$uf_check_required5DAT*`Updating data...setmicrohelpZ#$uf_check_master_rid7il_city_rid>##getrowmail_city_rid>setitemO#updated4<$$uf_check_detail_rid8T<$d4<$$8T<$d4#$<$$ib_new_mastery:ib_new_detail;Data updated successfullyZ 4 P X t      DAT*    $ , < D L h p x              $)08L$)T8\$)l8t$8|)8$8)88"8"!8080:)@@8$)8DAT*$)8$8|)088$)L899  8Z2RtCd< ll_cur_rowll_total_rowll_lengthsls_rolels_namex * , 4 T dw_contact_masterP#accepttext$dw_contact_detail88$$#getrowdDAT*#namegetitemstringt#roleDataWindow ErrorSorry! Must specify Name and/or Roles#setfocus#setrowQ #setcolumnH$#scrolltorow?@ 0 L T \ l t         0 8 L \$4$P$X$"L8`08m0:)@:@@8}}1@J@T@b@n@ @ @ @fami nt@xtal ov@aticou@mberrn@seledindod@ectli@ectain@ler@1@(1:@8DDAT*@!R@[@i!w@<@$@)@J@ y@"@$st@&@(@+@,@.@0@ DAT*  @3 6!. . {2{4       x$1D0$8$9)L8,^1l,T$Dd" +wparamDAT*+lparam::message< @#\( il_selected_row/idwc_dw_child ( /selectrow@ 0 8 L T $)(8}0$)@8}H$,)\8d$)t8|$)8<v$$680:)@@8$8)8DAT*$)8$<) 8$:NW@),8L84@$)H8P$)X8R(@(8z'`$8hz%8}z&)98$8)8$:NW@)8,f1t,$& L l ,Prv*LdA wparamlparamcurrowtotalrecls_totalgs_filt::mesDAT*sage & /@7@# uidw_active'!rowcount4'!getrow8'!setfilterIP'!filterl'!filteredcountf_'! No rows match the selection criteria!u'!allIP'!l'!scrolltorow?'!triggerevent@! Total : '!4'!DAT*'!total_index_t.Text=''modifyz'!total_index_t.Color=RGB(red)z'!  ( 0 @ H \ d t |            , @ H P X `       v$0$H$P$"#>9)l8#^9,!8t0)8DAT*9}$$j)8$)81<T$$P)8 $)81<>,#P,#9}f,#9}$$$),84$)<81<,#,#9}D$L9}T$\9}t9}9}f,!80)8DAT*>^ |  4:>DPTZf !"'()*,,@.fd! bresultw_mdi_mainsqlca<!@$#@% dw_loc_master$ib_obj_modified dw_loc_detail8# uf_check_required4XUpdating data...setmicrohelpZ$ uf_check_master_rid:$updated8# uf_check_detail_ridDAT*;8#d8# ;8#d$ 8# ib_new_masterd3ib_new_detailty|4Data updated successfullyZ 0 H P l              $ , 4 < D L T \ t   H!$),81<49D$)L81<DAT*h9T$)h818p$)8$8)88"8080:)@@8$)8$)8$8),84$)H89P$8XJp8 x$8X$)8$)81HDAT*8$8J868080:)@@8$)8$)8$8)8 $)(890$88)D88"4808L0:)@@8h$)p8x$)8$88)8$)89>9DAT*:4 h &Bb ,V !" #,&6'b(~)*+, -*/428d: ll_cur_rowll_total_rowls_sub_typels_shape_typeP , h dw_loc_master$accepttextf dw_loc_detailai4# $rowcount4\$getrowx$shape_typegetitemstringDataWindow ErrorSorry! ShaDAT*T \h p     >$8$D$P$*d X dw_permit_detail!dw_permit_master_ma$"r_1@#r_2L$ 8 D P   " # 123456789L"#2 uf_saveuf_check_requireduf_check_pendinguf_undo_dw_loc_detailuf_undo_dw_loc_masteDAT*x ruf_check_master_riduf_check_detail_riduf_retrieve_dw_permit_detailuf_retrieve_dw_permit_master+destructor+constructor+create+destroyJ "3I_@s    2 widthheightborderbackcolordw_permit_detaildw_permit_masterr_1r_2il_rDAT*p@)b?BA+7p@Jp@3@@8\@\@C[@[@Oc@c@\U@U@m@@y@@@@@@@@@@^@^@@@a 0@0@an@n@+`@,@@A@@`@`@j@j@k@k@l@l@m@m@@@@@@@@@@@q@q@ro0hctsli l2 ishrg@v@v@a@nt1DAT*a8 tiiD n@N n@\ x w_emission_factor_sw_emission_factor_basemenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderdatawindowchildEmission FactorJ  FIRE.ICOvalidgroupboxstructuremailrecipientenvironmentmailfiledescriptionmaDAT*ilmessagelistviewitemtreeviewitemconnectioninforadiobuttonstatictextJ h J  d_emission_factor_s_freeformArialProcessStateCountySelect Factor TypeSourceFiltered by SCC/AMS Code: Microsoft Sans Seriftransactionsqlcaselect rap_processes.rid from rap_processes , rap_devices , rap_sources where rap_processes.device_rid =rap_devices.rid and rap_devices.source_rid =rap_sources.rid and rap_sources.id =' ' and rapDAT*_devices.id =' ' and rap_processes.id =' ' BA,BAf_db_errorgl_source_ridgl_device_ridgd_process_ridgs_scc_ams_codeSELECT rap_processes.scc_ams_code FROM rap_processes WHERE rap_processes.rid =0 NOBA<BASELECT DISTINCT state_rid , county_rid FROM v_rap_sources DAT*WHERE source_rid =0 LMxBABAmessageselect id from rap_sources where rid =0 t&'atrHBAxBAselect id from rap_devices where rid =0 &'BATBAselect id , scc_ams_codeDAT* from rap_processes where rid =0 78BABAselect rap_devices.source_rid , rap_devices.rid from rap_processes , rap_devices where rap_processes.device_rid =rap_devices.rid and rap_processes.rid =0 DBA BA&'X HBAak DAT*\ BA&' BAA BA78H BA L BA DBA BAf_getgeoridu_dw_listu_dw_freeformL< , 0 DAT* < @    rx    T X        X \       H L       2 w_emission_factor_s   wf_dwmodifypl_cur_rowwf_check_specialal_rowof_setdddwadwof_setdddwkeys+open+create+destroDAT*y+wparam+lparam+add_row+currentrow+rowfocuschangedwparamlparamcurrentrowrowdwodata+itemchangednewrow+rowfocuschanging+row_pasted+clickedH BBL0ILB0ICdatawindow.LLQl tLULLLn LLCdwobject.SraLLLI ,Xt x DAT* _initsrcw_emission_factor_basew_emission_factor_smenuwindowtypewindowstatewindowobjecttoolbaralignmentw_emission_factor_base`st_no_record_greyst_no_record_greyfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_emission_factor_base`st_no_record_whitest_no_record_whitew_emission_factor_base`dw_2dw_2dwobjectw_emission_factor_base`dw_1dw_1w_emission_factor_base`r_1r_1linestyledatawindows_rec_holderdatawindowchildgroupboxgb_1structuremailrecipiDAT*entenvironmentmailfiledescriptionmailmessagelistviewitemtreeviewitemconnectioninforadiobuttonrb_processrb_staterb_countystatictextst_select_factor_typerb_sourcest_sccfiltertransactionmessageu_dw_listu_dw_freeform@(<@A@L@X@e@v@@ @DAT* @ @ @( @*=$Y^at@dowgerawin ma  8!@@@!J@<@ id@ME@w_syw@ash_ h@@*+IL@bjec8DAT*@E@T@ ` k t,~@=A@&@)@*@       DAT*)*+-./e% S*. . {1{1 %(-(-(-,. (-,.DAT* 90d  Q$8 l($80JL81"bT$8\Jh81"b8p08{0:)@@8$)8$)8$8\)8$)89$80) DAT*8<1b8088Dz%:)@@8p$)x8$)8$8\)8$)899$8$80J81"$8J81"8p080:)@@8$)8$)8DAT*  $8)(80$)889@$80)H8<18088Pz%:)@@8|$)8$)8$8)8$)899$8D$80J81":$8J81DAT*p@)b?CA!*p@Kp@0@@5\@\@@[@[@Lc@c@YU@U@j@@v@@@@@@@@a@@a^@^@@@0@0@n@n@+`@A @@*F@F@2q@q@>v@v@Q p@ !X w_emission_growth_factorw_single_tablemenuwindowtypewindowstatewindowobjecttoolbarDAT*alignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderUntitledabK  Growth (factors)ablK TK ԽP:\rapids\GLC\Dev60\rap_dw1.pbld_growth_factors_freeformd_growth_factorsf_get_sequencedatawindowchildpointertransactionsqlcaSELECT rap_geograpDAT*hic_locations.rid FROM rap_geographic_locations WHERE ( rap_geographic_locations.parent_rid =0 ) AND ( rap_geographic_locations.name =' ' ) AND ( rap_geographic_locations.type ='COUNTY' ) opDBATBAf_sqlcheckf_look_upgd_process_ridSELECT v_rap_ss_scc.state_rid , v_rap_ss_scc.state_name , v_rap_ss_scc.county_rid , v_rap_ss_scc.county_name , v_rap_ss_scc.scc_code FROM v_rap_ss_scc WDAT*HERE v_rap_ss_scc.source_sub2_rid =0 rCAxCAmessagew_filter4p T X rx   2! w_emission_growth_factor   wf_check_ridof_retrieve_dddwof_sync_county_dddwal_rowof_get_county_ridof_add_rowof_scc_lookup+open+create+destroywparamlparam+ueDAT*_open_filter_winrowdwodata+itemchanged+itemfocuschanged+add_rowxposypos+rbuttondown` BI:ILi::BLLQ LULLLCdwobject.S="LLCdwobject.ord LIILCdwobject.  DAT*(<X $Tl x _initsrcw_single_tablew_emission_growth_factormenuwindowtypewindowstatewindowobjecttoolbaralignmentw_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_1linestyledatDAT*awindows_rec_holderdatawindowchildpointertransactionmessagew_filter dtightna@bri xtgnme9ct@ete>ck@rboIte@zewUna@ontcbtf@yfoscth@@@ @v@ @F@ @ @ @Q!p@5*>?DAT*C@LN` ernsace mssx  !|@@@!K@<@@ @@      ! f$ =*DAT*. . {/{/  1$)(80$88JL819$19T$88)d8<19l$DAT*8tJ81^9)8<199 @ pD^ h!%'d ll_rowll_ridll_rc<H idw_active/#rowcount4/#ridgetitemnumber </#setitemO\/#county_rid <of_get_county_rid ( 0 DAT*2L T d l   :F@@8$8)08<,)H8<1)\8l$8)t8<,)|8<1)8$8)8<,)8<)8$8)8<,)DAT*g@)b?CA?g@TLg@!"X@X@A.c@c@A;@@AG@@S@@a]@@h@@ArY@Y@A}^@^@@@@@0@0@%p@p@q@q@  u_dw_group_srcu_dw_groupuserobjectswindowobjectborderstylefontcharsetfontpitchfontfamilyalignmentvtextalignpowerobjectArialadd.bmpremove.bmpfillpatternMS Sans Serif... Group Member... Selection ListdwobjectSource group memberDAT* recordsSource selection listlinestylewindowL `L Source Group MemberSource Selection Listd_sou_groupd_sou_names_for_grouptransactionsqlca,T2 u_dw_group_src  pl_cur_rowpl_selected_rowuf_setitem_on_dw_groupuf_setitem_on_dw_select_listp_parent_riduf_retrieve_select_list+create+destroyM QLLDAT*WQLQ$< x _initsrcu_dw_groupu_dw_group_srcuserobjectswindowobjectborderstyleu_dw_group`pb_addpb_addfontcharsetfontpitchfontfamilyalignmentvtextalignpowerobjectu_dw_group`pb_removepb_removeu_dw_group`st_group_memberst_group_memberfillpatternu_dw_group`st_selection_listst_selection_listu_dw_group`dw_groupdw_groupdwobjectu_dw_group`dw_select_listdw_select_listu_dw_group`r_1r_1linestyleu_dw_group`r_2r_2DAT*windowtransaction@+@7@D@Pbi@u @@ @ @rs @8/rsDEJJKNLvQRSTVW,X@Yf^l_afgd= ll_master_ridll_cur_rowls_sqlls_errsqlcacase36x! ( /4@[5 < uo_act?;hideuo_group(@Huo_locD>2dw_2\-setredraw!ldw_3,!ldw_1. rowcount4. getrow. ridDAT*@getitemnumbersa is_stateow 2geo memberis_style_state3formele,show@\-@\-dataobjecthis_member_dwt='|M\-h|M,his_member_dw_freeformN\-settransobject^is_selected_child_nameSSOURCEis_level_typeQ#RSTATE\\-retrieve2LCOUNTY\-2LCITY\-2Linvo_locations[T\-uf_get_orig_sql\-2LDAT*B\-,sharedataS,wf_retrieve_county_dddw ,wf_retrieve_city_dddw$42geo activity\-his_activity_dw|O,his_activity_dw_freeformP\-^\-DataWindow.Table.Selectdescribejis_use_type\onDataWindow.Table.Select=" and metric_code in (select code from rap_metric_maps where use_type in (is_use_type_list])) and (material_code in (select material_cDAT*"ode from rap_metric_maps])) or material_code is null)"\-j where use_type = 'DESCRIPTIVE INFORMATION AND CODES')"\-modifyz`Modify d_activity Error,z`Modify d_activity_freeform Error\-is_levelQ2L,triggerevent \-,\-!l,!l  4 < L T d x          DAT*Fg@)b?DA?g@Rg@"X@X@.c@c@;@@G@@S@@]@@h@@rY@Y@}^@^@@@a@@a0@0@%p@p@q@q@q s u_dw_group_matu_dw_groupuserobjectswindowobjectborderstylefontcharsetfontpitchfontfamilyalignmentvtextalignpowerobjectArialadd.bmpremove.bmpfillpatternMS Sans Serif... Group Member... Selection ListdwobjectSource group memberDAT*H recordsSource selection listlinestylewindowR pR $Material Group MemberMaterial Selection Listd_mat_groupd_mat_names_for_grouptransactionsqlca,T2 u_dw_group_mat  pl_cur_rowpl_selected_rowuf_setitem_on_dw_select_listuf_setitem_on_dw_groupp_parent_riduf_retrieve_select_list+create+destroyM QLLDAT*JWQLQ$< x _initsrcu_dw_groupu_dw_group_matuserobjectswindowobjectborderstyleu_dw_group`pb_addpb_addfontcharsetfontpitchfontfamilyalignmentvtextalignpowerobjectu_dw_group`pb_removepb_removeu_dw_group`st_group_memberst_group_memberfillpatternu_dw_group`st_selection_listst_selection_listu_dw_group`dw_groupdw_groupdwobjectu_dw_group`dw_select_listdw_select_listu_dw_group`r_1r_1linestyleu_dw_group`r_2DAT*Lr_2windowtransactionforwypglobn @ean _adata+ob@ong 7tr@leveDri@ourcPrievicbriroceitr@streuen@ototcs@ngares@ @dw_a LE@!le0 @oc_act o_p uo0 bus r_D nde M ma@DAT*N;V 8p z! @!R<@8$@        ! #DAT*P9. .!... . y+ y*  $8 0$88)\8)l8t$8|$8)8)8$8$8JDAT*R8;)8Jd# pl_cur_rowpl_selected_row(` dw_select_list&namedw_group%%rap_materials_namegetitemstringKsetitemPd&code%%rap_materials_codeKPd&rid%%child_ref_ridgetitemnumber Od 0 \ l t        $DAT*T8@$8H)\8)l8t$8|$8)8)8$8$8J8;)8$8$) 8Jd# pl_cur_rowpl_selected_row((x dw_group_li%rap_materials_namedw_select_listte/&namegetitemstringMsetitemPdDAT*V%rap_materials_code/&codeMPd%child_ref_rid/&ridgetitemnumber@ Od%parent_ref_ridil_ref_rid_s ,Od @ \ l t            F$,)088$)L8 d p_parent_ridsqlca(@ T dw_select_listDAT*X&settransobjectd^ &retrieveame2@ 0 8 L 8d  create8d  destroy5782 e uf_setitem_on_dw_select_listuf_setitem_on_dw_groupuf_retrieve_select_list+create+destroyd%<T\DAT*Z2  ] o  @@T1    @          # 8@ $7dH<DAT*2%x5|KK"-2  2  widthheight(x] o $x @   @   @ @ "-2 DAT*^w_contact`r_2cb_parentcb_contactkeycodemessagepointeru_dw_activityw_mdi_maintransactionw_filterdwitemstatuswindowm_main_menuh@!)@.@9@E@R@c@@ @ vi@s_ac fr@rm ac@ty_f _l@ODAT*` 1 6@l? T -Y jen !s  @!S<@R$@1@<@@@@@#@3@@@DAT*bM@\r_bufreect(r_r@ldwc) eturun@n 3#D Ugy@@ @ !" #6DAT*d*$0;%L&V'a"$@8i#@$q%@y'@(@<-@0@S6@<<@D@        "DAT*f $",-/ 1. 2 . 3. 4. 5. 6. 7. 8. 9. :!.=? @> A> B> C> D> E >FG p)Z*. DAT*h.  {4  {5  {5   !-!-!-.J> ?!< >E7?!!-!-     DAT*j )8#D,$01>,$$$:F@@8<8D0X$6`$6|$68$$$)88J8$6$680808080)8 $)8$$89}@$X$)l8,)DAT*l$6,$1,$$D^ x ^zd- +wparam+lparam::messagew_mdi_mainP $@I")@L wf_check_pending}is_style_state,3currentis_stateL2,3is_enlarge_stateh4uo_act;/dw_1. . getrowridgetitemnumberh@ is_levelS,3DAT*uf_prepare_dweC;/showce_;/bringtotop_, ;/dw_act_detail_aH!setfocusme`is_act_stylet+,3 $ < X ` |            $ 8 @ X l     )8#D,$01>,$$$:F@@8<8D0X$6DAT*pBase user object for adding group membersforward global type u_dw_group from UserObject end type type pb_add from picturebutton within u_dw_group end type type pb_remove from picturebutton within u_dw_group end type type st_group_member from statictext within u_dw_group end type type st_selection_list from statictext within u_dw_group end type type dw_group from datawindow within u_dw_group end type type dw_select_list from datawindow within u_dw_group end type type r_1 from rectangDAT*rle within u_dw_group end type type r_2 from rectangle within u_dw_group end type end forward global type u_dw_group from UserObject int Width=2775 int Height=960 boolean Border=true long BackColor=12632256 long PictureMaskColor=25166016 long TabTextColor=33554432 long TabBackColor=67108864 pb_add pb_add pb_remove pb_remove st_group_member st_group_member st_selection_list st_selection_list dw_group dw_group dw_select_list dw_select_list r_1 r_1 r_2 r_2 end type global u_dw_DAT*tgroup u_dw_group type variables long il_last_clicked_row long il_last_clicked_member_row boolean ib_obj_modified long il_ref_rid; window iw_cur_win; end variables forward prototypes public function boolean uf_save () public function boolean uf_check_pending () public subroutine uf_assign_active_dw (datawindow pdw_obj) public subroutine uf_retrieve_group_member (long p_ref_rid) public subroutine uf_retrieve_select_list (long p_parent_rid) public subroutine uf_undo_dw_group () pubDAT*vlic subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row) public subroutine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row) end prototypes public function boolean uf_save ();// This function saves data into rap_group_members tables boolean lb_result if Not ib_obj_modified then return TRUE SetMicroHelp(w_mdi_main, "Updating data...") lb_result = TRUE if ib_obj_modified then if dw_group.Update() = 1 then commit; else rollback; DAT*x lb_result = FALSE end if end if // Reset modified and new record flags ib_obj_modified = FALSE if lb_result then SetMicroHelp(w_mdi_main, "Data updated successfully") return (lb_result) end function public function boolean uf_check_pending ();integer li_messagebox_return // Have any modifications been made to the datawindows if ib_obj_modified then li_messagebox_return = MessageBox("Group View", & "Data have been modified in the group view.~nSave current changes?", QuDAT*zestion!, YesNo!) choose case (li_messagebox_return) case 1 if Not uf_save() then return FALSE end if case 2 // Undo the changes uf_undo_dw_group() // Reset modified flag ib_obj_modified = FALSE // case 3 // return FALSE end choose end if return TRUE end function public subroutine uf_assign_active_dw (datawindow pdw_obj);// This function assigns the active datawindow // Get the active window name iw_cur_win = w_mdi_main.GetActiveSheet() chooDAT*|se case iw_cur_win.ClassName() case 'w_geo' w_geo.idw_active = pdw_obj case 'w_source' w_source.idw_active = pdw_obj case 'w_device' w_device.idw_active = pdw_obj case 'w_process' w_process.idw_active = pdw_obj case 'w_material' w_material.idw_active = pdw_obj end choose end subroutine public subroutine uf_retrieve_group_member (long p_ref_rid);// Purpose: retrieve data for dw_group il_ref_rid = p_ref_rid dw_group.SetTransObject(SQLCA) // Retrieve data for dwDAT*~_mat_group dw_group.Retrieve(il_ref_rid) end subroutine public subroutine uf_retrieve_select_list (long p_parent_rid);// Perform on the descendant level end subroutine public subroutine uf_undo_dw_group ();// This function uses dwGetNextModified to check if any row is modified. // If found, undo the changes by using ReselectRow function long ll_row_num, ll_total_row dw_group.AcceptText() ll_total_row = dw_group.RowCount() ll_row_num = 0 // For primary buffer do while ll_rowDAT*_num <= ll_total_row ll_row_num = dw_group.GetNextModified(ll_row_num, Primary!) if ll_row_num > 0 then if dw_group.GetItemStatus(ll_row_num, 0, Primary!) = NewModified! then dw_group.DeleteRow(ll_row_num) else dw_group.ReselectRow(ll_row_num) end if else ll_row_num = ll_total_row + 1 end if loop end subroutine public subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row);// Perform this on the descendant level end subroutine public suDAT*broutine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row);// Perform this on the descendant level end subroutine on u_dw_group.create this.pb_add=create pb_add this.pb_remove=create pb_remove this.st_group_member=create st_group_member this.st_selection_list=create st_selection_list this.dw_group=create dw_group this.dw_select_list=create dw_select_list this.r_1=create r_1 this.r_2=create r_2 this.Control[]={this.pb_add,& this.pb_remove,& this.st_group_member,& DAT*this.st_selection_list,& this.dw_group,& this.dw_select_list,& this.r_1,& this.r_2} end on on u_dw_group.destroy destroy(this.pb_add) destroy(this.pb_remove) destroy(this.st_group_member) destroy(this.st_selection_list) destroy(this.dw_group) destroy(this.dw_select_list) destroy(this.r_1) destroy(this.r_2) end on type pb_add from picturebutton within u_dw_group event mousemove pbm_mousemove int X=1801 int Y=292 int Width=155 int Height=120 int TabOrder=30 string PictureNDAT*ame="add.bmp" Alignment HTextAlign=Left! boolean OriginalSize=true int TextSize=-8 int Weight=700 string FaceName="Arial" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on on clicked;long ll_cur_row, ll_selected_row, ll_row_num[] integer li_array_size // Make the current row number the total row number plus 1 ll_cur_row = dw_group.RowCount() + 1 ll_selected_row = dw_select_list.GetSelectedRow(0) li_aDAT*rray_size = 1 // Add the selected row(s) to the group list do while ll_selected_row > 0 dw_group.InsertRow(0) uf_setitem_on_dw_group(ll_cur_row, ll_selected_row) ib_obj_modified = TRUE // Make the dw_group datawindow the active datawindow in its // parent window object uf_assign_active_dw(dw_group) // Store the selected row number into an array for later use ll_row_num[li_array_size] = ll_selected_row li_array_size = li_array_size + 1 ll_selected_row = dw_seDAT*lect_list.GetSelectedRow(ll_selected_row) ll_cur_row = ll_cur_row + 1 loop // Remove the added row out of the selection list to prevent the user // from adding the same row more than once li_array_size = li_array_size - 1 do while li_array_size > 0 dw_select_list.DeleteRow(ll_row_num[li_array_size]) li_array_size = li_array_size - 1 loop end on type pb_remove from picturebutton within u_dw_group event mousemove pbm_mousemove int X=1801 int Y=532 int Width=155 int HeightDAT*=120 int TabOrder=40 string PictureName="remove.bmp" Alignment HTextAlign=Left! boolean OriginalSize=true int TextSize=-8 int Weight=700 string FaceName="Arial" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on on clicked;long ll_cur_row, ll_selected_row, ll_row_num[] integer li_array_size // Make the current row the total row number plus 1 ll_cur_row = dw_select_list.RowCount() + 1 ll_selected_row = DAT*dw_group.GetSelectedRow(0) li_array_size = 1 // Add the removed rows back to the selection list do while ll_selected_row > 0 dw_select_list.InsertRow(0) uf_setitem_on_dw_select_list(ll_cur_row, ll_selected_row) // Store the selected row number into an array for later use ll_row_num[li_array_size] = ll_selected_row li_array_size = li_array_size + 1 ll_selected_row = dw_group.GetSelectedRow(ll_selected_row) ll_cur_row = ll_cur_row + 1 loop // Remove the rows out oDAT*f the group list li_array_size = li_array_size - 1 do while li_array_size > 0 dw_group.DeleteRow(ll_row_num[li_array_size]) ib_obj_modified = TRUE // Make the dw_group datawindow the active datawindow in its // parent window object uf_assign_active_dw(dw_group) li_array_size = li_array_size - 1 loop dw_select_list.setsort("1 A, 2 A") dw_select_list.sort() end on type st_group_member from statictext within u_dw_group int X=2021 int Y=12 int Width=631 int HeigDAT*ht=56 boolean Enabled=false string Text="... Group Member" boolean FocusRectangle=false long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type st_selection_list from statictext within u_dw_group int X=55 int Y=16 int Width=741 int Height=56 boolean Enabled=false string Text="... Selection List" boolean FocusRectangle=false long TextColor=8388608 lonDAT*g BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type dw_group from datawindow within u_dw_group event mousemove pbm_mousemove event save pbm_custom21 event select_one pbm_custom22 event select_all pbm_custom23 event validate_delete pbm_custom24 event add_row pbm_custom25 int X=2025 int Y=84 int Width=681 int Height=804 int TabOrder=20 string Tag="Source group member records"DAT* BorderStyle BorderStyle=StyleLowered! boolean VScrollBar=true boolean LiveScroll=true end type on mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on on save;uf_save() end on on select_one;MessageBox("Filter on group", "Sorry! This function is not available") end on on select_all;MessageBox("Show All on group", "Sorry! This function is not available") end on on validate_delete;MessageBox("Delete", "Sorry! This function is not available") end on on add_row;MessageBox("InDAT*sert", "Sorry! This function is not available") end on on clicked;il_last_clicked_member_row = f_highlight_row(This, il_last_clicked_member_row) end on on getfocus;r_2.show() uf_assign_active_dw(This) end on on losefocus;r_2.hide() end on type dw_select_list from datawindow within u_dw_group event mousemove pbm_mousemove event select_one pbm_custom21 event select_all pbm_custom22 event validate_delete pbm_custom23 event add_row pbm_custom24 int X=55 int Y=88 int Width=16DAT*73 int Height=804 int TabOrder=10 string Tag="Source selection list" BorderStyle BorderStyle=StyleLowered! boolean HScrollBar=true boolean VScrollBar=true boolean LiveScroll=true end type on mousemove;setmicrohelp(w_mdi_main, this.tag) end on on select_one;MessageBox("Filter on group", "Sorry! This function is not available") end on on select_all;MessageBox("Show All on group", "Sorry! This function is not available") end on on validate_delete;MessageBox("Delete", "Sorry! ThDAT*is function is not available") end on on add_row;MessageBox("Insert", "Sorry! This function is not available") end on on losefocus;r_1.hide() end on on getfocus;r_1.show() uf_assign_active_dw(This) end on event clicked;il_last_clicked_row = f_highlight_row(This, il_last_clicked_row) end event type r_1 from rectangle within u_dw_group int X=41 int Y=72 int Width=1714 int Height=836 boolean Visible=false boolean Enabled=false int LineThickness=16 long LineColor=32768 DAT*long FillColor=32768 end type type r_2 from rectangle within u_dw_group int X=2007 int Y=72 int Width=722 int Height=836 boolean Visible=false boolean Enabled=false int LineThickness=16 long LineColor=32768 long FillColor=32768 end type DAT*`$6|$68$$$)88J8$6$680808080)8 $)8$$89},)PX$6,$1,$`$D^ x ^zd- +wparam+lparam::messagew_mdi_mainP DAT*$@I")@Lh wf_check_pending}is_style_state,3historyis_stateL2,3is_enlarge_stateh4uo_act;/dw_1. . getrowridgetitemnumber is_level@S,3uf_prepare_dwcC;/show;/bringtotop, is_act_styled.@+,3 $ < X ` |        DAT*    $ 8 P X ` x$1D0$8$9)L8,$^1l,$T$ Dd" +wparam+lparam::message< $@I\( il_selected_rowEidwc_dw_child> F(Eselectrow@ 0 8 L T >$)$81<4DAT*94$)<81<h9L$)T81<9\$)l81t$8|)88080@8$)8$)8$8)8$)$89,$)@81X$68`DAT*l$$6808080808#98 $8J8|8080@8$)8$)8$8)8 $)89$8#9$$8,08@08R08f08#98xDAT*$8|)88080@8$)8$)8$8)8$)898$8)88080@8 $)8$)$8,$84)<8D$)L89T$8\)`DAT*8808h0@8$)8$)8$8\)8$)89$8|)88080@8$)8$)8$8)8$)8994h <\~ $&'( ) *,-DAT*./0102R3r5|68:<= >J?r@ABCEFG<HdIJKLNOP>QZRzSTVWXY4ZT[v\_ad( ll_cur_rowll_total_rowcase39< X dw_1. accepttextdw_2,-dw_3D,. getrowd. namegetitemstringData ErrorSorry! Name is requiredr. setfocushDAT*@. setrowQ. NamesetcolumnH. scrolltorow?,-rowcount@44is_current_btn@HYActivity ,-is_leveltSSource,-ref_ridgetitemnumber Sorry! Agency Source ID is required,-,-Q,-H,-?,-,-begin_relation_dateend_relation_dateBegin Relation DateEnd Relation DateChildren,-,-,-Q,-H,DAT*-?Form,-typeSorry! Type is required,-,-Q,-TypeH,-?,-idSorry! ID is required,-,-Q,-H,-?,-,-,-Q,-H,-? $ 4 < L T \ l t         $ , @ X lDAT*              $                 $ , < D L T `                   3$) 84$)<8L$DAT*9)`8p$9)x8$)81F$)81$8J8$688"8 "0$68 $0$H$P$X`$6h$p$6$,.)88DAT*$$$$$6$$6 $,.)(88 0$8$L$T$\d$6l$t$6$,.)8$8$)8$)8$)8 $$)(8FDAT*T%80F@$H`$6h$p$6$,.)8$8)88z%8z&$),884f8506@8P$)X8848`06@8$$6)8$:NW@)8DAT*p@)b?EA69p@Up@#@@(\@\@3[@[@?c@c@LU@U@]@@i@@s@@~@@@@a@@a^@^@@@0@0@n@n@+`@P@@@^`@`@hj@j@vk@k@Ql@l@am@m@@@@@@@@@A@@Rg@@X@X@p@p@*@*@av@v@;F@F@p@ =DAT*?g@ 3@` in?,sa?owoNq@q@aZw@l`ou_pceo|wa$( w_materialw_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitledfU DAT*commandbuttonstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninforectangleu_dw_group_matuserobjectswindowwU MaterialMATERIAL.ICOU L˵U tWkeycoded_material_displayGroupkU messagepointerw_filtergb_filteru_dw_groupf_menu_behavem_main_menuf_highlight_DAT*buttonf_get_sequencetransactionsqlcags_scc_ams_codegs_materialf_dddw_searchf_validate_codef_retrieve_group_typesf_check_matrl_group(Hp2 w_material   wparamlparam+highlight_dddwwf_check_requiredwf_select_onewf_detail_viewwf_general_viewdw_objwf_check_rid+ue_vertical_scroll+dwescapekeykeyflags+dwnkey+wparam+lparam+closequery+open+create+destroy+key+keyflagsrowdwodata+itDAT*emchanged+dwnprocessenter+row+dwo+data+editchanged+itemfocuschanged+currentrow+rowfocuschanged+delete_row+scrollpos+scrollvertical+add_row+rowsinserted+rowsupdated+rowsdeleted+updateend+itemerror+clickedh  LULBQeBCdatawindow. Lwi: LCkeycode.ULLCdwobject.S#LLCdwobject.hanHDAT*LLe q LLLL(D`,8P| x _initsrcw_master_detailw_materialmenuwindowtypewindowstatewindowobjecttoolbaralignmentw_master_detail`st_no_record_whitest_no_record_whitefontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_masDAT*ter_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_groupstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninforectangler_buttonsu_dw_group_matuo_groupuserobjectsu_dw_group_mat`pb_addu_dw_group_mat`pb_removeu_dw_group_mat`st_group_memberu_dwDAT*_group_mat`st_selection_listu_dw_group_mat`dw_groupu_dw_group_mat`dw_select_listu_dw_group_mat`r_1u_dw_group_mat`r_2windowkeycodemessagepointerw_filteru_dw_groupm_main_menutransaction onect_m@c_co!urilre,vi@ent1sc@ion<e@windHst@itemUte@nnecfowjecttaow@@@ @8 @8 @DAT* @LLCd @@ $E4$9@(EBW \ q !v  pe@!U<@Q@ @@@*IL@bjec@@DAT*#@ 3@d@@ M@\@ fp@ Code@\8  !9K9L_@Sf!U@n"<@v$ai@~%!@(@*@.@DAT*        " $"-/ 1. 2. 3. 4. 5. 6. 7. 8. j' F*.DAT* . {2{2 {5   !-, .9. .!  x$1D0$8$9)L8,#^1l,#T$Dd" +wDAT*param+lparam::message< #@;\( il_selected_row@idwc_dw_child A(@selectrow@ 0 8 L T D:F@@8$)$81<N9,$)<8D$8L)`88h"R8i08z0:)@@8$)8DAT*$8L)8$)89$8)88h"48i080:)@@8$)8$$8),84$)<899N p (HR~ *4d# ll_cur_rowls_codels_name<  D DAT* dw_1. accepttext. getrow4. codegetitemstringQDataWindow ErrorSorry! Code is required. setrowQ. setcolumnH. scrolltorow?. nameQSorry! Name is required. Q. H. ? $ , < D `           $ , 4 < r:F@@DAT*8&8@8,'l'9}80),8 < D Pd w_filtergb_filter(&@='@4 rap_materialsfiltertriggerevent ,  $$$T,$)H8TP$)`8|80$6$6$68$$$1)DAT*8$$$$),84$<$)L8)`8l$t$|$1-<R$$1#<R)8$$$1-<R$$1#<R)8$$$1<Y$$1<Y) 8 $($0$8$@$1"DAT*<R)H8P$)`88 T n ,b2d h uo_group:/visible:/uf_check_pending24:/uf_save1Xis_enlarge_stateh4detailis_state2is_style_state3h4dw_1. . widthresize. . xii_dw1_y;movesi$. . getrowsDscrolltorow?DAT*Tr_1h/". . height@r_20$dw_2F@--0$--y$cb_group8"8". $:/hidep@X $ , H P ` |            , 4 < L ` l t |     DAT*&              ( 0 8 @ H P ` ,+$$$@9}P$X$h$$)8$$$$)8$$$1-<R$$1#<R) 8$$$$1<Y,$8$1DAT*p@)b?EA29p@Vp@!@@&\@\@1[@[@=c@c@JU@U@[@@g@@q@@|@@@@!@@a^@^@@@0@0@n@n@`+`@aL@@@Z`@`@dj@j@rk@k@q~l@l@am@m@@@@@@@a@@AIg@X@X@$@@ q@q@9l p_s_rF@F@q p@DAT* ;,;Kv@v@K <dS\f"p@f=q( w_permitw_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitledV ucommandbuttonstructuremailrecipientDAT*environmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfou_dw_permit_conditionuserobjectsidV +rectanglePermitPROCESS.ICOV *V +Member information (freeform view)Member information (tabular view)General informationd_permit_infoConditionsReporting RequirementsV &Filter on sourced_source_ids_ddDAT*dwFilter on deviced_device_ids_dddwFilter on processd_process_ids_dddwgl_source_ridtransactionsqlcagl_device_ridgd_process_ridf_validate_dev_propointerw_filtergb_filterf_menu_behavef_get_sequencef_check_dup_actmessagef_highlight_buttonw_mdi_main$Dl 2 w_permit [ wf_retrieve_datawf_check_requiredwf_draw_dw2dwnamewf_select_onewf_set_varwf_general_viewwf_detail_viewwf_check_ridfDAT*lagsxposypos+mousemove+open+activate+close+create+destroy+row+dwo+itemfocuschanged+wparam+lparam+add_row+currentrow+rowfocuschanged+xpos+ypos+rbuttondown+clicked+flagsrowdwodata+itemchanged QB7QCdatawindow.xt7BCdatawindow.fo LUIIdow  LLLCdwobject. LULDAT* LL@LIILCdwobject.AEAEILLCdwobject.SilAEAEIAEAEI (Dp0HX,DAT*Ph xf _initsrcw_master_detailw_permitmenuwindowtypewindowstatewindowobjecttoolbaralignmentw_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_holdercommandbuttDAT*oncb_conditionsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfocb_rpt_requ_dw_permit_conditionuo_1userobjectsu_dw_permit_condition`dw_permit_detailu_dw_permit_condition`dw_permit_masteru_dw_permit_condition`r_1u_dw_permit_condition`r_2dw_4dw_5dw_6rectangler_buttonstransactionpointerw_filtermessagew_mdi_mainon dlvcal;te@tail!oltica*th@ataw/bDAT*e@hrun: r@//ifFe_@e = She@/ Thdnt_verll//enon@ @ @d@ @ g@@g@ @ g@@g@  g@g@2?7@@U Z o 8!t  f@!VDAT*<@8@$@('8@@@@@&@ 6@C@ P@$_ivdw_fj@D-.T@.Selbej)lurce!_eDAT*_dK"@,6!t@SB&V@J'<@S-_r@[0!@        " $",. 0- 1- DAT*2- 3-4568 m& G*. . {2{2{2  !-!--:/ )!y&y&DAT*y&7     >, 1$, )$814$8<)H81<X$68`8z%@8,")8, )81,#1$,#)81$8<)81<$68DAT*89z%@8,")8,#)81\Q$36$Q$2)812$Q$2)8X$1)8~$1)8$1)8$1)8$1) 8($1)088$:NW@)P8:r DAT*$\2 6"X#\%~&(),-/03d= dwcgl_source_ridsqlcagl_device_ridgd_process_ridd ( @"@9 #@.$~X dw_4;4retrieve2dw_5,<5idgetchildo?titleP Application Error: Device Id - Not a DataWindowChild in device context. Contact your technical support.settransobject},DAT*<52dw_6=6o?P Application Error: Process Id - Not a DataWindowChild in process context. Contact your technical support.}=62dw_1c_h. 2=6insertrowra(=6(,<5(,<5(;4(;4(. triggerevent @ $ 4 H X            DAT*             ( 0 8 P $)$84$)<8D$L$)\88#9d$)x81$898 d ll_cur_rowll_total_row(DAT*P dw_1. accepttextdw_2,-. . getrowT,-rowcount4lis_current_btnBActivity $ 4 < D L \ d x  *$9)$84$9)<8L$)`81h$p$)88J8$8$$$hDAT*$ $6$<$6D$,")\8d$)x8$:NW@)8$$)8$9)8$9)8)8 @f Hhd ll_master_ridsqlca("@9 dw_2-setredraw!DAT* User object for adding device group membersforward global type u_dw_group_dev from u_dw_group end type end forward global type u_dw_group_dev from u_dw_group int Height=869 end type global u_dw_group_dev u_dw_group_dev forward prototypes public subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row) public subroutine uf_retrieve_select_list (long p_parent_rid) public subroutine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row) end prototypes DAT* public subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row);dw_group.SetItem(pl_cur_row, "rap_devices_id", & dw_select_list.GetItemString(pl_selected_row, "id")) dw_group.SetItem(pl_cur_row, "rap_devices_name", & dw_select_list.GetItemString(pl_selected_row, "name")) dw_group.SetItem(pl_cur_row, "rap_devices_code", & dw_select_list.GetItemString(pl_selected_row, "code")) dw_group.SetItem(pl_cur_row, "child_ref_rid", & dw_select_list.GetItemNumber(pl_selected_row, "rDAT*id")) dw_group.SetItem(pl_cur_row, & "parent_ref_rid", il_ref_rid) end subroutine public subroutine uf_retrieve_select_list (long p_parent_rid);// Purpose: Retrieve data for dw_select_list // Store dev_type into instance variable // is_dev_type = dev_type dw_select_list.SetTransObject(SQLCA) // Retrieve data for dw_select_list dw_select_list.Retrieve(p_parent_rid, gl_source_rid) //dw_select_list.SetFocus() end subroutine public subroutine uf_setitem_on_dw_select_list (longDAT* pl_cur_row, long pl_selected_row);dw_select_list.SetItem(pl_cur_row, "id", & dw_group.GetItemString(pl_selected_row, "rap_devices_id")) dw_select_list.SetItem(pl_cur_row, "name", & dw_group.GetItemString(pl_selected_row, "rap_devices_name")) dw_select_list.SetItem(pl_cur_row, "code", & dw_group.GetItemString(pl_selected_row, "rap_devices_code")) dw_select_list.SetItem(pl_cur_row, "rid", & dw_group.GetItemNumber(pl_selected_row, "child_ref_rid")) end subroutine on u_dw_group_dev.creDAT*ate call u_dw_group::create end on on u_dw_group_dev.destroy call u_dw_group::destroy end on type pb_add from u_dw_group`pb_add within u_dw_group_dev int X=1866 int Y=245 end type type pb_remove from u_dw_group`pb_remove within u_dw_group_dev int X=1866 int Y=457 string Text=" " end type type st_group_member from u_dw_group`st_group_member within u_dw_group_dev int X=2113 string Text="Device Group Member" end type type st_selection_list from u_dw_group`st_selection_lisDAT*t within u_dw_group_dev int X=69 int Height=53 string Text="Device Selection List" end type type dw_group from u_dw_group`dw_group within u_dw_group_dev int X=2117 int Width=577 int Height=705 string DataObject="d_dev_group" end type type dw_select_list from u_dw_group`dw_select_list within u_dw_group_dev int X=74 int Width=1697 int Height=705 string DataObject="d_dev_names_for_group" end type type r_1 from u_dw_group`r_1 within u_dw_group_dev int X=55 int Width=1738 int DAT*Height=737 end type type r_2 from u_dw_group`r_2 within u_dw_group_dev int X=2099 int Width=613 int Height=737 end type DAT*dw_3,,!dw_1 D. rowcount4TD. D. getrowxridgetitemnumber is_current_btnBActivity-dataobjectis_activity_dw?-?,,is_activity_dw_freeform$@-settransobject^L-retrieve2l,,triggerevent -,,sharedata)-!,,!wf_detail_view $ 4 < LDAT* ` h p             < D \ d x            :F@@8$)(8808$)@88H"\$8d(8m@8(8|@8,))9}80)8DAT*l d" dwnamew_filtergb_filter< (@;)@0 idw_active1%classnamedw_21%dw_3is_current_btnMBActivitypro_activitiesrap_processesfiltertriggerevent  ( 8 @ \  T8 0D8L0l8t04d xDAT* is_activity_dw?d_activityis_activity_dw_freeform+@d_activity_freeformis_level`APMT D l  $$($@$)P8X$l9}t$|$$$)8$)8$$$1-<R$$1#<R)8$$$$1-<R,$DAT* 4$1#<R)<8D$LT$\$1<Y}d$px$$1<Y}>\ d  dw_1tiv. . widthvi ii_dw1_heightfo0CresizecH. vscrollbar`. . xii_dw1_yDmovedw_2-hider_1/". . heightDAT*"Hr_20$- -H0$-0$yl -l  ( @ P X l t |              $ , 4 < D L T \ d p x   8$04$6L$6T$6 8DAT*`'d$l$|$1x)8$9}$$$$$1<R)8 $$$$$,$1<R)48D$)T8`$h$p$1-<Rx$$1#<R)8$$$1-<R$$1#<R)8DAT*&@@@@8@@)"@2@?@$L8@[8gq,{@_r@)8!E<M DAT*(^hp@@ 2!"#$%3&Q'd(w @X~!@})*"@<+8,N$@<%$@)&@(@DAT**,@p-@0@79@} 8N@:<@A@,Q@5S@        " $",-DAT*,.0 2/ 3 / 4/ 5/ 6/ 7/ 8/ 9/ :/ ;!/=? @> A> B> C> D> E> F> G>JKMN m)X*. .DAT*. {4{4{5  !-!-!-!-/J> ?!!->:/ .!I !-Ly- 'LDAT*0y- '     ~)8#D,'01>,'$$:F@@8<8D0`8h0x$6$6$68$)8$$$$$)8$9}$ 9}($DAT*20$@$1)P8X$l9}t$|$$1<R$$1<R)8$$$1<Y}$$$1<Y}$$$$$1<R) 84$<$D$L$T$1<R)\8p$xDAT*4$$$$1<R)8$$$$$1<R)8$$$$$1<R)8$$,$4$<$D$1<R)L8`$h$8p08t$18|)8$18|)8$Q+DAT*6$6$666$680)8 $)8$$,9}4$L$)`8,.x$6,'d1r,'$ D ^ x :Xv8x h!"#p$'(,+Z-./1(2JdZ +wparam+lparamls_source_codels_device_code::messagegd_process_ridw_mdi_mainDAT*8  ' 6'@Q@+~O.@T wf_check_pending}is_style_state,3currentis_enlarge_stateL4detailis_stateo2,3L4r_1/"hide[dw_1d. . x dw_6^AMyQmoveAMbringtotopd .  . . widthil8resize1H. vscrollbarj`DAT*L/". 8. heightsH/". /" . cb_group8"8". cb_activity(9,(9,. cb_scheduled@Kd@K. cb_stream;.;.. cb_permit:-:-. cb_factor4====. r_buttonsTDAT*<User object for adding geographic group membersforward global type u_dw_group_geo from u_dw_group end type end forward global type u_dw_group_geo from u_dw_group int Height=925 end type global u_dw_group_geo u_dw_group_geo type variables string is_geo_type; end variables forward prototypes public subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row) public subroutine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row) public subroutine uf_reDAT*>trieve_select_list (string p_geo_type, long p_parent_rid) end prototypes public subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row);dw_group.SetItem(pl_cur_row, "rap_geographic_locations_name", & dw_select_list.GetItemString(pl_selected_row, "name")) dw_group.SetItem(pl_cur_row, "rap_geographic_locations_type", & dw_select_list.GetItemString(pl_selected_row, "type")) dw_group.SetItem(pl_cur_row, "rap_group_members_child_ref_rid", & dw_select_list.GetItemNumber(pl_DAT*@selected_row, "rid")) dw_group.SetItem(pl_cur_row, & "rap_group_members_parent_ref_rid", il_ref_rid) end subroutine public subroutine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row);dw_select_list.SetItem(pl_cur_row, "name", & dw_group.GetItemString(pl_selected_row, "rap_geographic_locations_name")) dw_select_list.SetItem(pl_cur_row, "type", & dw_group.GetItemString(pl_selected_row, "rap_geographic_locations_type")) dw_select_list.SetItem(pl_cur_row, "rid", & dwDAT*B_group.GetItemNumber(pl_selected_row, "rap_group_members_child_ref_rid")) end subroutine public subroutine uf_retrieve_select_list (string p_geo_type, long p_parent_rid);// Function overriding // Purpose: Retrieve data for dw_select_list string ls_second_geo_type // Store geo_type into instance variable is_geo_type = p_geo_type if is_geo_type = 'COUNTY' then dw_select_list.DataObject = 'd_geo_loc_names_for_county_group' // Retrieve data for dw_select_list dw_select_list.SetTDAT*DransObject(SQLCA) dw_select_list.Retrieve(p_parent_rid) elseif is_geo_type = 'CITY' then dw_select_list.DataObject = 'd_geo_loc_names_for_city_group' // The rule for defining the region group member is: // If the geo type is CITY and the group type is REGION // then retrieve any other records with the geo type = CITY or COUNTY // If the group type of the current geo record in geographic window is // region, then set up the second geo type to county if w_geo.dw_1.GetItemDAT*FString(w_geo.dw_1.GetRow(), "group_type") = 'REGION' then ls_second_geo_type = 'COUNTY' // Otherwise, the second geo type is 0. (This means that only retrieve // any records with the city level of geo type) else ls_second_geo_type = '0' end if // Retrieve data for dw_select_list dw_select_list.SetTransObject(SQLCA) dw_select_list.Retrieve(ls_second_geo_type, p_parent_rid) else dw_select_list.DataObject = 'd_geo_loc_names_for_group' // Retrieve data for dw_select_lisDAT*Ht dw_select_list.SetTransObject(SQLCA) dw_select_list.Retrieve(is_geo_type, p_parent_rid) end if //dw_select_list.SetFocus() end subroutine on u_dw_group_geo.create call u_dw_group::create end on on u_dw_group_geo.destroy call u_dw_group::destroy end on type pb_add from u_dw_group`pb_add within u_dw_group_geo int X=1308 int Y=277 end type type pb_remove from u_dw_group`pb_remove within u_dw_group_geo int X=1308 int Y=513 end type type st_group_member from u_dw_gDAT*Jroup`st_group_member within u_dw_group_geo int X=1518 int Width=951 string Text="Geographic Location Group Member" end type type st_selection_list from u_dw_group`st_selection_list within u_dw_group_geo int Width=929 string Text="Geographic Location Selection List" end type type dw_group from u_dw_group`dw_group within u_dw_group_geo int X=1523 int Width=1185 int Height=789 string DataObject="d_geo_group" boolean HScrollBar=true end type type dw_select_list from u_dw_group`dwDAT*U_select_list within u_dw_group_geo int Width=1189 int Height=789 string DataObject="d_geo_loc_names_for_group" end type type r_1 from u_dw_group`r_1 within u_dw_group_geo int Width=1230 int Height=821 end type type r_2 from u_dw_group`r_2 within u_dw_group_geo int X=1500 int Y=69 int Width=1226 int Height=821 end type DAT*N?J(9,onAMcodegetitemstringdw_7BNuo_act<0is_level //R,3is_process_codeWuf_prepare_dwC<0show<0 <0dw_act_detail<!setfocusTis_act_styleh+,3 $ < ` x                ( 0 @ P X l tDAT*P |                    4 < D L T \ p x                 $ , 4 < D L ` h t            DAT*R$ , 4 L ` x   )8#D,'01>,'$$:F@@8<8D0`8h0x$6$6$68$$$$$)8$9}$9} $$$$1)48<$P9DAT*T}\$d$l$1<Rt$$1<R)8$$$1<Y}$$$1<Y}$$$$$1<R)8$$$,$4$<$1<R)D8X$`$h$p$x$1<R)8DAT*V$$$$$1<R)8$$$$$1<R)8 $$808 $18()<8L$18()T8d$Q+x$6$666$680)8$)8$9},.DAT*X$6,'1,'$ D ^ x <Z\ L!"#T&'*,T-p/0dZ +wparam+lparamls_source_codels_device_code::messagegd_process_ridw_mdi_main  ' 6'@Q@+~O.@T wf_check_pending}is_style_state,3histDAT*Zoryis_enlarge_stateL4detailis_stateo2,3L4dw_1. . x= dw_6er(AMy('moveAMbringtotop . . . widthresize,. vscrollbarDr_1X/". . height|,X/". X/" . cb_group`8"8". cb_activity9,9,. DAT*\cb_stream L;.L;.. cb_permit:-:-. cb_factor====. r_buttons$?J9,onAMcodegetitemstring-dw_7)DBN-uo_act\<0is_levellR,3is_process_codeWuf_prepare_dwC\<0show\<0 is_act_style+,3 $ < ` x DAT*^               $ 4 < P \ d l t                  $ , 4 < D X ` h p x                DAT*`   < L T d x           x$1D0$8$9)L8,'^1l,'T$Dd" +wparam+lparam::message< '@Q\( il_selected_rowIidwc_dw_child> J(Iselectrow@ 0 8DAT*b L T ,/1H$,/)$81"4$8<)H81<1@8X$68`8z%@8,1)8,/)81,21$,2)81$,2)8,31$8,3(@(8z'1 $)48)D98DAT*dL$)`8h$1)|8D$1)8j$1)8$:NW@)8:r Bbr!""$D%H(jdD dwcll_row_numgl_source_ridsqlcagl_device_ridgl_cur_rowx ( /@%1@U+2@93@ dw_6DAT*'AMretrieve2dw_7,BNidgetchildo?titleP Application Error: Device Id - Not a DataWindowChild in device context. Contact your technical support.settransobject},BN2dw_1. 2. rid = . rowcount4(findk<. scrolltorow?T,BNinsertrow(pAM(pAM(p. triggerevent}  $ 4 H X     DAT*hp@)b?FA"9p@Yp@q*@@a/\@\@q:[@[@qFc@c@aSU@U@ad@@p@@z@@@@@@a@@a^@^@@@0@0@ n@n@+`@@@*@*@v@v@#F@F@q@q@*%0Q3@&&6( w_product_profilew_master_detailmenuwindowtypewiDAT*jndowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitledataY HProduct ProfilesPROD_PRO.ICOY ȵvaliddatawindowchildY keycoded_split_factorsd_speciation_profilesmessagepointertransactionsqlcaf_DAT*ldel_speciation_profileDelete from Rap_speciation_split_factors Where profile_code =' ' and material_code =' ' =@TWIFAf_db_errorgs_materialm_main_menuf_dddw_searchf_retrieve_codesf_validate_code0x 2 w_product_profile  wparamlparam+highlight_dddwwf_retrieve_dw2p_dwwf_show_whitewf_show_greywf_draw_dw2wf_check_requiredwf_undo_dw1DAT*nwf_cascade_del+dwescapekeykeyflags+dwnkey+wparam+lparam+open+activate+expand_view+create+destroy+original_view+key+keyflagsrowdwo+itemfocuschangeddata+itemchanged+add_row+rowcount+retrieveend+validate_delete+row+dwo+data+editchanged+itemerror+dwnprocessenter+currentrow+rowfocuschangedp  LULQ6QCdatawindow.6BL" LCkeycode.U"   DAT*p LLCdwobject. $LLCdwobject.SmN ?LLe glq $ $ ?  glq $(DTxDAT*r4D\(L x _initsrcw_master_detailw_product_profilemenuwindowtypewindowstatewindowobjecttoolbaralignmentw_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_detDAT*~ail`dw_1dw_1w_master_detail`r_1r_1linestylew_master_detail`r_2r_2datawindows_rec_holderdatawindowchildkeycodemessagepointertransactionm_main_menu  onect_m@c_co!urilre3vi@ent8sc@ionCe@windOst@item\te@nnecmowjecttaow@@ @) @ @8 @8 $@DAT*vUser object for adding material group membersforward global type u_dw_group_mat from u_dw_group end type end forward global type u_dw_group_mat from u_dw_group end type global u_dw_group_mat u_dw_group_mat forward prototypes public subroutine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row) public subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row) public subroutine uf_retrieve_select_list (long p_parent_rid) end prototypes public subroutDAT*xine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row);dw_select_list.SetItem(pl_cur_row, "name", & dw_group.GetItemString(pl_selected_row, "rap_materials_name")) dw_select_list.SetItem(pl_cur_row, "code", & dw_group.GetItemString(pl_selected_row, "rap_materials_code")) dw_select_list.SetItem(pl_cur_row, "rid", & dw_group.GetItemNumber(pl_selected_row, "child_ref_rid")) end subroutine public subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row);dDAT*zw_group.SetItem(pl_cur_row, "rap_materials_name", & dw_select_list.GetItemString(pl_selected_row, "name")) dw_group.SetItem(pl_cur_row, "rap_materials_code", & dw_select_list.GetItemString(pl_selected_row, "code")) dw_group.SetItem(pl_cur_row, "child_ref_rid", & dw_select_list.GetItemNumber(pl_selected_row, "rid")) dw_group.SetItem(pl_cur_row, & "parent_ref_rid", il_ref_rid) end subroutine public subroutine uf_retrieve_select_list (long p_parent_rid);// Purpose: Retrieve data for dwDAT*|_select_list dw_select_list.SetTransObject(SQLCA) // Retrieve data for dw_select_list dw_select_list.Retrieve(p_parent_rid) end subroutine on u_dw_group_mat.create call super::create end on on u_dw_group_mat.destroy call super::destroy end on type pb_add from u_dw_group`pb_add within u_dw_group_mat int Width=155 int Height=120 end type type pb_remove from u_dw_group`pb_remove within u_dw_group_mat int Width=155 int Height=120 boolean OriginalSize=false end type tyDAT*pe st_group_member from u_dw_group`st_group_member within u_dw_group_mat string Text="Material Group Member" end type type st_selection_list from u_dw_group`st_selection_list within u_dw_group_mat string Text="Material Selection List" end type type dw_group from u_dw_group`dw_group within u_dw_group_mat string DataObject="d_mat_group" end type type dw_select_list from u_dw_group`dw_select_list within u_dw_group_mat string DataObject="d_mat_names_for_group" end type DAT*W@8,'&;@@I ^ $c x _gpe!}  //@!Y</g@ocesAL@ s_@ams_nd@ @@@p@@  DAT*      " $m' A*. . {2 {4  {4   DAT*     x$1D0$8$9)L8,^1l,T$Dd" +wparam+lparam::message< @#\( il_selected_row<idwc_dw_child =!<selectrow@ 0 8 L T $)$81,$4$)D8DAT*8L)`8p$6)8&hd ls_profile_code @ dw_1. rowcount4. . getrow<codegetitemstringQdw_2h-retrieve2x $ , 4 D ` p  $,840l$t$|$$$<<Y5Ik@V$DAT*$$$<<Y5Ik@V)8$)8$d p_dw  st_no_record_whitec*text$No records present. Use Insert to create a new record.**width@*height@move*show  , l t |   DAT*       $,840l$t$|$$$<<Y5Ik@V$$$$<<Y5Ik@V)8$)8$d p_dw  st_no_record_greyc+text$No records present. Use Insert to create a DAT*new record.++width$@+height@move+show  , l t |          $9)$84$)H81P$X$`$)p88x)8)8$9)8 F DAT*)d ` dw_2_re-setredraw!dw_1,. rowcount4<-,. ,. getrowhcodegetitemstring}retrieveb@2-! $ 4 H P X ` p     /$)$81<494$)<81<h9D$)T8\$8d)x8DAT*e ) AS ' + & // 'SELECT rap_sources.id, ' + & // 'rap_devices.id, ' + & // 'rap_activities.value_amt, ' + & // 'rap_devices.name, ' + & // 'rap_activities.start_date_time, ' + & // f_retrieve_date(SQLCA, 'rap_activities.end_date_time') + ' ' + & // 'FROM rap_activities, ' + & // 'rap_devices, ' + & // 'rap_sources ' + & // 'WHERE ( rap_activities.ref_rid = rap_devices.rid ) AND ' + & // '( rap_devices.source_rid = rap_sources.rid ) AND ' + & // "( rap_activities.metrDAT*ic_code = 'ID STK AFS' ) AND " + & // "( rap_devices.code = 'STACK' ) AND " + & // f_date_range('rap_activities', ldt_from, ldt_to) + & // ls_sources + & // ls_where_state + & // ls_where_county // //if not cbx_general_stack.Checked then // ls_sql_stmnt = ls_sql_stmnt + ' AND ( rap_activities.rid < 0 ) ' //end if // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// stack parameters //ls_view = 'vrap_geini_stack_parameters' //ls_sql_stmntDAT* = & // '( srcid, ' + & // 'stkid, ' + & // 'metric, ' + & // 'valueamt, ' + & // 'strtdate, ' + & // 'enddate ) AS ' + & // 'SELECT rap_sources.id, ' + & // 'rap_devices.id, ' + & // 'rap_activities_a.metric_code, ' + & // 'rap_activities_a.value_amt * rap_units_a.conversion_factor_amt ' + & // '/ rap_units_b.conversion_factor_amt, ' + & // 'rap_activities_a.start_date_time, ' + & // f_retrieve_date(SQLCA, 'rap_activities_a.end_date_time') + ' ' + & // 'FROMDAT* rap_activities rap_activities_a, ' + & // 'rap_activities rap_activities_b, ' + & // 'rap_devices, ' + & // 'rap_sources, ' + & // 'rap_units rap_units_a, ' + & // 'rap_units rap_units_b, ' + & // 'rap_metrics ' + & // 'WHERE ( rap_activities_a.ref_rid = rap_devices.rid ) AND ' + & // '( rap_devices.source_rid = rap_sources.rid ) AND ' + & // '( rap_units_a.code = rap_activities_a.value_unit_code ) AND ' + & // '( rap_metrics.code = rap_activities_a.metric_code ) AND DAT*' + & // '( rap_metrics.meas_code = rap_units_a.meas_code ) AND ' + & // '( rap_metrics.meas_code = rap_units_b.meas_code ) AND ' + & // '( rap_activities_b.ref_rid = rap_activities_a.ref_rid ) AND ' + & // "( rap_activities_b.metric_code = 'ID STK AFS' ) AND " + & // "( rap_activities_a.metric_code IN ('HEIGHT','DIAMETER') ) AND " + & // "( rap_devices.code = 'STACK' ) AND " + & // "( rap_units_b.code = 'FT' ) AND " + & // f_date_range('rap_activities_a', ldt_from, ldt_to)DAT* + ' AND ' + & // f_date_range('rap_activities_b', ldt_from, ldt_to) + & // ls_sources + & // ls_where_state + & // ls_where_county // //if not cbx_general_stack.Checked then // ls_sql_stmnt = ls_sql_stmnt + ' AND ( rap_activities_a.rid < 0 )' //end if // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // //// devices //ls_view = 'vrap_geini_devices' //ls_sql_stmnt = & // '( srcid, ' + & // 'devid, ' + & // 'id_pt, ' + & // 'devname, ' +DAT* & // 'strtdate, ' + & // 'enddate ) AS ' + & // 'SELECT rap_sources.id, ' + & // 'rap_devices.id, ' + & // 'rap_activities.value_amt, ' + & // 'rap_devices.name, ' + & // 'rap_activities.start_date_time, ' + & // f_retrieve_date(SQLCA, 'rap_activities.end_date_time') + ' ' + & // 'FROM rap_activities, ' + & // 'rap_devices, ' + & // 'rap_sources ' + & // 'WHERE ( rap_activities.ref_rid = rap_devices.rid ) AND ' + & // '( rap_devices.source_rid = rap_sources.rid)DAT* AND ' + & // "( rap_activities.metric_code IN ( 'ID PT AFS', 'ID AFS PT' ) ) AND " + & // "( rap_devices.code NOT IN ( 'CONTROL', 'STACK' ) ) AND " + & // f_date_range('rap_activities', ldt_from, ldt_to) + & // ls_sources + & // ls_where_state + & // ls_where_county // //if not (cbx_general_point.Checked or cbx_segment_general.Checked or & //cbx_seg_pollutant_annual.Checked or cbx_seg_pollutant_sip.Checked) then // ls_sql_stmnt = ls_sql_stmnt + ' AND ( rap_activities.rid < 0 )' DAT*User object for adding process group memberforward global type u_dw_group_pro from u_dw_group end type end forward global type u_dw_group_pro from u_dw_group int Height=861 end type global u_dw_group_pro u_dw_group_pro forward prototypes public subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row) public subroutine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row) public subroutine uf_retrieve_select_list (long p_parent_rid, long p_source_rid) DAT* end prototypes public subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row);dw_group.SetItem(pl_cur_row, "rap_devices_id", & dw_select_list.GetItemString(pl_selected_row, "rap_devices_id")) dw_group.SetItem(pl_cur_row, "rap_processes_id", & dw_select_list.GetItemString(pl_selected_row, "rap_processes_id")) dw_group.SetItem(pl_cur_row, "rap_processes_name", & dw_select_list.GetItemString(pl_selected_row, "name")) dw_group.SetItem(pl_cur_row, "rap_devices_name", & DAT*dw_select_list.GetItemString(pl_selected_row, "rap_devices_name")) dw_group.SetItem(pl_cur_row, "rap_processes_code", & dw_select_list.GetItemString(pl_selected_row, "code")) dw_group.SetItem(pl_cur_row, "child_ref_rid", & dw_select_list.GetItemNumber(pl_selected_row, "rid")) dw_group.SetItem(pl_cur_row, & "parent_ref_rid", il_ref_rid) end subroutine public subroutine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row);dw_select_list.SetItem(pl_cur_row, "rap_devices_iDAT*d", & dw_group.GetItemString(pl_selected_row, "rap_devices_id")) dw_select_list.SetItem(pl_cur_row, "rap_processes_id", & dw_group.GetItemString(pl_selected_row, "rap_processes_id")) dw_select_list.SetItem(pl_cur_row, "name", & dw_group.GetItemString(pl_selected_row, "rap_processes_name")) dw_select_list.SetItem(pl_cur_row, "rap_devices_name", & dw_group.GetItemString(pl_selected_row, "rap_devices_name")) dw_select_list.SetItem(pl_cur_row, "code", & dw_group.GetItemString(pl_selectedDAT*_row, "rap_processes_code")) dw_select_list.SetItem(pl_cur_row, "rid", & dw_group.GetItemNumber(pl_selected_row, "child_ref_rid")) end subroutine public subroutine uf_retrieve_select_list (long p_parent_rid, long p_source_rid);// Purpose: Retrieve data for dw_select_list dw_select_list.SetTransObject(SQLCA) // Retrieve data for dw_select_list dw_select_list.Retrieve(p_parent_rid, p_source_rid) end subroutine on u_dw_group_pro.create call u_dw_group::create end on on u_dw_groDAT*up_pro.destroy call u_dw_group::destroy end on type pb_add from u_dw_group`pb_add within u_dw_group_pro int X=1838 int Y=257 end type type pb_remove from u_dw_group`pb_remove within u_dw_group_pro int X=1838 int Y=461 end type type st_group_member from u_dw_group`st_group_member within u_dw_group_pro int X=2039 string Text="Process Group Member" end type type st_selection_list from u_dw_group`st_selection_list within u_dw_group_pro string Text="Process Selection List" end DAT*type type dw_group from u_dw_group`dw_group within u_dw_group_pro int X=2044 int Width=668 int Height=697 string DataObject="d_pro_group" end type type dw_select_list from u_dw_group`dw_select_list within u_dw_group_pro int Width=1729 int Height=697 string DataObject="d_pro_names_for_group" end type type r_1 from u_dw_group`r_1 within u_dw_group_pro int Width=1765 int Height=729 end type type r_2 from u_dw_group`r_2 within u_dw_group_pro int X=2026 int Width=709 int HeigDAT*ht=729 end type DAT* //end if // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// Streams // //ls_where_afs_segno = & //'( ref_rid IN ' + & // '( SELECT DISTINCT rap_streams.rid ' + & // 'FROM rap_streams, ' + & // 'rap_processes rap_processes_a, ' + & // 'rap_processes rap_processes_b ' + & // 'WHERE rap_streams.from_process_rid = rap_processes_a.rid AND ' + & // 'rap_processes_a.rid = rap_processes_b.rid AND ' + & // 'rap_processes_b.rid IN ' DAT*+ & // '( SELECT DISTINCT ref_rid ' + & // 'FROM rap_activities ' + & // 'WHERE metric_code IN ' + ls_process_id_metrics + ' AND ' +& // f_date_range('rap_activities', ldt_from, ldt_to) + & // ' ) ' + & // ') ' + & // 'OR ' + & // 'ref_rid IN ' + & // '( SELECT DISTINCT ref_rid FROM rap_activities ' + & // 'WHERE metric_code IN ' + ls_stream_id_metrics + ' AND ' +& // f_date_range('rap_activities', ldt_from, ldt_to) + & // ') ' + & //') ' // //ls_view DAT*= 'vrap_geini_streams' //ls_sql_stmnt = & // '( srcid, ' + & // 'devid, ' + & // 'procid, ' + & // 'strmid, ' + & // 'scc_pro, ' + & // 'pr_name, ' + & // 'strname ) AS ' + & // 'SELECT rap_sources.id, ' + & // 'rap_devices.id, ' + & // 'rap_processes.id, ' + & // 'rap_streams.id, ' + & // 'rap_processes.scc_ams_code, ' + & // 'rap_processes.name, ' + & // 'rap_streams.name ' + & // 'FROM rap_streams, ' + & // 'rap_processes, ' + & // 'rap_devicesDAT*, ' + & // 'rap_sources ' + & // 'WHERE ( rap_processes.rid = rap_streams.from_process_rid ) AND ' + & // '( rap_devices.rid = rap_processes.device_rid ) AND ' + & // '( rap_sources.rid = rap_devices.source_rid ) AND ' + & // '( rap_streams.rid IN ' + & // '( SELECT DISTINCT ref_rid FROM rap_activities ' + & // 'WHERE ' + ls_where_afs_segno + & // ' ) ' + & // ') ' + & // ls_sources + & // ls_where_state + & // ls_where_county // //if not (cbx_general_point.Checked oDAT*r cbx_segment_general.Checked or & //cbx_seg_pollutant_annual.Checked or cbx_seg_pollutant_sip.Checked) then // ls_sql_stmnt = ls_sql_stmnt + ' AND ( rap_streams.rid < 0 )' //end if // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// Process Segment ID's //ls_view = 'vrap_geini_process_segment_ids' //ls_sql_stmnt = & // '( srcid, ' + & // 'devid, ' + & // 'procid, ' + & // 'id_pro, ' + & // 'strtdate, ' + & // 'enddate ) AS ' + &DAT* // 'SELECT rap_sources.id, ' + & // 'rap_devices.id, ' + & // 'rap_processes.id, ' + & // 'rap_activities.value, ' + & // 'rap_activities.start_date_time, ' + & // f_retrieve_date(SQLCA, 'rap_activities.end_date_time') + ' ' + & // 'FROM rap_activities, ' + & // 'rap_streams, ' + & // 'rap_processes, ' + & // 'rap_devices, ' + & // 'rap_sources ' + & // 'WHERE ( rap_activities.ref_rid = rap_processes.rid ) AND ' + & // '( rap_processes.rid = rap_streams.from_procDAT*ess_rid ) AND ' + & // '( rap_devices.rid = rap_processes.device_rid ) AND ' + & // '( rap_sources.rid = rap_devices.source_rid ) AND ' + & // "( rap_activities.metric_code IN " + ls_process_id_metrics + ' ) AND ' + & // f_date_range('rap_activities', ldt_from, ldt_to) + & // ls_sources + & // ls_where_state + & // ls_where_county // //if not (cbx_general_point.Checked or cbx_segment_general.Checked or & //cbx_seg_pollutant_annual.Checked or cbx_seg_pollutant_sip.Checked) thenDAT* // ls_sql_stmnt = ls_sql_stmnt + ' AND ( rap_activities.rid < 0 )' //end if // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// Stream Parameters //ls_view = 'vrap_geini_stream_parameters' //ls_sql_stmnt = & // '( srcid, ' + & // 'devid, ' + & // 'procid, ' + & // 'strmid, ' + & // 'metric, ' + & // 'value, ' + & // 'strtdate, ' + & // 'enddate ) AS ' + & // 'SELECT rap_sources.id, ' + & // 'rap_devices.id, ' + & // DAT*'rap_processes.id, ' + & // 'rap_streams.id, ' + & // 'rap_activities.metric_code, ' + & // 'rap_activities.value, ' + & // 'rap_activities.start_date_time, ' + & // f_retrieve_date(SQLCA, 'rap_activities.end_date_time') + ' ' + & // 'FROM rap_activities, ' + & // 'rap_streams, ' + & // 'rap_processes, ' + & // 'rap_devices, ' + & // 'rap_sources ' + & // 'WHERE ( rap_activities.ref_rid = rap_streams.rid ) AND ' + & // '( rap_processes.rid = rap_streams.from_procesDAT*s_rid ) AND ' + & // '( rap_devices.rid = rap_processes.device_rid ) AND ' + & // '( rap_sources.rid = rap_devices.source_rid ) AND ' + & // f_date_range('rap_activities', ldt_from, ldt_to) + ' AND ' + & // '( rap_activities.rid IN ' + & // '( SELECT DISTINCT rid FROM rap_activities ' + & // "WHERE ( metric_code IN " + ls_stream_id_metrics + ' AND ' + & // f_date_range('rap_activities', ldt_from, ldt_to) + ' ) OR ' + & // "( metric_code = 'SCC AMS CODE' AND " + & DAT*// f_date_range('rap_activities', ldt_from, ldt_to) + ' AND ' + & // ls_where_afs_segno + & // ' ) ' + & // ') ' + & // ') ' + & // ls_sources + & // ls_where_state + & // ls_where_county // //if not (cbx_general_point.Checked or cbx_segment_general.Checked or & //cbx_seg_pollutant_annual.Checked or cbx_seg_pollutant_sip.Checked) then // ls_sql_stmnt = ls_sql_stmnt + ' AND ( rap_activities.rid < 0 )' //end if // //if not f_create_view(ls_view, ls_sql_stmnt) then // retDAT*urn FALSE //end if // // //// SCC codes //ls_view = 'vrap_geini_scc_codes' //ls_sql_stmnt = & // '( scc_code, ' + & // 'scc_flag ) AS ' + & // 'SELECT rap_scc_ams_codes.code, ' + & // 'rap_scc_ams_codes.epa_invalid_flag ' + & // 'FROM rap_scc_ams_codes ' + & // 'WHERE ( LENGTH( rap_scc_ams_codes.code ) <= 8 ) ' // //if not (cbx_general_point.Checked or cbx_segment_general.Checked or & //cbx_seg_pollutant_annual.Checked or cbx_seg_pollutant_sip.Checked) then // ls_sql_stmnt = ls_sqlDAT*_stmnt + ' AND ( rap_scc_ams_codes.code IS NULL )' //end if // //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // // //// emissions //ls_view = 'vrap_geini_emissions' //ls_sql_stmnt = & // '( srcid, ' + & // 'devid, ' + & // 'procid, ' + & // 'strmid, ' + & // 'matcode, ' + & // 'polid, ' + & // 'emsrid, ' + & // 'ems, ' + & // 'strtdate, ' + & // 'enddate ) AS ' + & // 'SELECT rap_sources.id, ' + & // 'rap_devices.id, ' + & DAT* // 'rap_processes.id, ' + & // 'rap_streams.id, ' + & // 'rap_activities.material_code, ' + & // 'rap_materials.airs_afs_code, ' + & // 'rap_activities.rid, ' + & // 'rap_activities.value_amt * rap_units_a.conversion_factor_amt ' + & // '/ rap_units_b.conversion_factor_amt, ' + & // 'rap_activities.start_date_time, ' + & // f_retrieve_date(SQLCA, 'rap_activities.end_date_time') + ' ' + & // 'FROM rap_activities, ' + & // 'rap_streams, ' + & // 'rap_processes, ' +DAT* & // 'rap_devices, ' + & // 'rap_sources, ' + & // 'rap_materials, ' + & // 'rap_metrics, ' + & // 'rap_units rap_units_a, ' + & // 'rap_units rap_units_b ' + & // 'WHERE ( rap_activities.ref_rid = rap_streams.rid ) AND ' + & // '( rap_processes.rid = rap_streams.from_process_rid ) AND ' + & // '( rap_devices.rid = rap_processes.device_rid ) AND ' + & // '( rap_sources.rid = rap_devices.source_rid ) AND ' + & // '( rap_metrics.code = rap_activities.metric_code ) ANDDAT* ' + & // '( rap_metrics.meas_code = rap_units_a.meas_code ) AND ' + & // '( rap_metrics.meas_code = rap_units_b.meas_code ) AND ' + & // '( rap_units_a.code = rap_activities.value_unit_code ) AND ' + & // '( rap_materials.code = rap_activities.material_code ) AND ' + & // "( rap_activities.metric_code = 'DOWNSTRMDIS' ) " + & // ls_where_ref_code + & // ls_where_material + ' AND ' + & // '( rap_materials.airs_afs_code IS NOT NULL ) AND ' + & // "( rap_units_b.code = 'TON' ) DAT*AND " + & // f_date_range('rap_activities', ldt_from, ldt_to) + ' AND ' + & // '( rap_activities.ref_rid IN ' + & // '( SELECT DISTINCT ref_rid FROM rap_activities ' + & // 'WHERE ' + ls_where_afs_segno + & // ' ) ' + & // ') ' + & // ls_sources + & // ls_where_state + & // ls_where_county // //if not (cbx_seg_pollutant_annual.Checked or cbx_seg_pollutant_sip.Checked) then // ls_sql_stmnt = ls_sql_stmnt + ' AND ( rap_activities.rid < 0 )' //end if // //if not f_creaDAT*te_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // //// methods //ls_view = 'vrap_geini_methods' //ls_sql_stmnt = & // '( emsrid, ' + & // 'meth ) AS ' + & // 'SELECT DISTINCT rap_activities.rid, ' + & // 'rap_methods.afs_type ' + & // 'FROM rap_activities, ' + & // 'rap_streams, ' + & // 'rap_processes, ' + & // 'rap_devices, ' + & // 'rap_sources, ' + & // 'rap_materials, ' + & // 'rap_methods ' + & // 'WHERE ( rap_activities.ref_rid = rap_streams.riDAT*d ) AND ' + & // '( rap_materials.code = rap_activities.material_code ) AND ' + & // '( rap_methods.type = rap_activities.method_type ) AND ' + & // '( rap_processes.rid = rap_streams.from_process_rid ) AND ' + & // '( rap_devices.rid = rap_processes.device_rid ) AND ' + & // '( rap_sources.rid = rap_devices.source_rid ) AND ' + & // "( rap_activities.metric_code = 'DOWNSTRMDIS' ) " + & // ls_where_ref_code + & // ls_where_material + ' AND ' + & // '( rap_materials.airs_afs_DAT*User object for adding source group memberforward global type u_dw_group_src from u_dw_group end type end forward global type u_dw_group_src from u_dw_group end type global u_dw_group_src u_dw_group_src forward prototypes public subroutine uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row) public subroutine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row) public subroutine uf_retrieve_select_list (long p_parent_rid) end prototypes public subroutineDAT* uf_setitem_on_dw_group (long pl_cur_row, long pl_selected_row);dw_group.SetItem(pl_cur_row, "rap_sources_name", & dw_select_list.GetItemString(pl_selected_row, "name")) dw_group.SetItem(pl_cur_row, "rap_sources_code", & dw_select_list.GetItemString(pl_selected_row, "code")) dw_group.SetItem(pl_cur_row, "child_ref_rid", & dw_select_list.GetItemNumber(pl_selected_row, "rid")) dw_group.SetItem(pl_cur_row, "rap_sources_id", & dw_select_list.GetItemstring(pl_selected_row, "id")) dw_group.SDAT*etItem(pl_cur_row, & "parent_ref_rid", il_ref_rid) end subroutine public subroutine uf_setitem_on_dw_select_list (long pl_cur_row, long pl_selected_row);dw_select_list.SetItem(pl_cur_row, "name", & dw_group.GetItemString(pl_selected_row, "rap_sources_name")) dw_select_list.SetItem(pl_cur_row, "code", & dw_group.GetItemString(pl_selected_row, "rap_sources_code")) dw_select_list.SetItem(pl_cur_row, "rid", & dw_group.GetItemNumber(pl_selected_row, "child_ref_rid")) dw_select_list.SetItDAT*em(pl_cur_row, "id", & dw_group.GetItemstring(pl_selected_row, "rap_sources_id")) end subroutine public subroutine uf_retrieve_select_list (long p_parent_rid);// Purpose: Retrieve data for dw_select_list // Store sou_type into instance variable //is_sou_type = sou_type dw_select_list.SetTransObject(SQLCA) // Retrieve data for dw_select_list dw_select_list.Retrieve(p_parent_rid) end subroutine on u_dw_group_src.create call u_dw_group::create end on on u_dw_group_src.destDAT*roy call u_dw_group::destroy end on type pb_add from u_dw_group`pb_add within u_dw_group_src int X=1866 int Y=289 end type type pb_remove from u_dw_group`pb_remove within u_dw_group_src int X=1866 int Y=529 end type type st_group_member from u_dw_group`st_group_member within u_dw_group_src int X=2081 string Text="Source Group Member" end type type st_selection_list from u_dw_group`st_selection_list within u_dw_group_src string Text="Source Selection List" end type type DAT*dw_group from u_dw_group`dw_group within u_dw_group_src int X=2085 int Width=613 string DataObject="d_sou_group" end type type dw_select_list from u_dw_group`dw_select_list within u_dw_group_src int Width=1747 string DataObject="d_sou_names_for_group" end type type r_1 from u_dw_group`r_1 within u_dw_group_src int Width=1783 end type type r_2 from u_dw_group`r_2 within u_dw_group_src int X=2067 int Y=69 int Width=654 end type DAT*code IS NOT NULL ) AND ' + & // f_date_range('rap_activities', ldt_from, ldt_to) + ' AND ' + & // '( rap_activities.ref_rid IN ' + & // '( SELECT DISTINCT ref_rid FROM rap_activities ' + & // 'WHERE ' + ls_where_afs_segno + & // ' ) ' + & // ') ' + & // ls_sources + & // ls_where_state + & // ls_where_county // //if not (cbx_seg_pollutant_annual.Checked or cbx_seg_pollutant_sip.Checked) then // ls_sql_stmnt = ls_sql_stmnt + ' AND ( rap_activities.rid < 0 )' //end if DAT*// //if not f_create_view(ls_view, ls_sql_stmnt) then // return FALSE //end if // return TRUE end function public function boolean wf_check_required ();// This function checks if all required fields are entered before // generating report string ls_ref_code, ls_material SetPointer(HourGlass!) if Not (cbx_plant_general.Checked or cbx_mailing_label.Checked or & cbx_general_stack.Checked or cbx_general_point.Checked or & cbx_segment_general.Checked or cbx_seg_pollutant_annual.CDAT*hecked or & cbx_seg_pollutant_sip.Checked) then MessageBox(This.Title, 'No AIRS/AFS transaction is selected.~n' + & 'Please select one or more transactions to generate') cbx_plant_general.SetFocus() return FALSE end if if sle_report_file.Text = '' then MessageBox(This.Title, 'Sorry! Report File Name is required') sle_report_file.SetFocus() return FALSE end if if sle_log_file.Text = '' then MessageBox(This.Title, 'Sorry! Log File Name is required') sle_log_file.SetFocusDAT*() return FALSE end if if sle_trans_file.Text = '' then MessageBox(This.Title, 'Sorry! Transaction File Name is required') sle_trans_file.SetFocus() return FALSE end if if ddlb_mode.Text = '' then MessageBox(This.Title, 'Sorry! Operation Mode is required') ddlb_mode.SetFocus() return FALSE end if // Check to make sure from date is valid IF NOT IsDate(em_from_date.Text) THEN MessageBox(This.Title, "Sorry! From Date is Invalid") em_from_date.SetFocus() Return FDAT*ALSE END IF // Check to make sure to date is valid IF NOT IsDate(em_to_date.Text) THEN MessageBox(This.Title, "Sorry! End Date is Invalid") em_to_date.SetFocus() Return FALSE END IF // Check to make sure from date is before (or same as) to date IF DaysAfter( Date(em_from_date.Text), Date(em_to_date.Text) ) < 0 THEN MessageBox(This.Title, "From Date must be earlier than To Date") em_from_date.SetFocus() Return FALSE END IF if cbx_toxic.Checked then dw_toxic_gDAT*roup.AcceptText() ls_material = dw_toxic_group.GetItemString(1, 'material_code') if ls_material = '' or IsNull(ls_material) then MessageBox(This.Title, 'Sorry! Toxic Group is required') dw_toxic_group.SetFocus() return FALSE end if end if if cbx_criteria.Checked then dw_criteria_group.AcceptText() ls_material = dw_criteria_group.GetItemString(1, 'material_code') if ls_material = '' or IsNull(ls_material) then MessageBox(This.Title, 'Sorry! Criteria Group is required') DAT* dw_criteria_group.SetFocus() return FALSE end if end if if cbx_seg_pollutant_annual.Checked or cbx_seg_pollutant_sip.Checked then if Not (cbx_criteria.Checked or cbx_toxic.Checked)then MessageBox(This.Title, 'Sorry! Either Criteria Pollutants or ' + & 'Toxic Pollutants needs to be checked') cbx_criteria.SetFocus() return FALSE end if // Make it non-mandatory for now, 9/20/94 // ls_ref_code = dw_ref_code.GetItemString(1, 'ref_code') // if ls_ref_code = '' or IsNull(lsDAT*_ref_code) then // MessageBox(This.Title, 'Sorry! Reference Code is required') // dw_ref_code.SetFocus() // return FALSE // end if end if // Pass validation check return TRUE end function public subroutine wf_retrieve_county (long pl_parent_rid);string ls_orig_sql, ls_err, ls_new_sql // Modify sql statement of the child datawindow in dw_county dwc_county.SetTransObject(SQLCA) ls_orig_sql = dwc_county.Describe("datawindow.table.select") ls_new_sql = ls_orig_sql + ' AND (rap_DAT*geographic_locations.parent_rid = ' + & String(pl_parent_rid) + ')' ls_err = dwc_county.Modify("datawindow.table.select = ~"" + ls_new_sql + "~"") if ls_err <> '' then MessageBox('Modify failed', ls_err) return end if dwc_county.SetTransObject(SQLCA) dwc_county.Retrieve() // Change the sql statement of dwc back to the original sql statement ls_err = dwc_county.Modify("datawindow.table.select = ~"" + ls_orig_sql + "~"") if ls_err <> '' then MessageBox('Modify failed', ls_err) DAT*return end if end subroutine public function boolean wf_write_geiniprm_file (string ps_dsn, string ps_uid);// This function writes parameters to a file named GEINIPRM.TXT // in the userdir directory. The file is a multi line tab-delimited file. string ls_file, ls_write_line, ls_region, ls_ref_code, ls_criteria, & ls_toxic, ls_state, ls_county, ls_priority integer li_file_num long ll_state, ll_county SetPointer(HourGlass!) ls_file = is_userdir + '\geiniprm.txt' // Check to DAT*see if GEINIPRM.TXT already exists. If it exists, overwrite // the file if FileExists(ls_file) then li_file_num = FileOpen(ls_file, LineMode!, Write!, LockReadWrite!, & Replace!) // Otherwise, create the file else li_file_num = FileOpen(ls_file, LineMode!, Write!, LockReadWrite!, & Append!) end if // Error checking if li_file_num = -1 then MessageBox(Upper(ls_file), "Error opening file.", StopSign!) return FALSE end if // Write the parameters to the file // REJ 22FDAT*EB96 Added previous sysparm parameters if not f_write_line(li_file_num, ls_file, 'SAS DIRECTORY', is_sasdir) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SAS USERDIR', is_userdir) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'CONNECTION TYPE', SQLCA.dbms) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'DSN', ps_dsn) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'UID', ps_uid) then returDAT*Report window for QC checkerforward global type w_rpt_qc from Window end type type st_geo_level from statictext within w_rpt_qc end type type ddlb_geo_level from dropdownlistbox within w_rpt_qc end type type dw_ref_code from u_dddw within w_rpt_qc end type type dw_unit from u_dddw within w_rpt_qc end type type dw_county from u_dddw within w_rpt_qc end type type dw_metric from u_dddw within w_rpt_qc end type type dw_state from u_dddw within w_rpt_qc end type type dw_matrl_code fromDAT* u_dddw within w_rpt_qc end type type dw_str_code from u_dddw within w_rpt_qc end type type dw_pro_code from u_dddw within w_rpt_qc end type type dw_dev_code from u_dddw within w_rpt_qc end type type dw_src_code from u_dddw within w_rpt_qc end type type cbx_pro_scc from checkbox within w_rpt_qc end type type cbx_dev_sic from checkbox within w_rpt_qc end type type cbx_src_sic from checkbox within w_rpt_qc end type type cbx_county from checkbox within w_rpt_qc end type type dw_pro_DAT*scc from datawindow within w_rpt_qc end type type dw_dev_sic from datawindow within w_rpt_qc end type type dw_src_sic from datawindow within w_rpt_qc end type type dw_value_type from datawindow within w_rpt_qc end type type st_10 from statictext within w_rpt_qc end type type ddlb_level from dropdownlistbox within w_rpt_qc end type type st_9 from statictext within w_rpt_qc end type type em_lower from editmask within w_rpt_qc end type type em_upper from editmask within w_rpt_qc end DAT* type type st_8 from statictext within w_rpt_qc end type type st_7 from statictext within w_rpt_qc end type type em_column from editmask within w_rpt_qc end type type em_line from editmask within w_rpt_qc end type type cbx_state from checkbox within w_rpt_qc end type type cbx_outlier from checkbox within w_rpt_qc end type type cbx_long_plots from checkbox within w_rpt_qc end type type cbx_long_wo_plots from checkbox within w_rpt_qc end type type cbx_short from checkbox within w_rptDAT*p _qc end type type st_6 from statictext within w_rpt_qc end type type st_5 from statictext within w_rpt_qc end type type st_4 from statictext within w_rpt_qc end type type em_to_date from editmask within w_rpt_qc end type type em_from_date from editmask within w_rpt_qc end type type st_source_type from statictext within w_rpt_qc end type type ddlb_source_type from dropdownlistbox within w_rpt_qc end type type st_2 from statictext within w_rpt_qc end type type ddlb_mode from dropdoDAT* User object with location coordinate group and location coordinate information (master-detail style)forward global type u_dw_loc from UserObject end type type st_no_record_white from statictext within u_dw_loc end type type st_no_record_grey from statictext within u_dw_loc end type type dw_loc_detail from u_dw_list within u_dw_loc end type type dw_loc_master from u_dw_freeform within u_dw_loc end type type r_1 from rectangle within u_dw_loc end type type r_2 from rectangle within u_dwDAT* _loc end type end forward global type u_dw_loc from UserObject int Width=2888 int Height=961 boolean Border=true long BackColor=12632256 long PictureMaskColor=25166016 long TabTextColor=33554432 long TabBackColor=67108864 event highlight_dddw pbm_custom33 event filter pbm_custom02 st_no_record_white st_no_record_white st_no_record_grey st_no_record_grey dw_loc_detail dw_loc_detail dw_loc_master dw_loc_master r_1 r_1 r_2 r_2 end type global u_dw_loc u_dw_loc type variables DAT*  datawindow uidw_active datawindowchild idwc_dw_child string is_validation_table string is_column_name string is_old_value string is_msg_name string is_msg_text string is_child_name long il_selected_row string is_column_status = "valid" long il_ref_rid; string is_orig_sql; boolean ib_new_master; boolean ib_new_detail; boolean ib_delete; end variables forward prototypes public function boolean uf_save () public function boolean uf_check_required () public function boolean uf_chDAT* eck_pending () public subroutine uf_retrieve_dw_loc_detail () public subroutine uf_undo_dw_loc_detail () public subroutine uf_undo_dw_loc_master () public subroutine uf_retrieve_dw_loc_master (long ref_rid) public subroutine uf_check_master_rid () public subroutine uf_check_detail_rid () public subroutine uf_select_all (userobject uo_object) public subroutine uf_delete (datawindow dw_obj) public function long uf_cascade_del () public subroutine uf_select_one (string table_name) end protDAT* otypes on highlight_dddw;if il_selected_row > 0 then idwc_dw_child.SelectRow(il_selected_row, TRUE) end if end on event filter;integer curRow, totalRec string ls_total // Get total records and current row number before filtering totalRec = uidw_active.RowCount() curRow = uidw_active.GetRow() // Filter datawindow based on the criteria entered in w_filter uidw_active.SetFilter(gs_filt) uidw_active.Filter() if uidw_active.FilteredCount() = totalRec then MessageBox(uidw_aDAT* ctive.Title, "No rows match the selection criteria!", Information!) // Reselect all rows uidw_active.SetFilter('') uidw_active.Filter() uidw_active.ScrollToRow(curRow) uidw_active.TriggerEvent(Rowfocuschanged!) else // Turn total indicator on ls_total = "Total : " + String(uidw_active.RowCount() + uidw_active.FilteredCount()) uidw_active.Modify("total_index_t.Text='"+ls_total+"'") uidw_active.Modify("total_index_t.Color=RGB(red)") uidw_active.TriggerEvent(RowfocuschaDAT* nged!) end if end event public function boolean uf_save ();// This function saves data into rap_location_coordinate_groups and // rap_location_coordinates tables boolean bResult if Not (dw_loc_master.ib_obj_modified or dw_loc_detail.ib_obj_modified) then return TRUE if Not uf_check_required() then return FALSE SetMicroHelp(w_mdi_main, "Updating data...") bResult = TRUE if dw_loc_master.ib_obj_modified then uf_check_master_rid() if dw_loc_master.Update() = 1 then if dDAT* w_loc_detail.ib_obj_modified then uf_check_detail_rid() if dw_loc_detail.Update() = 1 then commit; else rollback; bResult = FALSE end if end if else rollback; bResult = FALSE end if elseif dw_loc_detail.ib_obj_modified then uf_check_detail_rid() if dw_loc_detail.Update() = 1 then commit; else rollback; bResult = FALSE end if end if // Reset modified and new record flags dw_loc_master.ib_obj_modified = FALSE dw_loc_detail.iDAT* b_obj_modified = FALSE ib_new_master = FALSE ib_new_detail = FALSE if bResult then SetMicroHelp(w_mdi_main, "Data updated successfully") return (bResult) end function public function boolean uf_check_required ();// This function performs the validation check long ll_cur_row, ll_total_row string ls_sub_type, ls_shape_type if dw_loc_master.AcceptText() < 0 then return false if dw_loc_detail.AcceptText() < 0 then return false if dw_loc_master.rowcount() > 0 then ll_cur_row = dDAT* w_loc_master.GetRow() ls_shape_type = dw_loc_master.GetItemString(ll_cur_row, "shape_type") if IsNull(ls_shape_type) or ls_shape_type = '' then MessageBox("DataWindow Error", "Sorry! Shape Type is required", Information!) dw_loc_master.SetFocus() dw_loc_master.SetRow(ll_cur_row) dw_loc_master.SetColumn("shape_type") dw_loc_master.ScrollToRow(ll_cur_row) return FALSE end if if isnull(dw_loc_master.getitemnumber(ll_cur_row, "ref_rid")) then dw_loc_master.SetItem(ll_cur_rowDAT* , "ref_rid", il_ref_rid) end if ll_total_row = dw_loc_detail.RowCount() for ll_cur_row = 1 to ll_total_row // Do the validation check on the dw_loc_detail if IsNull(dw_loc_detail.GetItemNumber(ll_cur_row, "sequence_no")) then MessageBox("DataWindow Error", "Sorry! Sequence No is required", Information!) dw_loc_detail.SetFocus() dw_loc_detail.SetRow(ll_cur_row) dw_loc_detail.SetColumn("sequence_no") dw_loc_detail.ScrollToRow(ll_cur_row) return FALSE DAT*  end if ls_sub_type = dw_loc_detail.GetItemString(ll_cur_row, "sub_type") if IsNull(ls_sub_type) or ls_sub_type = '' then MessageBox("DataWindow Error", "Sorry! Sub Type is required", Information!) dw_loc_detail.SetFocus() dw_loc_detail.SetRow(ll_cur_row) dw_loc_detail.SetColumn("sub_type") dw_loc_detail.ScrollToRow(ll_cur_row) return FALSE end if next end if return TRUE end function public function boolean uf_check_pending ();integer li_messagDAT* ebox_return // Have any modifications been made to the datawindows if dw_loc_master.ib_obj_modified or dw_loc_detail.ib_obj_modified then li_messagebox_return = MessageBox("Location View", & "Data have been modified in the location view.~nSave current changes?", Question!, YesNo!) choose case (li_messagebox_return) case 1 if Not uf_save() then return FALSE end if case 2 // Undo the changes uf_undo_dw_loc_master() uf_undo_dw_loc_detail() // Reset modified DAT* flag dw_loc_master.ib_obj_modified = FALSE dw_loc_detail.ib_obj_modified = FALSE ib_new_master = FALSE ib_new_detail = FALSE // case 3 // return FALSE end choose end if return TRUE end function public subroutine uf_retrieve_dw_loc_detail ();// Purpose: retrieve data for dw_loc_detail long ll_group_rid if dw_loc_master.RowCount() = 0 or & dw_loc_master.GetRow() <= 0 then return ll_group_rid = dw_loc_master.GetItemNumber(dw_loc_master.GetRow(), "rid") // DAT* Move to constructor event. swj, 8/16/94 //dw_loc_detail.SetTransObject(SQLCA) // Retrieve data for dw_loc_detail dw_loc_detail.Retrieve(ll_group_rid) end subroutine public subroutine uf_undo_dw_loc_detail ();// This function uses dwGetNextModified to check if any row is modified. // If found, undo the changes by using ReselectRow function long rowNum, totalRow dw_loc_detail.AcceptText() totalRow = dw_loc_detail.RowCount() rowNum = 0 // For primary buffer do while rowNum <=DAT*"  totalRow rowNum = dw_loc_detail.GetNextModified(rowNum, Primary!) if rowNum > 0 then if dw_loc_detail.GetItemStatus(rowNum, 0, Primary!) = NewModified! then dw_loc_detail.DeleteRow(rowNum) else dw_loc_detail.ReselectRow(rowNum) end if else rowNum = totalRow + 1 end if loop // For filter buffer do while rowNum <= totalRow rowNum = dw_loc_detail.GetNextModified(rowNum, Filter!) if rowNum > 0 then if dw_loc_detail.GetItemStatus(rowNum, 0, Filter!) = NewDAT*$ Modified! then dw_loc_detail.DeleteRow(rowNum) else dw_loc_detail.ReselectRow(rowNum) end if else rowNum = totalRow + 1 end if loop end subroutine public subroutine uf_undo_dw_loc_master ();// This function checks if the current row is modified or new. // If new, delete the current row; otherwise, undo the changes by // using ReselectRow function dw_loc_master.AcceptText() if ib_new_master then dw_loc_master.DeleteRow(dw_loc_master.GetRow()) else dw_locDAT*& _master.ReselectRow(dw_loc_master.GetRow()) end if uf_retrieve_dw_loc_detail() end subroutine public subroutine uf_retrieve_dw_loc_master (long ref_rid);// Purpose: Retrieve data for dw_loc_master // Store ref_rid into instance variable il_ref_rid = ref_rid dw_loc_master.SetTransObject(SQLCA) // Retrieve data for dw_loc_master dw_loc_master.Retrieve(il_ref_rid) //dw_loc_master.SetFocus() end subroutine public subroutine uf_check_master_rid ();// This function calls dataDAT*( base-dependent function to get the sequence // number for the rid on the master datawindow long ll_cur_row, ll_rid_num if dw_loc_master.rowcount() > 0 then ll_cur_row = dw_loc_master.GetRow() if IsNull(dw_loc_master.GetItemNumber(ll_cur_row, "rid")) then // Select the next available rid from the rid_storage in database ll_rid_num = f_get_sequence() if ll_rid_num = -1 then return end if dw_loc_master.SetItem(ll_cur_row, "rid", ll_rid_num) end if end if end subrDAT** outine public subroutine uf_check_detail_rid ();// This function gets the sequence number for the rid on the detail // datawindow long ll_row_num, ll_cur_row, ll_rid_num // Get the rid of the master datawindow ll_rid_num = dw_loc_master.GetItemNumber(dw_loc_master.GetRow(), "rid") ll_row_num = dw_loc_detail.RowCount() for ll_cur_row = 1 to ll_row_num // If the rid attribute is null, this means the row is a new inserted row if IsNull(dw_loc_detail.GetItemNumber(ll_cur_row, "DAT*, group_rid")) then dw_loc_detail.SetItem(ll_cur_row, "group_rid", ll_rid_num) end if next end subroutine public subroutine uf_select_all (userobject uo_object);//uo_name.triggerevent("unfilter") long ll_selected_row uidw_active.SetFilter('') uidw_active.Filter() // Unhighlighted the clicked row before unfiltering ll_selected_row = uidw_active.GetSelectedRow(0) uidw_active.SelectRow(ll_selected_row, FALSE) uidw_active.TriggerEvent(Rowfocuschanged!) // Turn total indiDAT*. cator off by changing the color to transparent uidw_active.Modify("total_index_t.Text='' total_index_t.Color=553648127") end subroutine public subroutine uf_delete (datawindow dw_obj);// This function will validate the delete, delete the current row. // If there are any child records, it will prompt the user and stop the // deletion (because the cascade deleting is not implemented yet); // otherwise, it deletes the record and does an automatic // update to the database. int nCntDAT*0  = 0 ib_delete = FALSE If MessageBox("Location", "You are about to delete this record.~r~n" + & "Are you sure?", Exclamation!, YesNo!, 2) <> 1 then return end if SetPointer(HourGlass!) w_mdi_main.SetMicroHelp("Validate the delete...") dw_obj.TriggerEvent("delete_row") if not ib_delete then return // If this is a location group, then delete all locations nCnt = uf_cascade_del() if nCnt < 0 then return // user changed his or her mind if dw_obj.DeleteRow(0) = 1 then // UpDAT*2 date the data if dw_obj.Update(TRUE, FALSE) = 1 then commit; dw_obj.ResetUpdate() w_mdi_main.SetMicroHelp("Row deleted successfully.") dw_obj.TriggerEvent(Rowfocuschanged!) else rollback; w_mdi_main.SetMicroHelp("Row not deleted.") end if else MessageBox("Location", "Could not delete row.") end if end subroutine public function long uf_cascade_del ();string szWinName long nRid long nCnt int nInd szWinName = uidw_active.DataObject if szWinName = "d_lDAT*4 oc_coord_group" then nRid = uidw_active.GetItemNumber(uidw_active.GetRow(), "RID") // Get the count of records involved nCnt = f_del_recs(nRid, "d_loc_coord", FALSE) // Get user verification if more than one record if nCnt > 0 then nInd = MessageBox("Location Groups", "Deleting this record will also delete " & + String(nCnt) + " child records.~r~nDo you want to continue?", & Question!, YesNo!, 2) else nInd = 1 end if if nInd = 1 then DAT*6  nCnt = f_del_recs(nRid, "d_loc_coord", TRUE) else nCnt = -1 // User said no end if end if return nCnt end function public subroutine uf_select_one (string table_name);SetPointer(HourGlass!) // Open the filter window with parameter - table name openwithparm(w_filter, table_name) // If filter flag is set to true, then trigger the filter event to perform // filter if gb_filter then gb_filter = FALSE This.TriggerEvent("filter") end if end subroutine DAT*8  on u_dw_loc.create this.st_no_record_white=create st_no_record_white this.st_no_record_grey=create st_no_record_grey this.dw_loc_detail=create dw_loc_detail this.dw_loc_master=create dw_loc_master this.r_1=create r_1 this.r_2=create r_2 this.Control[]={ this.st_no_record_white,& this.st_no_record_grey,& this.dw_loc_detail,& this.dw_loc_master,& this.r_1,& this.r_2} end on on u_dw_loc.destroy destroy(this.st_no_record_white) destroy(this.st_no_record_grey) destroy(this.dw_loc_dDAT*: etail) destroy(this.dw_loc_master) destroy(this.r_1) destroy(this.r_2) end on type st_no_record_white from statictext within u_dw_loc int X=726 int Y=644 int Width=1476 int Height=71 boolean Visible=false boolean Enabled=false string Text="No records present. Use Insert to create a new record." Alignment Alignment=Center! boolean FocusRectangle=false long TextColor=8388608 long BackColor=16777215 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFDAT*< amily=Swiss! FontPitch FontPitch=Variable! end type type st_no_record_grey from statictext within u_dw_loc int X=726 int Y=177 int Width=1476 int Height=71 boolean Visible=false boolean Enabled=false string Text="No records present. Use Insert to create a new record." Alignment Alignment=Center! boolean FocusRectangle=false long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPDAT*> itch=Variable! end type type dw_loc_detail from u_dw_list within u_dw_loc event select_one pbm_custom21 event select_all pbm_custom22 event save pbm_custom23 event validate_delete pbm_custom24 int X=36 int Y=420 int Width=2792 int Height=493 int TabOrder=20 string DataObject="d_loc_coord" boolean HScrollBar=false boolean HSplitScroll=false end type on select_one;call u_dw_list::select_one;//uf_check_pending() if uf_check_pending() then uf_select_one("rap_location_coordinateDAT*@ s") end if end on on select_all;call u_dw_list::select_all;//uf_check_pending() if uf_check_pending() then uf_select_all(parent) end if end on on save;call u_dw_list::save;uf_save() end on on validate_delete;call u_dw_list::validate_delete;uf_delete(This) end on on constructor;call u_dw_list::constructor;This.SetTransObject(SQLCA) end on on add_row;call u_dw_list::add_row;// User Event: add_row // Purpose: This event gets triggered when this datawindow is focus and // DAT*B  the user click on the insert menu item. // If there is no row in the master table, do not allow user to insert // any row in the detail table. if dw_loc_master.RowCount() = 0 then MessageBox("Insert", "Please provide location group information first") dw_loc_master.SetFocus() return elseif IsNull(dw_loc_master.GetItemNumber(dw_loc_master.GetRow(), "rid")) then MessageBox("Insert", "Please save location group information first") dw_loc_master.SetFocus() return end if st_noDAT*D _record_white.Hide() This.InsertRow(This.GetRow()) This.ScrollPriorRow() ib_new_detail = TRUE end on on rowfocuschanged;call u_dw_list::rowfocuschanged;if This.RowCount() = 0 then // Display no record message st_no_record_white.Show() else st_no_record_white.Hide() end if end on on retrieveend;call u_dw_list::retrieveend;if This.RowCount() = 0 then // Display no record message st_no_record_white.Show() else st_no_record_white.Hide() end if end on on delete_roDAT*F w;call u_dw_list::delete_row;// Set ib_delete to true in case there is not code in the descendent // the descendent is expected to do what ever validation is required // and then set ib_delete to true or false as required ib_delete = TRUE end on on first_row;call u_dw_list::first_row;This.ScrollToRow(1) end on on getfocus;call u_dw_list::getfocus;window lw_active_sheet string lw_active_sheet_name // Put green focus around this datawindow r_2.Show() // Get current active sheet foDAT*H r this mdi frame lw_active_sheet = w_mdi_main.GetActiveSheet() // Get the name assigned to this active sheet lw_active_sheet_name = lw_active_sheet.ClassName() // Make this datawindow the active datawindow in that sheet choose case lw_active_sheet_name case "w_geo" w_geo.idw_active = This case "w_source" w_source.idw_active = This case "w_device" w_device.idw_active = This end choose uidw_active = this end on on losefocus;call u_dw_list::losefocus;// Hide the greDAT*J en focus r_2.Hide() end on on mousemove;call u_dw_list::mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on on last_row;call u_dw_list::last_row;This.ScrollToRow(This.RowCount()) end on on next_row;call u_dw_list::next_row;This.ScrollNextRow() end on on prev_row;call u_dw_list::prev_row;This.ScrollPriorRow() end on type dw_loc_master from u_dw_freeform within u_dw_loc event select_one pbm_custom21 event select_all pbm_custom22 event save pbm_custom23 event dwescape pbm_dweDAT*L scape event validate_delete pbm_custom24 event dwnkey pbm_dwnkey int X=36 int Y=33 int Width=2792 int Height=349 int TabOrder=10 string DataObject="d_loc_coord_group" boolean Border=true BorderStyle BorderStyle=StyleLowered! end type on select_one;call u_dw_freeform::select_one;//uf_check_pending() if uf_check_pending() then uf_select_one("rap_location_coordinate_groups") end if end on on select_all;call u_dw_freeform::select_all;//uf_check_pending() if uf_check_pending()DAT*N  then uf_select_all(parent) end if end on on save;call u_dw_freeform::save;uf_save() end on on dwescape;call u_dw_freeform::dwescape;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, is_old_value) f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) Parent.PostEvent("highlight_dddw") end if end if //if is_column_name = "accuracy_type" or is_cDAT*P olumn_name = "calculation_type" then // dw_loc_master.setitem(dw_loc_master.getrow(), is_column_name, is_old_value) // f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // Parent.PostEvent("highlight_dddw") //end if end on on validate_delete;call u_dw_freeform::validate_delete;uf_delete(This) end on on dwnkey;call u_dw_freeform::dwnkey;string ls_col_name if keydown(keytab!) then if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name DAT*R = is_column_name then this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if end if end on on rowfocuschanged;call u_dw_freeform::rowfocuschanged;// Only retrieve detail record when there are any master records // Otherwise, clean the contents of dw_loc_detail if This.RowCount() > 0 then st_no_record_grey.Hide() // Call this function to retrieve data for dw_loc_detail uf_retrieve_dw_loc_detail() elsDAT*T e st_no_record_grey.Show() dw_loc_detail.Reset() end if end on on add_row;call u_dw_freeform::add_row;long nRow if uf_check_pending() then st_no_record_grey.Hide() nRow = This.InsertRow(This.GetRow()) This.ScrollPriorRow() // Set the radio button to Point This.SetItem(nRow, "rap_location_coordinate_groups_shape_typ", "P") // This.TriggerEvent(Rowfocuschanged!) commented out by swj, 8/15/94 ib_obj_modified = TRUE ib_new_master = TRUE if isnull(this.getitemnumbeDAT*V r(this.getrow(), "ref_rid")) then this.SetItem(this.getrow(), "ref_rid", il_ref_rid) end if end if end on on delete_row;call u_dw_freeform::delete_row;// Set ib_delete to true in case there is not code in the descendent // the descendent is expected to do what ever validation is required // and then set ib_delete to true or false as required ib_delete = TRUE end on event itemfocuschanged;call super::itemfocuschanged;string ls_col_name ls_col_name = This.GetColumnName() DAT*X // if ls_col_name <> is_column_name then // if is_column_name = "accuracy_type" or is_column_name = "calculation_type" then // if is_column_status <> "valid" then // MessageBox(is_msg_name, is_msg_text) // this.setcolumn(is_column_status) // return // end if // end if // end if //if ls_col_name = "mode_type" or ls_col_name = "group_type" then // f_retrieve_codes(.Title, dw_loc_master, ls_col_name, "type") //elseif ls_col_name = "code" or ls_coDAT*Z l_name = "primary_material_code" or & // ls_col_name = "weekly_schedule_code" or ls_col_name = "daily_schedule_code" then // f_retrieve_codes(Parent.Title, dw_loc_master, ls_col_name, "code") //end if // if ls_col_name = "accuracy_type" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_accuracy_methods" is_msg_name = "Column - Accuracy Type" is_msg_text = "Sorry! Not a valid DAT*\ accuracy method" is_old_value = dw_loc_master.getitemstring(dw_loc_master.getrow(), ls_col_name) elseif ls_col_name = "calculation_type" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_coordinate_calc_types" is_msg_name = "Column - Calculation Type" is_msg_text = "Sorry! Not a valid calculation type" is_old_value = dw_loc_master.getitemstring(dw_loc_master.getrow(), ls_col_name)DAT*^  else is_column_name = "" end if end event on retrieveend;call u_dw_freeform::retrieveend;// Only retrieve detail record when there are any master records // Otherwise, clean the contents of dw_loc_detail if This.RowCount() > 0 then st_no_record_grey.Hide() // Call this function to retrieve data for dw_loc_detail uf_retrieve_dw_loc_detail() else // This.InsertRow(0) // Display no record message st_no_record_grey.Show() // ib_new_master = TRUE dw_loc_detail.RDAT*` eset() end if end on on getfocus;call u_dw_freeform::getfocus;window lw_active_sheet string lw_active_sheet_name // Put green focus around this datawindow r_1.Show() // Get current active sheet for this mdi frame lw_active_sheet = w_mdi_main.GetActiveSheet() // Get the name assigned to this active sheet lw_active_sheet_name = lw_active_sheet.ClassName() // Make this datawindow the active datawindow in that sheet choose case lw_active_sheet_name case "w_geo" w_geo.idw_acDAT*b tive = This case "w_source" w_source.idw_active = This case "w_device" w_device.idw_active = This end choose uidw_active = this end on on mousemove;call u_dw_freeform::mousemove;//string objNameStr, objName // //objNameStr = This.dwGetObjectAtPointer() //objName = Left(objNameStr, Pos(objNameStr, "~t") - 1) SetMicroHelp(w_mdi_main, This.Tag) //Parent.Title = wTitle + " - " + This.Tag end on on last_row;call u_dw_freeform::last_row;if uf_check_pending() then This.SDAT*d crollToRow(This.RowCount()) end if end on on losefocus;call u_dw_freeform::losefocus;// Hide the green focus r_1.Hide() end on on first_row;call u_dw_freeform::first_row;if uf_check_pending() then This.ScrollToRow(1) end if end on on prev_row;call u_dw_freeform::prev_row;if uf_check_pending() then This.ScrollPriorRow() end if end on on next_row;call u_dw_freeform::next_row;if uf_check_pending() then This.ScrollNextRow() end if end on on editchanged;call u_dw_freefDAT*f orm::editchanged;string ls_col_name ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) if il_selected_row > 0 then Parent.PostEvent("highlight_dddw") end if end if //string ls_col_name // // if is_column_name = "accuracy_type" or is_column_name = "calculation_type" then // il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // /DAT*h / After the f_dddw_search function has concluded the highlight the // // correct row in the dddw, post an event to the window because it is // // incorrect to create any event on a datawindow that maps to pbm_custom??. // Parent.PostEvent("highlight_dddw") // end if //ls_col_name = This.GetColumnName() //if ls_col_name = "accuracy_type" or ls_col_name = "calculation_type" then // if Not f_validate_code(This.GetText(), is_child_name, is_validation_table) then // is_column_statDAT*j us = ls_col_name // else // is_column_status = "valid" // end if //else // is_column_status = "valid" //end if end on event dwnprocessenter;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if //if il_selected_row <> 0 then //if is_column_name = "accuracy_type" or is_columDAT*l n_name = "calculation_type" then // //f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // dw_loc_master.setitem(dw_loc_master.getrow(), is_column_name, & // idwc_dw_child.getitemstring(il_selected_row, is_child_name)) //// dw_loc_master.triggerevent(editchanged!) //end if //end if // dw_loc_master.triggerevent(editchanged!) Send(Handle(This), 256, 9, Long(0,0)) return 1 end event event itemerror;call super::itemerror;return 2 end event event itemchangedDAT*n ;call super::itemchanged;string ls_col_name ls_col_name = This.GetColumnName() if ls_col_name = is_column_name then if Not f_validate_code(This.GetText(), is_child_name, is_validation_table) then MessageBox(is_msg_name, is_msg_text) return 1 end if end if end event type r_1 from rectangle within u_dw_loc int X=22 int Y=20 int Width=2827 int Height=375 boolean Visible=false boolean Enabled=false int LineThickness=13 long LineColor=32768 long FillColor=32768 end tDAT*ype type r_2 from rectangle within u_dw_loc int X=22 int Y=407 int Width=2827 int Height=519 boolean Visible=false boolean Enabled=false int LineThickness=17 long LineColor=32768 long FillColor=32768 end type DAT*r wnlistbox within w_rpt_qc end type type cb_browse_2 from commandbutton within w_rpt_qc end type type cb_browse_1 from commandbutton within w_rpt_qc end type type sle_log_file from singlelineedit within w_rpt_qc end type type sle_output_file from singlelineedit within w_rpt_qc end type type st_rpt_msg from statictext within w_rpt_qc end type type cb_close from commandbutton within w_rpt_qc end type type cb_generate from commandbutton within w_rpt_qc end type type gb_3 from groupbox DAT*t within w_rpt_qc end type type gb_6 from groupbox within w_rpt_qc end type type gb_2 from groupbox within w_rpt_qc end type type gb_1 from groupbox within w_rpt_qc end type end forward global type w_rpt_qc from Window int X=11 int Y=17 int Width=2937 int Height=1585 boolean TitleBar=true string Title="QC Checker" long BackColor=12632256 boolean ControlMenu=true boolean MinBox=true boolean MaxBox=true boolean Resizable=true string Icon="QCCHECK.ICO" event highlight_dddw pbm_cDAT*v ustom01 st_geo_level st_geo_level ddlb_geo_level ddlb_geo_level dw_ref_code dw_ref_code dw_unit dw_unit dw_county dw_county dw_metric dw_metric dw_state dw_state dw_matrl_code dw_matrl_code dw_str_code dw_str_code dw_pro_code dw_pro_code dw_dev_code dw_dev_code dw_src_code dw_src_code cbx_pro_scc cbx_pro_scc cbx_dev_sic cbx_dev_sic cbx_src_sic cbx_src_sic cbx_county cbx_county dw_pro_scc dw_pro_scc dw_dev_sic dw_dev_sic dw_src_sic dw_src_sic dw_value_type dw_value_type st_10 sDAT*x t_10 ddlb_level ddlb_level st_9 st_9 em_lower em_lower em_upper em_upper st_8 st_8 st_7 st_7 em_column em_column em_line em_line cbx_state cbx_state cbx_outlier cbx_outlier cbx_long_plots cbx_long_plots cbx_long_wo_plots cbx_long_wo_plots cbx_short cbx_short st_6 st_6 st_5 st_5 st_4 st_4 em_to_date em_to_date em_from_date em_from_date st_source_type st_source_type ddlb_source_type ddlb_source_type st_2 st_2 ddlb_mode ddlb_mode cb_browse_2 cb_browse_2 cb_browse_1 cb_browse_1DAT*z  sle_log_file sle_log_file sle_output_file sle_output_file st_rpt_msg st_rpt_msg cb_close cb_close cb_generate cb_generate gb_3 gb_3 gb_6 gb_6 gb_2 gb_2 gb_1 gb_1 end type global w_rpt_qc w_rpt_qc type variables string is_short = 'O' string is_long_plots = 'O' string is_long_wo_plots = 'O' string is_outlier = 'O' string is_sasdir string is_userdir boolean ib_sas_run datawindowchild idwc_state datawindowchild idwc_county datawindowchild idwc_metric string is_orig_select stDAT*| ring is_material_flg string is_metric_name end variables forward prototypes public function boolean wf_create_view () public function boolean wf_check_required () public subroutine wf_retrieve_county (long pl_parent_rid) public subroutine wf_show_dddw (datawindow pdw_obj) public function boolean wf_write_qcparm_file (string ps_dsn, string ps_uid) end prototypes on highlight_dddw;//if il_selected_row > 0 then // idwc_dw_child.SelectRow(il_selected_row, TRUE) //end if end on puDAT*~ blic function boolean wf_create_view ();//// purpose: Creates a permanent view to be accessed by the User Interface //// when creating the setup to generate qc checker in SAS. // //string ls_view_attrib, ls_result_set, ls_table_list, & // ls_where_clause, ls_sql_stmnt, & // ls_src_code, ls_dev_code, ls_pro_code, ls_src_sic, ls_dev_sic, & // ls_pro_scc, ls_str_code, ls_matrl_code, ls_and_in_where, & // ls_metric_code, ls_ref_code, ls_where_ref_code, ls_meas_code, & // ls_unit_codDAT* e // //long ll_cur_row, ll_state, ll_county //datetime ldt_from, ldt_to // //SetPointer(HourGlass!) // ////is_group_by = '' // //// First, construct based statements. The sql statement is constructed //// from bottom to top in order to utilize oracle optimizer (version 6) // //// Retrieve unit code (if valid) and perform unit conversion of the value_amt //// in rap_activities to the desired units // //idwc_metric.SetTransObject(SQLCA) //ll_cur_row = idwc_metric.GetRow() //ls_measDAT* _code = idwc_metric.GetItemString(ll_cur_row, 'meas_code') // //if Not (IsNull(ls_meas_code) or ls_meas_code = '') then // ls_unit_code = dw_unit.GetItemString(1, 'unit_code') //end if // //if Not (IsNull(ls_unit_code) or ls_unit_code = '') then // ls_result_set = & // 'rap_activities.value_amt * ' + & // 'rap_units_a.conversion_factor_amt / ' + & // 'rap_units_b.conversion_factor_amt ' // // ls_table_list = & // 'rap_activities, rap_metrics, rap_units AS rap_units_a, ' + & // 'DAT* rap_units AS rap_units_b' // // ls_where_clause = & // '( rap_activities.metric_code = rap_metrics.code ) AND ' + & // '( rap_metrics.meas_code = rap_units_a.meas_code ) AND ' + & // '( rap_metrics.meas_code = rap_units_b.meas_code ) AND ' + & // '( rap_units_a.code = rap_activities.value_unit_code ) AND ' + & // "( rap_units_b.code = '" + ls_unit_code + "' ) AND " //else // ls_result_set = 'rap_activities.value_amt' // ls_table_list = 'rap_activities' // ls_where_clause = "" //eDAT* nd if // //ls_view_attrib = 'value )' // //// Stream level //if ddlb_level.Text = 'Stream' then // // ls_view_attrib = 'matrl_cd, strm_id, ' + ls_view_attrib // ls_result_set = & // 'rap_activities.material_code, rap_streams.id, ' + ls_result_set // ls_table_list = ls_table_list + ', rap_streams' // // // Get reference code // ls_ref_code = dw_ref_code.GetItemString(1, 'ref_code') // if Not (IsNull(ls_ref_code) or ls_ref_code = '') then // ls_where_ref_code = "( rap_activities.refDAT* erence_code = '" + & // ls_ref_code + "' ) AND " // else // ls_where_ref_code = "( rap_activities.reference_code IS NULL ) AND " // end if // // ls_where_clause = ls_where_clause + ls_where_ref_code + & // '( rap_activities.ref_rid = rap_streams.rid )' + & // ' AND ( rap_streams.from_process_rid = rap_processes.rid )' //// + ' OR rap_streams.to_process_rid = rap_processes.rid )' // ls_and_in_where = ' AND ' // //end if // //// Process or stream level // //if ddlb_level.Text = DAT* 'Process' or ddlb_level.Text = 'Stream' then // // if cbx_pro_scc.Checked then // ls_view_attrib = 'scc_ams, ' + ls_view_attrib // ls_result_set = 'rap_processes.scc_ams_code, ' + ls_result_set // end if // // ls_view_attrib = 'proc_id, ' + ls_view_attrib // ls_result_set = 'rap_processes.id, ' + ls_result_set // ls_table_list = ls_table_list + ', rap_processes' // if ddlb_level.Text = 'Process' then // ls_where_clause = ls_where_clause + & // '( rap_activities.ref_rid = rap_proDAT* cesses.rid ) AND ' // end if // ls_where_clause = ls_where_clause + ls_and_in_where + & // '( rap_processes.device_rid = rap_devices.rid )' // ls_and_in_where = ' AND ' // //end if // //// Device, process or stream level // //if ddlb_level.Text = 'Device' or ddlb_level.Text = 'Process' or & // ddlb_level.Text = 'Stream' then // // if cbx_dev_sic.Checked then // ls_view_attrib = 'dev_sic, ' + ls_view_attrib // ls_result_set = 'rap_devices.sic_code, ' + ls_result_set // end if //DAT*  // ls_view_attrib = 'dev_id, ' + ls_view_attrib // ls_result_set = 'rap_devices.id, ' + ls_result_set // ls_table_list = ls_table_list + ', rap_devices' // if ddlb_level.Text = 'Device' then // ls_where_clause = ls_where_clause + & // '( rap_activities.ref_rid = rap_devices.rid ) AND ' // end if // ls_where_clause = ls_where_clause + ls_and_in_where + & // '( rap_devices.source_rid = rap_sources.rid )' // ls_and_in_where = ' AND ' // //end if // //if cbx_src_sic.Checked then //DAT*  ls_view_attrib = 'src_sic, ' + ls_view_attrib // ls_result_set = 'rap_sources.sic_code, ' + ls_result_set //end if // //// Always include the following in the sql statement // //ls_view_attrib = '( state, county, src_id, src_name, ' + ls_view_attrib // //ls_result_set = 'rap_geographic_locations_b.name, ' + & // 'rap_geographic_locations_a.name, rap_sources.id, rap_sources.name, ' + & // ls_result_set // // //ls_table_list = ls_table_list + ', rap_sources' + & // ', rap_geographic_lDAT* ocations AS rap_geographic_locations_a' + & // ', rap_geographic_locations AS rap_geographic_locations_b' // //if ddlb_level.Text = 'Source' then // ls_where_clause = ls_where_clause + & // '( rap_activities.ref_rid = rap_sources.rid ) AND ' //end if //ls_where_clause = ls_where_clause + ls_and_in_where + & // '( rap_geographic_locations_a.rid = ' + & // 'rap_sources.geographic_county_rid ) AND ' + & // '( rap_geographic_locations_b.rid = ' + & // 'rap_geographic_locations_a.parent_ridDAT*  ) ' // ////if cbx_group_by.Checked then //// is_group_by = ls_result_set //// ls_group_by_stmnt = ' GROUP BY ' + ls_result_set ////end if // //// Build more restrictions // //// ls_where_clause = ls_where_clause + ' AND ( rap_activities.value_amt IS NOT NULL )' // //ls_metric_code = dw_metric.GetItemString(1, 'code') //if Not (IsNull(ls_metric_code) or ls_metric_code = '') then // ls_where_clause = ls_where_clause + & // " AND ( rap_activities.metric_code = '" + ls_metric_code + "DAT* ' )" //end if // //// Get from and to dates //ldt_from = DateTime(Date(em_from_date.Text)) //ldt_to = DateTime(Date(em_to_date.Text)) //ls_where_clause = ls_where_clause + & // " AND " + f_date_range('rap_activities', ldt_from, ldt_to) // //if ddlb_level.Text = 'Stream' then // // ls_matrl_code = dw_matrl_code.GetItemString(1, 'code') // if Not (IsNull(ls_matrl_code) or ls_matrl_code = '') then // ls_where_clause = ls_where_clause + & // " AND ( rap_activities.material_code = '" DAT* + ls_matrl_code + "' )" // end if // // ls_str_code = dw_str_code.GetItemString(1, 'code') // if Not (IsNull(ls_str_code) or ls_str_code = '') then // ls_where_clause = ls_where_clause + & // " AND ( rap_streams.code = '" + ls_str_code + "' )" // end if // //end if // //if ddlb_level.Text = 'Process' or ddlb_level.Text = 'Stream' then // // ls_pro_code = dw_pro_code.GetItemString(1, 'code') // if Not (IsNull(ls_pro_code) or ls_pro_code = '') then // ls_where_clause = ls_where_clDAT* ause + & // " AND ( rap_processes.code = '" + ls_pro_code + "' )" // end if // // ls_pro_scc = dw_pro_scc.GetItemString(1, 'scc_ams') // if Not (IsNull(ls_pro_scc) or ls_pro_scc = '') then // ls_where_clause = ls_where_clause + & // " AND ( rap_processes.scc_ams_code = '" + ls_pro_scc + "' )" // end if // //end if // //if ddlb_level.Text = 'Device' or ddlb_level.Text = 'Process' or & // ddlb_level.Text = 'Stream' then // // ls_dev_code = dw_dev_code.GetItemString(1, 'code') //DAT*  if Not (IsNull(ls_dev_code) or ls_dev_code = '') then // ls_where_clause = ls_where_clause + & // " AND ( rap_devices.code = '" + ls_dev_code + "' )" // end if // // ls_dev_sic = dw_dev_sic.GetItemString(1, 'device_sic') // if Not (IsNull(ls_dev_sic) or ls_dev_sic = '') then // ls_where_clause = ls_where_clause + & // " AND ( rap_devices.sic_code = '" + ls_dev_sic + "' )" // end if // //end if // //ls_src_code = dw_src_code.GetItemString(1, 'code') //if Not (IsNull(ls_src_codeDAT* ) or ls_src_code = '') then // ls_where_clause = ls_where_clause + & // " AND ( rap_sources.code = '" + ls_src_code + "' )" //end if //ls_src_sic = dw_src_sic.GetItemString(1, 'source_sic') //if Not (IsNull(ls_src_sic) or ls_src_sic = '') then // ls_where_clause = ls_where_clause + & // " AND ( rap_sources.sic_code = '" + ls_src_sic + "' )" //end if // //// Get county // //ll_county = idwc_county.GetItemNumber(idwc_county.GetRow(), 'rid') //if Not (IsNull(ll_county) or ll_county = 0DAT* ) then // ls_where_clause = ls_where_clause + & // " AND ( rap_geographic_locations_a.rid = " + String(ll_county) + ")" //end if // //// Get state // //ll_state = idwc_state.GetItemNumber(idwc_state.GetRow(), 'rid') //if Not (IsNull(ll_state) or ll_state = 0) then // ls_where_clause = ls_where_clause + & // " AND ( rap_geographic_locations_b.rid = " + String(ll_state) + ")" //end if // // //// Drop the old view first // //ls_sql_stmnt = 'DROP VIEW vrap_sas_qc_checker' //EXECUTE DAT* IMMEDIATE :ls_sql_stmnt; // // //// Construct all parts of the sql statements together // ////ls_sql_stmnt = 'CREATE VIEW vrap_sas_qc_checker ' + ls_view_attrib + & //// ' AS SELECT ' + ls_result_set + ' FROM ' + ls_table_list + & //// ' WHERE ' + ls_where_clause + ls_group_by_stmnt //ls_sql_stmnt = 'CREATE VIEW vrap_sas_qc_checker ' + ls_view_attrib + & // ' AS SELECT ' + ls_result_set + ' FROM ' + ls_table_list + & // ' WHERE ' + ls_where_clause // //// Create the view // //EXECUTEDAT*  IMMEDIATE :ls_sql_stmnt; //if f_db_error(SQLCA, "Fail on creating view vrap_sas_qc_checker. Contact " + & // "your technical support") = 1 then // return FALSE //end if // return TRUE end function public function boolean wf_check_required ();// This function checks if all required fields are entered before // generating report string ls_unit, ls_metric, ls_value_type, ls_material, ls_meas_code long ll_cur_row SetPointer(HourGlass!) if is_short = 'O' and is_long_plots = 'O' aDAT* nd is_long_wo_plots = 'O' and & is_outlier = 'O' then MessageBox(This.Title, 'No report is selected.~nPlease select ' + & 'one or more reports to generate') cbx_long_plots.SetFocus() return FALSE end if // Check to make sure lower percentile is less than upper percentile if Integer(em_lower.Text) > Integer(em_upper.Text) then MessageBox(This.Title, "The lower Percentile must be less than the " + & "Upper Percentile") em_lower.SetFocus() Return FALSE end if if sleDAT* _output_file.Text = '' then MessageBox(This.Title, 'Sorry! Output File Name is required') sle_output_file.SetFocus() return FALSE end if if sle_log_file.Text = '' then MessageBox(This.Title, 'Sorry! Log File Name is required') sle_log_file.SetFocus() return FALSE end if if ddlb_mode.Text = '' then MessageBox(This.Title, 'Sorry! Operation Mode is required') ddlb_mode.SetFocus() return FALSE end if if ddlb_level.Text = '' then MessageBox(This.Title, 'Sorry! Level TypeDAT*  is required') ddlb_level.SetFocus() return FALSE end if if ddlb_level.Text = 'Geographic' then if ddlb_geo_level.Text = '' then MessageBox(This.Title, 'Sorry! Geographic Data Level is required') ddlb_geo_level.SetFocus() return FALSE end if else if ddlb_source_type.Text = '' then MessageBox(This.Title, 'Sorry! Source Type is required') ddlb_source_type.SetFocus() return FALSE end if end if // Check to make sure from date is valid IF NOT IsDate(em_from_date.DAT* Text) THEN MessageBox(This.Title, "Sorry! From Date is Invalid") em_from_date.SetFocus() Return FALSE END IF // Check to make sure to date is valid IF NOT IsDate(em_to_date.Text) THEN MessageBox(This.Title, "Sorry! End Date is Invalid") em_to_date.SetFocus() Return FALSE END IF // Check to make sure from date is before (or same as) to date IF DaysAfter( Date(em_from_date.Text), Date(em_to_date.Text) ) < 0 THEN MessageBox(This.Title, "From Date must be earlier DAT* than To Date") em_from_date.SetFocus() Return FALSE END IF dw_metric.AcceptText() ls_metric = dw_metric.GetItemString(1, 'code') if ls_metric = '' or IsNull(ls_metric) then MessageBox(This.Title, 'Sorry! Metric Code is required') dw_metric.SetFocus() return FALSE end if // Make it non-mandatory for now. 9/14/94 //ls_value_type = dw_value_type.GetItemString(1, 'value_type') //if ls_value_type = '' or IsNull(ls_value_type) then // MessageBox(This.Title, 'Sorry! Value TypeDAT*  is required') // dw_value_type.SetFocus() // return FALSE //end if idwc_metric.SetTransObject(SQLCA) ll_cur_row = idwc_metric.GetRow() ls_meas_code = idwc_metric.GetItemString(ll_cur_row, 'meas_code') if Not (IsNull(ls_meas_code) or ls_meas_code = '') then dw_unit.AcceptText() ls_unit = dw_unit.GetItemString(1, 'code') if ls_unit = '' or IsNull(ls_unit) then MessageBox(This.Title, 'Sorry! Unit of Measure is required') dw_unit.SetFocus() return FALSE end if end if // DAT* The material code should be required if // the metric table says a material is required if is_material_flg = 'Y' then dw_matrl_code.AcceptText() ls_material = dw_matrl_code.GetItemString(1, 'code') if ls_material = '' or IsNull(ls_material) then MessageBox(This.Title, 'Sorry! Material Code is required') dw_matrl_code.SetFocus() return FALSE end if end if is_material_flg = '' // Reset variable // Pass validation check return TRUE end function public subroutine wf_retDAT* rieve_county (long pl_parent_rid);string ls_orig_sql, ls_err, ls_new_sql // Modify sql statement of the child datawindow in dw_county idwc_county.SetTransObject(SQLCA) ls_orig_sql = idwc_county.Describe("datawindow.table.select") ls_new_sql = ls_orig_sql + ' AND (rap_geographic_locations.parent_rid = ' + & String(pl_parent_rid) + ')' ls_err = idwc_county.Modify("datawindow.table.select = ~"" + ls_new_sql + "~"") if ls_err <> '' then MessageBox('Modify failed', ls_err) return end iDAT* f idwc_county.SetTransObject(SQLCA) idwc_county.Retrieve() // Change the sql statement of dwc back to the original sql statement ls_err = idwc_county.Modify("datawindow.table.select = ~"" + ls_orig_sql + "~"") if ls_err <> '' then MessageBox('Modify failed', ls_err) return end if end subroutine public subroutine wf_show_dddw (datawindow pdw_obj);// Function: wf_show_dddw // // Purpose: To retrieve data for value type, unit code and reference code // dddw based // // ScopeDAT* : Public // // Parameters: // pdw_obj (datawindow/value) - contains a pointer to the datawindow // // Returns: none DataWindowChild dwc long ll_cur_row string ls_meas_code SetPointer(HourGlass!) // Get the measurement code of the selected metric code ll_cur_row = idwc_metric.GetRow() ls_meas_code = idwc_metric.GetItemString(ll_cur_row, 'meas_code') is_material_flg = idwc_metric.GetItemString(ll_cur_row, 'material_flag') is_metric_name = idwc_metric.GetItemString(ll_cur_row, 'nDAT* ame') // Retrieve data for value type dddw // Get the handle of the child datawindow if dw_value_type.GetChild("value_type", dwc) = -1 then MessageBox(This.Title, "Application Error:~nValue Type - " + & "Not a DataWindowChild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) if dwc.Retrieve(pdw_obj.GetText()) > 0 then dw_value_type.SetTransObject(SQLCA) dw_value_type.InsertRow(1) dw_value_type.Enabled = TRUE else dw_value_type.Reset() dw_vaDAT* lue_type.Enabled = FALSE end if // Retrieve data for unit code dddw when the meas_code is not null // Otherwise, hide the unit code dddw if Not IsNull(ls_meas_code) then // Get the handle of the child datawindow if dw_unit.GetChild("code", dwc) = -1 then MessageBox(This.Title, "Application Error:~nUnit of Measure - " + & "Not a DataWindowChild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) dwc.Retrieve(ls_meas_code) dw_unit.SetTranDAT* sObject(SQLCA) dw_unit.InsertRow(1) dw_unit.Enabled = TRUE else dw_unit.Reset() dw_unit.Enabled = FALSE end if // Always show reference code dddw. 4/22/96, swj //// Retrieve data for reference code dddw only at the stream level // //if ddlb_level.Text = 'Stream' then // // Get the handle of the child datawindow // if dw_ref_code.dwGetChild("ref_code", dwc) = -1 then // MessageBox(pdw_obj.Title, "Application Error:~nReference Code - " + & // "Not a DataWindowChild.~nContacDAT* t your technical support.") // return // end if // // dwc.SetTransObject(SQLCA) // if dwc.Retrieve(pdw_obj.GetText()) > 0 then // dw_ref_code.SetTransObject(SQLCA) // dw_ref_code.InsertRow(0) // dw_ref_code.Enabled = TRUE // end if //end if end subroutine public function boolean wf_write_qcparm_file (string ps_dsn, string ps_uid);// This function writes the parameters to a file named QCPARM.TXT // in the userdir directory. The file is a multi line tab-delimited file. booleanDAT*  lb_found string ls_file, ls_write_line, ls_metric_name, ls_value_type, & ls_variable_names, ls_upper, ls_lower, ls_cbx_pro_scc, & ls_cbx_dev_sic, ls_cbx_src_sic, ls_matrl_code, ls_str_code, & ls_pro_code, ls_pro_scc, ls_dev_code, ls_dev_sic, & ls_ref_code, ls_unit_code, ls_src_code, ls_src_sic, & ls_county, ls_state, ls_meas_code, ls_priority, ls_check_maps[100] integer li_file_num, li_i, li_check_cnt long ll_county, ll_state, ll_cur_row SetPointer(HourGlass!) ls_file = is_userdiDAT* r + '\qcparm.txt' // Check to see if QCPARM.TXT already exists. If it exists, overwrite // the file if FileExists(ls_file) then li_file_num = FileOpen(ls_file, LineMode!, Write!, LockReadWrite!, & Replace!) // Otherwise, create the file else li_file_num = FileOpen(ls_file, LineMode!, Write!, LockReadWrite!, & Append!) end if // Error checking if li_file_num = -1 then MessageBox(Upper(ls_file), "Error opening file.", StopSign!) return FALSE end if // Get variablDAT* e values if is_metric_name = '' or IsNull(is_metric_name) then ls_metric_name = ' ' else ls_metric_name = is_metric_name end if if dw_value_type.RowCount() > 0 then ls_value_type = dw_value_type.GetItemString(1, "value_type") if IsNull(ls_value_type) OR ls_value_type = '' then ls_value_type = ' ' end if else ls_value_type = ' ' end if if ddlb_level.Text = 'Stream' then ls_str_code = dw_str_code.GetItemString(1, 'code') end if if ddlb_level.Text = 'Process' or ddlDAT* b_level.Text = 'Stream' then ls_pro_code = dw_pro_code.GetItemString(1, 'code') ls_pro_scc = dw_pro_scc.GetItemString(1, 'scc_ams') end if if ddlb_level.Text = 'Device' or ddlb_level.Text = 'Process' or & ddlb_level.Text = 'Stream' then ls_dev_code = dw_dev_code.GetItemString(1, 'code') ls_dev_sic = dw_dev_sic.GetItemString(1, 'device_sic') end if if ddlb_level.Text = 'Source' or ddlb_level.Text = 'Device' or ddlb_level.Text = 'Process' & or ddlb_level.Text = 'Stream' then ls_DAT* src_code = dw_src_code.GetItemString(1, 'code') ls_src_sic = dw_src_sic.GetItemString(1, 'source_sic') end if // Construct variable names from the group by box if cbx_state.Checked then ls_variable_names = ls_variable_names + ' state' end if if cbx_county.Checked then ls_variable_names = ls_variable_names + ' county' end if if cbx_src_sic.Checked then ls_variable_names = ls_variable_names + ' src_sic' ls_cbx_src_sic = 'X' end if if cbx_dev_sic.Checked then ls_variablDAT* e_names = ls_variable_names + ' dev_sic' ls_cbx_dev_sic = 'X' end if if cbx_pro_scc.Checked then ls_variable_names = ls_variable_names + ' scc_ams' ls_cbx_pro_scc = 'X' end if if IsNull(ls_variable_names) or ls_variable_names = '' then ls_variable_names = ' ' end if ls_lower = em_lower.Text if IsNull(ls_lower) or ls_lower = '' then ls_lower = ' ' end if ls_upper = em_upper.Text if IsNull(ls_upper) or ls_upper = '' then ls_upper = ' ' end if ll_cur_row = idwc_metriDAT* c.GetRow() ls_meas_code = idwc_metric.GetItemString(ll_cur_row, 'meas_code') if Not IsNull(ls_meas_code) then ls_unit_code = dw_unit.GetItemString(1, "code") end if ls_ref_code = dw_ref_code.GetItemString(1, 'code') ls_matrl_code = dw_matrl_code.GetItemString(1, 'code') IF (IsNull(ls_matrl_code) OR ls_matrl_code = "") AND & (is_material_flg = "" OR IsNull(is_material_flg)) THEN DECLARE check_maps CURSOR FOR select rap_metrics.code from rap_metrics, rap_metric_maps where mateDAT* rial_flag is NULL AND rap_metrics.code = rap_metric_maps.code AND rap_metric_maps.material_code is not NULL; CLOSE check_maps; OPEN check_maps; IF f_db_error (SQLCA, "sql_error on OPEN of check_maps cursor. Contact your technical support") & = 1 THEN RETURN FALSE END IF FETCH check_maps INTO :ls_check_maps[1]; IF SQLCA.sqlcode <> 100 THEN IF f_db_error (SQLCA, "sql_error on FETCH of check_maps cursor. Contact your technical support") & = 1 THEN CLOSDAT* E check_maps; RETURN FALSE END IF END IF DO WHILE SQLCA.sqlcode = 0 li_check_cnt++ IF li_check_cnt = 100 THEN MessageBox("Program Failure","wf_write_qcparm array too small") EXIT END IF FETCH check_maps INTO :ls_check_maps[li_check_cnt + 1]; LOOP IF SQLCA.sqlcode <> 100 THEN IF f_db_error (SQLCA, "sql_error on FETCH of check_maps cursor. Contact your technical support") & = 1 THEN CLOSE check_maps; RETURN FALSE END IF END IF CDAT* LOSE check_maps; lb_found = FALSE FOR li_i = 1 TO li_check_cnt IF ls_check_maps[li_i] = dw_metric.GetItemString(1, 'code') THEN lb_found = TRUE EXIT END IF NEXT IF lb_found THEN ls_matrl_code = 'NULL' END IF END IF // Get county dw_county.AcceptText() if Not (IsNull(dw_county.GetItemString(1, 'name')) or & dw_county.GetItemString(1, 'name') = '') then ll_county = idwc_county.GetItemNumber(idwc_county.GetRow(), 'rid') end if if Not (IsNull(ll_county) or ll_cDAT* ounty = 0) then ls_county = String(ll_county) else ls_county = '' end if // Get state dw_state.AcceptText() if Not (IsNull(dw_state.GetItemString(1, 'name')) or & dw_state.GetItemString(1, 'name') = '') then ll_state = idwc_state.GetItemNumber(idwc_state.GetRow(), 'rid') end if if Not (IsNull(ll_state) or ll_state = 0) then ls_state = String(ll_state) else ls_state = '' end if // Write the parameters to the file if not f_write_line(li_file_num, ls_file, 'SAS DIRECTORY', DAT* is_sasdir) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SAS USERDIR', is_userdir) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'CONNECTION TYPE', SQLCA.dbms) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'DSN', ps_dsn) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'UID', ps_uid) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'FROM DATE', em_from_date.Text) then DAT*  return FALSE end if if not f_write_line(li_file_num, ls_file, 'FROM TIME', & String(DateTime(Date(em_from_date.Text)), "yyyy-mm-dd hh:mm:ss")) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'TO DATE', em_to_date.Text) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'TO TIME', & String(DateTime(Date(em_to_date.Text)), "yyyy-mm-dd hh:mm:ss")) then return FALSE end if if ddlb_level.Text = 'Geographic' THEN if not f_write_line(li_file_num, ls_fDAT* ile, 'GEO LEVEL', ddlb_geo_level.Text) then return FALSE end if else if not f_write_line(li_file_num, ls_file, 'SOURCE TYPE', ddlb_source_type.Text) then return FALSE end if end if if not f_write_line(li_file_num, ls_file, 'METRIC LEVEL', ddlb_level.Text) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'METRIC NAME', ls_metric_name) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'UNIT CODE', ls_unit_code) then return FALSE end if ifDAT*  not f_write_line(li_file_num, ls_file, 'VALUE TYPE', ls_value_type) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'BY VARIABLES', ls_variable_names) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SHORT DESCRIPTIVE', is_short) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'LONG PLOTS', is_long_plots) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'LONG NO PLOTS', is_long_wo_plots) then return FALSEDAT*  end if if not f_write_line(li_file_num, ls_file, 'OUTLIERS', is_outlier) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'OUTLIER LOW', ls_lower) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'OUTLIER HIGH', ls_upper) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'LINES', em_line.Text) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'COLUMNS', em_column.Text) then return FALSE end if if not f_wriDAT* te_line(li_file_num, ls_file, 'REFERENCE CODE', ls_ref_code) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'C PROCESS SCC', ls_cbx_pro_scc) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'C DEVICE SIC', ls_cbx_dev_sic) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'C SOURCE SIC', ls_cbx_src_sic) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'METRIC CODE', & dw_metric.GetItemString(1, 'code')) then DAT*  return FALSE end if if not f_write_line(li_file_num, ls_file, 'MATERIAL CODE', ls_matrl_code) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'STREAM CODE', ls_str_code) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'PROCESS CODE', ls_pro_code) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'PROCESS SCC', ls_pro_scc) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'DEVICE CODE', ls_dev_code) then reDAT* turn FALSE end if if not f_write_line(li_file_num, ls_file, 'DEVICE SIC', ls_dev_sic) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SOURCE CODE', ls_src_code) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SOURCE SIC', ls_src_sic) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'STATE RID', ls_state) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'COUNTY RID', ls_county) then return FALSE end if DAT*  // look up priorities from rapids.ini file ls_priority = ProfileString(gs_iniFile, 'data code priority', 'null', & 'not found') IF ls_priority = 'not found' THEN // Do this in case that rapids.ini does not have this key ls_priority = '99' SetProfileString(gs_iniFile, 'data code priority', 'null', ls_priority) END IF if not f_write_line(li_file_num, ls_file, 'NULL PRIORITY', ls_priority) then return FALSE end if ls_priority = ProfileString(gs_iniFile, 'data code priority', 'RO'DAT* , & 'not found') IF ls_priority = 'not found' THEN // Do this in case that rapids.ini does not have this key ls_priority = '00' SetProfileString(gs_iniFile, 'data code priority', 'RO', ls_priority) END IF if not f_write_line(li_file_num, ls_file, 'RO PRIORITY', ls_priority) then return FALSE end if // Close the file if FileClose(li_file_num) = -1 then MessageBox(Upper(ls_file), "Error closing the file.", StopSign!) return FALSE end if // Write to file successfully! returDAT* n TRUE end function on activate;f_menu_behave('base', '', '') end on on other;//// This script checks the sas error when the user returns to PowerBuilder //// from SAS // //string ls_file, ls_text //integer li_file_num, li_bytes_read //long ll_pos // //// 28 is the window message number for WM_ACTIVATEAPP //// wordparm <> 0 means when this window has been brought from inactive //// to active //if Message.Number = 28 and Message.WordParm <> 0 and ib_sas_run then // // ib_sas_rDAT* un = FALSE // ls_file = is_userdir + '\sqlxrc.qc' // // if FileExists(ls_file) then // // li_file_num = FileOpen(ls_file, LineMode!, Read!, LockReadWrite!) // // Error checking // if li_file_num = -1 then // MessageBox(Upper(ls_file), "Error opening file.", StopSign!) // else // // Read the first line - sql error code // li_bytes_read = FileRead(li_file_num, ls_text) // if li_bytes_read > 0 then // // Read the second line - sql error text // li_bytes_read = FileReadDAT* (li_file_num, ls_text) // if li_bytes_read > 0 then // MessageBox('Error generating ' + This.Title, ls_text) // end if // elseif li_bytes_read = -1 then // MessageBox(Upper(ls_file), "Error reading file.", StopSign!) // elseif li_bytes_read = -100 or li_bytes_read = 0 then // MessageBox(Upper(ls_file), "Empty file.", StopSign!) // end if // FileClose(li_file_num) // end if // // // Delete the error file // if Not FileDelete(ls_file) then // MessageBox(ThiDAT* s.Title, 'Error deleting file ' + ls_file) // end if // // end if // //end if end on on resize;f_put_scroll_bars(This) end on on w_rpt_qc.create this.st_geo_level=create st_geo_level this.ddlb_geo_level=create ddlb_geo_level this.dw_ref_code=create dw_ref_code this.dw_unit=create dw_unit this.dw_county=create dw_county this.dw_metric=create dw_metric this.dw_state=create dw_state this.dw_matrl_code=create dw_matrl_code this.dw_str_code=create dw_str_code this.dw_pro_code=crDAT* eate dw_pro_code this.dw_dev_code=create dw_dev_code this.dw_src_code=create dw_src_code this.cbx_pro_scc=create cbx_pro_scc this.cbx_dev_sic=create cbx_dev_sic this.cbx_src_sic=create cbx_src_sic this.cbx_county=create cbx_county this.dw_pro_scc=create dw_pro_scc this.dw_dev_sic=create dw_dev_sic this.dw_src_sic=create dw_src_sic this.dw_value_type=create dw_value_type this.st_10=create st_10 this.ddlb_level=create ddlb_level this.st_9=create st_9 this.em_lower=create em_lower thisDAT* .em_upper=create em_upper this.st_8=create st_8 this.st_7=create st_7 this.em_column=create em_column this.em_line=create em_line this.cbx_state=create cbx_state this.cbx_outlier=create cbx_outlier this.cbx_long_plots=create cbx_long_plots this.cbx_long_wo_plots=create cbx_long_wo_plots this.cbx_short=create cbx_short this.st_6=create st_6 this.st_5=create st_5 this.st_4=create st_4 this.em_to_date=create em_to_date this.em_from_date=create em_from_date this.st_source_type=create stDAT* _source_type this.ddlb_source_type=create ddlb_source_type this.st_2=create st_2 this.ddlb_mode=create ddlb_mode this.cb_browse_2=create cb_browse_2 this.cb_browse_1=create cb_browse_1 this.sle_log_file=create sle_log_file this.sle_output_file=create sle_output_file this.st_rpt_msg=create st_rpt_msg this.cb_close=create cb_close this.cb_generate=create cb_generate this.gb_3=create gb_3 this.gb_6=create gb_6 this.gb_2=create gb_2 this.gb_1=create gb_1 this.Control[]={ this.st_geo_levDAT* el,& this.ddlb_geo_level,& this.dw_ref_code,& this.dw_unit,& this.dw_county,& this.dw_metric,& this.dw_state,& this.dw_matrl_code,& this.dw_str_code,& this.dw_pro_code,& this.dw_dev_code,& this.dw_src_code,& this.cbx_pro_scc,& this.cbx_dev_sic,& this.cbx_src_sic,& this.cbx_county,& this.dw_pro_scc,& this.dw_dev_sic,& this.dw_src_sic,& this.dw_value_type,& this.st_10,& this.ddlb_level,& this.st_9,& this.em_lower,& this.em_upper,& this.st_8,& this.st_7,& this.em_column,& DAT* this.em_line,& this.cbx_state,& this.cbx_outlier,& this.cbx_long_plots,& this.cbx_long_wo_plots,& this.cbx_short,& this.st_6,& this.st_5,& this.st_4,& this.em_to_date,& this.em_from_date,& this.st_source_type,& this.ddlb_source_type,& this.st_2,& this.ddlb_mode,& this.cb_browse_2,& this.cb_browse_1,& this.sle_log_file,& this.sle_output_file,& this.st_rpt_msg,& this.cb_close,& this.cb_generate,& this.gb_3,& this.gb_6,& this.gb_2,& this.gb_1} end on on w_rpt_qc.destroy DAT* destroy(this.st_geo_level) destroy(this.ddlb_geo_level) destroy(this.dw_ref_code) destroy(this.dw_unit) destroy(this.dw_county) destroy(this.dw_metric) destroy(this.dw_state) destroy(this.dw_matrl_code) destroy(this.dw_str_code) destroy(this.dw_pro_code) destroy(this.dw_dev_code) destroy(this.dw_src_code) destroy(this.cbx_pro_scc) destroy(this.cbx_dev_sic) destroy(this.cbx_src_sic) destroy(this.cbx_county) destroy(this.dw_pro_scc) destroy(this.dw_dev_sic) destroy(this.dw_src_sic)DAT*  destroy(this.dw_value_type) destroy(this.st_10) destroy(this.ddlb_level) destroy(this.st_9) destroy(this.em_lower) destroy(this.em_upper) destroy(this.st_8) destroy(this.st_7) destroy(this.em_column) destroy(this.em_line) destroy(this.cbx_state) destroy(this.cbx_outlier) destroy(this.cbx_long_plots) destroy(this.cbx_long_wo_plots) destroy(this.cbx_short) destroy(this.st_6) destroy(this.st_5) destroy(this.st_4) destroy(this.em_to_date) destroy(this.em_from_date) destroy(this.sDAT* t_source_type) destroy(this.ddlb_source_type) destroy(this.st_2) destroy(this.ddlb_mode) destroy(this.cb_browse_2) destroy(this.cb_browse_1) destroy(this.sle_log_file) destroy(this.sle_output_file) destroy(this.st_rpt_msg) destroy(this.cb_close) destroy(this.cb_generate) destroy(this.gb_3) destroy(this.gb_6) destroy(this.gb_2) destroy(this.gb_1) end on type st_geo_level from statictext within w_rpt_qc int X=72 int Y=596 int Width=466 int Height=71 boolean Visible=false boolDAT* ean Enabled=false string Text="Geographic Level:" Alignment Alignment=Center! boolean FocusRectangle=false long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="Arial" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type ddlb_geo_level from dropdownlistbox within w_rpt_qc int X=537 int Y=583 int Width=289 int Height=193 int TabOrder=140 boolean Visible=false BorderStyle BorderStyle=StyleLowered! boolean Sorted=falseDAT*  boolean VScrollBar=true long TextColor=33554432 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! string Item[]={"State",& "County"} end type type dw_ref_code from u_dddw within w_rpt_qc int X=43 int Y=676 int Width=1142 int Height=103 int TabOrder=190 string DataObject="d_ref_codes_table_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type event constructor;DAT* call super::constructor;DataWindowChild dwc // Make the external datawindow display by using InsertRow dw_ref_code.SetTransObject(SQLCA) dw_ref_code.InsertRow(0) // Retrieve data for child datawindow IF dw_ref_code.GetChild("code", dwc) = -1 THEN MessageBox(This.Title, "Application Error:~nReference Code - " + & "Not a DataWindowChild.~nContact your technical support.") return END IF dwc.SetTransObject(sqlca) dwc.Retrieve() end event on itemfocuschangedDAT* ;call u_dddw::itemfocuschanged;is_child_name = 'code' is_validation_table = 'rap_reference_codes' is_msg_name = 'Column - Reference Code' is_msg_text = 'Sorry! Not a valid reference code' end on type dw_unit from u_dddw within w_rpt_qc int X=1782 int Y=689 int Width=1057 int Height=100 int TabOrder=200 boolean Enabled=false string DataObject="d_units_dddw_on_qcchecker" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type on itemfocuschanged;DAT* call u_dddw::itemfocuschanged;is_child_name = 'code' is_validation_table = 'rap_units' is_msg_name = 'Column - Unit of Measure' is_msg_text = 'Sorry! Not a valid unit code' end on on constructor;call u_dddw::constructor;//DataWindowChild dwc //string ls_mod_string, ls_err // //// Get the handle of the child datawindow //if This.dwGetChild("unit_code", dwc) = -1 then // MessageBox(Parent.Title, "Application Error:~nUnit of Measure - " + & // "Not a DataWindowChild.~nContact your technDAT* ical support.") // return //end if // //// Use metricCode here as the argument because that only previously //// defined arguments in the datawindow object can be used in dwmodify //ls_mod_string = "datawindow.table.select = '" + & // "SELECT RAP_UNITS.CODE, RAP_UNITS.NAME FROM RAP_UNITS" + & // " WHERE RAP_UNITS.MEAS_CODE = :metricCode'" // //ls_err = dwc.dwModify(ls_mod_string) // //if ls_err <> '' then // MessageBox('dwModify on d_rpt_units failed', ls_err) // return //end iDAT* f // //ls_mod_string = "unit_code.dddw.datacolumn = 'code' " + & // "unit_code.dddw.displaycolumn = 'name'" // //ls_err = This.dwModify(ls_mod_string) // //if ls_err <> '' then // MessageBox('dwModify on unit_code failed', ls_err) // return //else // dwc.SetTransObject(SQLCA) // dwc.Reset() // dwc.InsertRow(0) // dwc.SetItem(1, 1, '0') //end if end on type dw_county from u_dddw within w_rpt_qc int X=68 int Y=881 int Width=1128 int Height=97 int TabOrder=220 boolean BordeDAT* r=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type on getfocus;call u_dddw::getfocus;is_child_name = 'name' is_validation_table = 'rap_geographic_locations' is_msg_name = 'Column - County' is_msg_text = 'Sorry! Not a valid county' end on event constructor;call super::constructor;// added line because error converting to 5.0 this.DataObject="d_county_dddw" // Retrieve data for county dddw // Get the handle of the child datawindow if This.GetChild("namDAT* e", idwc_county) = -1 then MessageBox(This.Title, "Application Error:~nCounty Name - " + & "Not a DataWindowChild.~nContact your technical support.") return end if idwc_county.SetTransObject(SQLCA) idwc_county.Retrieve() This.SetTransObject(SQLCA) This.InsertRow(0) end event type dw_metric from u_dddw within w_rpt_qc int X=961 int Y=583 int Width=1096 int Height=100 int TabOrder=170 boolean Enabled=false string DataObject="d_metric_code_dddw" boolean Border=false BordeDAT* rStyle BorderStyle=StyleBox! boolean LiveScroll=false end type on losefocus;call u_dddw::losefocus;string ls_data ls_data = This.GetText() if IsNull(is_old_value) then is_old_value = '' end if if Not IsNull(ls_data) then // Retrieve data and show value type, unit code and reference code dddw // if the item value is changed if (ls_data <> is_old_value) then wf_show_dddw(This) end if end if end on on itemchanged;call u_dddw::itemchanged;wf_show_dddw(This) end on DAT*  on itemfocuschanged;call u_dddw::itemfocuschanged;is_child_name = 'code' is_validation_table = 'rap_metrics' is_msg_name = 'Column - Metric Code' is_msg_text = 'Sorry! Not a valid metric code' end on type dw_state from u_dddw within w_rpt_qc int X=72 int Y=775 int Width=1121 int Height=103 int TabOrder=210 string DataObject="d_states_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type on losefocus;call u_dddw::losefocus;string ls_daDAT* ta ls_data = This.GetText() if IsNull(is_old_value) then is_old_value = '' end if // Retrieve data for county dddw if the item value is changed or the item // value is null if IsNull(ls_data) then This.TriggerEvent('retrieve_data') elseif (ls_data <> is_old_value) then This.TriggerEvent('retrieve_data') end if end on on retrieve_data;call u_dddw::retrieve_data;long ll_parent_rid string ls_null // Retrieve county list for the selected state if Not (IsNull(This.GetText()DAT* ) or This.GetText() = '')then ll_parent_rid = idwc_state.GetItemNumber(idwc_state.GetRow(), 'rid') end if if ll_parent_rid = 0 or IsNull(ll_parent_rid) then // If no state value, retrieve all counties idwc_county.Retrieve() else wf_retrieve_county(ll_parent_rid) end if SetNull(ls_null) dw_county.SetItem(1, 1, ls_null) dw_county.SetFocus() end on event constructor;call super::constructor;// Retrieve data for state dddw // Get the handle of the child datawindow if This.GeDAT* tChild("name", idwc_state) = -1 then MessageBox(This.Title, "Application Error:~nState Name - " + & "Not a DataWindowChild.~nContact your technical support.") return end if idwc_state.SetTransObject(SQLCA) idwc_state.Retrieve() This.SetTransObject(SQLCA) This.InsertRow(0) end event on dwnkey;call u_dddw::dwnkey;long ll_parent_rid if KeyDown(keytab!) then // Retrieve county list for the selected state if il_selected_row > 0 then ll_parent_rid = idwc_state.GetItemNumberDAT* (il_selected_row, 'rid') wf_retrieve_county(ll_parent_rid) end if end if end on on dwnprocessenter;call u_dddw::dwnprocessenter;string ls_col_name long ll_parent_rid if il_selected_row > 0 then ls_col_name = This.GetColumnName() if ls_col_name = is_column_name then ll_parent_rid = idwc_state.GetItemNumber(il_selected_row, 'rid') wf_retrieve_county(ll_parent_rid) end if end if end on on getfocus;call u_dddw::getfocus;is_child_name = 'name' is_validation_table = 'raDAT*" p_geographic_locations' is_msg_name = 'Column - State' is_msg_text = 'Sorry! Not a valid state' end on type dw_matrl_code from u_dddw within w_rpt_qc int X=57 int Y=1367 int Width=1138 int Height=93 int TabOrder=270 boolean Enabled=false string DataObject="d_matrl_code_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type event constructor;call super::constructor;DataWindowChild dwc_matrl dw_matrl_code.SetTransObject(SQLCA) dw_matrl_DAT*$ code.InsertRow(0) dw_matrl_code.Enabled = TRUE // Get the handles of the child datawindows in dw_matrl_code if dw_matrl_code.GetChild("code", dwc_matrl) = -1 then MessageBox(Parent.Title, "Application Error:~nMaterial Code - " + & "Not a DataWindowChild.~nContact your technical support.") return end if // Retrieve data for material code dddw dwc_matrl.SetTransObject(SQLCA) dwc_matrl.Retrieve() end event on getfocus;call u_dddw::getfocus;is_child_name = 'code' is_validation_tabDAT*& le = 'rap_materials' is_msg_name = 'Column - Material Code' is_msg_text = 'Sorry! Not a valid material code' end on type dw_str_code from u_dddw within w_rpt_qc int X=65 int Y=1271 int Width=1156 int Height=93 int TabOrder=260 boolean Enabled=false string DataObject="d_str_code_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type on getfocus;call u_dddw::getfocus;is_child_name = 'code' is_validation_table = 'rap_streams' is_msg_name =DAT*(  'Column - Stream Code' is_msg_text = 'Sorry! Not a valid stream code' end on type dw_pro_code from u_dddw within w_rpt_qc int X=54 int Y=1175 int Width=1138 int Height=97 int TabOrder=250 boolean Enabled=false string DataObject="d_pro_code_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type on getfocus;call u_dddw::getfocus;is_child_name = 'code' is_validation_table = 'rap_processes' is_msg_name = 'Column - Process Code' is_msg_teDAT*xt = 'Sorry! Not a valid process code' end on type dw_dev_code from u_dddw within w_rpt_qc int X=50 int Y=1076 int Width=1153 int Height=100 int TabOrder=240 boolean Enabled=false string DataObject="d_dev_code_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type on getfocus;call u_dddw::getfocus;is_child_name = 'code' is_validation_table = 'rap_devices' is_msg_name = 'Column - Device Code' is_msg_text = 'Sorry! Not a valid device code'DAT*, Report window for specifying SAS reporting parameters for Tier 1,2,3 reportsforward global type w_rpt_sas from Window end type type dw_unit_code from u_dddw within w_rpt_sas end type type dw_ref_code from u_dddw within w_rpt_sas end type type dw_4 from datawindow within w_rpt_sas end type type dw_county from datawindow within w_rpt_sas end type type dw_2 from datawindow within w_rpt_sas end type type st_8 from statictext within w_rpt_sas end type type st_7 from statictext within w_rDAT*. pt_sas end type type em_column from editmask within w_rpt_sas end type type em_line from editmask within w_rpt_sas end type type cbx_individual from checkbox within w_rpt_sas end type type cbx_region from checkbox within w_rpt_sas end type type cbx_tier3 from checkbox within w_rpt_sas end type type cbx_state from checkbox within w_rpt_sas end type type cbx_county from checkbox within w_rpt_sas end type type cbx_tier2 from checkbox within w_rpt_sas end type type cbx_tier1 from cheDAT*0 ckbox within w_rpt_sas end type type st_6 from statictext within w_rpt_sas end type type cbx_all_materials from checkbox within w_rpt_sas end type type sle_region from singlelineedit within w_rpt_sas end type type cbx_all_counties from checkbox within w_rpt_sas end type type cbx_all_states from checkbox within w_rpt_sas end type type st_5 from statictext within w_rpt_sas end type type st_4 from statictext within w_rpt_sas end type type em_to_date from editmask within w_rpt_sas endDAT*2  type type em_from_date from editmask within w_rpt_sas end type type st_3 from statictext within w_rpt_sas end type type ddlb_source_type from dropdownlistbox within w_rpt_sas end type type st_2 from statictext within w_rpt_sas end type type ddlb_mode from dropdownlistbox within w_rpt_sas end type type cb_browse_2 from commandbutton within w_rpt_sas end type type cb_browse_1 from commandbutton within w_rpt_sas end type type sle_log_file from singlelineedit within w_rpt_sas end typeDAT*4  type sle_output_file from singlelineedit within w_rpt_sas end type type st_rpt_msg from statictext within w_rpt_sas end type type st_1 from statictext within w_rpt_sas end type type cb_close from commandbutton within w_rpt_sas end type type cb_generate from commandbutton within w_rpt_sas end type type gb_6 from groupbox within w_rpt_sas end type type gb_5 from groupbox within w_rpt_sas end type type gb_4 from groupbox within w_rpt_sas end type type gb_3 from groupbox within w_rptDAT*6 _sas end type type gb_2 from groupbox within w_rpt_sas end type type gb_1 from groupbox within w_rpt_sas end type type r_1 from rectangle within w_rpt_sas end type end forward global type w_rpt_sas from Window int X=33 int Y=225 int Width=2873 int Height=1581 boolean TitleBar=true string Title="Tier 1,2,3 Report" long BackColor=12632256 boolean ControlMenu=true boolean MinBox=true boolean MaxBox=true boolean Resizable=true string Icon="TIER.ICO" dw_unit_code dw_unit_code dDAT*r w_ref_code dw_ref_code dw_4 dw_4 dw_county dw_county dw_2 dw_2 st_8 st_8 st_7 st_7 em_column em_column em_line em_line cbx_individual cbx_individual cbx_region cbx_region cbx_tier3 cbx_tier3 cbx_state cbx_state cbx_county cbx_county cbx_tier2 cbx_tier2 cbx_tier1 cbx_tier1 st_6 st_6 cbx_all_materials cbx_all_materials sle_region sle_region cbx_all_counties cbx_all_counties cbx_all_states cbx_all_states st_5 st_5 st_4 st_4 em_to_date em_to_date em_from_date em_from_date st_3 DAT*: User object for permit condition.forward global type u_dw_permit_condition from UserObject end type type dw_permit_detail from u_dw_list within u_dw_permit_condition end type type dw_permit_master from u_dw_freeform within u_dw_permit_condition end type type r_1 from rectangle within u_dw_permit_condition end type type r_2 from rectangle within u_dw_permit_condition end type end forward global type u_dw_permit_condition from UserObject int Width=2634 int Height=913 boolean Border=DAT*< true long BackColor=12632256 dw_permit_detail dw_permit_detail dw_permit_master dw_permit_master r_1 r_1 r_2 r_2 end type global u_dw_permit_condition u_dw_permit_condition type variables long il_ref_rid; string is_orig_sql; boolean ib_new_master; boolean ib_new_detail; end variables forward prototypes public function boolean uf_save () public function boolean uf_check_required () public function boolean uf_check_pending () public subroutine uf_undo_dw_loc_detail () public sDAT*> ubroutine uf_undo_dw_loc_master () public subroutine uf_check_master_rid () public subroutine uf_check_detail_rid () public subroutine uf_retrieve_dw_permit_detail () public subroutine uf_retrieve_dw_permit_master (long ref_rid) end prototypes public function boolean uf_save ();//// This function saves data into rap_location_coordinate_groups and //// rap_location_coordinates tables // //boolean ib_result // //if Not (dw_loc_master.ib_obj_modified or dw_loc_detail.ib_obj_modified) theDAT*@ n return TRUE //if Not uf_check_required() then return FALSE //SetMicroHelp(w_mdi_main, "Updating data...") // //ib_result = TRUE // //if dw_loc_master.ib_obj_modified then // uf_check_master_rid() // if dw_loc_master.Update() = 1 then // if dw_loc_detail.ib_obj_modified then // uf_check_detail_rid() // if dw_loc_detail.Update() = 1 then // commit; // else // rollback; // ib_result = FALSE // end if // end if // else // rollback; // ib_result = FALSE DAT*B // end if //elseif dw_loc_detail.ib_obj_modified then // uf_check_detail_rid() // if dw_loc_detail.Update() = 1 then // commit; // else // rollback; // ib_result = FALSE // end if //end if // //// Reset modified and new record flags //dw_loc_master.ib_obj_modified = FALSE //dw_loc_detail.ib_obj_modified = FALSE //ib_new_master = FALSE //ib_new_detail = FALSE // //if ib_result then SetMicroHelp(w_mdi_main, "Data updated successfully") // //return (ib_result) return (FALSDAT*D E) end function public function boolean uf_check_required ();//// This function performs the validation check // //long ll_cur_row, ll_total_row // //dw_loc_master.AcceptText() //dw_loc_detail.AcceptText() // //ll_cur_row = dw_loc_master.GetRow() // //if IsNull(dw_loc_master.GetItemString(ll_cur_row, "shape_type")) or & // dw_loc_master.GetItemString(ll_cur_row, "shape_type") = '' then // MessageBox("DataWindow Error", "Sorry! Shape Type is required", Information!) // dw_loc_mastDAT*F er.SetRow(ll_cur_row) // dw_loc_master.SetColumn("shape_type") // dw_loc_master.ScrollToRow(ll_cur_row) // return FALSE //end if // //ll_total_row = dw_loc_detail.RowCount() // //for ll_cur_row = 1 to ll_total_row // // Do the validation check on the dw_loc_detail // if IsNull(dw_loc_detail.GetItemNumber(ll_cur_row, "sequence_no")) then // MessageBox("DataWindow Error", "Sorry! Sequence No is required", Information!) // dw_loc_detail.SetRow(ll_cur_row) // dw_loc_detaiDAT*H l.SetColumn("sequence_no") // dw_loc_detail.ScrollToRow(ll_cur_row) // return FALSE // end if // if IsNull(dw_loc_detail.GetItemString(ll_cur_row, "sub_type")) or & // dw_loc_detail.GetItemString(ll_cur_row, "sub_type") = '' then // MessageBox("DataWindow Error", "Sorry! Sub Type is required", Information!) // dw_loc_detail.SetRow(ll_cur_row) // dw_loc_detail.SetColumn("sub_type") // dw_loc_detail.ScrollToRow(ll_cur_row) // return FALSE // end if //nextDAT*J  // return TRUE end function public function boolean uf_check_pending ();//integer li_messagebox_return // //// Have any modifications been made to the datawindows //if dw_loc_master.ib_obj_modified or dw_loc_detail.ib_obj_modified then // li_messagebox_return = MessageBox("Location View", & // "Data have been modified in the location view.~nSave current changes?", Question!, YesNoCancel!) // choose case (li_messagebox_return) // case 1 // if Not uf_save() then // return FADAT*L LSE // end if // case 2 // // Undo the changes // uf_undo_dw_loc_master() // uf_undo_dw_loc_detail() // // Reset modified flag // dw_loc_master.ib_obj_modified = FALSE // dw_loc_detail.ib_obj_modified = FALSE // ib_new_master = FALSE // ib_new_detail = FALSE // case 3 // return FALSE // end choose //end if // return TRUE end function public subroutine uf_undo_dw_loc_detail ();//// This function uses dwGetNextModified to check if any row is modified. //// If foDAT*N und, undo the changes by using ReselectRow function // //long rowNum, totalRow // //dw_loc_detail.AcceptText() // //totalRow = dw_loc_detail.RowCount() //rowNum = 0 // //// For primary buffer //do while rowNum <= totalRow // rowNum = dw_loc_detail.dwGetNextModified(rowNum, Primary!) // if rowNum > 0 then // dw_loc_detail.ReselectRow(rowNum) // else // rowNum = totalRow + 1 // end if //loop // //// For filter buffer //do while rowNum <= totalRow // rowNum = dw_loc_detaDAT*P il.dwGetNextModified(rowNum, Filter!) // if rowNum > 0 then // dw_loc_detail.ReselectRow(rowNum) // else // rowNum = totalRow + 1 // end if //loop end subroutine public subroutine uf_undo_dw_loc_master ();//// This function checks if the current row is modified or new. //// If new, delete the current row; otherwise, undo the changes by //// using ReselectRow function // //dw_loc_master.AcceptText() // //if ib_new_master then // dw_loc_master.DeleteRow(dw_loc_master.GetRowDAT*R ()) //else // dw_loc_master.ReselectRow(dw_loc_master.GetRow()) //end if // //uf_retrieve_dw_loc_detail() // end subroutine public subroutine uf_check_master_rid ();//// This function calls database-dependent function to get the sequence //// number for the rid on the master datawindow // //long ll_cur_row, ll_rid_num // //ll_cur_row = dw_loc_master.GetRow() // //if IsNull(dw_loc_master.GetItemNumber(ll_cur_row, "rid")) then // // Select the next available rid from the rid_stDAT*T orage in database // ll_rid_num = f_get_sequence() // if ll_rid_num = -1 then // return // end if // dw_loc_master.SetItem(ll_cur_row, "rid", ll_rid_num) //end if end subroutine public subroutine uf_check_detail_rid ();//// This function gets the sequence number for the rid on the detail //// datawindow // //long ll_row_num, ll_cur_row, ll_rid_num // //// Get the rid of the master datawindow //ll_rid_num = dw_loc_master.GetItemNumber(dw_loc_master.GetRow(), "rid") // //ll_rDAT*V ow_num = dw_loc_detail.RowCount() // //for ll_cur_row = 1 to ll_row_num // // If the rid attribute is null, this means the row is a new inserted row // if IsNull(dw_loc_detail.GetItemNumber(ll_cur_row, "group_rid")) then // dw_loc_detail.SetItem(ll_cur_row, "group_rid", ll_rid_num) // end if //next // end subroutine public subroutine uf_retrieve_dw_permit_detail ();// Purpose: retrieve data for dw_permit_detail long ll_rid ll_rid = dw_permit_master.GetItemNumber(dw_permit_mDAT*X aster.GetRow(), "permit_condition_rid") dw_permit_detail.SetTransObject(SQLCA) // Retrieve data for dw_permit_detail dw_permit_detail.Retrieve(ll_rid) end subroutine public subroutine uf_retrieve_dw_permit_master (long ref_rid);// Purpose: Retrieve data for dw_permit_master // Store ref_rid into instance variable il_ref_rid = ref_rid dw_permit_master.SetTransObject(SQLCA) // Retrieve data for dw_permit_master dw_permit_master.Retrieve(il_ref_rid) end subroutine on destrucDAT*Z tor;//dw_loc_detail.dwModify(is_orig_sql) end on on constructor;//is_orig_sql = dw_loc_detail.dwDescribe("DateWindow.Table.Select") end on on u_dw_permit_condition.create this.dw_permit_detail=create dw_permit_detail this.dw_permit_master=create dw_permit_master this.r_1=create r_1 this.r_2=create r_2 this.Control[]={ this.dw_permit_detail,& this.dw_permit_master,& this.r_1,& this.r_2} end on on u_dw_permit_condition.destroy destroy(this.dw_permit_detail) destroy(this.dw_permDAT*\ it_master) destroy(this.r_1) destroy(this.r_2) end on type dw_permit_detail from u_dw_list within u_dw_permit_condition event select_one pbm_custom21 event select_all pbm_custom22 event save pbm_custom23 int X=46 int Y=509 int Width=2515 int Height=365 int TabOrder=20 string DataObject="d_permit_condition_metrics" boolean HScrollBar=false boolean HSplitScroll=false end type on select_one;call u_dw_list::select_one;//uf_check_pending() end on on select_all;call u_dw_list::sDAT*^ elect_all;//uf_check_pending() end on on save;call u_dw_list::save;//uf_save() end on on delete_row;call u_dw_list::delete_row;ib_obj_modified = TRUE end on on last_row;call u_dw_list::last_row;This.ScrollToRow(This.RowCount()) end on on add_row;call u_dw_list::add_row;if uf_check_pending() then This.InsertRow(This.GetRow()) This.ScrollPriorRow() This.TriggerEvent(Rowfocuschanged!) ib_new_detail = TRUE end if end on on first_row;call u_dw_list::first_row;This.ScrolDAT*` lToRow(1) end on on getfocus;call u_dw_list::getfocus;//window lw_active_sheet //string lw_active_sheet_name // Put green focus around this datawindow r_2.Show() //// Get current active sheet for this mdi frame //lw_active_sheet = w_mdi_main.GetActiveSheet() // //// Get the name assigned to this active sheet //lw_active_sheet_name = lw_active_sheet.ClassName() // //// Make this datawindow the active datawindow in that sheet //choose case lw_active_sheet_name // case "w_geo" /DAT*b / w_geo.idw_active = This // case "w_source" // w_source.idw_active = This // case "w_device" // w_device.idw_active = This //end choose w_process.idw_active = This end on on losefocus;call u_dw_list::losefocus;// Hide the green focus r_2.Hide() end on on mousemove;call u_dw_list::mousemove;//SetMicroHelp(w_mdi_main, This.Tag) end on on next_row;call u_dw_list::next_row;This.ScrollNextRow() end on on prev_row;call u_dw_list::prev_row;This.ScrollPriorRow() end on tDAT*d ype dw_permit_master from u_dw_freeform within u_dw_permit_condition event select_one pbm_custom21 event select_all pbm_custom22 event save pbm_custom23 int X=46 int Y=33 int Width=2515 int Height=437 int TabOrder=10 string DataObject="d_permit_conditions" boolean Border=true BorderStyle BorderStyle=StyleLowered! end type on select_one;call u_dw_freeform::select_one;//uf_check_pending() end on on select_all;call u_dw_freeform::select_all;//uf_check_pending() end on on save;cDAT*f all u_dw_freeform::save;//uf_save() end on on delete_row;call u_dw_freeform::delete_row;ib_obj_modified = TRUE end on on rowfocuschanged;call u_dw_freeform::rowfocuschanged;// Only retrieve detail record when there are any master records // Otherwise, clean the contents of dw_permit_detail if This.RowCount() > 0 then // Call this function to retrieve data for dw_permit_detail uf_retrieve_dw_permit_detail() else dw_permit_detail.Reset() end if end on on first_row;call u_dw_DAT*h freeform::first_row;if uf_check_pending() then This.ScrollToRow(1) end if end on on last_row;call u_dw_freeform::last_row;if uf_check_pending() then This.ScrollToRow(This.RowCount()) end if end on on retrieveend;call u_dw_freeform::retrieveend;// Only retrieve detail record when there are any master records // Otherwise, clean the contents of dw_loc_detail //if This.RowCount() > 0 then // Call this function to retrieve data for dw_loc_detail // uf_retrieve_dw_loc_detail() /DAT*j /else // dw_permit_detail.Reset() //end if end on on getfocus;call u_dw_freeform::getfocus;//window lw_active_sheet //string lw_active_sheet_name // Put green focus around this datawindow r_1.Show() //// Get current active sheet for this mdi frame //lw_active_sheet = w_mdi_main.GetActiveSheet() // //// Get the name assigned to this active sheet //lw_active_sheet_name = lw_active_sheet.ClassName() // //// Make this datawindow the active datawindow in that sheet //choose case lDAT*l w_active_sheet_name // case "w_geo" // w_geo.idw_active = This // case "w_source" // w_source.idw_active = This // case "w_device" // w_device.idw_active = This //end choose w_process.idw_active = This end on on add_row;call u_dw_freeform::add_row;if uf_check_pending() then This.InsertRow(This.GetRow()) This.ScrollPriorRow() This.TriggerEvent(Rowfocuschanged!) ib_obj_modified = TRUE ib_new_master = TRUE end if end on on mousemove;call u_dw_freeform::mousemDAT*n ove;//string objNameStr, objName // //objNameStr = This.dwGetObjectAtPointer() //objName = Left(objNameStr, Pos(objNameStr, "~t") - 1) //SetMicroHelp(w_mdi_main, This.Tag) //Parent.Title = wTitle + " - " + This.Tag end on on losefocus;call u_dw_freeform::losefocus;// Hide the green focus r_1.Hide() end on on prev_row;call u_dw_freeform::prev_row;if uf_check_pending() then This.ScrollPriorRow() end if end on on next_row;call u_dw_freeform::next_row;if uf_check_pending() thenDAT*p  This.ScrollNextRow() end if end on type r_1 from rectangle within u_dw_permit_condition int X=28 int Y=17 int Width=2556 int Height=473 boolean Visible=false boolean Enabled=false int LineThickness=14 long LineColor=32768 long FillColor=32768 end type type r_2 from rectangle within u_dw_permit_condition int X=28 int Y=497 int Width=2556 int Height=397 boolean Visible=false boolean Enabled=false int LineThickness=19 long LineColor=32768 long FillColor=32768 end type DAT* DAT*t st_3 ddlb_source_type ddlb_source_type st_2 st_2 ddlb_mode ddlb_mode cb_browse_2 cb_browse_2 cb_browse_1 cb_browse_1 sle_log_file sle_log_file sle_output_file sle_output_file st_rpt_msg st_rpt_msg st_1 st_1 cb_close cb_close cb_generate cb_generate gb_6 gb_6 gb_5 gb_5 gb_4 gb_4 gb_3 gb_3 gb_2 gb_2 gb_1 gb_1 r_1 r_1 end type global w_rpt_sas w_rpt_sas type variables string is_individual = 'O' string is_tier1 = 'O' string is_tier2 = 'O' string is_tier3 = 'O' string is_staDAT*v te = 'O' string is_county = 'O' string is_region = 'O' string is_selected_items[] long il_selected_items[] string is_sasdir string is_userdir boolean ib_sas_run end variables forward prototypes public subroutine wf_select_all_dw_rows (datawindow dw_obj, checkbox cbx_obj) public function boolean wf_create_view () public function boolean wf_check_required () public function boolean wf_write_tierparm_file (string ps_dsn, string ps_uid) public subroutine wf_retrieve_selected_rows (dataDAT*x window pdw_dw_obj, string ps_dw_field_name, string ps_field_data_type, ref string ps_selected_items[], ref long pl_selected_items[]) end prototypes public subroutine wf_select_all_dw_rows (datawindow dw_obj, checkbox cbx_obj);// This function selects or unselect all rows in the datawindow integer li_total_items, li_cur_item boolean lb_select_state SetPointer(HourGlass!) // If the checkbox is checked the select all rows in the datawindow if cbx_obj.Checked then lb_select_state = TRDAT*z UE // Otherwise, deselect all rows in the datawindow else lb_select_state = FALSE end if // Get the total number of the items in the listbox li_total_items = dw_obj.RowCount() // Select or unselect all items in the listbox for li_cur_item = 1 to li_total_items dw_obj.SelectRow(li_cur_item, lb_select_state) next end subroutine public function boolean wf_create_view ();//// purpose: Creates a permanent view to be accessed by the User Interface //// when creating the sDAT*| etup to generate tier reports in SAS. // //string ls_source, ls_material[], ls_unit, ls_null[1], & // ls_material_list, ls_state_list, ls_county_list, ls_sql_stmnt, & // ls_ref_code, ls_where_ref_code, ls_where_state, ls_where_county //datetime ldt_from, ldt_to //long ll_state[], ll_county[], ll_null[1] //integer li_array_len, li_counter // //SetPointer(HourGlass!) // //// First, get reporting arguments from the window // // //// Get source type //ls_source = ddlb_source_type.Text DAT*~ //choose case ls_source // case 'Point' // ls_source = "'F'" // case 'Area' // ls_source = "'A'" // case 'Both' // ls_source = "'F', 'A'" //end choose // //// Get from and to dates //ldt_from = DateTime(Date(em_from_date.Text)) //ldt_to = DateTime(Date(em_to_date.Text)) // //// Get unit code //ls_unit = dw_1.GetItemString(1, "unit_code") // //// Get reference code //ls_ref_code = dw_ref_code.GetItemString(1, 'ref_code') //if Not (IsNull(ls_ref_code) or ls_ref_code = '') then DAT* // ls_where_ref_code = "( rap_activities.reference_code = '" + & // ls_ref_code + "' ) AND " //else // ls_where_ref_code = "( rap_activities.reference_code IS NULL ) AND " //end if // //// Get a list of selected materials and concatenate them into a string // //wf_retrieve_selected_rows(dw_4, 'code', 'string', ls_material[], ll_null[]) // //// Get the current size of the array //li_array_len = UpperBound(ls_material[]) // //// Perform processing on each element //for li_counter = 1 DAT* to li_array_len // if ls_material_list = '' then // ls_material_list = "'" + ls_material[li_counter] + "'" // else // ls_material_list = ls_material_list + ", '" + & // ls_material[li_counter] + "'" // end if //next // //// Get a list of selected states and concatenate them into a string // //if Not cbx_all_states.Checked then // wf_retrieve_selected_rows(dw_2, 'rid', 'number', ls_null[], ll_state[]) // // // Get the current size of the array // li_array_len = UpperBound(ll_statDAT* e[]) // // // Perform processing on each element // for li_counter = 1 to li_array_len // if ls_state_list = '' then // ls_state_list = String(ll_state[li_counter]) // else // ls_state_list = ls_state_list + ", " + String(ll_state[li_counter]) // end if // next // if li_array_len > 0 then // ls_where_state = & // "( rap_geographic_locations_b.rid in (" + ls_state_list + ")) AND " // end if //end if // //// Get a list of selected counties and concatenate them into a striDAT* ng // //if Not cbx_all_counties.Checked then // wf_retrieve_selected_rows(dw_3, 'rid', 'number', ls_null[], ll_county[]) // // // Get the current size of the array // li_array_len = UpperBound(ll_county[]) // // // Perform processing on each element // for li_counter = 1 to li_array_len // if ls_county_list = '' then // ls_county_list = String(ll_county[li_counter]) // else // ls_county_list = ls_county_list + ", " + & // String(ll_county[li_counter]) // end if // next /DAT* / if li_array_len > 0 then // ls_where_county = & // "( rap_geographic_locations_a.rid in (" + ls_county_list + ")) AND " // end if //end if // //// Drop the old view first //ls_sql_stmnt = 'DROP VIEW vrap_sas_tier_reports' //EXECUTE IMMEDIATE :ls_sql_stmnt; // //// Create the view // //ls_sql_stmnt = 'CREATE VIEW vrap_sas_tier_reports ( staterid, state, ' + & // 'cntyrid, county, t1_code, t1_name, ' + & // 't2_code, t2_name, t3_code, t3_name, polid, ' + & // 'emsum ) AS ' + & /DAT* / 'SELECT rap_geographic_locations_b.rid, ' + & // 'rap_geographic_locations_b.name, rap_geographic_locations_a.rid, ' + & // 'rap_geographic_locations_a.name, ' + & // 'SUBSTR( rap_tier_codes_c.code, 1 ,2 ), rap_tier_codes_c.name, ' + & // 'SUBSTR( rap_tier_codes_b.code, 1, 4 ), rap_tier_codes_b.name, ' + & // 'rap_tier_codes_a.code, rap_tier_codes_a.name, ' + & // 'rap_activities.material_code, ' + & // 'rap_activities.value_amt * rap_units_a.conversion_factor_amt / ' + & // 'rap_units_bDAT* .conversion_factor_amt ' + & // 'FROM rap_activities, rap_metrics, rap_units rap_units_a, ' + & // 'rap_units rap_units_b, rap_streams, ' + & // 'rap_processes, rap_scc_ams_codes, ' + & // 'rap_tier_codes rap_tier_codes_a, ' + & // 'rap_tier_codes rap_tier_codes_b, ' + & // 'rap_tier_codes rap_tier_codes_c, ' + & // 'rap_devices, rap_sources, ' + & // 'rap_geographic_locations rap_geographic_locations_a, ' + & // 'rap_geographic_locations rap_geographic_locations_b ' + & // "WHERE ( rap_DAT* activities.metric_code = 'DOWNSTRMDIS' ) AND " + & // ls_where_ref_code + & // "( rap_activities.ref_rid = rap_streams.rid ) AND " + & // '( rap_streams.from_process_rid = rap_processes.rid ) AND ' + & // '( rap_processes.scc_ams_code = rap_scc_ams_codes.code ) AND ' + & // '( rap_scc_ams_codes.tier_code = rap_tier_codes_a.code ) AND ' + & // '( SUBSTR(rap_tier_codes_a.code,1,4) = rap_tier_codes_b.code ) AND ' + & // '( SUBSTR(rap_tier_codes_b.code,1,2) = rap_tier_codes_c.code ) AND ' + & DAT* // '( rap_processes.device_rid = rap_devices.rid ) AND ' + & // '( rap_devices.source_rid = rap_sources.rid ) AND ' + & // '( rap_sources.geographic_county_rid = ' + & // 'rap_geographic_locations_a.rid ) AND ' + & // '( rap_geographic_locations_a.parent_rid = ' + & // 'rap_geographic_locations_b.rid ) AND ' + & // "( rap_sources.type in (" + ls_source + ")) AND " + & // "( rap_activities.start_date_time >= " + & // f_compare_date_time(SQLCA, ldt_from) + ") AND " + & // "( rap_activities.DAT* end_date_time <= " + & // f_compare_date_time(SQLCA, ldt_to) + ") AND " + & // "( rap_activities.material_code in (" + ls_material_list + ")) AND " + & // ls_where_county + & // ls_where_state + & // '( rap_activities.metric_code = rap_metrics.code ) AND ' + & // '( rap_metrics.meas_code = rap_units_a.meas_code ) AND ' + & // '( rap_metrics.meas_code = rap_units_b.meas_code ) AND ' + & // '( rap_units_a.code = rap_activities.value_unit_code ) AND ' + & // "( rap_units_b.code = '" + ls_uniDAT* t + "')" // //EXECUTE IMMEDIATE :ls_sql_stmnt; //if f_db_error(SQLCA, "Fail on creating view vrap_tier_reports. Contact " + & // "your technical support") = 1 then // return FALSE //end if // return TRUE end function public function boolean wf_check_required ();// This function checks if all required fields are entered before // generating report DataWindowChild dwc string ls_reference_code SetPointer(HourGlass!) if is_tier1 = 'O' and is_tier2 = 'O' and is_tier3 = 'O' and &DAT*  is_state = 'O' and is_county = 'O' and is_region = 'O' then MessageBox(This.Title, 'No report is selected.~nPlease select ' + & 'one or more reports to generate') cbx_tier1.SetFocus() return FALSE end if if sle_output_file.Text = '' then MessageBox(This.Title, 'Sorry! Output File Name is required') sle_output_file.SetFocus() return FALSE end if if sle_log_file.Text = '' then MessageBox(This.Title, 'Sorry! Log File Name is required') sle_log_file.SetFocus() return FADAT* LSE end if if ddlb_mode.Text = '' then MessageBox(This.Title, 'Sorry! Operation Mode is required') ddlb_mode.SetFocus() return FALSE end if if ddlb_source_type.Text = '' then MessageBox(This.Title, 'Sorry! Source Type is required') ddlb_source_type.SetFocus() return FALSE end if // Check to make sure from date is valid IF NOT IsDate(em_from_date.Text) THEN MessageBox(This.Title, "Sorry! From Date is Invalid") em_from_date.SetFocus() Return FALSE END IF // CDAT* heck to make sure to date is valid IF NOT IsDate(em_to_date.Text) THEN MessageBox(This.Title, "Sorry! End Date is Invalid") em_to_date.SetFocus() Return FALSE END IF // Check to make sure from date is before (or same as) to date IF DaysAfter( Date(em_from_date.Text), Date(em_to_date.Text) ) < 0 THEN MessageBox(This.Title, "From Date must be earlier than To Date") em_from_date.SetFocus() Return FALSE END IF dw_unit_code.AcceptText() if dw_unit_code.GetItemString(1DAT* , 'code') = '' or & IsNull(dw_unit_code.GetItemString(1, 'code')) then MessageBox(This.Title, 'Sorry! Unit of Measure is required') dw_unit_code.SetFocus() return FALSE end if // Make it non-mandatory for now, 9/20/94 //ls_reference_code = dw_ref_code.GetItemString(1, "ref_code") //if IsNull(ls_reference_code) or ls_reference_code = '' then // MessageBox("DataWindow Error", "Sorry! Reference Code is required", Information!) // dw_ref_code.SetColumn("ref_code") // return FALSE DAT* //end if if dw_4.GetSelectedRow(0) = 0 then MessageBox(This.Title, 'Sorry! At least one material code is required') dw_4.SetFocus() return FALSE end if if dw_2.GetSelectedRow(0) = 0 then MessageBox(This.Title, 'Sorry! At least one state is required') dw_2.SetFocus() return FALSE end if if dw_county.GetSelectedRow(0) = 0 then MessageBox(This.Title, 'Sorry! At least one county is required') dw_county.SetFocus() return FALSE end if // Pass validation check return TRUDAT* E end function public function boolean wf_write_tierparm_file (string ps_dsn, string ps_uid);// This function writes the parameters to a file named TIERPARM.TXT // in the userdir directory. The file is a multi line tab-delimited file. string ls_file, ls_region, ls_material[], ls_null[], ls_priority integer li_file_num, li_array_len, li_counter long ll_state[], ll_county[], ll_null[] SetPointer(HourGlass!) ls_file = is_userdir + '\tierparm.txt' // Check to see if TIERPARM.TXT alDAT* ready exists. If it exists, overwrite // the file if FileExists(ls_file) then li_file_num = FileOpen(ls_file, LineMode!, Write!, LockReadWrite!, & Replace!) // Otherwise, create the file else li_file_num = FileOpen(ls_file, LineMode!, Write!, LockReadWrite!, & Append!) end if // Error checking if li_file_num = -1 then MessageBox(Upper(ls_file), "Error opening file.", StopSign!) return FALSE end if // Substitute 'O' for the parameter written for the region variable, DAT* if // this variable is null if sle_region.Text = '' then ls_region = 'O' else ls_region = sle_region.Text end if // Write the parameters to the file if not f_write_line(li_file_num, ls_file, 'SAS DIRECTORY', is_sasdir) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SAS USERDIR', is_userdir) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'CONNECTION TYPE', SQLCA.dbms) then return FALSE end if if not f_write_line(li_file_num,DAT*  ls_file, 'DSN', ps_dsn) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'UID', ps_uid) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'FROM DATE', em_from_date.Text) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'FROM TIME', & String(DateTime(Date(em_from_date.Text)), "yyyy-mm-dd hh:mm:ss")) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'TO DATE', em_to_date.Text) then return FALSE end if if DAT* not f_write_line(li_file_num, ls_file, 'TO TIME', & String(DateTime(Date(em_to_date.Text)), "yyyy-mm-dd hh:mm:ss")) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SOURCE TYPE', ddlb_source_type.Text) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'UNIT CODE', dw_unit_code.GetItemString(1, "code")) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'REFERENCE CODE', dw_ref_code.GetItemString(1, "code")) then return FALSE end iDAT* f // Write material codes to the file wf_retrieve_selected_rows(dw_4, 'code', 'string', ls_material[], ll_null[]) li_array_len = UpperBound(ls_material[]) if not f_write_line(li_file_num, ls_file, 'MATERIALS', String(li_array_len)) then return FALSE end if for li_counter = 1 to li_array_len if not f_write_line(li_file_num, ls_file, String(li_counter), ls_material[li_counter]) then return FALSE end if next // Write selected state codes to the file if Not cbx_all_states.CheckedDAT*  then wf_retrieve_selected_rows(dw_2, 'rid', 'number', ls_null[], ll_state[]) li_array_len = UpperBound(ll_state[]) else li_array_len = 0 end if if not f_write_line(li_file_num, ls_file, 'STATES', String(li_array_len)) then return FALSE end if for li_counter = 1 to li_array_len if not f_write_line(li_file_num, ls_file, String(li_counter), String(ll_state[li_counter])) then return FALSE end if next // Write selected county codes to the file if Not cbx_all_counties.Checked tDAT* hen wf_retrieve_selected_rows(dw_county, 'rid', 'number', ls_null[], ll_county[]) li_array_len = UpperBound(ll_county[]) else li_array_len = 0 end if if not f_write_line(li_file_num, ls_file, 'COUNTIES', String(li_array_len)) then return FALSE end if for li_counter = 1 to li_array_len if not f_write_line(li_file_num, ls_file, String(li_counter), String(ll_county[li_counter])) then return FALSE end if next if not f_write_line(li_file_num, ls_file, 'REGION TITLE', ls_region) DAT* then return FALSE end if if not f_write_line(li_file_num, ls_file, 'TIER 1 REPORT', is_tier1) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'TIER 2 REPORT', is_tier2) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'TIER 3 REPORT', is_tier3) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'COUNTY REPORT', is_county) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'STATE REPORT', is_state) then returDAT* n FALSE end if if not f_write_line(li_file_num, ls_file, 'REGION REPORT', is_region) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'LINES', em_line.Text) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'COLUMNS', em_column.Text) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SINGLE STATE', is_individual) then return FALSE end if // look up priorities from rapids.ini file ls_priority = ProfileString(gs_iniFile, 'data DAT* code priority', 'null', & 'not found') IF ls_priority = 'not found' THEN // Do this in case that rapids.ini does not have this key ls_priority = '99' SetProfileString(gs_iniFile, 'data code priority', 'null', ls_priority) END IF if not f_write_line(li_file_num, ls_file, 'NULL PRIORITY', ls_priority) then return FALSE end if ls_priority = ProfileString(gs_iniFile, 'data code priority', 'RO', & 'not found') IF ls_priority = 'not found' THEN // Do this in case that rapids.ini doDAT* es not have this key ls_priority = '00' SetProfileString(gs_iniFile, 'data code priority', 'RO', ls_priority) END IF if not f_write_line(li_file_num, ls_file, 'RO PRIORITY', ls_priority) then return FALSE end if // Close the file if FileClose(li_file_num) = -1 then MessageBox(Upper(ls_file), "Error closing the file.", StopSign!) return FALSE end if // Write to file successfully! return TRUE end function public subroutine wf_retrieve_selected_rows (datawindow pdw_dw_obj, sDAT* tring ps_dw_field_name, string ps_field_data_type, ref string ps_selected_items[], ref long pl_selected_items[]);// This function retrieves all selected row from a datawindow long ll_cur_row integer li_counter = 1 SetPointer(HourGlass!) ll_cur_row = pdw_dw_obj.GetSelectedRow(ll_cur_row) do while ll_cur_row <> 0 if ps_field_data_type = 'string' then ps_selected_items[li_counter] = & pdw_dw_obj.GetItemString(ll_cur_row, ps_dw_field_name) else pl_selected_items[li_counter] DAT* = & pdw_dw_obj.GetItemNumber(ll_cur_row, ps_dw_field_name) end if li_counter = li_counter + 1 ll_cur_row = pdw_dw_obj.GetSelectedRow(ll_cur_row) loop end subroutine on other;// This script checks the sas error when the user returns to PowerBuilder // from SAS string ls_file, ls_text integer li_file_num, li_bytes_read long ll_pos // 28 is the window message number for WM_ACTIVATEAPP // wordparm <> 0 means when this window has been brought from inactive // to active if MDAT* essage.Number = 28 and Message.WordParm <> 0 and ib_sas_run then ib_sas_run = FALSE ls_file = is_userdir + '\sqlxrc.tie' if FileExists(ls_file) then li_file_num = FileOpen(ls_file, LineMode!, Read!, LockReadWrite!) // Error checking if li_file_num = -1 then MessageBox(Upper(ls_file), "Error opening file.", StopSign!) else // Read the first line - sql error code li_bytes_read = FileRead(li_file_num, ls_text) if li_bytes_read > 0 then // Read the second lDAT* ine - sql error text li_bytes_read = FileRead(li_file_num, ls_text) if li_bytes_read > 0 then MessageBox('Error generating ' + This.Title, ls_text) end if elseif li_bytes_read = -1 then MessageBox(Upper(ls_file), "Error reading file.", StopSign!) elseif li_bytes_read = -100 or li_bytes_read = 0 then MessageBox(Upper(ls_file), "Empty file.", StopSign!) end if FileClose(li_file_num) end if // Delete the error file if Not FileDelete(ls_file) tDAT* hen MessageBox(This.Title, 'Error deleting file ' + ls_file) end if end if end if end on on resize;f_put_scroll_bars(This) end on on open;//string ls_file, ls_text //integer li_file_num, li_bytes_read //long ll_pos // //ls_file = is_userdir + '\sqlxrc.tie' // //if FileExists(ls_file) then // // li_file_num = FileOpen(ls_file, LineMode!, Read!, LockReadWrite!) // // Error checking // if li_file_num = -1 then // MessageBox(Upper(ls_file), "Error opening file.", StDAT* opSign!) // else // li_bytes_read = FileRead(li_file_num, ls_text) // FileClose(li_file_num) // // if li_bytes_read = -1 then // MessageBox(Upper(ls_file), "Error reading file.", StopSign!) // elseif li_bytes_read <> -100 and li_bytes_read <> 0 then // ll_pos = Pos(ls_text, 'sqlxmsg') // if ll_pos > 0 then // MessageBox('Error generating ' + This.Title, & // Right(ls_text, Len(ls_text) - (ll_pos - 7))) // if Not FileDelete(ls_file) then // MessageBox(This.TitleDAT* , 'Error deleting file ' + ls_file) // end if // end if // end if // // end if // //end if end on on w_rpt_sas.create this.dw_unit_code=create dw_unit_code this.dw_ref_code=create dw_ref_code this.dw_4=create dw_4 this.dw_county=create dw_county this.dw_2=create dw_2 this.st_8=create st_8 this.st_7=create st_7 this.em_column=create em_column this.em_line=create em_line this.cbx_individual=create cbx_individual this.cbx_region=create cbx_region this.cbx_tier3=create cbxDAT* _tier3 this.cbx_state=create cbx_state this.cbx_county=create cbx_county this.cbx_tier2=create cbx_tier2 this.cbx_tier1=create cbx_tier1 this.st_6=create st_6 this.cbx_all_materials=create cbx_all_materials this.sle_region=create sle_region this.cbx_all_counties=create cbx_all_counties this.cbx_all_states=create cbx_all_states this.st_5=create st_5 this.st_4=create st_4 this.em_to_date=create em_to_date this.em_from_date=create em_from_date this.st_3=create st_3 this.ddlb_source_typDAT*forward global type u_dw_plain from datawindow end type end forward global type u_dw_plain from datawindow int Width=385 int Height=289 int TabOrder=1 boolean LiveScroll=true end type global u_dw_plain u_dw_plain DAT* e=create ddlb_source_type this.st_2=create st_2 this.ddlb_mode=create ddlb_mode this.cb_browse_2=create cb_browse_2 this.cb_browse_1=create cb_browse_1 this.sle_log_file=create sle_log_file this.sle_output_file=create sle_output_file this.st_rpt_msg=create st_rpt_msg this.st_1=create st_1 this.cb_close=create cb_close this.cb_generate=create cb_generate this.gb_6=create gb_6 this.gb_5=create gb_5 this.gb_4=create gb_4 this.gb_3=create gb_3 this.gb_2=create gb_2 this.gb_1=create gb_DAT* 1 this.r_1=create r_1 this.Control[]={ this.dw_unit_code,& this.dw_ref_code,& this.dw_4,& this.dw_county,& this.dw_2,& this.st_8,& this.st_7,& this.em_column,& this.em_line,& this.cbx_individual,& this.cbx_region,& this.cbx_tier3,& this.cbx_state,& this.cbx_county,& this.cbx_tier2,& this.cbx_tier1,& this.st_6,& this.cbx_all_materials,& this.sle_region,& this.cbx_all_counties,& this.cbx_all_states,& this.st_5,& this.st_4,& this.em_to_date,& this.em_from_date,& this.st_3,&DAT*(  this.ddlb_source_type,& this.st_2,& this.ddlb_mode,& this.cb_browse_2,& this.cb_browse_1,& this.sle_log_file,& this.sle_output_file,& this.st_rpt_msg,& this.st_1,& this.cb_close,& this.cb_generate,& this.gb_6,& this.gb_5,& this.gb_4,& this.gb_3,& this.gb_2,& this.gb_1,& this.r_1} end on on w_rpt_sas.destroy destroy(this.dw_unit_code) destroy(this.dw_ref_code) destroy(this.dw_4) destroy(this.dw_county) destroy(this.dw_2) destroy(this.st_8) destroy(this.st_7) destroy(tDAT* Calculation protocol windowforward global type w_cal_protocol from w_master_detail end type end forward global type w_cal_protocol from w_master_detail int X=324 int Y=177 int Width=2980 int Height=1565 boolean TitleBar=true string Title="Calculation Protocol" boolean MinBox=true boolean MaxBox=true string Icon="CAL_PROT.ICO" event highlight_dddw pbm_custom33 end type global w_cal_protocol w_cal_protocol type variables long masterRid; string is_child_name; string is_validatDAT* ion_table string is_column_status = "valid" string is_msg_name string is_msg_text long il_selected_row datawindowchild idwc_dw_child string is_column_name string is_old_value end variables forward prototypes public function boolean wf_check_required () public subroutine wf_draw_dw2 () public subroutine wf_select_one () public function long wf_cascade_del () public function boolean wf_check_rid (datawindow dw_obj) end prototypes on highlight_dddw;call w_master_detail::highlighDAT* t_dddw;if il_selected_row > 0 then idwc_dw_child.SelectRow(il_selected_row, TRUE) end if end on public function boolean wf_check_required ();long ll_cur_row, ll_total_row, ll_rec_group_num, ll_seq_num string ls_method_code, ls_sub_type, ls_item_type, ls_material_code if dw_1.AcceptText() < 0 then return false if dw_2.AcceptText() < 0 then return false if dw_3.AcceptText() < 0 then return false ll_cur_row = dw_1.GetRow() ls_method_code = dw_1.GetItemString(ll_cur_row, "method_coDAT* de") if IsNull(ls_method_code) or ls_method_code = '' then MessageBox("DataWindow Error", "Sorry! Method Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("method_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if if IsNull(dw_1.GetItemNumber(ll_cur_row, "priority_no")) then MessageBox("DataWindow Error", "Sorry! Priority Number is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("priority_DAT* no") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_sub_type = dw_1.GetItemString(ll_cur_row, "sub_type") if IsNull(ls_sub_type) or ls_sub_type = '' then MessageBox("DataWindow Error", "Sorry! Sub Type is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("sub_type") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ll_total_row = dw_2.RowCount() for ll_cur_row = 1 to ll_total_row ll_rec_group_num = dw_2.GetItemNumber(ll_cuDAT* r_row, "record_group_no") if IsNull(ll_rec_group_num) or ll_rec_group_num = 0 then MessageBox("DataWindow Error", "Sorry! Record Group Number is required", Information!) dw_2.SetFocus() dw_2.SetRow(ll_cur_row) dw_2.SetColumn("record_group_no") dw_2.ScrollToRow(ll_cur_row) return FALSE end if ll_seq_num = dw_2.GetItemNumber(ll_cur_row, "sequence_no") if IsNull(ll_seq_num) or ll_seq_num = 0 then MessageBox("DataWindow Error", "Sorry! Sequence Number is DAT* required", Information!) dw_2.SetFocus() dw_2.SetRow(ll_cur_row) dw_2.SetColumn("sequence_no") dw_2.ScrollToRow(ll_cur_row) return FALSE end if ls_item_type = dw_2.GetItemString(ll_cur_row, "item_type") if IsNull(ls_item_type) or ls_item_type = '' then MessageBox("DataWindow Error", "Sorry! Item Type is required", Information!) dw_2.SetFocus() dw_2.SetRow(ll_cur_row) dw_2.SetColumn("item_type") dw_2.ScrollToRow(ll_cur_row) return FALSE DAT*  end if ls_material_code = dw_2.GetItemString(ll_cur_row, "numer_material_code") if IsNull(ls_material_code) or ls_material_code = '' then MessageBox("DataWindow Error", "Sorry! Numer Material Code is required", Information!) dw_2.SetFocus() dw_2.SetRow(ll_cur_row) dw_2.SetColumn("numer_material_code") dw_2.ScrollToRow(ll_cur_row) return FALSE end if next return TRUE end function public subroutine wf_draw_dw2 (); dw_2.SetRedraw(FALSE) dw_3.SetRedrDAT* aw(FALSE) if dw_1.RowCount() > 0 then masterRid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") dw_2.Retrieve(masterRid) // Share data between dw_2 and dw_3 dw_2.ShareData(dw_3) end if dw_2.SetRedraw(TRUE) dw_3.SetRedraw(TRUE) end subroutine public subroutine wf_select_one (); SetPointer(HourGlass!) // Open the filter window with parameter - table name if idw_active.ClassName() = "dw_2" or idw_active.ClassName() = "dw_3" then OpenWithParm(w_filter, 'rap_method_metrics'DAT* ) else OpenWithParm(w_filter, 'rap_calculation_protocols') end if // If filter flag is set to true, then trigger the filter event to perform // filter if gb_filter then gb_filter = FALSE This.TriggerEvent("filter") end if end subroutine public function long wf_cascade_del ();// Override the ancestor's function string ls_dw_name long ll_cnt, ll_rid, ll_cur_row int li_ind, li_record_group_no, li_seq_no // Get the current datawindow object ls_dw_name = idw_active.DataObDAT* ject ll_cur_row = idw_active.GetRow() ll_rid = idw_active.GetItemNumber(ll_cur_row, "rid") // Get the count of records involved if ls_dw_name = 'd_cal_protocol' then ll_cnt = f_del_cal_protocol(ll_rid, sqlca, FALSE) // Get user verification if more than one record if ll_cnt > 1 then li_ind = MessageBox(ls_dw_name, & "Deleting this record will also delete " & + String(ll_cnt - 1) + & " child records.~r~nDo you want to continue?", & Question!, YesNo!, 2) DAT* elseif ll_cnt = 1 then li_ind = 1 else li_ind = 0 // There was an error end if if li_ind = 1 then ll_cnt = f_del_cal_protocol(ll_rid, sqlca, TRUE) elseif li_ind = 2 then ll_cnt = -1 // User answered no else ll_cnt = 0 end if // Otherwise, perform delete on d_method_metric or d_method_metric_freeform else li_record_group_no = idw_active.GetItemNumber(ll_cur_row, "record_group_no") li_seq_no = idw_active.GetItemNumber(ll_cur_row, "sequence_no") DAT*  Delete from Rap_Method_Metrics Where Protocol_Rid = :ll_rid and record_group_no = :li_record_group_no and sequence_no = :li_seq_no; if sqlca.sqlcode <> 0 then f_db_error(sqlca, "Error deleting record from rap_method_metrics." + & " Contact your technical support") ll_cnt = -1 else ll_cnt = 1 end if end if return ll_cnt end function public function boolean wf_check_rid (datawindow dw_obj);long ll_row_num, ll_cur_row, ll_rid_num, ll_rid stringDAT*  ls_method_code, ls_sub_type, ls_scc_ams_code, ls_src_code, & ls_dev_code, ls_pro_code, ls_throughput_mat_code, ls_emittant_mat_code integer li_priority_no ll_row_num = dw_obj.RowCount() for ll_cur_row = 1 to ll_row_num if IsNull(dw_obj.GetItemNumber(ll_cur_row, "rid")) then if dw_obj.ClassName() = "dw_1" then if gs_database <> 'ORACLE' then // Check for duplicate keys ls_method_code = dw_1.GetItemString(ll_cur_row, 'method_code') li_priority_no = dw_1.GetItemNumbDAT* er(ll_cur_row, 'priority_no') ls_sub_type = dw_1.GetItemString(ll_cur_row, 'sub_type') ls_scc_ams_code = dw_1.GetItemString(ll_cur_row, "scc_ams_code") ls_src_code = dw_1.GetItemString(ll_cur_row, "source_code") ls_dev_code = dw_1.GetItemString(ll_cur_row, "device_code") ls_pro_code = dw_1.GetItemString(ll_cur_row, "process_code") ls_emittant_mat_code = dw_1.GetItemString(ll_cur_row, "emittant_material_code") ls_throughput_mat_code = dw_1.GetItemString(ll_cur_row, "throDAT* ughput_material_code") // Plug the values into the get function ll_rid = f_get_cal_protocol_rid(ls_method_code, li_priority_no, & ls_sub_type, ls_scc_ams_code, ls_src_code, ls_dev_code, ls_pro_code, & ls_emittant_mat_code, ls_throughput_mat_code) if ll_rid > 0 then MessageBox('Calculation Protocol', 'Method Code, Priority No, Sub Type, ' + & 'SCC AMS Code, Source Code, Device Code, Process Code, ' + & 'Throughput Material Code and Emittant Material Code must DAT* be ' + & 'unique in the table.~nNo changes made to the database.') return FALSE elseif ll_rid < 0 then return FALSE end if end if end if // Select the next available rid from the rid_storage in database ll_rid_num = f_get_sequence() if ll_rid_num = -1 then return FALSE end if if dw_obj.ClassName() = "dw_1" then dw_obj.SetItem(ll_cur_row, "rid", ll_rid_num) else dw_obj.SetItem(ll_cur_row, "rid", dw_1.GetItemNumber(dw_1.GetRowDAT* (), "rid")) end if elseif dw_obj.GetItemStatus(ll_cur_row, 0, Primary!) <> NotModified! then if dw_obj.ClassName() = "dw_1" and gs_database <> 'ORACLE' then // Check for duplicate keys ls_method_code = dw_1.GetItemString(ll_cur_row, 'method_code') li_priority_no = dw_1.GetItemNumber(ll_cur_row, 'priority_no') ls_sub_type = dw_1.GetItemString(ll_cur_row, 'sub_type') ls_scc_ams_code = dw_1.GetItemString(ll_cur_row, "scc_ams_code") ls_src_code = dw_1.GetItemString(ll_DAT* cur_row, "source_code") ls_dev_code = dw_1.GetItemString(ll_cur_row, "device_code") ls_pro_code = dw_1.GetItemString(ll_cur_row, "process_code") ls_emittant_mat_code = dw_1.GetItemString(ll_cur_row, "emittant_material_code") ls_throughput_mat_code = dw_1.GetItemString(ll_cur_row, "throughput_material_code") // Plug the values into the get function ll_rid = f_get_cal_protocol_rid(ls_method_code, li_priority_no, & ls_sub_type, ls_scc_ams_code, ls_src_code, ls_dev_code, ls_pro_cDAT* ode, & ls_emittant_mat_code, ls_throughput_mat_code) if ll_rid > 0 and ll_rid <> dw_1.GetItemNumber(ll_cur_row, 'rid') then MessageBox('Calculation Protocol', 'Method Code, Priority No, Sub Type, ' + & 'SCC AMS Code, Source Code, Device Code, Process Code, ' + & 'Throughput Material Code and Emittant Material Code must be ' + & 'unique in the table.~nNo changes made to the database.') return FALSE elseif ll_rid < 0 then return FALSE end if end if endDAT*  if next return TRUE end function on open;call w_master_detail::open; // Set up variable for handling menu behavior is_state = 'master/detail' dw_1.SetTransObject(SQLCA) dw_2.SetTransObject(SQLCA) if gs_scc_ams_code = '@STREAM' or & IsNull(gs_scc_ams_code) or (gs_scc_ams_code = "") then dw_1.retrieve("none") else dw_1.Retrieve(gs_scc_ams_code) end if end on on w_cal_protocol.create call w_master_detail::create end on on w_cal_protocol.destroy call w_master_DAT* detail::destroy end on type dw_3 from w_master_detail`dw_3 within w_cal_protocol int X=54 int Y=865 int Width=2770 int Height=548 string DataObject="d_method_metric_freeform" end type type dw_2 from w_master_detail`dw_2 within w_cal_protocol event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=54 int Y=865 int Width=2770 int Height=548 string DataObject="d_method_metric" end type on dw_2::dwescape;call w_master_detail`dw_2::dwescape;string ls_col_name if il_selectedDAT* _row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, is_old_value) f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) Parent.PostEvent("highlight_dddw") end if end if end on on dw_2::dwnkey;call w_master_detail`dw_2::dwnkey;string ls_col_name if keydown(keytab!) then if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then DAT* this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if end if end on event dw_2::itemchanged;call super::itemchanged; string ls_col_name ls_col_name = This.GetColumnName() if ls_col_name = is_column_name then if Not f_validate_code(This.GetText(), is_child_name, is_validation_table) then MessageBox(is_msg_name, is_msg_text) return 1 else il_selected_row = idwc_dw_child.GetRow() end DAT* if end if end event event dw_2::dwnprocessenter;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if Send(Handle(This), 256, 9, Long(0,0)) return 1 end event event dw_2::itemfocuschanged;call super::itemfocuschanged;string ls_col_name ls_col_name = This.GetColumnName() iDAT* f ls_col_name = "numer_material_code" or & ls_col_name = "denom_material_code" or & ls_col_name = "metric_code" then f_retrieve_codes(Parent.Title, dw_2, ls_col_name, "code") end if if ls_col_name = "numer_material_code" then il_selected_row = 0 getchild("numer_material_code", idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_old_value = dw_2.getitemstring(dw_2.getrow(), "numer_material_code") is_validation_table = "rap_materials" is_msg_nameDAT*  = "Column - Numerator Material Code" is_msg_text = "Sorry! Not a valid numerator material code" elseif ls_col_name = "denom_material_code" then il_selected_row = 0 getchild("denom_material_code", idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_old_value = dw_2.getitemstring(dw_2.getrow(), "denom_material_code") is_validation_table = "rap_materials" is_msg_name = "Column - Denominator Material Code" is_msg_text = "Sorry! Not a valid denominator matDAT* erial code" elseif ls_col_name = "metric_code" then il_selected_row = 0 getchild("metric_code", idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_old_value = dw_2.getitemstring(dw_2.getrow(), "metric_code") is_validation_table = "rap_metrics" is_msg_name = "Column - Metric Codee" is_msg_text = "Sorry! Not a valid metric code" else is_column_name = "" end if end event on dw_2::editchanged;call w_master_detail`dw_2::editchanged;string ls_col_nameDAT*  ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) if il_selected_row > 0 then Parent.PostEvent("highlight_dddw") end if end if end on event dw_2::itemerror;call super::itemerror;return 2 end event type dw_1 from w_master_detail`dw_1 within w_cal_protocol event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=54 int Y=93 int Width=2770 int Height=733 strDAT* ing DataObject="d_cal_protocol" end type on dw_1::dwescape;call w_master_detail`dw_1::dwescape;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, is_old_value) f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) Parent.PostEvent("highlight_dddw") end if end if //if is_column_name = "method_code" or is_column_name = "mode_type" or & // is_column_DAT* name = "device_code" or is_column_name = "emittant_material_code" or & // is_column_name = "process_code" or is_column_name = "source_code" or & // is_column_name = "throughput_material_code" then // dw_1.setitem(dw_1.getrow(), is_column_name, is_old_value) // f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) //end if end on on dw_1::dwnkey;call w_master_detail`dw_1::dwnkey;string ls_col_name if keydown(keytab!) then if il_selected_row > 0 then ls_col_name = DAT* this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if end if end on event dw_1::clicked;call super::clicked;long ll_cur_row string ls_scc_ams_code ll_cur_row = row if ll_cur_row > 0 then This.AcceptText() ls_scc_ams_code = This.GetItemString(ll_cur_row, 'scc_ams_code') end if if f_look_up(This, "scc_ams_code_t", "SCC/AMS Code Lookup"DAT* , & "select code, desc_1, desc_2, desc_3, desc_4, " + & "device_code, material_code, process_code, " + & "source_code, type, epa_invalid_flag, inventory_invalid_flag, " + & "mode_type, tier_code, unit_code " + & "from rap_scc_ams_codes order by code", ls_scc_ams_code) then This.ib_obj_modified = TRUE end if end event on dw_1::rbuttondown;call w_master_detail`dw_1::rbuttondown;long ll_cur_row string ls_scc_ams_code ll_cur_row = This.GetRow() if ll_cur_row > 0 then This.DAT* AcceptText() ls_scc_ams_code = This.GetItemString(ll_cur_row, 'scc_ams_code') end if if f_look_up(This, "scc_ams_code", "SCC/AMS Code Lookup", & "select code, desc_1, desc_2, desc_3, desc_4, " + & "device_code, material_code, process_code, " + & "source_code, type, epa_invalid_flag, inventory_invalid_flag, " + & "mode_type, tier_code, unit_code " + & "from rap_scc_ams_codes order by code", ls_scc_ams_code) then This.ib_obj_modified = TRUE end if end on event dw_1::itemchaDAT* nged;call super::itemchanged; string ls_col_name ls_col_name = This.GetColumnName() choose case ls_col_name case "scc_ams_code" if Not f_validate_code(This.GetText(), "code", "rap_scc_ams_codes") and & Pos(This.GetText(), '%') = 0 then MessageBox('Column - SCC/AMS Code', 'Sorry! Not a valid SCC/AMS code') return 1 else il_selected_row = idwc_dw_child.GetRow() end if end choose if ls_col_name = is_column_name then if Not f_validate_code(This.GetText(DAT* ), is_child_name, is_validation_table) then MessageBox(is_msg_name, is_msg_text) return 1 else il_selected_row = idwc_dw_child.GetRow() end if end if end event event dw_1::dwnprocessenter;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if Send(Handle(This), 256,DAT*  9, Long(0,0)) return 1 end event event dw_1::itemfocuschanged;call super::itemfocuschanged;string ls_col_name ls_col_name = This.GetColumnName() if ls_col_name = "mode_type" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "type") elseif ls_col_name = "method_code" or ls_col_name = "device_code" or & ls_col_name = "emittant_material_code" or ls_col_name = "process_code" or & ls_col_name = "source_code" or ls_col_name = "throughput_material_code" then f_retrDAT* ieve_codes(Parent.Title, dw_1, ls_col_name, "code") end if if ls_col_name = "method_code" then il_selected_row = 0 getchild("method_code", idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_old_value = dw_1.getitemstring(dw_1.getrow(), "method_code") is_validation_table = "rap_calculation_methods" is_msg_text = "Sorry! Not a valid method code" is_msg_name = "Column - Method Code" elseif ls_col_name = "device_code" then il_selected_row = 0 getchDAT* ild("device_code", idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_old_value = dw_1.getitemstring(dw_1.getrow(), "device_code") is_validation_table = "rap_device_codes" is_msg_text = "Sorry! Not a valid device code" is_msg_name = "Column - Device Code" elseif ls_col_name = "emittant_material_code" then il_selected_row = 0 getchild("emittant_material_code", idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_old_value = dw_1.DAT* getitemstring(dw_1.getrow(), "emittant_material_code") is_validation_table = "rap_materials" is_msg_text = "Sorry! Not a valid emittant material code" is_msg_name = "Column - Emittant Material Code" elseif ls_col_name = "mode_type" then il_selected_row = 0 getchild("mode_type", idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_old_value = dw_1.getitemstring(dw_1.getrow(), "mode_type") is_validation_table = "rap_modes" is_msg_text = "Sorry! Not a vDAT* alid mode type" is_msg_name = "Column - Mode Type" elseif ls_col_name = "process_code" then il_selected_row = 0 getchild("process_code", idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_old_value = dw_1.getitemstring(dw_1.getrow(), "process_code") is_validation_table = "rap_process_codes" is_msg_text = "Sorry! Not a valid mode type" is_msg_name = "Column - Process Code" elseif ls_col_name = "source_code" then il_selected_row = 0 getchild("souDAT*" rce_code", idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_old_value = dw_1.getitemstring(dw_1.getrow(), "source_code") is_validation_table = "rap_source_codes" is_msg_text = "Sorry! Not a valid source code" is_msg_name = "Column - Source Code" elseif ls_col_name = "throughput_material_code" then il_selected_row = 0 getchild("throughput_material_code", idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_old_value = dw_1.getiDAT*$ temstring(dw_1.getrow(), "throughput_material_code") is_validation_table = "rap_materials" is_msg_text = "Sorry! Not a valid throughput material code" is_msg_name = "Column - Throughput Material Code" else is_column_name = "" end if end event on dw_1::rowfocuschanged;call w_master_detail`dw_1::rowfocuschanged;wf_draw_dw2() if dw_1.RowCount() > 0 then // if rid is null, this means the current row is the new inserted row // then reset the dw_2 if IsNull(dw_1.GetItemNumbDAT*& er(dw_1.GetRow(), "rid")) then dw_2.Reset() end if else // Clean the activity datawindow buffer dw_2.Reset() end if end on on dw_1::editchanged;call w_master_detail`dw_1::editchanged;string ls_col_name ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) if il_selected_row > 0 then Parent.PostEvent("highlight_dddw") end if end if //if is_column_name = "metDAT*hod_code" or is_column_name = "device_code" or & // is_column_name = "emittant_material_code" or & // is_column_name = "mode_type" or is_column_name = "process_code" or & // is_column_name = "source_code" or & // is_column_name = "throughput_material_code" then // f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) //end if end on event dw_1::itemerror;call super::itemerror;return 2 end event DAT** his.em_column) destroy(this.em_line) destroy(this.cbx_individual) destroy(this.cbx_region) destroy(this.cbx_tier3) destroy(this.cbx_state) destroy(this.cbx_county) destroy(this.cbx_tier2) destroy(this.cbx_tier1) destroy(this.st_6) destroy(this.cbx_all_materials) destroy(this.sle_region) destroy(this.cbx_all_counties) destroy(this.cbx_all_states) destroy(this.st_5) destroy(this.st_4) destroy(this.em_to_date) destroy(this.em_from_date) destroy(this.st_3) destroy(this.ddlb_source_tDAT*, ype) destroy(this.st_2) destroy(this.ddlb_mode) destroy(this.cb_browse_2) destroy(this.cb_browse_1) destroy(this.sle_log_file) destroy(this.sle_output_file) destroy(this.st_rpt_msg) destroy(this.st_1) destroy(this.cb_close) destroy(this.cb_generate) destroy(this.gb_6) destroy(this.gb_5) destroy(this.gb_4) destroy(this.gb_3) destroy(this.gb_2) destroy(this.gb_1) destroy(this.r_1) end on on activate;f_menu_behave('base', '', '') end on type dw_unit_code from u_dddw within w_DAT*. rpt_sas int X=129 int Y=631 int Width=1057 int Height=100 int TabOrder=110 string DataObject="d_rpt_units_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type event constructor;call super::constructor;DataWindowChild dwc // Retrieve data for unit of measure dddw // Get the handle of the child datawindow if This.GetChild("code", dwc) = -1 then MessageBox(This.Title, "Application Error:~nUnit Code - " + & "Not a DataWindowChild.~nConDAT*0 tact your technical support.") return end if dwc.SetTransObject(SQLCA) dwc.Retrieve('DOWNSTRMDIS') This.SetTransObject(SQLCA) This.InsertRow(0) end event on itemfocuschanged;call u_dddw::itemfocuschanged;is_child_name = 'code' is_validation_table = 'rap_units' is_msg_name = 'Column - Unit of Measure' is_msg_text = 'Sorry! Not a valid unit code' end on type dw_ref_code from u_dddw within w_rpt_sas int X=129 int Y=740 int Width=1220 int Height=109 int TabOrder=170 strinDAT*2 g DataObject="d_ref_codes_table_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type event constructor;call super::constructor;DataWindowChild dwc // Make the external datawindow display by using InsertRow dw_ref_code.SetTransObject(SQLCA) dw_ref_code.InsertRow(0) // Retrieve data for child datawindow IF dw_ref_code.GetChild("code", dwc) = -1 THEN MessageBox(This.Title, "Application Error:~nReference Code - " + & "Not aDAT*4  DataWindowChild.~nContact your technical support.") return END IF dwc.SetTransObject(sqlca) dwc.Retrieve() end event on itemfocuschanged;call u_dddw::itemfocuschanged;is_child_name = 'code' is_validation_table = 'rap_reference_codes' is_msg_name = 'Column - Reference Code' is_msg_text = 'Sorry! Not a valid reference code' end on type dw_4 from datawindow within w_rpt_sas int X=178 int Y=916 int Width=822 int Height=269 string DataObject="d_rpt_materials" BorderStyle BoDAT*6 rderStyle=StyleLowered! boolean VScrollBar=true boolean LiveScroll=true end type event clicked;//// Call function to perform control and shift click functionalities //il_last_clicked_mat_row = f_highlight_row(This, il_last_clicked_mat_row) long ll_clicked_row ll_clicked_row = GetRow(This) if ll_clicked_row > 0 then if IsSelected(ll_clicked_row) then SelectRow(This, ll_clicked_row, FALSE) else SelectRow(This, ll_clicked_row, TRUE) end if end if // If all materDAT*8 ials has been checked, turn it off if cbx_all_materials.Checked then cbx_all_materials.Checked = FALSE end if end event on constructor;// Retrieve data for material dw This.SetTransObject(SQLCA) This.Retrieve() end on type dw_county from datawindow within w_rpt_sas int X=1988 int Y=916 int Width=726 int Height=269 string DataObject="d_rpt_counties" BorderStyle BorderStyle=StyleLowered! boolean VScrollBar=true boolean LiveScroll=true end type event clicked;//// Call functiDAT*: on to perform control and shift click functionalities //il_last_clicked_county_row = f_highlight_row(This, il_last_clicked_county_row) long ll_clicked_row ll_clicked_row = GetRow(This) if ll_clicked_row > 0 then if IsSelected(ll_clicked_row) then SelectRow(This, ll_clicked_row, FALSE) else SelectRow(This, ll_clicked_row, TRUE) end if end if // If all counties has been checked, turn it off if cbx_all_counties.Checked then cbx_all_counties.Checked = FALSE end if DAT*<  end event on constructor;//// Retrieve data for county dw //This.SetTransObject(SQLCA) //This.Retrieve() end on type dw_2 from datawindow within w_rpt_sas int X=1131 int Y=916 int Width=726 int Height=269 string DataObject="d_rpt_states" BorderStyle BorderStyle=StyleLowered! boolean VScrollBar=true boolean LiveScroll=true end type event clicked;//// Call function to perform control and shift click functionalities //il_last_clicked_state_row = f_highlight_row(This, il_last_clDAT*> icked_state_row) long ll_clicked_row, ll_selected_row, ll_total_row string ls_orig_sql, ls_err, ls_new_sql, ls_rid_list ll_clicked_row = GetRow(This) if ll_clicked_row > 0 then if IsSelected(ll_clicked_row) then SelectRow(This, ll_clicked_row, FALSE) else SelectRow(This, ll_clicked_row, TRUE) end if ll_total_row = This.RowCount() ll_selected_row = This.GetSelectedRow(0) do while ll_selected_row <> 0 if ls_rid_list = '' then ls_rid_list = String(This.GetItemNuDAT*@ mber(ll_selected_row, 'rid')) else ls_rid_list = ls_rid_list + ', ' + & String(This.GetItemNumber(ll_selected_row, 'rid')) end if if ll_selected_row = ll_total_row then exit ll_selected_row = This.GetSelectedRow(ll_selected_row) loop dw_county.Reset() cbx_all_counties.Enabled = FALSE if ll_selected_row <> 0 then // If all states selected, retrieve all counties if dw_county.Retrieve() > 0 then cbx_all_counties.Enabled = TRUE else // Retrieve county listDAT*B  for the selected states //dwc_county.SetTransObject(SQLCA) ls_orig_sql = dw_county.Describe("datawindow.table.select") ls_new_sql = ls_orig_sql + ' AND (rap_geographic_locations.parent_rid in (' + & ls_rid_list + '))' ls_err = dw_county.Modify("datawindow.table.select = ~"" + ls_new_sql + "~"") if ls_err <> '' then MessageBox('Modify failed', ls_err) return end if dw_county.SetTransObject(SQLCA) if dw_county.Retrieve() > 0 then cbx_all_counties.Enabled = TRUE DAT*D  // Change the sql statement of dwc back to the original sql statement ls_err = dw_county.Modify("datawindow.table.select = ~"" + ls_orig_sql + "~"") if ls_err <> '' then MessageBox('Modify failed', ls_err) return end if end if end if // If all states has been checked, turn it off if cbx_all_states.Checked then cbx_all_states.Checked = FALSE end if end event on constructor;// Retrieve data for state dw This.SetTransObject(SQLCA) This.Retrieve() end on tyDAT*F pe st_8 from statictext within w_rpt_sas int X=662 int Y=513 int Width=264 int Height=103 boolean Enabled=false string Text="Lines per page:" Alignment Alignment=Right! boolean FocusRectangle=false long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type st_7 from statictext within w_rpt_sas int X=132 int Y=513 int Width=260 int Height=103 boolean EnDAT*H abled=false string Text="Columns per page:" Alignment Alignment=Right! boolean FocusRectangle=false long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type em_column from editmask within w_rpt_sas int X=395 int Y=525 int Width=225 int Height=87 int TabOrder=100 BorderStyle BorderStyle=StyleLowered! string Mask="###" boolean Spin=true double IncrementDAT*J =1 string MinMax="1~~176" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on constructor;// Set default values This.Text = '176' end on on modified;// Default value is 176 if This.Text = '' then This.Text = '176' end if end on type em_line from editmask within w_rpt_sas int X=932 int Y=525 int Width=171 int Height=87 int TabOrder=120 BorderStyle BorderStyle=StyleLowered! string Mask="DAT*L ##" boolean Spin=true double Increment=1 string MinMax="1~~86" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on modified;// Default value is 65 if This.Text = '' then This.Text = '65' end if end on on constructor;// Set default values This.Text = '65' end on type cbx_individual from checkbox within w_rpt_sas int X=146 int Y=433 int Width=964 int Height=71 int TabOrder=70 string Text=DAT*N "Print individual state reports" BorderStyle BorderStyle=StyleLowered! long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;if This.Checked then is_individual = 'X' else is_individual = 'O' end if end on type cbx_region from checkbox within w_rpt_sas int X=790 int Y=327 int Width=516 int Height=71 int TabOrder=60 string Text="Region SumDAT*P mary" BorderStyle BorderStyle=StyleLowered! long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;if This.Checked then is_region = 'X' else is_region = 'O' end if end on type cbx_tier3 from checkbox within w_rpt_sas int X=203 int Y=327 int Width=484 int Height=71 int TabOrder=30 string Text="Tier 3 Summary" BorderStyle BorderStyle=StyleDAT*R Lowered! long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;if This.Checked then is_tier3 = 'X' else is_tier3 = 'O' end if end on type cbx_state from checkbox within w_rpt_sas int X=790 int Y=247 int Width=513 int Height=71 int TabOrder=50 string Text="State Summary" BorderStyle BorderStyle=StyleLowered! long TextColor=8388608 long DAT*T BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;if This.Checked then is_state = 'X' else is_state = 'O' end if end on type cbx_county from checkbox within w_rpt_sas int X=790 int Y=167 int Width=513 int Height=71 int TabOrder=40 string Text="County Summary" BorderStyle BorderStyle=StyleLowered! long TextColor=8388608 long BackColor=12632256 int TextSize=-8 DAT*V int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;if This.Checked then is_county = 'X' else is_county = 'O' end if end on type cbx_tier2 from checkbox within w_rpt_sas int X=203 int Y=247 int Width=484 int Height=71 int TabOrder=20 string Text="Tier 2 Summary" BorderStyle BorderStyle=StyleLowered! long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS DAT*X Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;if This.Checked then is_tier2 = 'X' else is_tier2 = 'O' end if end on type cbx_tier1 from checkbox within w_rpt_sas int X=203 int Y=167 int Width=484 int Height=71 int TabOrder=10 string Text="Tier 1 Summary" BorderStyle BorderStyle=StyleLowered! long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=SwiDAT*Z ss! FontPitch FontPitch=Variable! end type on clicked;if This.Checked then is_tier1 = 'X' else is_tier1 = 'O' end if end on type st_6 from statictext within w_rpt_sas int X=1355 int Y=769 int Width=353 int Height=71 boolean Enabled=false string Text="Region Title:" Alignment Alignment=Right! boolean FocusRectangle=false long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FDAT*\ ontPitch=Variable! end type type cbx_all_materials from checkbox within w_rpt_sas int X=178 int Y=1188 int Width=690 int Height=71 int TabOrder=190 string Text="All Toxic Materials" BorderStyle BorderStyle=StyleLowered! long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;wf_select_all_dw_rows(dw_4, This) end on type sle_region from singlDAT*^ elineedit within w_rpt_sas int X=1718 int Y=756 int Width=1025 int Height=81 int TabOrder=180 BorderStyle BorderStyle=StyleLowered! long TextColor=33554432 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type cbx_all_counties from checkbox within w_rpt_sas int X=1988 int Y=1188 int Width=427 int Height=71 int TabOrder=210 boolean Enabled=false string Text="All Counties" BorderStyle BorderStylDAT*` e=StyleLowered! long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;wf_select_all_dw_rows(dw_county, This) end on type cbx_all_states from checkbox within w_rpt_sas int X=1131 int Y=1188 int Width=377 int Height=71 int TabOrder=200 string Text="All States" BorderStyle BorderStyle=StyleLowered! long TextColor=8388608 long BackColor=12632256DAT*@ int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;wf_select_all_dw_rows(dw_2, This) dw_county.Reset() cbx_all_counties.Enabled = FALSE if This.Checked then dw_county.SetTransObject(SQLCA) if dw_county.Retrieve() > 0 then cbx_all_counties.Enabled = TRUE end if end on type st_5 from statictext within w_rpt_sas int X=2027 int Y=647 int Width=264 int Height=71 boolean Enabled=falsDAT*d p@)b?GA"*p@ap@*@@/\@\@:[@[@Fc@c@SU@U@d@@p@@z@@@@@@a@@a^@^@@@0@0@ n@n@a+`@ag@@a*@*@ "p@ v@v@Q F@F@&p@ &"/q@q@;#AQ_wiso_h w_scc_ams_materialw_single_tablemenuwindowtypewiDAT*f ndowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderUntitleda hSCC/AMS MaterialSCC_MATR.ICOa  datawindowchilda keycoded_scc_ams_material_freeformd_scc_ams_materialw_mdi_mainmessagepointerw_filtertraDAT*h nsactionsqlcags_scc_ams_codef_dddw_searchf_validate_codef_retrieve_codes,t2 w_scc_ams_material   wparamlparam+ue_retrieve_dw+highlight_dddwwf_check_required+dwescapekeykeyflags+dwnkey+wparam+lparam+ue_open_filter_win+open+create+destroy+key+keyflagsrowdwodata+itemchanged+itemfocuschanged+row+dwo+data+editchanged+itemerror+dwnprocessenterh  LULDAT*j  BLRV LCkeycode.URV g oQ^@LLCdwobject.SLLCdwobject.$@d|<TxDAT*l  x _initsrcw_single_tablew_scc_ams_materialmenuwindowtypewindowstatewindowobjecttoolbaralignmentw_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_holderdatawindowchildkeycodew_mdi_mainmessagepointerw_filtertransactiDAT*n on QCdaim@ 3@8@tawiCte@Oaw@wchi\wi@treemonionibjwindr@ageme@d va @ @$ @ @( @,$08=@FZ _ )DAT*p r 88!v@@z@!a@<@@z'@@@@      !a& <*. DAT*r . {1{1 x$80)(8,800)D8,^1l,L$&Dd- +wparam+lparamw_mdi_main::messageP @#@ T dw_1-noneretrieve2ReadyseDAT*t tmicrohelpZ6 ( D L x$1D0$8$9)L8,^1l,T$Dd" +wparam+lparam::message< @ \( il_selected_row6idwc_dw_child 76selectrow@ 0 8 L T |:F@@8$)$DAT*v 81<N9,$)<8D$8L)h88p"n8q080:)@@8$)8$)8$8L)8$)89$8)(88p"l8q0800:)@@8P$)X8`$)h8pDAT*x $8)x8$)899N p "Ddn Bbld( ll_cur_rowll_total_rowls_code<  dw_1-accepttext-getrow4-material_codegetitemstringZDataWindow ErrorSorry! Material Code is required-setfocusL-setrowQDAT*t*-setcolumntiH-scrolltorow?-scc_ams_code2ZSorry! SCC AMS Code is required--Q-H-? $ , < D h          ( P X ` h p x   vz88@8,\1j,4$DAT*| p@)b?GA+(p@bp@@@$\@\@/[@[@;c@c@HU@U@Y@@e@@n^@^@z0@0@@@q@q@n@n@@@@@@@@@`@`@j@j@k@k@+l@l@?m@m@K@@[@@h@@u@@@@@@@@ @@l*@*@ast es@s@at-ostdsebv@v@aan.DAT*~ F@F@e w_securityw_single_dwmenuwindowtypewindowstatewindowobjecttoolbaralignmentborderstyledwobjectpowerobjectlinestylefillpatterntransactiondatawindowUntitledb  Pcommandbuttonfontcharsetfontpitchfontfamilystructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfostatictextalignmentdropdownlistboxde  PODAT*   PgroupboxSecuritySECUR05.ICOd@b  b keycodeUsers and their granted rolesd_securityRevoke a role from a userRevokeMS Sans SerifUser NameValid users p{Valid roles \>User RoleGrant a role to a userGrantRevoke User AccessGrant User Accessgs_inifiledynamicstagingareasqlsa,#usDAT* er_cursorGAsqlca,$select granted_role from user_role_privs where admin_option ='YES' and granted_role like 'RAP_%' and granted_role <> 'RAP_SECURITY' role_cursorGAGAgf_db_message"GA\GAmessagepointerf_securityDAT* _revokef_security_grantD      " $ \ ` 2 w_security  wparamlparam+highlight_dddwwf_initialize_varskeykeyflags+dwnkeyflagsxposypos+mousemove+open+activate+create+destroyrowdwo+clicked+flags+xpos+ypos+index+selectionchanged8  LULQ9,=DAT*  LCkeycode.UN TYLUIIN TYLtaTY LIILCdwobject.rLI(Lx x _initsrcw_single_dww_securitymenuwindowtypewindowstatewindowobjecttoolbaralignmentw_single_dw`dw_1dw_1borderstyledwobjectpowerobjectw_single_dw`r_1r_1linestylefillpatterntransactiondatawindowcommandbuttoncb_revoDAT* kefontcharsetfontpitchfontfamilystructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfostatictextst_1alignmentdropdownlistboxddlb_userddlb_rolest_2cb_grantst_3groupboxgb_1keycodedynamicstagingareamessagepointer@(@-@8@D@Q@bsDAT* x@@ @1!>1 @! @! @z $@8@%z@@@&@)@Y@`p+(@7@K@bpWb@g<@t@ @@DAT* @@ILbjec h $ $ )@  @$"1@< &@8(bu@   "%&'()+DAT* }\!B*y2  .!. $G7%%$G7%%!. .!. *%:8$0@8H0d ^ is_delete_colDAT* umn-arg_usernameis_delete_text1.Delete User Account:  @ X&8,!68$08-0890@8D$89L8T0,!68$08-0\$6@88d$z%8z&,#,$,#,$8089,# $,$8081d<DAT* $6)8D$1)8,#,$808,$ ,$8089,$ `,$8081d< $6)(8N0$1)88,$,$808,'>1L,'@$` | ! ""#D$L%f&(DAT* )*+,./,0N1V2p356789;$dn ancestorreturnvaluels_sqlls_userls_rolegs_inifilesqlsauser_cursorsqlcarole_cursor::message # + 3!@>#@-D>Q$@W>d'@.Hp openis_master_user :securitymaster_usernot found : :RAPIDS :sDAT* elect username from all_users where username not in (' :','SYS','SYSTEM','PUBLIC','SYSCASE')fetchddlb_user6483%additem13%selectitemBcloseddlb_role4&14&B D L \        ( 0 8 @ 4,'1(,'$d ::message'@.  DDAT* 8*$4*<P*Xl*t****$}1<R$1<R$1<R$ 1<R($01<R8$@1<RH$P1<RDAT* X$`1<Rh$(>Tj  6bd icurrentp createcb_revoke1st_1,2","ddlb_userD3%D%ddlb_role`4&`&st_2|5'|'cb_grant!6((st_37))gb_1_t.8++controlc@c@1c@,2"c@D3%c@`DAT* 4&c@|5'c@6(c@7)c@8+ $4 <P Xl t             ( 0 8 @ H P X ` h  8$,$@$T$d$x$$$ .<JXDAT*  f td @ destroycb_revoke1st_1$2"ddlb_user43%ddlb_roleH4&st_2\5'cb_grantl6(st_37)gb_1b_g8+ , @ T d x   &{|$&2 Z +highlight_dddwwf_initialize_vars+opengf_db_message+activate+create+destroy+1%DAT* 1%1%1%1%1%?IQ2 xywidthheighttitlebartitleiconcb_revokest_1ddlb_userddlb_rolest_2cb_grantst_3gb_1is_validation_tableis_master_useris_msg_nameis_msg_textil_selected_rowidwc_dw_childis_column_nameis_child_nameis_domain   DAT* "(- 7 "< %F &P 'U (^ )c +h|d@] o    DAT* D1 @@@   " % & ' ( ) + |O&${DAT* ix&o y$ $ > $8$),81@$P9}X$19)l8t$)|89)8 $9}$19)8,'$12,'DAT* $(Nl d8 xposyposrowdwoancestorreturnvalue::messagex  .'@.p clickedidw_active0getrow$cb_revoke41enabledH0selectrow@`0$@`41H0@` , @ P X l t | DAT**      $  &2$.2  +dwnkey+clicked(2 H xywidthheighttabordertagdataobjectborderstylevscrollbar`  "t&1 =] to` DAT* p@)b?GAX9p@cp@!@@&\@\@1[@[@=c@c@JU@U@[@@g@@q@@|@@@@@@^@^@@@0@0@n@n@+`@L@@Z`@`@dj@j@rk@k@~l@l@am@m@q@@@@@@@@:g@X@X@';g@X[g@e_`@Lg@p@p@@@`a@T*@*@v@DAT* v@8^F@F@$2E S=g@a"p@a\albp wc Op@b~chq@q@ c?g@3@@bje(p@ (@fr1ore;redJ,Ue@@r-,raatiny!litered,&DAT* 7QASp@AhIO@O@\N@N@k@@tX w_sourcew_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitledc /commandbuttonstructuremailrecipientenvironmentmailfiledescriptionmailmessagedaDAT* tawindowchildlistviewitemtreeviewitemconnectioninfou_dw_contactuserobjectsc Ԩnullnewvalidu_dw_locc Lu_dw_act_srcstr_actc Pu_dw_group_srcwindowc {rectangleSourceSOURCE.ICOc ,<nvo_locationsdec `keycodeRelated information (freeform view)Related information (tDAT* abular view)General informationShow device memberDeviceShow group informationGroupShow activity current viewActivityShow location informationLocationShow contact informationContactShow legal informationLegalc >c  c  c $Jmessagepointerf_menu_behavef_highlight_buttongl_source_ridu_dw_activityw_mdi_maingi_geo_numgl_geo_ridw_geogb_dDAT* ouble_clickgl_cur_rowf_validate_srcf_check_dates_ntf_validate_actf_validate_dev_prof_validate_legal_relationtransactionsqlcau_dw_groupm_main_menuw_filtergb_filterf_get_sequencegs_user_idf_check_dup_actdwitemstatusf_window_countf_window_closef_dddw_searchf_set_value_amtf_validate_codef_retrieve_metric_codesf_retrieve_group_typesf_get_unit_sqlf_retrieve_unit_codesf_act_dddw_retrievef_retrieve_codesf_look_upw_legalsqlpreviewfunctionsqlpreviewtypedwbuffer$DAT* 0p,t2 w_source 9 wparamlparam+current_view+history_view+highlight_dddwwf_retrieve_datawf_check_requiredwf_draw_dw2wf_set_varwf_general_viewwf_detail_viewwf_select_onewf_undo_uopdw_objwf_retrieve_city_dddwpb_enablewf_enable_btndw_objwf_check_ridps_stylewf_clear_prev_style+dwescapekeykeyflags+dwnkey+stay_row+ue_get_from_rms+wparam+lparam+openDAT* +activate+close+refresh+closequery+flags+xpos+ypos+clicked+create+destroy+key+keyflagsrowdwodata+itemchanged+row+dwo+itemfocuschanged+data+editchangedxposypos+rbuttondown+dwnprocessenter+add_row+itemerror+doubleclicked+currentrow+rowfocuschanged+rowcount+retrieveend+save+rowsinserted+rowsupdated+rowsdeleted+updateend+request+sqltype+sqlsyntax+buffer+sqlpreviewd@  LUL  QBDAT* QCdatawindow.QBrBCdatawindow.seQSLuo%]) LCkeycode.U%]) %])  U ] LUIILLCdwobject.SLLCdwobject.LIILCdwobject.DAT* U ]aLLU ]a~DAT* U ]LLLLijkLCsqlpreviewfunction.Csqlpreviewtype.SCdwbuffer.LU ]$<Xt 8d$Tl P`DAT* xDt(L x _initsrcw_master_detailw_sourcemenuwindowtypewindowstatewindowobjecttoolbaralignmentw_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_detDAT* ail`r_1r_1linestylew_master_detail`r_2r_2datawindows_rec_holdercommandbuttoncb_memberstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfocb_groupcb_activitycb_locationcb_contactcb_legalu_dw_contactuo_contactuserobjectsu_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_dw_contact`r_2u_dw_locuo_locu_dw_loc`st_no_recoDAT* rd_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_srcuo_actu_dw_act_src`dw_act_detailu_dw_act_src`cb_selectu_dw_act_src`st_no_recordu_dw_act_src`dw_act_queryu_dw_act_src`st_current_headingu_dw_act_src`dw_act_masteru_dw_act_src`r_1u_dw_act_src`r_2u_dw_act_src`ln_1u_dw_act_src`ln_2str_actu_dw_group_srcuo_groupu_dw_group_src`pb_addu_dw_group_src`pb_removeu_dw_group_src`st_group_memberu_dw_group_src`st_selection_listDAT* u_dw_group_src`dw_groupu_dw_group_src`dw_select_listu_dw_group_src`r_1u_dw_group_src`r_2windowrectangler_buttonsnvo_locationskeycodemessagepointeru_dw_activityw_mdi_mainw_geotransactionu_dw_groupm_main_menuw_filterdwitemstatusw_legalsqlpreviewfunctionsqlpreviewtypedwbufferp@!*@/@:@F@S@dDAT* @@ @,$ @ @$ @ @,$ 8287@@&zU &Z 80o z!t  @!c<@id@ME@$DAT* @@e@@@a"\@2@\?X@LH@[dp|alP@)@?tfalmaste_eur1s_rge_BS@4\_ck_paDAT* c_rtw_rsbout "!""0#,<@,!$% in &ed ('ThetitB(rothro\)ercode|*_v) +en en,on-<.y @[!@</01,2pK3lDAT* 45}6[7<"@#@8%@&@'@4)@8 -$@).@T"2@(;@$4=@?>c@ K@kg@dTF@aS@iU@|V@Wrs@ DAT*        " $",-./02 41 51 61 71 81 9 1; <: =: >: DAT* Connection windowforward global type w_connect from w_master_detail end type type cb_from from commandbutton within w_connect end type type cb_to from commandbutton within w_connect end type type r_connections from rectangle within w_connect end type type dw_4 from u_dddw within w_connect end type type dw_5 from u_dddw within w_connect end type end forward global type w_connect from w_master_detail int Width=2898 int Height=1236 boolean TitleBar=true string Title="Connection" DAT* string Icon="CONNECT.ICO" event highlight_dddw pbm_custom33 cb_from cb_from cb_to cb_to r_connections r_connections dw_4 dw_4 dw_5 dw_5 end type global w_connect w_connect type variables string is_validation_table string is_column_status = "valid" string is_msg_name string is_msg_text long il_selected_row datawindowchild idwc_dw_child string is_column_name string is_old_value string is_child_name end variables forward prototypes public subroutine wf_retrieve_data () publiDAT* c subroutine wf_undo_dw1 () public function boolean wf_insert_ok () end prototypes on highlight_dddw;call w_master_detail::highlight_dddw;if il_selected_row > 0 then idwc_dw_child.SelectRow(il_selected_row, TRUE) end if end on public subroutine wf_retrieve_data ();DataWindowChild dwc if gl_source_rid > 0 then if dw_4.Retrieve(gl_source_rid) > 0 then if dw_5.GetChild("id", dwc) = -1 then Beep(1) MessageBox(This.Title, "Application Error:~nDevice Id - " + & "Not a DAT* DataWindowChild in device context.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) if dwc.Retrieve(gl_source_rid) = 0 then // Beep(1) // MessageBox(This.Title, "No devices available for this source name.~n" + & // "Please select another source name.", Information!) else if gl_device_rid > 0 then // Retrieve process records only if there is any if dw_5.Retrieve(gl_device_rid) > 0 then dw_1.Retrieve(gl_devicDAT* e_rid) dw_1.ScrollToRow(gl_cur_row) end if else dw_5.InsertRow(0) end if end if else dw_4.InsertRow(0) end if else dw_4.InsertRow(0) end if dw_1.TriggerEvent(Rowfocuschanged!) end subroutine public subroutine wf_undo_dw1 ();// This function checks if the current row is modified or new. // If new, delete the current row; otherwise, undo the changes by // using ReselectRow function dw_1.AcceptText() dw_1.Retrieve(gl_device_rid) end subrDAT* outine public function boolean wf_insert_ok ();// Make sure user has defined a source, device, and process Boolean lb_Check = TRUE // Assume everything is OK string ls_Rid // Source ls_Rid = dw_4.GetText() if ls_Rid = "" then lb_Check = FALSE // Device ls_Rid = dw_5.GetText() if ls_Rid = "" then lb_Check = FALSE return lb_Check end function on open;call w_master_detail::open; // Set up variable for handling menu behavior is_state = 'connection' f_window_count("connectDAT* ion") dw_1.SetTransObject(SQLCA) dw_4.SetTransObject(SQLCA) dw_5.SetTransObject(SQLCA) //dw_1.Retrieve(il_device_rid) wf_retrieve_data() // Put the green focus on the input connections button f_highlight_button(r_connections, cb_from, "on") dw_1.PostEvent(GetFocus!) end on on close;call w_master_detail::close; f_window_close("connection") end on on w_connect.create int iCurrent call w_master_detail::create this.cb_from=create cb_from this.cb_to=create cb_to this.r_conDAT* nections=create r_connections this.dw_4=create dw_4 this.dw_5=create dw_5 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=cb_from this.Control[iCurrent+2]=cb_to this.Control[iCurrent+3]=r_connections this.Control[iCurrent+4]=dw_4 this.Control[iCurrent+5]=dw_5 end on on w_connect.destroy call w_master_detail::destroy destroy(this.cb_from) destroy(this.cb_to) destroy(this.r_connections) destroy(this.dw_4) destroy(this.dw_5) end on type dw_3 from w_master_detail`dw_3 DAT* within w_connect int TabOrder=70 end type type dw_2 from w_master_detail`dw_2 within w_connect int Y=609 int TabOrder=60 boolean Visible=false end type type dw_1 from w_master_detail`dw_1 within w_connect event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=54 int Y=484 int Width=2724 int Height=593 int TabOrder=30 string DataObject="d_connect_from" end type on dw_1::dwescape;call w_master_detail`dw_1::dwescape;string ls_col_name if il_selected_row > 0 then ls_col_DAT* name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, is_old_value) f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) Parent.PostEvent("highlight_dddw") end if end if end on on dw_1::dwnkey;call w_master_detail`dw_1::dwnkey;string ls_col_name if keydown(keytab!) then if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_DAT* column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if end if end on on dw_1::doubleclicked;call w_master_detail`dw_1::doubleclicked;long ll_device_rid // Do not perform double click functionality if there is no row in datawindow if This.RowCount() = 0 then return // If data have been modified, ask the user to save the modified data // before navigating to the other device id if dw_1.ModifiedCount() > 0 then MessageBox("Double-ClickDAT* ed", "Data have been modified.~n" + & "Save the changes before proceeding") return end if // 6/20/94 SJS: rap_connections_from_device_rid // and rap_connections_to_device_rid columns have been renamed in each // respective datawindow as rid. ll_device_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") // Update the current device_rid gl_device_rid = ll_device_rid // Get the current device info dw_5.SetItem(1, "id", dw_1.GetItemString(dw_1.GetRow(), "rap_devices_id")) dw_5.SetItemDAT* (1, "code", dw_1.GetItemString(dw_1.GetRow(), "rap_devices_code")) dw_5.SetItem(1, "name", dw_1.GetItemString(dw_1.GetRow(), "rap_devices_name")) // Clear the dw_1 buffer and retrieve the connection data based on the // selected device_rid dw_1.Reset() dw_1.Retrieve(gl_device_rid) end on event dw_1::itemchanged;call super::itemchanged; string ls_col_name DataWindowChild dwc ls_col_name = This.GetColumnName() if ls_col_name = is_column_name then if Not f_validate_code(This.GeDAT* tText(), is_child_name, is_validation_table) then MessageBox(is_msg_name, is_msg_text) return 1 else il_selected_row = idwc_dw_child.GetRow() end if end if // If the user picks a device id from DropDownDataWindow, then copy // device name, code and rid from dddw to dw_1 if ls_col_name = "rap_devices_id" then // Get the handle of the child datawindow if This.GetChild("rap_devices_id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nAgency Device IdDAT*  - " + & "Not a DataWindowChild.~nContact your technical support.") return end if // copy from dddw to dw_1 dw_1.SetItem(dw_1.GetRow(), "rap_devices_name", & dwc.GetItemString(dwc.GetRow(), "name")) dw_1.SetItem(dw_1.GetRow(), "rap_devices_code", & dwc.GetItemString(dwc.GetRow(), "code")) // If the current datawindow object is d_connect_from, put rid into // rid column and global variable gl_device_rid into // to_device_rid if dw_1.DataObject = 'd_connect_frDAT* om' then dw_1.SetItem(dw_1.GetRow(), "rid", & dwc.GetItemNumber(dwc.GetRow(), "rid")) dw_1.SetItem(dw_1.GetRow(), "rap_connections_to_device_rid", gl_device_rid) // otherwise, put rid into rid column and global variable // gl_device_rid into from_device_rid else dw_1.SetItem(dw_1.GetRow(), "rid", & dwc.GetItemNumber(dwc.GetRow(), "rid")) dw_1.SetItem(dw_1.GetRow(), "rap_connections_from_device_rid", gl_device_rid) end if end if end event on dw_1::add_rowDAT* ;// This script override the ancestor script for not checking unsaved // record when inserting if wf_insert_ok() then st_no_record_grey.Hide() This.InsertRow(This.GetRow()) This.ScrollPriorRow() This.TriggerEvent(Rowfocuschanged!) ib_obj_modified = TRUE end if st_no_record_white.Hide() end on on dw_1::retrieveend;// This script override the ancestor's script // Display no record message if This.RowCount() = 0 then // This.InsertRow(0) st_no_record_white.Move(This.X +DAT*  ((This.Width - st_no_record_white.Width) / 2), & This.Y + ((This.Height - st_no_record_white.Height) / 2)) st_no_record_white.Show() else st_no_record_white.Hide() end if end on event dw_1::itemfocuschanged;call super::itemfocuschanged;string ls_col_name DataWindowChild dwc ls_col_name = This.GetColumnName() if ls_col_name = "rap_devices_id" then if This.GetChild("rap_devices_id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nAgency Device Id - " + & DAT*  "Not a DataWindowChild.~nContact your technical support.") return end if // If the first value for code is 0 (the dddw has not been retrieved yet), // retrieve a list of valid codes for this dddw if dwc.GetItemString(1, "id") = '0' then dwc.SetTransObject(SQLCA) dwc.Retrieve(gl_source_rid, gl_device_rid) end if end if if ls_col_name = "rap_devices_id" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_DAT* name = "id" is_validation_table = "rap_devices" is_msg_name = "Column - Device Id" is_msg_text = "Sorry! Not a valid device id" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if end event on dw_1::editchanged;call w_master_detail`dw_1::editchanged;string ls_col_name ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) if DAT* il_selected_row > 0 then Parent.PostEvent("highlight_dddw") end if end if end on event dw_1::itemerror;call super::itemerror;return 2 end event on dw_1::dwnprocessenter;call w_master_detail`dw_1::dwnprocessenter;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if end on tyDAT* pe cb_from from commandbutton within w_connect int X=690 int Y=340 int Width=566 int Height=81 int TabOrder=40 boolean Enabled=false boolean BringToTop=true string Text="Input Connections" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;SetPointer(HourGlass!) if wf_check_pending() then // Check the function to see if data have been modified. If yes, // ask the user to save it. DAT*  Only change the dataobject of dw_1 when // wf_check_pending return true if wf_check_pending() then cb_to.Enabled = TRUE This.Enabled = FALSE // Put the green focus on this button f_highlight_button(r_connections, This, "on") dw_1.SetRedraw(FALSE) dw_1.DataObject = 'd_connect_from' dw_1.SetTransObject(SQLCA) dw_1.Retrieve(gl_device_rid) dw_1.SetRedraw(TRUE) dw_1.SetFocus() end if end if end on type cb_to from commandbutton within w_connDAT* ect int X=1540 int Y=340 int Width=566 int Height=81 int TabOrder=50 boolean BringToTop=true string Text="Output Connections" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;SetPointer(HourGlass!) if wf_check_pending() then // Check the function to see if data have been modified. If yes, // ask the user to save it. Only change the dataobject of dw_1 when // wf_check_pending DAT* return true if wf_check_pending() then cb_from.Enabled = TRUE This.Enabled = FALSE // Put the green focus on this button f_highlight_button(r_connections, This, "on") dw_1.SetRedraw(FALSE) dw_1.DataObject = 'd_connect_to' dw_1.SetTransObject(SQLCA) dw_1.Retrieve(gl_device_rid) dw_1.SetRedraw(TRUE) dw_1.SetFocus() end if end if end on type r_connections from rectangle within w_connect int X=2610 int Y=305 int Width=161 int Height=145 booleDAT* an Visible=false boolean Enabled=false int LineThickness=4 long LineColor=12632256 long FillColor=32768 end type type dw_4 from u_dddw within w_connect int X=8 int Y=61 int Width=2827 int Height=93 string DataObject="d_source_ids_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type event retrieve_data;call super::retrieve_data;string ls_data DataWindowChild dwc ls_data = This.GetText() if ls_data = is_old_value then return // DAT* Blank out value and hit enter will trigger itemchange and losefocus // This prevents it from asking required field twice if ib_check_required then ib_check_required = FALSE This.SetFocus() return end if if ls_data = '' or IsNull(ls_data) then MessageBox('Context Error', 'Source Id is required') ib_check_required = TRUE This.SetFocus() return end if if dw_4.GetChild("id", dwc) = -1 then MessageBox("Source Context", "Application Error:~nSource Name - " + & "Not a DataWinDAT* dowChild.~nContact your technical support.") return end if // Put source code and name in the context area dw_4.SetItem(1, "code", dwc.GetItemString(dwc.GetRow(), "code")) dw_4.SetItem(1, "name", dwc.GetItemString(dwc.GetRow(), "name")) gl_source_rid = dwc.GetItemNumber(dwc.GetRow(), "rid") if gl_source_rid > 0 then if dw_5.GetChild("id", dwc) = -1 then MessageBox("Device Context", "Application Error:~nDevice Name - " + & "Not a DataWindowChild.~nContact your technical suDAT* pport.") return end if dwc.SetTransObject(SQLCA) if dwc.Retrieve(gl_source_rid) = 0 then dwc.Reset() dw_5.Reset() dw_1.Reset() gl_device_rid = 0 MessageBox(Parent.Title, "No devices available for this source name." + & "~nPlease select another source name.", Information!) ib_check_required = TRUE else // Device name list has been changed based on the source name, // so let user pick the device name dw_5.Retrieve(0) dw_5.InsertRow(0) dw_1.ResetDAT* () end if end if end event on getfocus;call u_dddw::getfocus;is_child_name = 'id' is_validation_table = 'rap_sources' is_msg_name = 'Column - Source Id' is_msg_text = 'Sorry! Not a valid Source Id' end on event clicked;call super::clicked;if not wf_check_pending() then return 1 else return 0 end if end event type dw_5 from u_dddw within w_connect int X=1 int Y=180 int Width=2827 int Height=93 int TabOrder=20 string DataObject="d_device_ids_dddw" boolean Border=DAT* false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type event retrieve_data;call super::retrieve_data;DataWindowChild dwc string ls_data if wf_check_pending() then if This.RowCount() = 0 then return // Blank out value and hit enter will trigger itemchange and losefocus // This prevents it from asking required field twice if ib_check_required then ib_check_required = FALSE This.SetFocus() return end if ls_data = This.GetText() if ls_data = ''DAT*  or IsNull(ls_data) then MessageBox('Context Error', 'Device Id is required') ib_check_required = TRUE This.SetFocus() return end if if This.GetChild("id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nDevice Id - " + & "Not a DataWindowChild in device context.~nContact your technical support.") return end if // Put device code and name in the context area This.SetItem(1, "code", dwc.GetItemString(dwc.GetRow(), "code")) This.SetItem(1, "name", DAT*dwc.GetItemString(dwc.GetRow(), "name")) gl_device_rid = dwc.GetItemNumber(dwc.GetRow(), "rid") dw_1.Retrieve(gl_device_rid) dw_1.TriggerEvent(Rowfocuschanged!) end if end event on getfocus;call u_dddw::getfocus;is_child_name = 'id' is_validation_table = 'rap_devices' is_msg_name = 'Column - Device Id' is_msg_text = 'Sorry! Not a valid Device Id' end on event clicked;call super::clicked;if not wf_check_pending() then return 1 else return 0 end if end event DAT* ?: @: A :C DB E B FB GB HB IB JB KB LB M!BP QO RO SO TO UO VO WO XO[ n)a*. .  {4DAT*   {4 {5  !-!-!-!-!-!-1E7?!:@3 6!BJ> ?!O9. .!Z DAT*      )8#D,(01>,($$:F@@8<8D0`8h0x$6$6$68$$$1)8$$$1)8$9}$$$$1<RDAT* ,$<$1<R)D8L$T\$d$1<Y}l$x$$1<Y}$$$$$1<R)8$$$$$1<R)8$$$$,$4$1<R)<8P$X$`$h$p$1DAT* <R)x8$$$$$1<R)8$$$$$1<R)8$ $808 $,,4$6<$6T$68\08\08\0)l8t$)8$9}$$)8,/$6,DAT* (1,($D ^ x NlT\  d"$%$&B(h)d9 wparamlparam::messagegl_source_ridw_mdi_maind (@^ ,@./@a wf_check_pending}is_style_state,3currentis_enlarge_stateL4detailis_stateo2,3L4dw_1,. . xDAT*" move$. . widthssresize. vscrollbarCr_1/". . heighto4/". /"yt . tcb_member u8"8". tcb_groupons9,9,. tcb_activity:-:-. tcb_locationD;.D;.. tcb_contacti</</DAT*$ . tcb_legalspl=0=0. tr_buttonsB[:-onuo_act@Cis_level(U,3is_source_codeD]uf_prepare_dwC]@Cshow|@Cbringtotop @Cdw_act_detail!setfocuswnis_act_stylez+,3 $ < ` x               DAT*& $ , < D L T \ d l x                 $ , 4 < P X ` h p x                  4 < T l t        DAT*(   )8#D,(01>,($$:F@@8<8D0`8h0x$6$6$68$$$1)8$$$1)8$9}$$$$1<R,$<$1<R)D8L$DAT** T\$d$1<Y}l$x$$1<Y}$$$$$1<R)8$$$$$1<R)8$$$$,$4$1<R)<8P$X$`$h$p$1<R)x8$$$DAT*, $$1<R)8$$$$$1<R)8$ $808 $,,4$6<$6T$68\08\08\0)l8t$)8$9},/$6,(~1,($D ^ x NlTDAT*. \  d"$%$'B*dd9 wparamlparam::messagegl_source_ridw_mdi_maind (@^ ,@./@a wf_check_pending}is_style_state,3historyis_enlarge_stateL4detailis_stateo2,3L4dw_1@. . xmove. . widthresize@. vscrollbarr_1DAT*0 /". . height4/". /"yt . tcb_member8"8". tcb_groupHOD9,9,. tcb_activity:-:-. tcb_locationD;.D;.. tcb_contact</</. tcb_legal=0=0. tr_buttonsB[DAT*2 :-onuo_act@Cis_level(U,3is_source_codeD]uf_prepare_dwC]@Cshow|@Cbringtotop is_act_style+,3 $ < ` x               $ , < D L T \ d l x          DAT*4        $ , 4 < P X ` h p x                  4 < T l t       `$0$9)D8,(F1T,(L$,d" +wparam+lparam::message<DAT*6  (@^T idwc_dw_child,I(il_selected_row Hselectrow8 0 D L ,01<,11,3$8 !8&X$z%8`z&,1(@(8z(8z&,11,3$8! 8&$z%8z&,1(@(8z(8z&,11,3$8!DAT*8 8&$z%8z&,1(@(8z(8z&8&$z%8z&$)88806@8,$)@8,4,51!H$8P,5(@(8z'1X$)l8)|98$)8  @8 ,021H3dx DAT*: ll_row_numls_orig_sql_statementls_sql_stmntls_errdwcgi_geo_numgl_geo_ridw_geogb_double_clickgl_cur_row ) 6 = (A0@L1@W3@b]4@m5@ is_level_typeRSTATEDataWindow.Table.Select="is_orig_sql_statement@^ WHERE GEOGRAPHIC_STATE_RID = "RCOUNTY@^ WHERE GEOGRAPHIC_COUNTYDAT*< _RID = RCITY@^ WHERE GEOGRAPHIC_INCORP_RID = @^dw_1. modifyz Modify Failed. retrieve@14. rid = @. rowcount4`findkt. scrolltorow? X        , @ H X l |   >1$)$81<494$)<81<h9L$)TDAT*+81<9\$)p81zx$$)88# 9$$)8808080808#z9$)81.$68$f0$D$6\$68d08d08d08#b9*8eDAT*x$)899N :h8!f"#$%(*+6-d./0146749b:~;<=@AB<CXDxEFIKdk ll_cur_rowll_total_rowll_amtls_emit_mat_codels_throu_unit_codels_unit_codels_throu_matl_code ' 8 K XDAT*B ontfamilyalignmentfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use insert to create a new recorddwobjectlinestyledatawindows_rec_holderdatawindowchildEmission Factor6 յFIRE.ICOvalidSource-Specific Constants (Factors)CONST.ICO6 @6 @d_emission_factor_f_freeformd_emission_factor_ftransactionsqlcaselect rap_processes.rid from rap_processes , rap_dDAT*D evices , rap_sources where rap_processes.device_rid =rap_devices.rid and rap_devices.source_rid =rap_sources.rid and rap_sources.id =' ' and rap_devices.id =' ' and rap_processes.id =' ' 6G>A|D>Af_db_errorgl_source_ridgl_device_ridgd_process_ridmessageselect id from rap_sources where rid =0 &' >A\$DAT*F >Aselect id from rap_devices where rid =0 &'>A>Aselect id , scc_ams_code from rap_processes where rid =0 78Mv<>A|>Aselect rap_devices.source_rid , rap_devices.rid from rap_processes , rap_devices where rap_processes.device_rid =rap_dDAT*H evices.rid and rap_processes.rid =0 >A>A&'>A@>A&'|>A>A78<>A0DAT*J >Al>Ap>AL6D |   $ \ `    v|       @ D |    0 4 lp   2 w_emission_factor_aDAT*L   } wf_dwmodifypl_cur_rowwf_check_special+open+create+destroy+wparam+lparam+add_row+currentrow+rowfocuschangedp( BBLLQG OLUL`LLG O`  <Ld x _initsrcw_emission_factor_basew_emission_factor_amenuwindowtypewindowstatewindowobjecttoolbaralignmentw_emission_factor_base`st_no_record_greyst_no_record_greyfontDAT*N charsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_emission_factor_base`st_no_record_whitest_no_record_whitew_emission_factor_base`dw_2dw_2dwobjectw_emission_factor_base`dw_1dw_1w_emission_factor_base`r_1r_1linestyledatawindows_rec_holderdatawindowchildtransactionmessageforwypglobn @ean (_adata<ob@ong Atr@leveLri@ourcXri@eviceri@rocevtrstreDAT*P enototcs@ngares@3 @ @ @ @ @*=Y^@g   !@@@!6@<@@ DAT*6      c% C*. . {1{1 90d  $8)88DAT*T p@)b?>A0p@p@9p@@@$\@\@/[@[@;c@c@HU@U@Y`@`@cj@j@qk@k@}l@l@m@m@@@@@@@@@^@^@ @@@@#@@-@@8@@B@@N@@Zn@h@@qn@{@@0@0@n@n@+`@Fv@v@qF-'cNn\klls"p@As(~DAT*V F@F@q@q@*@@ d\ w_master_detailwindowmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectty9 pOstatictextfontcharsetfontpitchfontfamilyalignmentfillpatternborderstyleu_dw_freeformdwobjectu_dw_listrectanglelinesDAT*X tyleUntitled9 Hdatawindows_rec_holder9 ˵No records present. Use Insert to create a new record.MS Sans Serifmessagef_copy_recordf_paste_recordgs_filtw_mdi_mainf_menu_behavepointertransactionsqlcadwitemstatusf_del_legal_entity_relations_recf_del_recsgi_open_sheet_numf_put_scroll_bars2 w_master_detail   wparamlparam+edit_aDAT*Z ctions+filter+unfilter+refresh+original_view+expand_viewwf_check_pendingwf_check_requiredwf_draw_dw2wf_freeform_viewwf_savewinnamewf_select_allwf_tabular_viewwf_undo_dw1wf_undo_dw2wf_detail_viewwf_select_onewf_undo_uodw_objwf_deletesznamewf_getcurridwf_insert_okwf_general_viewwf_cascade_deldwnamewf_check_ridps_stylewf_clear_prev_style+select_one+select_all+save+validate_delete+wparam+lparam+open+sizetype+newwidth+newheight+resize+closequery+close+activateDAT* +flags+xpos+ypos+mousemove+create+destroy+getfocus+add_row+delete_row+first_row+last_row+prev_row+losefocus+next_row+rowsinserted+rowsupdated+rowsdeleted+updateend+rowcount+retrieveend+currentrow+rowfocuschanged  LUL     BQQCwindow. %QCdatawindow.LRSLZ%BCdatawindow.DAT*^ p@)b?HAF9p@dp@!@@&\@\@1[@[@=c@c@JU@U@[@@g@@q@@|@@@@@@^@^@@@0@0@n@n@+`@aL@@`Z`@`@adj@j@rk@k@~l@l@m@m@@@@@a@@!@@qZg@`X@X@_`@a+@@5n@`<@@*@*@v@v@FF@F@$DAT*` 2=g@@"p@@ItKq@q@WJ@]3@]<Kiti|!p@ L R @@ +ct/+ru=ngUp@p@\@k d |( w_streamw_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmDAT*b entfillpatternborderstylepowerobjectMS Sans SerifNo records present. Use Insert to create a new record.dwobjectlinestyledatawindows_rec_holderUntitledd Tqcommandbuttonstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfou_dw_act_struserobjectsstr_actd avalidnullrectangleu_dddwstatictextStreamSTREAM.ICOd xPDAT*d d `keycodeMember information (freeform style)Member information (tabular style)General informationd_stream_fromShow all streams from the current processInput StreamsShow all streams to the current processOutput StreamsShow activity informationActivitytd  d_source_ids_dddwd_device_ids_dddwd_process_ids_dddwnonemessagepointerf_menu_behaveu_dw_activityw_mdi_maintransactionsqlcam_main_menuf_higDAT*f hlight_buttonf_validate_actw_filtergb_filtergl_source_ridgl_device_ridgd_process_ridf_get_sequencegs_user_idf_check_dup_actf_get_stream_riddwitemstatusf_window_countf_window_closef_dddw_searchf_retrieve_metric_codeswindowf_get_unit_sqlf_retrieve_unit_codesf_act_dddw_retrievef_set_value_amtf_validate_code$\2 w_stream $ wparamlparam+current_view+history_view+highlight_dddwwf_sDAT*h et_varwf_detail_viewwf_draw_dw2wf_general_viewwf_check_requiredwf_select_onewf_retrieve_datawf_undo_uowf_insert_okps_dw_namewf_dwmodify_dw1dw_objectwf_check_ridps_stylewf_clear_prev_styleal_ridab_inputas_typeal_act_ridwf_get_from_rms+dwescapekeykeyflags+dwnkeyflagsxposypos+mousemove+wparam+lparam+open+close+create+destroy+key+keyflagsrowdwodata+editchanged+itemfocuschanged+itemchanged+dwnprocessenter+add_row+itemerror+doubleclicked+currentrow+rowfocusDAT*j changed+row+dwo+data+rowcount+retrieveend+save+rowsinserted+rowsupdated+rowsdeleted+updateend+flags+xpos+ypos+clicked+retrieve_data+getfocus+retrieve_dddw8  LUL  QBBSaBCdatawindow.eqQS_ (QLBSLLMEQ LCkeycode.UMEQ MEQ b hmDAT*l LUIIi_db hmLLCdwobject.SLLCdwobject.} } hmLIILCdwobject.'LLDAT*n DIN} T} qLLLLct_} hm hm  hm$<XhDAT*p  Lp,Ph 0TxLd x* _initsrcw_master_detailw_streammenuwindowtypewindowstatewindowobjecttoolbaralignmentw_master_detail`st_no_record_whitest_no_record_whitefontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectwDAT*r _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_fromstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfocb_tocb_activityu_dw_act_struo_actuserobjectsu_dw_act_str`dw_act_detailu_dw_act_str`cb_selectu_dw_act_str`st_no_recordu_dw_act_DAT*t str`dw_act_queryu_dw_act_str`st_current_headingu_dw_act_str`dw_act_masteru_dw_act_str`r_1u_dw_act_str`r_2u_dw_act_str`ln_1u_dw_act_str`ln_2str_actrectangler_buttonsr_streamsu_dddwdw_4dw_5dw_6statictextst_err_msgkeycodemessagepointeru_dw_activityw_mdi_maintransactionm_main_menuw_filterdwitemstatuswindow,@!*@/@:@F@S@dDAT*v @@ @ @8 @8 @ @89 127lu@it_c@_codU tr[Z mo ,!t  @!d<@@DAT*x @@@@@ @ @0@=@J@Y,_k@x Facs@-,<8),8=N,`DAT*z r@)z@($ @ 0!,<",!!@##@$@p&@$(@8)@9+@-@ 1@<;_d@oup#@@   DAT*|      " $",-/ 1. 2 . 3. 4. 5. 6. 7. 8. 9. :!.=>@ABDDAT*~  n)U*. . {4{4 {4   !.!.!-.J> ?!< < ?y- '?yDAT* - '?y- 'C.       )8#D,%01>,%$$:F@@8<8D0`8h0x$6$6$68)8$18)8$18)8$DAT* 18)8 $$$8$6@$6666X$6)p8x$)8$9}$$)8,*$6,%~1,%$D ^ x DrBdd[ +wparam+lparamls_source_codels_device_codels_process_code::messagew_mdi_mainDAT*   ' 6 F%@FP*@I wf_check_pending}is_style_state,3currentis_enlarge_stateL4detailis_stateo2,3L4wf_detail_viewdw_4>@codegetitemstringdw_5_ta?Adw_6@Buo_act;/il_stream_rid8Sis_level,O,3is_stream_codeHTuf_prepare_DAT* dwC`;/show;/bringtotop ;/dw_act_detail!setfocusis_act_stylebro+,3 $ < ` x            $ 8 @ X p x          r )8#D,%01>,%$$:F@@8d[ +wparam+lparamls_source_codels_device_codels_process_code::messagew_mdi_main  ' 6 F%@FP*@I wf_check_pending}is_style_state,3historyis_enlarge_stateL4detailis_stateo2,3L4wf_detail_viewDAT* dw_4>@codegetitemstring_dw_5iev?Adw_6ond@Buo_act;/il_stream_ridSis_level,O,3is_stream_codeHTuf_prepare_dw@C`;/shown@;/bringtotop is_act_style@!+,3 $ < ` x            $ 8 @ X p x     DAT*   x$1D0$8$9)L8,%^1l,%T$Dd" +wparam+lparam::message< %@F\( il_selected_rowEidwc_dw_child> F(Eselectrow@ 0 8 L T T8 0D8L0l8t0DAT* 4d x is_activity_dwLd_activityis_activity_dw_freeform+Md_activity_freeformis_level`OSTR D l $ $T($)D8TL$)\8x80$6$6$68$)8$$$1)8 $ 9}($0DAT* $8$1-<R@$P$1#<R)X8`$h$)x8)8$$$$$1<R)8$)8$)8$)8$$),88Tn  (:Vrd 4P uo_actv;/visible;/uf_check_pendingmDAT* 50;/uf_save2Tis_enlarge_stated4detailis_state2is_style_state3d4r_1/"hidedw_1. . widthresize. vscrollbar/". . heightH. . getrowpscrolltorow?cb_activity:-:-x. ymovedw_2-dw_3,r_20$;/DAT*   ( D L \ x              ( 0 8 @ P X ` h x              $ ,  $)$81,$4$)D88LJ`8x$8$$DAT* $l$$6$ $6$,,),84$8<)h8p$8<)x8$$6)8$:NW@)8$$)8& l (Jld ll_master_ridsqlca(,@J dw_1tv. rowcountDAT* 4. . getrow<ridgetitemnumberm Pis_current_btnhNActivitydw_2-dataobjectis_activity_dwL-Ldw_3@,is_activity_dw_freeformM-settransobject^-metric_code.DDDW.Name=d_metrics_strmodifyz`,z`-is_levelOretrieve2,triggerevent -,sharedata $ , 4 DDAT*  ` x            , 4 h p x          $88,$)H8,.X$l$9}$$$$)8$9}$$$$$)48<$)P81@DAT* d$t9}$$808$$$$)8$)8$)8$) 8$ $($1-<R0$@$1#<R)H8T$\$d$1-<Rl$t$1#<R)|8$$$1<Y}DAT* $$$1<Y}$)8808 0 8 0($60$68$688b "@vpX!t"#$d m_main_menu.@K@ is_state2activityuo_act%;/uf_check_pending54m_viewnP(m_originalDAT* `$7toolbaritemvisiblet dw_1. . widthii_dw1_heightPresize. vscrollbar. . x ii_dw1_yQmove,. rowcount4Dcb_activityX:-enabledlr_buttons|<=X:-offX:-X:- ii_cb_yR,dw_2-hidehardw_3,%;/r_1/". . height8r_2P0$-DAT*6-8P0$ - P0$yem -. setfocus2streamis_style_state3is_enlarge_state 423 4 , H X l            $ 4 < P d t               DAT* p@)b?HA!p@p@ep@q@@a\@\@q*[@[@6c@c@CU@U@T`@`@^j@j@lk@k@xl@l@m@m@a@@a@@@@@@^@^@q@@p@@"@@,@@7n@0A@@aM@@A\`@@v@v@@ q@q@ @d@d@*:n@n@qE w_use_typewindowmenuwindowtypewindowstatewindowobjecttoolbDAT* aralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecte ,commandbuttonfontcharsetfontpitchfontfamilyu_dw_listborderstyledwobjectSelect Use Typepae Fstr_use_typetote wClear AllMS Sans Serifd_use_types_selSelect AllCancelOKmessagetransactionsqlcadragobjectf_highlight_rowdataDAT* windowh2 w_use_type W +open+create+destroy+clickedxposyposrowdwo+currentrow+rowfocuschanged[ LQ(-26LIILCdwobject.:LL L x _initsrcwindoww_use_typemenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewiteDAT* mtreeviewitemconnectioninfopowerobjectcommandbuttoncb_clear_allfontcharsetfontpitchfontfamilyu_dw_listdw_use_typeborderstyledwobjectcb_sel_allcb_cancelcb_okstr_use_typemessagetransactiondragobjectdatawindowforwypglobn @ean _adata#ob@ong (tr@leve3ri@ourc?ri@evicLri@roce]tr@stregen@ototu cs@ngar es@ @text DAT* ty@is_a _f@orm_b@s_le_h@tiicb@l_sts_@am_c@ @X@)d"8@0,8ea@de!D@MXs !bh<@uco@+ret}re@ve_dcu@w_sy w@ DAT* wW 1*-{.--- , $4$,)L8T$)h8p$#R1}x$$R$8$$ 1 then rDAT* eturn end if SetPointer(HourGlass!) w_mdi_main.SetMicroHelp("Checking related records ...") if wf_cascade_del() >= 0 then // Update the data if pdw_obj.DeleteRow(0) = 1 then commit; pdw_obj.ResetUpdate() w_mdi_main.SetMicroHelp("Row deleted successfully.") pdw_obj.TriggerEvent(Rowfocuschanged!) else rollback; w_mdi_main.SetMicroHelp("Row not deleted.") end if end if end subroutine public function long wf_getcurrid (ref string szname);// Function obtainsDAT*  the RID of the current record and the associated // datawindow. The function returns zero if an error occurs. // It assumes that the datawindow has a field named "RID". long nRid = 0 int nRow if IsNull(idw_active) then MessageBox("wf_GetCurRid", "No active datawindow") nRid = 0 else // Get the current rid nRow = idw_active.GetRow() if nRow > 0 then nRid = idw_active.GetItemNumber(nRow, "RID") end if if nRid <> 0 then // Get the current datawindow object szNaDAT* me = idw_active.DataObject else szName = "None" end if return nRid end function public function integer wf_cascade_del ();// You should override this function in any decendent window. // that needs special handling string szName, szType, ls_code long nRid long nCnt int nInd if is_current_table = 'Reference Codes' then // Get the key of the active record ls_code = idw_active.GetItemString(idw_active.GetRow(), 'code') // Get the count of records involved nCnt = f_dDAT* el_ref_code(ls_code, sqlca, FALSE) // Get user verification if more than one record if nCnt > 1 then nInd = MessageBox(szName, "Deleting this record will also delete " & + String(nCnt - 1) + " activity records.~r~nDo you want to continue?", & Question!, YesNo!, 2) elseif nCnt = 1 then nInd = 1 else nInd = 0 // There was an error end if if nInd = 1 then nCnt = f_del_ref_code(ls_code, sqlca, TRUE) elseif nInd = 2 then nCnt = -1 // User answeredDAT*  no else nCnt = 0 end if else // Get the RID of the active record nRid = wf_GetCurRid(szName) // Get the count of records involved nCnt = f_del_recs(nRid, szName, FALSE) // Get user verification if more than one record if nCnt > 1 then nInd = MessageBox(szName, "Deleting this record will also delete " & + String(nCnt - 1) + " child records.~r~nDo you want to continue?", & Question!, YesNo!, 2) elseif nCnt = 1 then nInd = 1 else nInd = 0 DAT*  // There was an error end if if nInd = 1 then nCnt = f_del_recs(nRid, szName, TRUE) elseif nInd = 2 then nCnt = -1 // User answered no else nCnt = 0 end if end if return nCnt end function public function boolean wf_check_rid ();if is_current_table = "Legal Entities" then long ll_row_num, ll_cur_row, ll_rid_num ll_row_num = dw_1.RowCount() for ll_cur_row = 1 to ll_row_num if IsNull(dw_1.GetItemNumber(ll_cur_row, "rid")) then DAT*  // Select the next available rid from the rid_storage in database ll_rid_num = f_get_sequence() if ll_rid_num = -1 then // 07JUN96 REJ added RETURN value to match ancestor window return type return false end if dw_1.SetItem(ll_cur_row, "rid", ll_rid_num) end if next end if // 07JUN96 REJ added RETURN to match ancestor window return type RETURN TRUE end function on w_data.create call w_reference::create end on on w_data.destroy cDAT*all w_reference::destroy end on type ddlb_1 from w_reference`ddlb_1 within w_data boolean BringToTop=true string Item[]={"Legal Entities",& "Reference Codes"} end type type st_1 from w_reference`st_1 within w_data boolean BringToTop=true end type DAT* =z%8z&1)981N$9)8,l1z,$> ` t NRdD ls_rtnli_rowll_totalll_found_rowmessagesqlca::message ,@4@ :@ istr_use_type0 ^@dw_use_type(+settransobjecDAT* t^<(+retrieve1\00upper_bound(+type = '0use_type'findk(+selectrow@  4 L T h p x         * 4*<P*Xl*t*$$$$$ |DAT* ,BXnd cb_clear_all*dw_use_type(+(cb_sel_allD,Dcb_cancel`-`cb_okpe|.|controlc@*(+D,`-|.  4 <P Xl t       L$,$@$T$d$*8dDAT*  l( cb_clear_all*dw_use_type +cb_sel_all4,cb_cancelH-cb_ok\. , @ T d &&2  +open+create+destroy<2 xywidthheighttitlebartitlebackcolorcontrolmenuwindowtypecb_clear_alldw_use_typecb_sel_allcb_cancelcb_okil_last_clicked_rowistr_use_type@VDAT*  a "V(2>I V b m w }] oVa V  1  DAT*"0@@@     &  xZ$19)(8,@1N,0$&d ::message@8DAT* nQSb             LUII !     DAT*   !    LLLL،LL !       DAT*  !    $<Tl,D\t4` D\(@XpDAT* $<Tl x _initsrcwindoww_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectstatictextst_no_record_whitefontcharsetfontpitchfontfamilyalignmentfillpatternborderstylest_no_record_greyu_dw_freeformdw_3dwobjectu_dw_listdw_2dw_1rectangler_DAT* 1linestyler_2datawindows_rec_holdermessagew_mdi_mainpointertransactiondwitemstatusp@(@-@8@D@Q@b@l@z @ @ @  @p @ @@ @4@ tDAT*  @ @@* @4@@ @!L^@l!q@z<@ @@*IL@bjec@ @%@ (@)@ +@ DAT*  "$!j& !8*. . {2{2{2! !      DAT*  V.,!$80)@)88($)88@$)H8X$68`0@8"8x$)8"8$)8"8R$)8"8$8"8$8DAT* $)88 8($@9}8HnP$X9}8`h$p9}"8x$80)8"8 $80)8"8^$80)8"8$80)8"8 $8(0)4DAT* 8"8<D$8L0)X8"8`Vh$8p0)|8"8$80)8"8)8"8)8"8"$80)8,!<1J,!$2Fd 2Nf4Lj $%'+-DAT* .40Z1r34679:,<R=j?@BCEFI"d9 +wparam+lparammessagecase3case26::messagex !@' ' /!@'h addressundoidw_active1%canundoD01%StitleP Sorry! Nothing to undo!copy1%Fxcut1%Gpastela1%Icopy_record1%istr_record7&pDAT* aste_recordo1%7&1%classname8 dw_1 . ib_obj_modified0dw_2H-0dw_3`,0insert1%add_rowtriggerevent8 delete1%validate_delete first1%first_row prior1%prev_row next1%next_row last81%last_row select1%select_one selectall1%select_all tabularwf_tabular_viewfreeformwf_freDAT* eform_viewsavedwo1%  ( 8 @ H X             ( @ P X h p           4 D X h |        p$)(80$)H8R}P$)DAT* `8}h$,$)|8$)8$)8<$680:)@@8$8)8$)8$<)8$$:NW@)<8<8DP$)X8`$)h8R(@(8z'p$8xz%8z&)98$:NW@)8,!V1DAT* d,!$B h ">b<dA wparamlparamcurrowtotalrecls_totalgs_filt::message & /$@7!@' idw_activer1%rowcountve41%filteredcount%81%getrowX1%setfilterIp1%filter1%8tiDAT* tle No rows match the selection criteria!@1%@Ip1%1%scrolltorow?1%triggerevent ,Total: 1%41%81%total_index_t.Text='' total_index_t.Color=String(RGB(red))modifysz1% , ( 0 H P ` h |            $ < P X ` h DAT* p     $8)(80$)@8H$1)`8h$9)|8$:NW@)8$8)8,!1,!$">f d2 +wparam+lparamll_selected_row::messageP (!@'h idw_actiDAT* ver1%setfilterI1%filterd81%getselectedrowP1%selectrow@p1%triggerevent 1%total_index_t.Text='' total_index_t.Color=553648127modifyz ( 0 @ H ` h |      )8r,&9)08)H8d$)t8,&9)|8,!1,!$DAT*  , >Zrd- +wparam+lparamw_mdi_main::messageP &@(#!@'8 wf_check_pending%}setredrawY$wf_general_view8st_no_record_whiteP*hidelY$ 0 H d t |  v,&9)8),8,&9)48,!\1j,!<$DAT*` * Bd- +wparam+lparamw_mdi_main::messageP &@(#!@'D setredrawenYwf_detail_viewaY , 4 < $($8$@$"P$X$"h$68p0:)@:@@8}}1<)8#91<v)DAT*Pr !."N#p$')+,-..\/x012567,8Z9v:;<?@A*BXCtDEFIJ K(LVMrNOPRTdu ll_cur_rowll_total_rowll_rec_group_numll_seq_numls_method_codels_sub_typels_item_typels_material_code 1< K W d t dw_1DAT*f $2Nz~ d6 ancestorreturnvaluegs_scc_ams_code::message<@,@X openis_factor_type 4Pdw_1'- 4retrieve2<wf_dwmodifyP'-2<'-setfocus , 4 H \ d l t |   8d DAT*&":8p080:)@@8 $)8$)$8,$8)48<$)D89L$80)T8<1:8088\z%:)@@8$)8$)8$8)8$)899$8)8DAT* Device windowforward global type w_device from w_master_detail end type type cb_member from commandbutton within w_device end type type cb_group from commandbutton within w_device end type type cb_activity from commandbutton within w_device end type type cb_location from commandbutton within w_device end type type cb_connection from commandbutton within w_device end type type cb_contact from commandbutton within w_device end type type uo_contact from u_dw_contact within w_device enDAT* d type type cb_legal from commandbutton within w_device end type type uo_loc from u_dw_loc within w_device end type type uo_act from u_dw_act_dev within w_device end type type uo_group from u_dw_group_dev within w_device end type type r_buttons from rectangle within w_device end type type dw_6 from u_dddw within w_device end type end forward global type w_device from w_master_detail int Width=2917 int Height=1564 boolean TitleBar=true string Title="Device" string Icon="DEVICE.DAT* ICO" event current_view pbm_custom31 event history_view pbm_custom32 event highlight_dddw pbm_custom33 cb_member cb_member cb_group cb_group cb_activity cb_activity cb_location cb_location cb_connection cb_connection cb_contact cb_contact uo_contact uo_contact cb_legal cb_legal uo_loc uo_loc uo_act uo_act uo_group uo_group r_buttons r_buttons dw_6 dw_6 end type global w_device w_device type variables string is_unit_sql = "null" string is_validation_table string is_column_stDAT* atus = "valid" string is_msg_name string is_msg_text long il_selected_row datawindowchild idwc_dw_child string is_column_name string is_old_value string is_child_name string is_member_dw; string is_member_dw_freeform; string is_activity_dw; string is_activity_dw_freeform; string is_legal_dw; string is_legal_dw_freeform; string is_level; string is_device_code; string is_selected_child_type; integer ii_dw1_height; // dw_1 original height integer ii_dw1_y; // dw_1 original Y cooDAT* rd. integer ii_cb_y; // command button original y coord. str_connect_context istr_connect_context end variables forward prototypes public subroutine wf_retrieve_data () public function boolean wf_check_required () public subroutine wf_draw_dw2 () public subroutine wf_set_var () public subroutine wf_general_view () public subroutine wf_detail_view () public subroutine wf_select_one () public subroutine wf_undo_uo () public function boolean wf_insert_ok () public subroutine wf_enabDAT* le_btn (boolean pb_enable) public function boolean wf_check_rid (datawindow dw_object) public subroutine wf_clear_prev_style (string ps_style) end prototypes on current_view;call w_master_detail::current_view;// User Event // Purpose: Make uo_1 visible, shrink the dw_1 and move dw_4 // Change the attributes of expand and original toolbaritems //DataWindowChild dwc string ls_source_code if Not wf_check_pending() then return SetPointer(HourGlass!) //w_mdi_main.SetRedraw(FALSEDAT* ) is_style_state = 'current' is_enlarge_state = 'detail' f_menu_behave(is_state, is_style_state, is_enlarge_state) // Shrink the dw_1, put a vertical scrollbar on it and move it up to the // top of the window r_1.Hide() dw_1.Move(dw_1.X, dw_6.Y) dw_6.BringToTop = FALSE dw_1.BringToTop = TRUE dw_1.Resize(dw_1.Width, 192) dw_1.VScrollBar = TRUE // Resize and move the focus indicator for dw_1 r_1.Resize(dw_1.Width + 25, dw_1.Height + 25) r_1.X = dw_1.X - 15 r_1.Y = dw_1.Y - 15 DAT*  // Move all command buttons up cb_member.Move(cb_member.X, dw_1.Y + 225) cb_group.Move(cb_group.X, dw_1.Y + 225) cb_activity.Move(cb_activity.X, dw_1.Y + 225) cb_location.Move(cb_location.X, dw_1.Y + 225) cb_contact.Move(cb_contact.X, dw_1.Y + 225) cb_legal.Move(cb_legal.X, dw_1.Y + 225) cb_connection.Move(cb_connection.X, dw_1.Y + 225) f_highlight_button(r_buttons, cb_activity, "on") // Get source code ls_source_code = dw_6.GetItemString(1, "code") // Show uo_act uo_act.uf_preparDAT* e_dw(gl_device_rid, is_level, is_style_state, & ls_source_code, is_device_code, '', '') uo_act.Show() uo_act.BringToTop = TRUE uo_act.dw_act_detail.SetFocus() //w_mdi_main.SetRedraw(TRUE) w_mdi_main.is_act_style = is_style_state end on on history_view;call w_master_detail::history_view;// User Event // Purpose: Make uo_1 visible, shrink the dw_1 and move dw_4 // Change the attributes of expand and original toolbaritems string ls_source_code if Not wf_check_pending() then DAT* return SetPointer(HourGlass!) //w_mdi_main.SetRedraw(FALSE) is_style_state = 'history' is_enlarge_state = 'detail' f_menu_behave(is_state, is_style_state, is_enlarge_state) // Shrink the dw_1, put a vertical scrollbar on it and move it up to the // top of the window dw_1.Move(dw_1.X, dw_6.Y) dw_6.BringToTop = FALSE dw_1.BringToTop = TRUE dw_1.Resize(dw_1.Width, 192) dw_1.VScrollBar = TRUE // Resize the focus indicator for dw_1 r_1.Resize(dw_1.Width + 25, dw_1.Height + 25) DAT* r_1.X = dw_1.X - 15 r_1.Y = dw_1.Y - 15 // Move all command buttons up cb_member.Move(cb_member.X, dw_1.Y + 225) cb_group.Move(cb_group.X, dw_1.Y + 225) cb_activity.Move(cb_activity.X, dw_1.Y + 225) cb_location.Move(cb_location.X, dw_1.Y + 225) cb_contact.Move(cb_contact.X, dw_1.Y + 225) cb_legal.Move(cb_legal.X, dw_1.Y + 225) cb_connection.Move(cb_connection.X, dw_1.Y + 225) f_highlight_button(r_buttons, cb_activity, "on") // Get source code ls_source_code = dw_6.GetItemString(1, "cDAT* ode") // Show uo_act uo_act.uf_prepare_dw(gl_device_rid, is_level, is_style_state, & ls_source_code, is_device_code, '', '') uo_act.Show() uo_act.BringToTop = TRUE //w_mdi_main.SetRedraw(TRUE) //// Turn expand flag on //ib_expand = TRUE w_mdi_main.is_act_style = is_style_state end on on highlight_dddw;call w_master_detail::highlight_dddw;if il_selected_row > 0 then idwc_dw_child.SelectRow(il_selected_row, TRUE) end if end on public subroutine wf_retrieve_data ();DataWDAT* indowChild dwc long ll_row_num if gl_source_rid > 0 then // Retrieve device records only if the device window is called from // source window if dw_6.Retrieve(gl_source_rid) > 0 then // Retrieve dw_1 data if dw_1.Retrieve(gl_source_rid) > 0 then // dw_1.ScrollToRow(gl_cur_row) if gl_cur_row > 0 then ll_row_num = dw_1.Find('rid = ' + String(gl_cur_row), & 1, dw_1.RowCount()) dw_1.ScrollToRow(ll_row_num) end if end if end if else dw_6.InseDAT* rtRow(0) end if dw_1.TriggerEvent(Rowfocuschanged!) end subroutine public function boolean wf_check_required ();long ll_cur_row, ll_total_row string ls_source_code if dw_1.AcceptText() < 0 then return false if dw_2.AcceptText() < 0 then return false if dw_3.accepttext() < 0 then return false // Only perform checking when there is any row if dw_1.RowCount() > 0 then if Not f_validate_dev_pro(dw_1, dw_1.GetRow()) then return FALSE if not f_check_dates_nt(dw_1, dw_1.DAT*" getrow(), "install_date", "dismantle_date", "Install Date", "Dismantle Date") then return false end if end if ll_total_row = dw_2.RowCount() for ll_cur_row = 1 to ll_total_row choose case is_state case "activity" ls_source_code = dw_6.GetItemString(1, "code") if Not f_validate_act(dw_2, ll_cur_row, is_level, ls_source_code, & is_device_code, '', '') then return FALSE case "member" if Not f_validate_dev_pro(dw_2, ll_cur_row) then return FALSE case "legalDAT*$ " if Not f_validate_legal_relation(dw_2, ll_cur_row) then return FALSE if not f_check_dates_nt(dw_2, ll_cur_row, "begin_relation_date", & "end_relation_date", "Begin Relation Date", & "End Relation Date") then return false end choose next return TRUE end function public subroutine wf_draw_dw2 ();long ll_master_rid if dw_1.RowCount() > 0 then // Get the rid for device ll_master_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") if is_state = "member" then //DAT*&  Only replace the datawindow object when the button is changed if dw_2.DataObject <> is_member_dw then dw_2.DataObject = is_member_dw dw_3.DataObject = is_member_dw_freeform SetTransObject(dw_2, SQLCA) end if f_highlight_button(r_buttons, cb_member, "on") if is_style_state = 'form' then dw_3.Show() else dw_2.Show() end if dw_2.Retrieve(ll_master_rid) // Share data between dw_2 and dw_3 dw_2.ShareData(dw_3) elseif is_state = "activitDAT*( y" then // Only replace the datawindow object when the button is changed if dw_2.DataObject <> is_activity_dw then dw_2.DataObject = is_activity_dw dw_3.DataObject = is_activity_dw_freeform SetTransObject(dw_2, SQLCA) dw_2.Modify("metric_code.DDDW.Name=d_metrics_dev") dw_3.Modify("metric_code.DDDW.Name=d_metrics_dev") end if f_highlight_button(r_buttons, cb_activity, "on") dw_2.Retrieve(ll_master_rid, is_level) dw_3.TriggerEvent(RowfocusChanged!) DAT**  // Share data between dw_2 and dw_3 dw_2.ShareData(dw_3) elseif is_state = "legal" then // Only replace the datawindow object when the radiobutton is changed if dw_2.DataObject <> is_legal_dw then dw_2.DataObject = is_legal_dw dw_3.DataObject = is_legal_dw_freeform SetTransObject(dw_2, SQLCA) end if f_highlight_button(r_buttons, cb_legal, "on") if is_style_state = 'form' then dw_3.Show() else dw_2.Show() end if dw_2.Retrieve(ll_masteDAT*, r_rid) // Share data between dw_2 and dw_3 dw_2.ShareData(dw_3) end if end if end subroutine public subroutine wf_set_var ();is_member_dw = "d_dev_member" is_member_dw_freeform = "d_process" is_activity_dw = "d_activity" is_activity_dw_freeform = "d_activity_freeform" is_legal_dw = "d_legal_entity_relations" is_legal_dw_freeform = "d_legal_entity_relations_freeform" //is_connect_dw = "d_connect" //is_connect_dw_freeform = "d_connect_freeform" is_level = "DEV" eDAT*. nd subroutine public subroutine wf_general_view ();if is_state = 'activity' then uo_act.uf_check_pending() elseif is_state = 'contact' then uo_contact.uf_check_pending() elseif is_state = 'group' then uo_group.uf_check_pending() elseif is_state = 'location' then uo_loc.uf_check_pending() end if m_main_menu.m_view.m_original.ToolbarItemVisible = FALSE // Resize dw_1 to its original size and move it back to the original position dw_1.Resize(dw_1.Width, ii_dw1_height) dDAT*0 w_1.VScrollBar = FALSE dw_1.Move(dw_1.X, ii_dw1_y) // Resize and move focus indicators r_1.Resize(dw_1.Width + 45, dw_1.Height + 35) r_1.X = dw_1.X - 15 r_1.Y = dw_1.Y - 15 r_2.Resize(dw_2.Width + 45, dw_2.Height + 35) r_2.X = dw_2.X - 15 r_2.Y = dw_2.Y - 15 // Move all command buttons up cb_member.Move(cb_member.X, ii_cb_y) cb_group.Move(cb_group.X, ii_cb_y) cb_activity.Move(cb_activity.X, ii_cb_y) cb_location.Move(cb_location.X, ii_cb_y) cb_contact.Move(cb_contact.X, ii_cb_y) DAT*2 cb_legal.Move(cb_legal.X, ii_cb_y) cb_connection.Move(cb_connection.X, ii_cb_y) // Enable all command buttons wf_enable_btn(TRUE) f_highlight_button(r_buttons, cb_member, "off") // Make dw_2, dw_3 and other user objects invisible dw_2.Hide() dw_3.Hide() uo_act.Hide() uo_contact.Hide() uo_group.Hide() uo_loc.Hide() dw_1.SetFocus() is_state = 'master' is_style_state = '' is_enlarge_state = '' f_menu_behave(is_state, is_style_state, is_enlarge_state) end subroutine publiDAT*4 c subroutine wf_detail_view ();if uo_act.Visible then if uo_act.uf_check_pending() then uo_act.uf_save() end if end if if uo_group.Visible then if uo_group.uf_check_pending() then uo_group.uf_save() end if end if if uo_loc.Visible then if uo_loc.uf_check_pending() then uo_loc.uf_save() end if end if if uo_contact.Visible then if uo_contact.uf_check_pending() then uo_contact.uf_save() end if end if is_enlarge_state = 'detail' f_menu_behave(is_staDAT*6 te, is_style_state, is_enlarge_state) // Shrink the dw_1 to show the device id line only and // put a vertical scrollbar on it // 192 is the height for showing device id line only r_1.Hide() dw_1.Resize(dw_1.Width, 192) dw_1.VScrollBar = TRUE dw_1.Move(dw_1.X, ii_dw1_y) // Resize and move the green focus r_1.Resize(dw_1.Width + 45, dw_1.Height + 35) r_1.X = dw_1.X - 15 r_1.Y = dw_1.Y - 15 // Move all command buttons up cb_member.Move(cb_member.X, dw_1.Y + 225) cb_group.Move(cbDAT*8 _group.X, dw_1.Y + 225) cb_activity.Move(cb_activity.X, dw_1.Y + 225) cb_location.Move(cb_location.X, dw_1.Y + 225) cb_contact.Move(cb_contact.X, dw_1.Y + 225) cb_legal.Move(cb_legal.X, dw_1.Y + 225) cb_connection.Move(cb_connection.X, dw_1.Y + 225) // Make dw_2, dw_3 and all other user objects off dw_2.Hide() dw_3.Hide() r_2.Hide() uo_act.Hide() uo_group.Hide() uo_loc.Hide() uo_contact.Hide() end subroutine public subroutine wf_select_one ();SetPointer(HourGlass!) // Open thDAT*: e filter window with parameter - table name if idw_active.ClassName() = "dw_2" or idw_active.ClassName() = "dw_3" or & idw_active.ClassName() = "dw_act_detail" then if is_state = 'activity' then OpenWithParm(w_filter, 'rap_activities') elseif is_state = 'member' then OpenWithParm(w_filter, 'rap_processes') elseif is_state = 'legal' then OpenWithParm(w_filter, 'rap_legal_entity_relations') end if elseif idw_active.ClassName() = "dw_act_master" then OpenWithParm(w_filteDAT*< r, 'act_master') else OpenWithParm(w_filter, 'rap_devices') end if // If filter flag is set to true, then trigger the filter event to perform // filter if gb_filter then gb_filter = FALSE This.TriggerEvent("filter") end if end subroutine public subroutine wf_undo_uo ();// This function retrieve data for the user object based on the reselected // information on the general info area string ls_source_code if uo_group.Visible then uo_group.uf_retrieve_group_member(dw_DAT*> 1.GetItemNumber(dw_1.GetRow(), "rid")) uo_group.uf_retrieve_select_list(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) end if if uo_act.Visible then // Get source code ls_source_code = dw_6.GetItemString(1, "code") uo_act.uf_prepare_dw(gl_device_rid, is_level, is_style_state, & ls_source_code, is_device_code, '', '') end if if uo_loc.Visible then uo_loc.uf_retrieve_dw_loc_master(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) end if if uo_contact.Visible then uo_contact.uf_retDAT*@ rieve_dw_contact_master(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) end if end subroutine public function boolean wf_insert_ok ();// Make sure user has defined a source, device, and process Boolean lb_Check = TRUE // Assume everything is OK string ls_Rid // Device ls_Rid = dw_6.GetText() if ls_Rid = "" then lb_Check = FALSE return lb_Check end function public subroutine wf_enable_btn (boolean pb_enable);cb_member.Enabled = pb_enable cb_group.Enabled = pb_enable cb_activity.EnaDAT*B bled = pb_enable cb_location.Enabled = pb_enable cb_contact.Enabled = pb_enable cb_legal.Enabled = pb_enable cb_connection.Enabled = pb_enable end subroutine public function boolean wf_check_rid (datawindow dw_object); long ll_row_num, ll_cur_row, ll_rid_num, ll_rid ll_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") ll_row_num = dw_object.RowCount() for ll_cur_row = 1 to ll_row_num if is_state = 'legal' then dw_object.SetItem(ll_cur_row, "ref_rid", ll_rid) else ifDAT*D  IsNull(dw_object.GetItemNumber(ll_cur_row, "rid")) then // Select the next available rid from the rid_storage in database ll_rid_num = f_get_sequence() if ll_rid_num = -1 then return FALSE end if // Set the value for the primary key dw_object.SetItem(ll_cur_row, "rid", ll_rid_num) // Set values for other not null fields if dw_object.ClassName() = "dw_1" then dw_object.SetItem(ll_cur_row, "source_rid", gl_source_rid) elsDAT*F eif dw_object.classname() = "dw_2" then if is_state = "activity" then dw_object.SetItem(ll_cur_row, "ref_rid", ll_rid) dw_object.SetItem(ll_cur_row, "metric_level_type", is_level) dw_object.SetItem(ll_cur_row, "creation_date_time", today()) dw_object.SetItem(ll_cur_row, "user_id", gs_user_id) if Left(sqlca.dbms, 2) <> 'OR' then if Not f_check_dup_act(dw_object, ll_rid, is_level) then return FALSE end if elseif is_state = "member" thenDAT*H  dw_object.SetItem(ll_cur_row, "device_rid", ll_rid) elseif is_state = "legal" then dw_object.SetItem(ll_cur_row, "ref_rid", ll_rid) end if end if else // If the activity record is updated. if dw_object.DataObject = 'd_activity' and & dw_object.GetItemStatus(ll_cur_row, 0, Primary!) <> NotModified! then dw_object.SetItem(ll_cur_row, "creation_date_time", today()) dw_object.SetItem(ll_cur_row, "user_id", gs_user_id) if Left(sqDAT*J lca.dbms, 2) <> 'OR' then if Not f_check_dup_act(dw_object, ll_rid, is_level) then return FALSE end if end if end if end if next return TRUE end function public subroutine wf_clear_prev_style (string ps_style);if is_style_state = 'current' or is_style_state = 'history' then wf_detail_view() wf_draw_dw2() end if if is_state = 'activity' then w_mdi_main.is_act_style = ps_style end if end subroutine on open;call w_master_detail::open; // Set uDAT*L p variable for handling menu behavior is_state = 'master' // for dddw use is_column_status = "valid" //gb_device_open = TRUE f_window_count("device") // Save the height and Y coordinate of datawindows into instance variables ii_dw1_height = dw_1.Height ii_dw1_y = dw_1.Y ii_cb_y = cb_member.Y wf_set_var() dw_1.SetTransObject(SQLCA) // The following codes handle the context area for source dw_6.SetTransObject(SQLCA) wf_retrieve_data() dw_1.PostEvent(GetFocus!) endDAT*N  on event activate;call super::activate; // If this window is activated by double-clicked from the source window // then, refresh the data if gb_double_click then gb_double_click = FALSE wf_retrieve_data() end if //if dw_1.RowCount() > 0 then // gl_device_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") //end if end event on close;call w_master_detail::close; f_window_close("device") //if Not (gb_geo_open or gb_source_open) then // gl_geo_rid = 0 // gl_source_rid = 0 //elsDAT*P eif gb_geo_open and (Not gb_source_open) then // gl_source_rid = 0 //end if // //gl_cur_row = 0 //gl_device_rid = 0 //gb_device_open = FALSE end on on clicked;call w_master_detail::clicked;//if not (isnull(is_old_value) or is_old_value = "") then // if idw_active = dw_1 then // if is_column_name = "code" then // dw_1.setitem(dw_1.getrow(), is_column_name, is_old_value) // f_dddw_search(dw_1, idwc_dw_child, is_child_name, is_filt, il_selected_row) // end if // DAT*R  elseif idw_active = dw_2 then // if is_state = 'activity' then // if is_column_name = "material_code" or is_column_name = "metric_code" or & // is_column_name = "value_unit_code" or is_column_name = "method_type" or & // is_column_name = "value_type" then // dw_2.setitem(dw_2.getrow(), is_column_name, is_old_value) // f_dddw_search(dw_2, idwc_dw_child, is_child_name, is_filt, il_selected_row) // end if // elseif is_state = 'member' then // DAT*T  if is_column_name = "code" or is_column_name = "mode_type" or is_column_name = "primary_material_code" then // dw_2.setitem(dw_2.getrow(), is_column_name, is_old_value) // f_dddw_search(dw_2, idwc_dw_child, is_child_name, is_filt, il_selected_row) // end if // end if // elseif idw_active = dw_3 then // if is_state = 'activity' then // if is_column_name = "material_code" or is_column_name = "metric_code" or & // is_column_name = "value_unit_codeDAT*V " or is_column_name = "method_type" or & // is_column_name = "value_type" then // dw_3.setitem(dw_3.getrow(), is_column_name, is_old_value) // f_dddw_search(dw_3, idwc_dw_child, is_child_name, is_filt, il_selected_row) // end if // elseif is_state = 'member' then // if is_column_name = "code" or is_column_name = "mode_type" or is_column_name = "primary_material_code" then // dw_3.setitem(dw_3.getrow(), is_column_name, is_old_value) // f_dddDAT*X w_search(dw_3, idwc_dw_child, is_child_name, is_filt, il_selected_row) // end if // end if // end if //end if end on on w_device.create int iCurrent call super::create this.cb_member=create cb_member this.cb_group=create cb_group this.cb_activity=create cb_activity this.cb_location=create cb_location this.cb_connection=create cb_connection this.cb_contact=create cb_contact this.uo_contact=create uo_contact this.cb_legal=create cb_legal this.uo_loc=create uo_loc this.uDAT*Z o_act=create uo_act this.uo_group=create uo_group this.r_buttons=create r_buttons this.dw_6=create dw_6 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_member this.Control[iCurrent+2]=this.cb_group this.Control[iCurrent+3]=this.cb_activity this.Control[iCurrent+4]=this.cb_location this.Control[iCurrent+5]=this.cb_connection this.Control[iCurrent+6]=this.cb_contact this.Control[iCurrent+7]=this.uo_contact this.Control[iCurrent+8]=this.cb_legal this.Control[iCurrent+9DAT*\ ]=this.uo_loc this.Control[iCurrent+10]=this.uo_act this.Control[iCurrent+11]=this.uo_group this.Control[iCurrent+12]=this.r_buttons this.Control[iCurrent+13]=this.dw_6 end on on w_device.destroy call super::destroy destroy(this.cb_member) destroy(this.cb_group) destroy(this.cb_activity) destroy(this.cb_location) destroy(this.cb_connection) destroy(this.cb_contact) destroy(this.uo_contact) destroy(this.cb_legal) destroy(this.uo_loc) destroy(this.uo_act) destroy(this.uo_group) DAT*^ destroy(this.r_buttons) destroy(this.dw_6) end on on closequery;call w_master_detail::closequery;if is_state = 'activity' then uo_act.uf_check_pending() elseif is_state = 'contact' then uo_contact.uf_check_pending() elseif is_state = 'group' then uo_group.uf_check_pending() elseif is_state = 'location' then uo_loc.uf_check_pending() end if end on type dw_3 from w_master_detail`dw_3 within w_device event dwescape pbm_dwescape event dwnkey pbm_dDAT*` wnkey int X=27 int Y=540 int Width=2789 int Height=872 int TabOrder=40 string Tag="Member information (freeform view)" end type on dw_3::dwescape;call w_master_detail`dw_3::dwescape;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, is_old_value) f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) Parent.PostEvent("highlight_dddw") end if end if DAT*b  //if is_state = 'activity' then // if is_column_name = "material_code" or is_column_name = "metric_code" or & // is_column_name = "value_unit_code" or is_column_name = "method_type" or & // is_column_name = "value_type" then // dw_3.setitem(dw_3.getrow(), is_column_name, is_old_value) // f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // Parent.PostEvent("highlight_dddw") // end if //elseif is_state = 'member' then // if is_column_name = "code" or DAT*d is_column_name = "mode_type" or is_column_name = "primary_material_code" then // dw_3.setitem(dw_3.getrow(), is_column_name, is_old_value) // f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // Parent.PostEvent("highlight_dddw") // end if //end if end on on dw_3::dwnkey;call w_master_detail`dw_3::dwnkey;string ls_col_name if keydown(keytab!) then if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then tDAT*f his.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if end if end on event dw_3::itemchanged;call super::itemchanged; string ls_col_name DataWindowChild dwc ls_col_name = This.GetColumnName() choose case ls_col_name case "scc_ams_code" if Not f_validate_code(This.GetText(), "code", "rap_scc_ams_codes") then MessageBox('Column - SCC/AMS Code', 'Sorry! Not a valid SCC/AMS code') return 1 eDAT*h nd if case "value" f_set_value_amt(This, This.GetText(), "value", "value_amt", This.GetRow()) end choose if ls_col_name = is_column_name then if Not f_validate_code(This.GetText(), is_child_name, is_validation_table) then MessageBox(is_msg_name, is_msg_text) return 1 else il_selected_row = idwc_dw_child.GetRow() end if end if // Prefill unit code // Put code here so that f_validate_code can be performed first. swj, 8/19/94 if ls_col_name = 'metric_code' thenDAT*j  This.GetChild(ls_col_name, dwc) This.SetItem(This.GetRow(), 'value_unit_code', & dwc.GetItemString(dwc.GetRow(), 'unit_code')) elseif ls_col_name = 'rap_legal_entities_name' then This.GetChild(ls_col_name, dwc) This.SetItem(This.GetRow(), 'rid', dwc.GetItemNumber(dwc.GetRow(), 'rid')) end if end event event dw_3::editchanged;call super::editchanged;string ls_col_name ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then GetChild(ls_col_name, idwc_dw_child)DAT*l  il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) if il_selected_row > 0 then Parent.PostEvent("highlight_dddw") end if end if end event event dw_3::itemfocuschanged;call super::itemfocuschanged;string ls_col_name, ls_source, ls_device, ls_stream, ls_process long ll_cur_row ls_col_name = This.GetColumnName() // Call the function to retrieve code values //f_act_dddw_retrieve(This, Parent, is_level, 'DEV') //string code_value //code_DAT*n value = dw_1.getitemstring(dw_1.getrow(), "code") //f_act_dddw_retrieve(This, Parent, is_level, code_value) ll_cur_row = dw_6.GetRow() if ll_cur_row > 0 then ls_source = dw_6.getitemstring(dw_6.getrow(), "code") end if ll_cur_row = dw_1.GetRow() if ll_cur_row > 0 then ls_device = dw_1.getitemstring(dw_1.getrow(), "code") end if ls_process = "" ls_stream = "" if ls_col_name = "metric_code" then //dw_3.dwModify("metric_code.DDDW.Name=d_metrics_dev") f_retrieve_metric_codeDAT*p s(parent, this, is_level, ls_source, ls_device, ls_process, ls_stream) elseif ls_col_name = "group_type" then if this.dataobject = "d_dev_member" or & this.dataobject = "d_process" then f_retrieve_group_types(parent, this, "PRO") else f_retrieve_group_types(parent, this, "DEV") end if elseif ls_col_name = "value_unit_code" then if is_unit_sql = "null" then is_unit_sql = f_get_unit_sql(parent, this) end if string ls_metric_code ls_metric_code = this.getDAT*r itemstring(this.getrow(), "metric_code") f_retrieve_unit_codes(parent, this, is_unit_sql, ls_metric_code) else f_act_dddw_retrieve(This, Parent, is_level, 'DEV') end if //DataWindowChild dwc //choose case ls_col_name // case "code", "material_code", "value_unit_code", "primary_material_code" // f_retrieve_codes(Parent.title, dw_3, ls_col_name, "code") // case "metric_code" // f_retrieve_metric_codes(Parent, dw_3, is_level, 'DEV') // case "method_type", "value_type", "moDAT*t de_type" // f_retrieve_codes(Parent.title, dw_3, ls_col_name, "type") // case "device_rid" // if This.GetChild("device_rid", dwc) = -1 then // MessageBox(Parent.Title, "Application Error:~nDevice Id - " + & // "Not a DataWindowChild.~nContact your technical support.") // return // end if // // If the first value for code is 0 (the dddw has not been retrieved yet), // // retrieve a list of valid codes for this dddw // if dwc.GetItemString(1, "id") = '0' then // dwc.SetDAT*v TransObject(SQLCA) // dwc.Retrieve(dw_1.GetItemNumber(dw_1.GetRow(), "source_rid")) // end if //end choose //if is_state = 'activity' then if ls_col_name = "material_code" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_materials" is_msg_name = "Column - Material Code" is_msg_text = "Sorry! Not a valid material code" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_colDAT*x _name) elseif ls_col_name = "metric_code" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_metrics" is_msg_name = "Column - Metric Code" is_msg_text = "Sorry! Not a valid metric code" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "value_unit_code" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_nameDAT*z  is_child_name = "code" is_validation_table = "rap_units" is_msg_name = "Column - Value Unit Code" is_msg_text = "Sorry! Not a valid value unit code" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "method_type" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_methods" is_msg_name = "Column - Method Type" is_msg_text = "Sorry! Not a valDAT*| id method type" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "value_type" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_value_types" is_msg_name = "Column - Value Type" is_msg_text = "Sorry! Not a valid value type" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "code" then il_selected_row = 0 getcDAT*~ hild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_process_codes" is_msg_name = "Column - Code" is_msg_text = "Sorry! Not a valid process code" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "mode_type" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_modes" is_msg_name = "CoDAT* lumn - Type" is_msg_text = "Sorry! Not a valid mode type" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "primary_material_code" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_materials" is_msg_name = "Column - Code" is_msg_text = "Sorry! Not a valid material code" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_coDAT* l_name = "group_type" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_group_types" is_msg_name = "Column - Group Type" is_msg_text = "Sorry! Not a valid group type" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "daily_schedule_code" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_naDAT* me = "code" is_validation_table = "rap_operating_daily_schedules" is_msg_name = "Column - Daily Schedule Code" is_msg_text = "Sorry! Not a valid daily schedule code" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "weekly_schedule_code" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_operating_weekly_schedules" is_msg_name = "Column - WeeklyDAT*  Schedule Code" is_msg_text = "Sorry! Not a valid weekly schedule code" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "reference_type" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_reference_types" is_msg_name = "Column - Reference Type" is_msg_text = "Sorry! Not a valid reference type" is_old_value = dw_3.getitemstring(dw_3.getrow(), lsDAT* _col_name) elseif ls_col_name = "reference_code" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) idwc_dw_child.SetTransObject(SQLCA) idwc_dw_child.Retrieve() is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_reference_codes" is_msg_name = "Column - Reference Code" is_msg_text = "Sorry! Not a valid reference code" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "data_code" then il_selectDAT* ed_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_data_codes" is_msg_name = "Column - Data Code" is_msg_text = "Sorry! Not a valid data code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = 'rap_legal_entities_name' then f_retrieve_codes(Parent.Title, This, ls_col_name, "name") il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_colDAT* _name is_child_name = "name" is_validation_table = "rap_legal_entities" is_msg_name = "Column - Legal Entity Name" is_msg_text = "Sorry! Not a valid legal entity name" is_old_value = This.getitemstring(This.getrow(), ls_col_name) else is_column_name = "" end if end event event dw_3::rbuttondown;call super::rbuttondown;string ls_obj_name_str, ls_obj_name, ls_sql, ls_process_code, & ls_scc_ams_code long ll_cur_row ls_obj_name_str = this.GetObjectAtPointer() ls_obj_name = LeDAT* ft(ls_obj_name_str, Pos(ls_obj_name_str, "~t") - 1) if ls_obj_name = "scc_ams_code" then ls_sql = "select code, desc_1, desc_2, desc_3, desc_4, " + & "device_code, material_code, process_code, " + & "source_code, type, epa_invalid_flag, inventory_invalid_flag, " + & "mode_type, tier_code, unit_code " + & "from rap_scc_ams_codes" ll_cur_row = This.GetRow() if ll_cur_row > 0 then this.accepttext() ls_process_code = this.getitemstring(ll_cur_row, "code") iDAT* f len(trim(ls_process_code)) > 0 then ls_sql = ls_sql + " where process_code = " + "'" + ls_process_code + "'" end if ls_scc_ams_code = This.GetItemString(ll_cur_row, 'scc_ams_code') end if ls_sql = ls_sql + " order by code" if f_look_up(This, "scc_ams_code", "SCC/AMS Code Lookup", ls_sql, & ls_scc_ams_code) then This.ib_obj_modified = TRUE end if end if end event event dw_3::clicked;call super::clicked;string ls_obj_name_str, ls_obj_name, ls_sql, ls_process_cDAT* ode, & ls_scc_ams_code long ll_cur_row ls_obj_name_str = this.GetObjectAtPointer() ls_obj_name = Left(ls_obj_name_str, Pos(ls_obj_name_str, "~t") - 1) if ls_obj_name = "scc_ams_code_t" then ls_sql = "select code, desc_1, desc_2, desc_3, desc_4, " + & "device_code, material_code, process_code, " + & "source_code, type, epa_invalid_flag, inventory_invalid_flag, " + & "mode_type, tier_code, unit_code " + & "from rap_scc_ams_codes" ll_cur_row = row if ll_cur_row > DAT* 0 then this.accepttext() ls_process_code = this.getitemstring(ll_cur_row, "code") if len(trim(ls_process_code)) > 0 then ls_sql = ls_sql + " where process_code = " + "'" + ls_process_code + "'" end if ls_scc_ams_code = This.GetItemString(ll_cur_row, 'scc_ams_code') end if ls_sql = ls_sql + " order by code" if f_look_up(This, "scc_ams_code_t", "SCC/AMS Code Lookup", ls_sql, & ls_scc_ams_code) then This.ib_obj_modified = TRUE end if end if end event DAT*  event dw_3::dwnprocessenter;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if Send(Handle(This), 256, 9, Long(0,0)) return 1 end event on dw_3::add_row;call w_master_detail`dw_3::add_row; // alternative solution: use the column specification in the datawindow // painter, but iDAT* t fails for some reason.... if is_state = "activity" then This.SetItem(This.GetRow(), "user_id", gs_user_id) This.SetItem(This.GetRow(), "creation_date_time", today()) end if end on on dw_3::getfocus;call w_master_detail`dw_3::getfocus; if uo_act.Visible then uo_act.Hide() end if //if ib_expand then // TriggerEvent("original_view") //end if end on event dw_3::itemerror;call super::itemerror;return 2 end event type dw_2 from w_master_detail`dw_2 within w_device eventDAT*  dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=41 int Y=556 int Width=2784 int Height=864 int TabOrder=30 boolean Visible=false string Tag="Member information (tabular view)" end type on dw_2::dwescape;call w_master_detail`dw_2::dwescape;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, is_old_value) f_dddw_search(this, idwc_dw_child, is_child_name, il_selecDAT* ted_row) Parent.PostEvent("highlight_dddw") end if end if //if is_state = 'activity' then // if is_column_name = "material_code" or is_column_name = "metric_code" or & // is_column_name = "value_unit_code" or is_column_name = "method_type" or & // is_column_name = "value_type" then // dw_2.setitem(dw_2.getrow(), is_column_name, is_old_value) // f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // Parent.PostEvent("highlight_dddw") // end if //elsDAT* eif is_state = 'member' then // if is_column_name = "code" or is_column_name = "mode_type" or is_column_name = "primary_material_code" then // dw_2.setitem(dw_2.getrow(), is_column_name, is_old_value) // f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // Parent.PostEvent("highlight_dddw") // end if //end if end on on dw_2::dwnkey;call w_master_detail`dw_2::dwnkey;string ls_col_name if keydown(keytab!) then if il_selected_row > 0 then ls_col_name = thiDAT* s.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if end if end on event dw_2::itemchanged;call super::itemchanged; string ls_col_name DataWindowChild dwc ls_col_name = This.GetColumnName() choose case ls_col_name case "scc_ams_code" if Not f_validate_code(This.GetText(), "code", "rap_scc_ams_codes") then MessageBox('Column - SCC/DAT* AMS Code', 'Sorry! Not a valid SCC/AMS code') return 1 end if case "value" f_set_value_amt(This, This.GetText(), "value", "value_amt", This.GetRow()) end choose ls_col_name = This.GetColumnName() if ls_col_name = is_column_name then if Not f_validate_code(This.GetText(), is_child_name, is_validation_table) then MessageBox(is_msg_name, is_msg_text) return 1 else il_selected_row = idwc_dw_child.GetRow() end if end if // Prefill unit code // Put codeDAT*  here so that f_validate_code can be performed first. swj, 8/19/94 if ls_col_name = 'metric_code' then This.GetChild(ls_col_name, dwc) This.SetItem(This.GetRow(), 'value_unit_code', & dwc.GetItemString(dwc.GetRow(), 'unit_code')) elseif ls_col_name = 'rap_legal_entities_name' then This.GetChild(ls_col_name, dwc) This.SetItem(This.GetRow(), 'rid', dwc.GetItemNumber(dwc.GetRow(), 'rid')) end if end event event dw_2::editchanged;call super::editchanged;string ls_col_name ls_col_DAT* name = this.getcolumnname() if ls_col_name = is_column_name then GetChild(ls_col_name, idwc_dw_child) il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) if il_selected_row > 0 then Parent.PostEvent("highlight_dddw") end if end if end event event dw_2::doubleclicked;// Do not perform double click function when there is no row in datawindow if This.RowCount() = 0 then return if is_state = "member" then // // NOT WORKING // // ChDAT* eck if any modifications have been made to datawindow // if wf_check_pending() then // // Refresh the datawindow // masterRid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") // dw_2.Retrieve(masterRid) // return // end if // gl_cur_row = row gl_cur_row = This.GetItemNumber(row, "rid") gb_double_click = TRUE m_main_menu.m_data.m_process.TriggerEvent(Clicked!) elseif is_state = "legal" then gl_cur_row = This.GetItemNumber(row, "rid") gb_double_click = TRUE // mDAT* _main_menu.m_data.m_legal.TriggerEvent(Clicked!) SetPointer(HourGlass!) OpenSheet(w_legal, w_mdi_main, 0, Layered!) end if end event event dw_2::itemfocuschanged;call super::itemfocuschanged;string ls_col_name, ls_source, ls_device, ls_process, ls_stream long ll_cur_row ls_col_name = This.GetColumnName() // Call the function to retrieve code values //f_act_dddw_retrieve(This, Parent, is_level, 'DEV') ll_cur_row = dw_6.GetRow() if ll_cur_row > 0 then ls_source = dw_6.getiteDAT* mstring(dw_6.getrow(), "code") end if ll_cur_row = dw_1.GetRow() if ll_cur_row > 0 then ls_device = dw_1.getitemstring(dw_1.getrow(), "code") end if ls_process = "" ls_stream = "" if ls_col_name = "metric_code" then //dw_2.dwModify("metric_code.DDDW.Name=d_metrics_dev") f_retrieve_metric_codes(parent, this, is_level, ls_source, ls_device, ls_process, ls_stream) elseif ls_col_name = "group_type" then if this.dataobject = "d_dev_member" or & this.dataobject = "d_procesDAT* s" then f_retrieve_group_types(parent, this, "PRO") else f_retrieve_group_types(parent, this, "DEV") end if elseif ls_col_name = "value_unit_code" then if is_unit_sql = "null" then is_unit_sql = f_get_unit_sql(parent, this) end if string ls_metric_code ls_metric_code = this.getitemstring(this.getrow(), "metric_code") f_retrieve_unit_codes(parent, this, is_unit_sql, ls_metric_code) else f_act_dddw_retrieve(This, Parent, is_level, ls_device) end if //DAT* DataWindowChild dwc //choose case ls_col_name // case "code", "material_code", "value_unit_code", "primary_material_code" // f_retrieve_codes(Parent.title, dw_2, ls_col_name, "code") // case "metric_code" // f_retrieve_metric_codes(Parent, dw_2, is_level, 'DEV') // case "method_type", "value_type", "mode_type" // f_retrieve_codes(Parent.title, dw_2, ls_col_name, "type") // case "device_rid" // if This.GetChild("device_rid", dwc) = -1 then // MessageBox(Parent.Title, "ADAT* pplication Error:~nDevice Id - " + & // "Not a DataWindowChild.~nContact your technical support.") // return // end if // // If the first value for code is 0 (the dddw has not been retrieved yet), // // retrieve a list of valid codes for this dddw // if dwc.GetItemString(1, "id") = '0' then // dwc.SetTransObject(SQLCA) // dwc.Retrieve(dw_1.GetItemNumber(dw_1.GetRow(), "source_rid")) // end if //end choose if is_state = 'legal' then if ls_col_name = "rid" then DAT*  il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "rid" is_validation_table = "rap_legal_entities" is_msg_name = "Legal Entity Name" is_msg_text = "Sorry! Not a valid Legal Entity Name" // is_old_value = dw_2.getitemnumber(dw_2.getrow(), ls_col_name) elseif ls_col_name = "code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_naDAT* me = "code" is_validation_table = "rap_legal_relationship_codes" is_msg_name = "Code" is_msg_text = "Sorry! Not a valid legal relationship code" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) end if else //if is_state = 'activity' then if ls_col_name = "material_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_materiaDAT* ls" is_msg_name = "Column - Material Code" is_msg_text = "Sorry! Not a valid material code" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_process_codes" is_msg_name = "Column - Process Code" is_msg_text = "Sorry! Not a valid process code" is_old_vDAT* alue = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "metric_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_metrics" is_msg_name = "Column - Metric Code" is_msg_text = "Sorry! Not a valid metric code" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "value_unit_code" then il_selectedDAT* _row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_units" is_msg_name = "Column - Value Unit Code" is_msg_text = "Sorry! Not a valid value unit code" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "method_type" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "typDAT* e" is_validation_table = "rap_methods" is_msg_name = "Column - Method Type" is_msg_text = "Sorry! Not a valid method type" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "value_type" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_value_types" is_msg_name = "Column - Value Type" is_msg_text = "Sorry! NDAT* ot a valid value type" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_process_codes" is_msg_name = "Column - Code" is_msg_text = "Sorry! Not a valid process code" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "mode_typeDAT* " then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_modes" is_msg_name = "Column - Type" is_msg_text = "Sorry! Not a valid mode type" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "primary_material_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_DAT* child_name = "code" is_validation_table = "rap_materials" is_msg_name = "Column - Code" is_msg_text = "Sorry! Not a valid material code" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "group_type" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_group_types" is_msg_name = "Column - Group Type" is_msg_teDAT* xt = "Sorry! Not a valid group type" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "daily_schedule_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_operating_daily_schedules" is_msg_name = "Column - Daily Schedule Code" is_msg_text = "Sorry! Not a valid daily schedule code" is_old_value = dw_2.getitemstring(DAT* dw_2.getrow(), ls_col_name) elseif ls_col_name = "weekly_schedule_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_operating_weekly_schedules" is_msg_name = "Column - Weekly Schedule Code" is_msg_text = "Sorry! Not a valid weekly schedule code" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "reference_type" theDAT* n il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_reference_types" is_msg_name = "Column - Reference Type" is_msg_text = "Sorry! Not a valid reference type" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "reference_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name DAT*  is_child_name = "code" is_validation_table = "rap_reference_codes" is_msg_name = "Column - Reference Code" is_msg_text = "Sorry! Not a valid reference code" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "data_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_data_codes" is_msg_name = "Column - Data Code" iDAT* s_msg_text = "Sorry! Not a valid data code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = 'rap_legal_entities_name' then f_retrieve_codes(Parent.Title, This, ls_col_name, "name") il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "name" is_validation_table = "rap_legal_entities" is_msg_name = "Column - Legal Entity Name" is_msg_text = "Sorry! Not a valid legal entity name" is_DAT* old_value = This.getitemstring(This.getrow(), ls_col_name) else is_column_name = "" end if end if end event event dw_2::rbuttondown;call super::rbuttondown;string ls_obj_name_str, ls_obj_name, ls_sql, ls_process_code, & ls_scc_ams_code long ll_cur_row ls_obj_name_str = this.GetObjectAtPointer() ls_obj_name = Left(ls_obj_name_str, Pos(ls_obj_name_str, "~t") - 1) if ls_obj_name = "scc_ams_code" then ls_sql = "select code, desc_1, desc_2, desc_3, desc_4, " + & "DAT* device_code, material_code, process_code, " + & "source_code, type, epa_invalid_flag, inventory_invalid_flag, " + & "mode_type, tier_code, unit_code " + & "from rap_scc_ams_codes" ll_cur_row = This.GetRow() if ll_cur_row > 0 then this.accepttext() ls_process_code = this.getitemstring(ll_cur_row, "code") if len(trim(ls_process_code)) > 0 then ls_sql = ls_sql + " where process_code = " + "'" + ls_process_code + "'" end if ls_scc_ams_code = This.GetIteDAT* mString(ll_cur_row, 'scc_ams_code') end if ls_sql = ls_sql + " order by code" if f_look_up(This, "scc_ams_code", "SCC/AMS Code Lookup", ls_sql, & ls_scc_ams_code) then This.ib_obj_modified = TRUE end if end if end event on dw_2::rowfocuschanged;call w_master_detail`dw_2::rowfocuschanged;if is_state = "member" then if This.RowCount() > 0 then if This.GetRow() > 0 then gl_cur_row = This.GetItemNumber(This.GetRow(), "rid") end if end if end if end on on dDAT* w_2::add_row;call w_master_detail`dw_2::add_row; // alternative solution: use the column specification in the datawindow // painter, but it fails for some reason.... if is_state = "activity" then This.SetItem(This.GetRow(), "user_id", gs_user_id) This.SetItem(This.GetRow(), "creation_date_time", today()) end if end on event dw_2::dwnprocessenter;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setiteDAT* m(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if //if il_selected_row <> 0 then //if is_state = 'activity' then // if is_column_name = "material_code" or is_column_name = "metric_code" or & // is_column_name = "value_unit_code" or is_column_name = "method_type" or & // is_column_name = "value_type" then // //f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // dw_2.setitem(dw_2.getrow()DAT* , is_column_name, & // idwc_dw_child.getitemstring(il_selected_row, is_child_name)) //// dw_2.triggerevent(editchanged!) // end if //elseif is_state = 'member' then // if is_column_name = "code" or is_column_name = "mode_type" or is_column_name = "primary_material_code" then // //f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // dw_2.setitem(dw_2.getrow(), is_column_name, & // idwc_dw_child.getitemstring(il_selected_row, is_child_name)) //// dDAT* w_2.triggerevent(editchanged!) // end if //end if //end if // dw_2.triggerevent(editchanged!) Send(Handle(This), 256, 9, Long(0,0)) return 1 end event on dw_2::getfocus;call w_master_detail`dw_2::getfocus; if uo_act.Visible then uo_act.Hide() end if end on event dw_2::itemerror;call super::itemerror;return 2 end event type dw_1 from w_master_detail`dw_1 within w_device event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=41 int Y=220 int Width=2784 int HeiDAT* ght=788 int TabOrder=20 string Tag="General information" string DataObject="d_device" end type on dw_1::dwescape;call w_master_detail`dw_1::dwescape;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, is_old_value) f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) Parent.PostEvent("highlight_dddw") end if end if //if is_column_name = "code" or isDAT* _column_name = "group_type" then // dw_1.setitem(dw_1.getrow(), is_column_name, is_old_value) // f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // Parent.PostEvent("highlight_dddw") //end if end on on dw_1::dwnkey;call w_master_detail`dw_1::dwnkey;string ls_col_name if keydown(keytab!) then if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, & idwc_dw_chDAT* ild.getitemstring(il_selected_row, is_child_name)) end if end if end if end on event dw_1::clicked;call super::clicked;//long ll_cur_row //string ls_obj_name_str, ls_obj_name, ls_sic_code // //ls_obj_name_str = this.GetObjectAtPointer() //ls_obj_name = Left(ls_obj_name_str, Pos(ls_obj_name_str, "~t") - 1) // //if ls_obj_name = "sic_code_t" then // // ll_cur_row = row // if ll_cur_row > 0 then // This.AcceptText() // ls_sic_code = This.GetItemString(ll_cur_row, 'sic_code')DAT*  // end if // // if f_look_up(This, "sic_code_t", "SIC Code Lookup", & // "select code, name, user_define_flag from rap_sic_codes order by code", & // ls_sic_code) then // This.ib_obj_modified = TRUE // end if // //end if long ll_cur_row string ls_obj_name_str, ls_obj_name, ls_code ls_obj_name_str = this.GetObjectAtPointer() ls_obj_name = Left(ls_obj_name_str, Pos(ls_obj_name_str, "~t") - 1) choose case ls_obj_name case "sic_code_t" ll_cur_row = row if ll_cur_row > DAT* 0 then This.AcceptText() ls_code = This.GetItemString(ll_cur_row, 'sic_code') end if if f_look_up(This, "sic_code_t", "SIC Code Lookup", & "select code, name, user_define_flag from rap_sic_codes order by code", & ls_code) then This.ib_obj_modified = TRUE end if case "naics_code_t" ll_cur_row = row if ll_cur_row > 0 then This.AcceptText() ls_code = This.GetItemString(ll_cur_row, 'naics_code') end if if f_look_up(This, "naics_code_t", "NAIDAT* CS Code Lookup", & "select code, short_desc from rap_naics_codes order by code", & ls_code) then This.ib_obj_modified = TRUE end if end choose end event on dw_1::rbuttondown;call w_master_detail`dw_1::rbuttondown;long ll_cur_row string ls_sic_code ll_cur_row = This.GetRow() if ll_cur_row > 0 then This.AcceptText() ls_sic_code = This.GetItemString(ll_cur_row, 'sic_code') end if if f_look_up(This, "sic_code", "SIC Code Lookup", & "select code, name, user_defiDAT* ne_flag from rap_sic_codes order by code", & ls_sic_code) then This.ib_obj_modified = TRUE end if end on on dw_1::rowfocuschanged;call w_master_detail`dw_1::rowfocuschanged; string ls_source_code //if Right(is_current_btn, 6) = 'Member' or & // (is_current_btn = 'Activity' and Not uo_1.Visible)then // wf_draw_dw2() //end if if ( dw_1.RowCount() > 0 ) and ( dw_1.GetRow() > 0 ) then wf_enable_btn(TRUE) gl_device_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") is_device_cDAT* ode = dw_1.GetItemString(dw_1.GetRow(), "code") // if gl_device_rid = 0, this means the current row is the new inserted row // then reset the dw_2 if IsNull(gl_device_rid) then dw_2.Reset() end if else gl_device_rid = 0 // Clean the activity datawindow buffer dw_2.Reset() wf_enable_btn(FALSE) end if if is_state = "location" then uo_loc.uf_check_pending() uo_loc.uf_retrieve_dw_loc_master(gl_device_rid) elseif is_state = 'contact' then uo_contact.uf_check_peDAT* nding() uo_contact.uf_retrieve_dw_contact_master(gl_device_rid) elseif is_state = "group" then uo_group.uf_check_pending() uo_group.uf_retrieve_group_member(gl_device_rid) uo_group.uf_retrieve_select_list(gl_device_rid) elseif is_state = 'member' or (is_state = 'activity' and Not uo_act.Visible) or is_state = 'legal' then wf_draw_dw2() end if // If uo_act is visible, then check if there is any modification in uo_1. // When checking is done, retrieve the dw_act_master data basDAT* ed on the // new values. if uo_act.Visible then if uo_act.uf_check_pending() then SetPointer(HourGlass!) // Get source code ls_source_code = dw_6.GetItemString(1, "code") uo_act.uf_prepare_dw(gl_device_rid, is_level, is_style_state, & ls_source_code, is_device_code, '', '') end if end if // Commented out by swj, 7/19/94 //// Refresh process window //if gb_process_open then //// w_process.wf_retrieve_data() this was commented out ********************************DAT* * //end if end on event dw_1::itemchanged;call super::itemchanged;string ls_col_name ls_col_name = This.GetColumnName() if ls_col_name = is_column_name then if Not f_validate_code(This.GetText(), is_child_name, is_validation_table) then MessageBox(is_msg_name, is_msg_text) return 1 else il_selected_row = idwc_dw_child.GetRow() end if end if if ls_col_name = "sic_code" then if not f_validate_code(this.gettext(), "code", "rap_sic_codes") then messagebox("CDAT* olumn - SIC Code", "Sorry! Not a valid SIC code ") return 1 end if end if end event event dw_1::itemfocuschanged;call super::itemfocuschanged;string ls_col_name ls_col_name = This.GetColumnName() if ls_col_name = "code" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") elseif ls_col_name = "group_type" then f_retrieve_group_types(parent, this, "DEV") end if if ls_col_name = "code" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) isDAT* _column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_device_codes" is_msg_name = "Column - Code" is_msg_text = "Sorry! Not a valid device code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "group_type" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_group_types" is_msg_name = "Column - Group Type" is_msg_textDAT*  = "Sorry! Not a valid group type" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if end event event dw_1::dwnprocessenter;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if Send(Handle(This), 256, 9, Long(0,0)) return 1 end evDAT* ent on dw_1::save;call w_master_detail`dw_1::save; string ls_source_code // If save failed, get out of the function if Not ib_save_ok then return // If uo_act is visible, retrieve the dw_act_master data based on the // new values. if uo_act.Visible then SetPointer(HourGlass!) // Get source code ls_source_code = dw_6.GetItemString(1, "code") uo_act.uf_prepare_dw(gl_device_rid, is_level, is_style_state, & ls_source_code, is_device_code, '', '') end if end on on dw_1::DAT* updateend;call w_master_detail`dw_1::updateend;if This.RowCount() > 0 then gl_device_rid = This.GetItemNumber(This.GetRow(), "rid") is_device_code = This.GetItemString(This.GetRow(), "code") else gl_device_rid = 0 SetNull(is_device_code) end if end on on dw_1::add_row;call w_master_detail`dw_1::add_row;// testing statements //string ls_group, ls_name, ls_code //ls_name = this.getitemstring(this.getrow(), "operator_name") //ls_group = this.getitemstring(this.getrow(), "group_type")DAT*  //ls_code =this.getitemstring(this.getrow(), "code") end on on dw_1::editchanged;call w_master_detail`dw_1::editchanged;string ls_col_name ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) if il_selected_row > 0 then Parent.PostEvent("highlight_dddw") end if end if //string filt // //if is_column_name = "code" or is_column_name = "group_type" then // il_selecteDAT*d_row = & // f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // // After the f_dddw_search function has concluded the highlight the // // correct row in the dddw, post an event to the window because it is // // incorrect to create any event on a datawindow that maps to pbm_custom??. // filt = dw_1.gettext() // if il_selected_row > 0 then // Parent.PostEvent("highlight_dddw") // end if //end if // //string ls_col_name //ls_col_name = This.GetColumnName() // DAT* //if ls_col_name = "code" or ls_col_name = "group_type" then // if Not f_validate_code(This.GetText(), is_child_name, is_validation_table) then // is_column_status = ls_col_name // else // is_column_status = "valid" // end if //else // is_column_status = "valid" //end if end on event dw_1::itemerror;call super::itemerror;return 2 end event on dw_1::retrieveend;call w_master_detail`dw_1::retrieveend; if This.RowCount() = 0 then wf_enable_btn(FALSE) end if end on tDAT*ype r_1 from w_master_detail`r_1 within w_device int X=128 int Y=188 end type type r_2 from w_master_detail`r_2 within w_device int X=50 int Y=884 end type type cb_member from commandbutton within w_device int X=37 int Y=1052 int Width=357 int Height=80 string Tag="Show process member" boolean BringToTop=true string Text="Process" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clickedDAT*;SetPointer(HourGlass!) if Not wf_check_pending() then return SetPointer(HourGlass!) wf_enable_btn(TRUE) // Change attributes of menu items is_state = 'member' is_style_state = 'list' //f_menu_behave(is_state, is_style_state, is_enlarge_state) // Change the size of dw_1, move buttons and draw dw_2 wf_detail_view() wf_draw_dw2() f_highlight_button(r_buttons, this, "on") dw_2.SetFocus() end on type cb_group from commandbutton within w_device int X=448 int Y=1052 int Width=DAT*357 int Height=80 string Tag="Show group information" boolean BringToTop=true string Text="Group" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;SetPointer(HourGlass!) if Not wf_check_pending() then return SetPointer(HourGlass!) wf_enable_btn(TRUE) // Change the attributes of menu items is_state = 'group' //f_menu_behave(is_state, is_style_state, is_enlarge_state) // Change thDAT* e size of dw_1, move buttons and display group user object wf_detail_view() uo_group.uf_retrieve_group_member(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) uo_group.uf_retrieve_select_list(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) uo_group.Show() f_highlight_button(r_buttons, this, "on") uo_group.dw_select_list.SetFocus() end on type cb_activity from commandbutton within w_device int X=850 int Y=1052 int Width=357 int Height=80 string Tag="Show activity current view" boolean BringToTDAT* op=true string Text="Activity" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;SetPointer(HourGlass!) if Not wf_check_pending() then return if uo_group.Visible then if uo_group.uf_check_pending() then uo_group.uf_save() end if end if if uo_loc.Visible then if uo_loc.uf_check_pending() then uo_loc.uf_save() end if end if if uo_contact.Visible then if uo_contact.DAT*uf_check_pending() then uo_contact.uf_save() end if end if SetPointer(HourGlass!) wf_enable_btn(TRUE) // Change default to current view // Change the attributes of menu items is_state = 'activity' //is_style_state = 'list' //f_menu_behave(is_state, is_style_state, is_enlarge_state) // //// Change the size of dw_1, move buttons and draw dw_2 //wf_detail_view() //wf_draw_dw2() //dw_2.SetFocus() choose case w_mdi_main.is_act_style case 'current', '' Parent.TriggerEvent(DAT*"current_view") case 'history' Parent.TriggerEvent('history_view') case 'form' wf_detail_view() wf_draw_dw2() m_main_menu.m_view.m_freeform.TriggerEvent(Clicked!) case 'list' wf_detail_view() wf_draw_dw2() m_main_menu.m_view.m_tabular.TriggerEvent(Clicked!) end choose f_highlight_button(r_buttons, this, "on") end on type cb_location from commandbutton within w_device int X=1257 int Y=1052 int Width=357 int Height=80 string Tag="Show location information" boDAT*olean BringToTop=true string Text="Location" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;SetPointer(HourGlass!) if Not wf_check_pending() then return SetPointer(HourGlass!) wf_enable_btn(TRUE) // Change the attributes of menu items is_state = 'location' //f_menu_behave(is_state, is_style_state, is_enlarge_state) // Change the size of dw_1, move buttons and display location useDAT*r object wf_detail_view() uo_loc.uf_retrieve_dw_loc_master(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) uo_loc.Show() f_highlight_button(r_buttons, this, "on") uo_loc.dw_loc_master.SetFocus() end on type cb_connection from commandbutton within w_device int X=2473 int Y=1052 int Width=357 int Height=80 string Tag="Open connection window" boolean BringToTop=true string Text="Connection" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontDAT*Pitch FontPitch=Variable! end type event clicked;SetPointer(HourGlass!) if Not wf_check_pending() then return SetPointer(HourGlass!) //wf_enable_btn(TRUE) OpenSheet(w_connect, w_mdi_main, 0, Layered!) end event type cb_contact from commandbutton within w_device int X=1664 int Y=1052 int Width=357 int Height=80 string Tag="Show contact information" boolean BringToTop=true string Text="Contact" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FonDAT*tFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;SetPointer(HourGlass!) if Not wf_check_pending() then return SetPointer(HourGlass!) wf_enable_btn(TRUE) // Change the attributes of menu items is_state = 'contact' //f_menu_behave(is_state, is_style_state, is_enlarge_state) // Change the size of dw_1, move buttons and display contact user object wf_detail_view() uo_contact.uf_retrieve_dw_contact_master(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) uo_contact.Show()DAT* f_highlight_button(r_buttons, this, "on") uo_contact.dw_contact_master.SetFocus() end on type uo_contact from u_dw_contact within w_device int X=23 int Y=548 boolean Visible=false boolean Border=false BorderStyle BorderStyle=StyleBox! end type on uo_contact.destroy call u_dw_contact::destroy end on type cb_legal from commandbutton within w_device int X=2071 int Y=1052 int Width=357 int Height=80 string Tag="Show legal information" boolean BringToTop=true string Text="LeDAT*gal" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;//MessageBox('Legal', 'Sorry! This function is not ready') //SetPointer(HourGlass!) //wf_enable_btn() //This.Enabled = FALSE //// The next two lines must be placed in script after buttons are moved //f_highlight_button(r_buttons, this, "off") //f_highlight_button(r_buttons, this, "on") SetPointer(HourGlass!) if Not wf_check_pending(DAT*) then return SetPointer(HourGlass!) wf_enable_btn(TRUE) // Change attributes of menu items is_state = 'legal' is_style_state = 'list' // Change the size of dw_1, move buttons and draw dw_2 wf_detail_view() wf_draw_dw2() f_highlight_button(r_buttons, this, "on") f_menu_behave(is_state, is_style_state, is_enlarge_state) dw_2.SetFocus() end on type uo_loc from u_dw_loc within w_device int X=0 int Y=528 boolean Visible=false boolean Border=false BorderStyle BorderStyle=SDAT* tyleBox! end type on uo_loc.destroy call u_dw_loc::destroy end on type uo_act from u_dw_act_dev within w_device int X=0 int Y=340 boolean Visible=false boolean Border=false BorderStyle BorderStyle=StyleBox! end type on highlight_dddw;call u_dw_act_dev::highlight_dddw;// Commented out by swj, 7/29/94 //if uil_selected_row > 0 then // uidwc_dw_child.SelectRow(uil_selected_row, TRUE) //end if end on on uo_act.destroy call u_dw_act_dev::destroy end on type uo_group fromDAT*" u_dw_group_dev within w_device int X=41 int Y=544 boolean Visible=false end type on uo_group.destroy call u_dw_group_dev::destroy end on type r_buttons from rectangle within w_device int X=485 int Y=1188 int Width=160 int Height=144 boolean Visible=false boolean Enabled=false int LineThickness=4 long LineColor=12632256 long FillColor=32768 end type type dw_6 from u_dddw within w_device int X=23 int Y=28 int Width=2793 int Height=92 int TabOrder=10 string DataObject=DAT*$"d_source_ids_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type event retrieve_data;call super::retrieve_data;string ls_data DataWindowChild dwc ls_data = This.GetText() if (ls_data = '' or IsNull(ls_data)) then MessageBox('Context Error', 'Source Id is required') This.SetFocus() return 1 end if if This.GetChild("id", dwc) = -1 then MessageBox("Source Context", "Application Error:~nSource Id - " + & "Not a DataWindowChild.~nCoDAT*ntact your technical support.") return end if // Put source code and name in the context area This.SetItem(1, "code", dwc.GetItemString(dwc.GetRow(), "code")) This.SetItem(1, "name", dwc.GetItemString(dwc.GetRow(), "name")) gl_source_rid = dwc.GetItemNumber(dwc.GetRow(), "rid") if dw_1.Retrieve(gl_source_rid) = 0 then dw_2.Reset() dw_2.TriggerEvent(Rowfocuschanged!) end if dw_1.TriggerEvent(Rowfocuschanged!) if gl_source_rid = 0 then dw_2.Reset() dw_2.TriggerEvent(RDAT*( $8)8 $8 )48<$80JD88L 8L! 8L!1"!  , 0, 8M8{z%81<9$80)8$80J81" 8080@8$)8DAT**$)8 $8 )8$)$899 Ld8Xb "#$%8&X+b2l5689:;F<b=>?CDEGFHbIJKPWZ[$]<^l_`abcd0h:inj~lmnop0u:}D~pFJNRd > Z z d pl_cur_rowll_process_ridll_countyriDAT*,dll_stateridll_sourceridll_rcls_countynamels_sourceidls_src_idls_dev_idls_pro_iddwc_childsqlca"/;HN \ h r |   @0, is_factor_type4Qdw_1"-process_ridgetitemnumber <"-state_rid <Data EntryPleaDAT*.se enter State.l"-setfocusrn"-setrowQ"-setcolumnH"-scrolltorow?"-setitemOErrorw_emission_factor_s::wf_check_special(); copy of state RID to process RID failed."-"-Q"-H"-?4Rw"- <"-county_rid <Please enter County."-"-Q"-H"-?"-Ocopy of county RID to process RID faiDAT*0led.$"-"-Q"-H"-?4Mnd"- <"-source_rid <Please enter Source ID."-"-Q"-H"-?"-Ocopy of source RID to process RID failed.8"-"-Q"-H"-?"-rap_sources_idgetitemstring"-rap_devices_id"-rap_processes_id"- <Error selecting rid from rap_pDAT* rocesses table. Contact your technical support."-O"- <DataWindow ErrorSorry! Process Id is required"-"-Q"-H"-? ( L T h            p x                  ( 0 8 @ H | DAT*!8<)8$8)8<,)8<) 8$8)8<,)$8<),81  N p:\v<!V"#%d ldwcll_rcsqlca<  @4 dw_1-couDAT*8*z%@8,)88)88) 81<80088[z%@8,)48P8)X80^d|"#%() d pdw_objdwcsqlca<  @`@ geographic_incorp_ridgetchildcouf_get_orig_sqlApplication Error: CityDAT*x.   ( 0 @ H T \ d l t |               ( 0 8 2-$)$81<494$)<81<h9L$)T81<9\$)l81t$8|)88080:DAT*:p@)b?HA# p@p@fp@q'@@a,\@\@7[@[@aCc@c@aPU@U@aa`@`@kj@j@yk@k@l@l@m@m@@@@@@@@@^@^@@@@@@+@@5@@@@@qJ@@aV@@b@@pn@n@{@@a_F@F@q@q@'d@d@av@v@ac_)r w_scc_speciation_lookupwindowmenuwindDAT*<owtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectmef statictextfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylecommandbuttondatawindowdwobjectGeneric Speciation Factor LookupEMIS_PRO.ICOf } f tors:Show All Profile CodesShow All SCC/AMS CodesClosed_emission_factor_list_by_profiled_speciation_profile_listd_scc_ams_listpointertransactionsqlcags_scc_ams_codedragobjectmessage2 w_scc_speciation_lookup  g of_setstatusas_modeof_setwindowof_setmode+create+destroy+open+clickedxposyposrowdwo( IyISbQLUZ_c#LDAT*@IILCdwobject.UZ_c#UZ_c# ,l x _initsrcwindoww_scc_speciation_lookupmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectstatictextst_factor_statusfontcharsetfontpitchfontfamilyalignmentfillpatternborderstyleDAT*Bst_profile_statusst_scc_statusst_1commandbuttoncb_profile_mastercb_scc_mastercb_closedatawindowdw_factordwobjectdw_profiledw_sccpointertransactiondragobjectmessageH$@$0@85@@,@4L@Y" @leanjol@lse t @ow h@@ @ @d") E=@_act ar@te_tMN@DAT*DE="rie@er_i(N@"raps.@e") E=_actmm@textNA@%@0@dw_2:@F@4!Rdr!w@<$@$ ash_h@ n  @)@ @DAT*F!0@  "$%zZ 6*. . . . ---!DAT*Hy%!y%!y%62$$$8,<8;0d8P$z%8z&$1)8$)81($8z%(@(8z(8z&(@(8z(\11!$(@(8z'8zDAT*J&\11!$ (@(8z'8(z&\4$8<8@$H8Pz%\\$d8l0$$8808$z%8z&$1)8 $)810$88z%(@(8z(8z&(@(8DAT*Lz(11!@$H(@(8z'8z&11!LP$X(@(8z'8(z&`$8<h$p8Pz%x$80$8<8<08$z%8z&$1)8$)81DAT*N $8z%(@(8z(8z&(@(8z( 11!:$$(@(8z'8z& 11!,$4(@(8z'8(z& <$8<D$L8Pz% T$\8l09)p81 & 8 <d$FDAT*P 48\ !"%&' ()*+,-H.h/04567:;:<\=l>?@6AXBCDEH K d* ll_rowll_rowcountls_description< x dw_scc3%dataobjectd_scc_ams_listAll SCC/AMS Codes: SCC/AMS Codes for Profile is_currentprofilek5: 3%getselectedrowi3%rowcount4st_scc_statush@,DAT*RtextRecord of , Record, Records%k5ot ,No Records,No Profile Selecteddw_profile2$d_speciation_profile_listAll Profile Codes: Profile Codes for SCC/AMS is_currentscc42$2$4st_profile_status+++4++No SCC/AMS Code Selectedk5Factors for Profile tink5dw_factoDAT*Tr1"1"4st_factor_status ***k5**setredrawYd $             4 @ H \ d         0 8 @ H P X ` h p x         DAT*V   $ , 4 < D L T \ p :F@@89)86)(8<)@89)H8 0Tf|d as_modeli_rc( P setredraw$Yof_setmodeyof_setstatusw0Y ( @ H T S:F@@DAT*X868$0$88H$P880X$,)p8x$)8,#,8! ,61$8$8$z%8z&1$)8)981$8)$8,$)@8H$19DAT*Z)\8d$9)l88t0)81<1$80$,)8$)88080 8$4$<$8D`$h8D0p$,)x8$)81$8H$8$z%8DAT*\z&1$)8)9814$8)8$)8$19)8$9)880)81<01$$8,0H$,)P8X$)`8h80p80 8x$8,0DAT*^$,)8$$6)81$8$8$z%8z&1$)8)981$8)8$)8$19)8$9) 8(80 8t 0$880@$,DAT*`)H8P$X$6)`81h$8p$8x$z%8z&1$)8)981v $8)8$)8$19)8$9)8 80 808z%:)@@81($8DAT*b" <$D$6)L8> T$)\81  *:Nt  4#%()*$-H.r134567:=2>X?|@DEFIHKXNOPST W0Y4ZX[x\]`cde$hPi^jzmor$sDtjuwz}~4B^ ( N r v  " > d5 as_modell_rowcase13sqlcags_scc_ams_codeDAT*@0d  @'%@d SCC_MASTERdw_scc3%dataobject$d_scc_ams_list3%$3%settransobject^`3%retrievetvi1is_currentsccn443%code = 'uff4'ba3%rowcountcti4find k43%codegetitemstring3%scrolltorow?43%selectrow@P3%@PPROFILE_DETAILof_sDAT*fp@)b?IA3p@p@gp@@@\@\@*[@[@6c@c@CU@U@T`@`@^j@j@lk@k@xl@l@m@m@@@@@@@@@^@^@n@@@@@@$n@n@/@@=@@I@@S@@^@@mS@S@v@@@@@@@@@@8@8@Q@@P@@@@I@@pS0@0@a F@F@q@DAT*hq@8L  v@v@M X(*@*@0p= Sp w_rpt_airswindowmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectg xu_dddwborderstyledwobjectdatawindowcommandbuttonfontcharsetfontpitchfontfamilysingleliDAT*jneedittextcasecheckboxstatictextalignmentfillpatterneditmaskmaskdatatype eL<|;dropdownlistbox L<groupboxrectanglelinestyleAIRS.ICO<g |;BASEOg L<d_ref_codes_table_dddwd_states_dddwd_criteria_dddwBrowse...MS Sans Serifd_toxic_dddwSegment Pollutant (SIP Daily Emissions)Segment Pollutant (Annual DAT*lEmissions)Segment GeneralGeneral PointMailing LabelGeneral StackPlant GeneralToxic PollutantsCriteria PollutantsTo Date:From Date:mm/dd/yyyy01/01/1900~12/31/21005<??n??Operation Mode:BatchInteractiveg Hg HReport may take a long time to print...ParametersCloseGenerDAT*nateAIRS Transaction File NameAIRS/AFS Transaction SelectionsSAS Log File NameGEINI Status Report File Namepointertransactionsqlcaf_write_linegs_inifilegs_app_titlemessagef_menu_behavef_put_scroll_barskeycodef_sas_configf_get_odbc_connectionh 8@Hpx2 w_rpt_airs '&V wf_create_viewwf_check_requiredpl_parent_ridwf_retrieveDAT*p_countyps_dsnps_uidwf_write_geiniprm_file+open+wparam+lparam+other+activate+create+destroy+sizetype+newwidth+newheight+resize+row+dwo+itemfocuschanged+constructor+retrieve_data+dwnprocessenter+getfocus+key+keyflags+dwnkey+losefocus+clicked+modified8 By)QLbJQBSSLenu }LULQtp LUII+otLLCdwobject.ypeu }!N&DAT*r LCkeycode.U <\ x _initsrcwindoww_rpt_airsmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectu_dddwdw_ref_codeborderstyledwobjectdw_statedw_countydatawindowdw_criteria_groupcommandbuttoncb_1fontcharsetfontpitchfontfamilysinglelineeditsle_trans_filetextcasedw_toDAT*txic_groupcheckboxcbx_seg_pollutant_sipcbx_seg_pollutant_annualcbx_segment_generalcbx_general_pointcbx_mailing_labelcbx_general_stackcbx_plant_generalcbx_toxiccbx_criteriastatictextst_5alignmentfillpatternst_4editmaskem_to_datemaskdatatypeem_from_datest_2dropdownlistboxddlb_modecb_browse_2cb_browse_1sle_log_filesle_report_filest_rpt_msgst_1cb_closecb_generategroupboxgb_3gb_7gb_6gb_5gb_2gb_1rectangler_1linestylepointertransactionmessagekeycode,DAT*v@#@(@3@?@L@]@g@u @ @ @ow, /g@the of@ is_fi@ thitr@row, @et tto@ det pt.of("@DETAre@ 0  nscta!@,DAT*x!>@LQ@!]@g<@r@idME@+ro@rs * ILbjec )  0@*<F$S@$^c@m@y~DAT*z@ @ctaiK!@roSg<id  %"@ct. g3!8"w_nu=# is.BB$=  enG%neL#8@8V&6Z$@d&DAT*|@8l'@<x,@(0@  "$%&'()*+,.135689:DAT*~;<=>?@BCDEFGI {[  ]*y- 'y- 'y- 'y%-;-##y%#-#DAT*-#-#-#-#-#-#-#--. -. 2G9002G900-. 7G7%%--DAT*;-##;-##-. -. --A%A%A%A%A%A%H  9dDAT*  25:F@@8$,$H$P$"l$t$"$$"$$"$$"$$"#  $68(8Nz%@8$)89$$8$680@8$)89$ $8($680DAT*0@8T$)\89t$|$8$680@8$)89$$8$680@8$)890$8$#|@$68H0@8d$)l89$$#$680@8DAT*$)89$$6@8$$6@8#@#81$680@8$)890$8$P$)d8l$18t)88"$680@8$)89$$b$) 8DAT*$18t)88"b$$68,0@8P$)X89`$h$p$x$""$$$$"#"$688z%@8$)899  Ft : h!$%&'+,(-V.r2|3459:f;<DAT*?@ABC:DhEIJKLMN<OXSbTUWXd"d ls_ref_codels_material(   cbx_plant_general7*checked$cbx_mailing_label45($cbx_general_stackX6)$cbx_general_pointip|4'$cbx_segment_general3&$cbx_seg_pollutant_annualero2%$cbx_seg_pollutant_sipin1$$titleac No AIRS/AFS transaction is selDAT*ected. Please select one or more transactions to generateows7*setfocusle_sle_report_fileC0X$68#`9 68`0l$68#9 68t0,($68#9 68068#29DAT* 68068#r9 680$$6 8#9 680$6 8# 9 680$6 8#T9 680<$6 8#9 68D0d$6 8#9 68l0$68#,9DAT* 680$68#t9 680$68#9 680 $($6@8@8800)@)88#N9 68D0X$`$6@8@8800)@)88#9$$$$"@DAT*$18)8 68068#9$$8$18@)P8 68X068#9t$|$P$18@)8 68068#9$)8$18)8$18)88"#T DAT* $$)$88,J@8  1"# (@(880 68H068#9\$)d8l$18)t8|$18)88"#  $$)88,J8  1"#   (@(8  80 680DAT* 68#4 9 ,*6808080@8 8  80,*68080 6@8 680 68# 9 ,*6808080@8 8  80,*68080 6@8 680 68# 9 /@/DAT*81<L 80:)@@899 8V!"V%`&)*-.(122h5r689; <J>T?ABDE"G,HjJtKNPDRNTWXZ@[v^_abef"hPimnprTsntuxy}~` * 4 t   R f x  B L d ps_dsnps_uidls_filels_write_linels_regionlsDAT*_ref_codels_criterials_toxicls_statels_countyls_priorityli_file_numll_statell_countysqlcags_inifile@    , 6 B N W ` j v(@L*@  is_userdireR\geiniprm.txtError opening file.DAT*SAS DIRECTORYis_sasdirscLQSAS USERDIRRCONNECTION TYPEDSNUIDTRANSACTION FILEsle_trans_file/ text8PLANT GENERALis_plant_general@TMAILING LABELis_mailing_labelUGENERAL STACKis_general_stack*VGENERAL POINTis_general_pointRWSEGMENT GENERALis_segment_general|XSEG POLLUTANT ANNUALis_segment_pollutant_annualYSEG POLLUTANT SIPis_segment_pollutant_sipZFROM TIMEem_from_date=5yyyyDAT*-mm-dd hh:mm:ssTO TIMEem_to_dateL<3cbx_seg_pollutant_annualh2%checkedcbx_seg_pollutant_sip1$dw_ref_code*ref_codegetitemstringREFERENCE CODEcbx_criteria9,dw_criteria_group$-material_codeZCRITERIA GROUPcbx_toxicg8+dw_toxic_group0"TOXIC GROUPdw_state+accepttext+name+dwc_state[ [ getrowbDAT*ridgetitemnumber8W0STATE RIDdw_countyR,R,R,dwc_county\ \ bW0COUNTY RIDdata code prioritynullnot found99NULL PRIORITYRO00RO PRIORITYError closing the file. X l      < d      ( X `         8 P t |    DAT*        $ @ \ d l t |       8,+z%8 z&H,*68P08T08[0@8h$8[p$8x"*|$68,*z%8z&8z&8z&:)@@8,-1$,-$$ 9}4$)DDAT*8L$\9}t$|9}$9},-1,-$(p *Hdd* gs_app_titlegs_inifile::message<+@*@ -@M title GEINI ( to AIRS/AFS Data Convertor)is_sasdir@=Qsassasdirnot found=Q=Q Error finding , sas section or sasdir key inDAT* the ProfileString function. Contact your technical support.cbx_seg_pollutant_sipab1$visibledw_ref_code(*reset/<(*enabledT cbx_criteriad9,Tcbx_toxic! 8+T H h p |     4 D L \ t |    4,-1(,-$0d" +wparam+lparam::message<DAT* -@M  f808 08 08,-L1Z,-$2d ::message-@M base &'*0*8L*Tp*x*****$DAT*@*Hd*l**** *$*,<*DX*`x****** $*,@*HX*`t*|***DAT**** *(4*<LT$\$d$l$t$|$$$$$$$$$$$$$$$$$$ $$$$$,$4$<$D$LDAT*$T$\$d$l$t$ %|,BXn 4J`v&<Rh~ !"#$%&'.d | dw_ref_code*dw_state$+$dw_county@,@dw_criteria_group\-\cb_1.sle_trans_file/ dw_toxic_group0""cbx_seg_pollutant_siDAT*p1$$cbx_seg_pollutant_annual ty2%%cbx_segment_general,3&,&cbx_general_pointxpP4'P'cbx_mailing_label}t5(t(cbx_general_stack6))cbx_plant_general7**cbx_toxic8++cbx_criteria9,,st_5:..st_44;141em_to_dateL<3L3em_from_date$h=5h5st_2>66ddlb_mode?88cb_browse_2@99cb_browse_DAT*1A::sle_log_file COB;;sle_report_fileC<<st_rpt_msg4D=4=st_1PE>P>cb_closehF?h?cb_generateG@@gb_3OXIHBBgb_7ICCgb_6JDDgb_5KEEgb_26LFFgb_1MGGr_10NI0IcontrolDc@*$+@,\-./ 0"1$2%,3&P4't5(6)7*8+9,DAT*:.4;1L<3h=5>6?8@9A:B;C<4D=PE>hF?G@HBICJDKELFMG0NI 0 8L Tp x     $@ Hd l      $ ,< DX `x  DAT*     $ ,@ HX `t |        (4 <L T \ d l t |                      $ , 4 < DAT*D L T \ d l t  %$($<$X$h$$$$$$$0$L$h$|$$$$$$$$$,$D$\$p$$$$$DAT*$$$$$$*8FT b p ~  &4BP^lz !"#$%&d ( dw_ref_code*dw_state*+dw_county0,dw_criteria_group*D-cb_1`.sle_trans_filep/ dw_toxic_group@0"cbx_seg_pollutant_sip1$cbx_seg_pollutant_annual2%cbx_segmenDAT*t_general3&cbx_general_point4'cbx_mailing_label5(cbx_general_stack86)cbx_plant_generalT7*cbx_toxicp8+cbx_criteria9,st_5:.st_4;1em_to_date<3em_from_date=5st_2 >6ddlb_mode?8cb_browse_2 @9cb_browse_1 A:sle_log_file4B;sle_report_fileLCcb_closeF?cb_generateG@gb_3HBgb_7ICgb_6n JDgb_5DAT*typKEgb_2d LFgb_1MGr_1NI ( < X h       0 L h |         , D \ p           J!8,-01>,-$d1 +sizetype+newwidth+newheight::messageDAT*P '-@M  &'. wxyz&'.2 wf_create_viewwf_check_requiredwf_retrieve_countywf_write_geiniprm_filef_write_line+open+other+activatef_menu_behave+create+destroy+resizef_put_scroll_bars)<S)S)DAT*S)S)S)S)S)S)S)S)S)S)S)S)S)S)$S)@6S)S)X6S)S))S)`,*f$m,Xw.,%DAT*+lo exw+r/d2  xywidthheighttitlebarbackcolorcontrolmenuminboxmaxboxresizableicondw_ref_codedw_statedw_countydw_criteria_groupcb_1sle_trans_filedw_toxic_groupcbx_seg_pollutant_sipcbx_seg_pollutant_annualcbx_segment_generalcbx_general_pointcbx_mailing_labelcbx_general_stackcbx_plant_generalcbx_toxiccbx_criteriast_5st_4em_to_dateem_from_datest_2ddlb_modecb_browse_2cb_browse_1sle_log_filesle_report_fDAT*ilest_rpt_msgst_1cb_closecb_generategb_3gb_7gb_6gb_5gb_2gb_1r_1is_invtypeis_geinidiris_sasdiris_userdirib_sas_runis_plant_generalis_mailing_labelis_general_stackis_general_pointis_segment_generalis_segment_pollutant_annualis_segment_pollutant_sipdwc_statedwc_county   7 ",8?FPDAT*]U a j t   " $ % &H ' ( )" *4 +`p> ,K .P 1U 3` 5m 6r 8| 9 :h_DAT* ;e  < =ec > ? @ B C D E@ F G I@$/@QbsDAT*  ] o  7    1] @@@      " $ % & ' ( ) * + , .DAT* 1 3 5 6 8 9 : ; < = > ? @ B C D E F G I  wx7 xyX4zo8&DAT*T<'8XX\. 18(800L8T0t8|080,-1,-$:Tnd0 +row+dwoDAT*ancestorreturnvalue::messageP &-@M( itemfocuschangedis_child_namecodeis_validation_table5"rap_reference_codesis_msg_nameh Column - Reference Codeis_msg_text!Sorry! Not a valid reference code( L t   T %8 $,()88@$1)T8\$8d)tDAT*81<$688z%@8,-1,-$,()8)8,-:1H,- $8 Z   d0 ancestorreturnvaluedwcsqlca::messageP (@L&-@MX constructordw_ref_code*settransobject_^(*insertrow(H*DAT*codegetchildoititle -| Application Error: Reference Code - Not a DataWindowChild. Contact your technical support.(retrievemf| 8 @ T \ t       %1L%OP-/10.2 ' +itemfocuschanged+constructor(typedem u_n 2 K xywidthheighttaborderdataobjectborderborderstyleliDAT*vescroll  l"-4@] ol @    DAT*18%L 8) 8)(880"#<$D$)T88\Jp81"$)8)8@8$116)8$)8,-p1~,-DAT*~0$ V :VdL +wparam+lparamancestorreturnvaluell_parent_ridls_null::messagex ,: B-@Mp retrieve_datagettextedwc_state1[ 1[ getrowbLridgetitemnumberW`dwc_countyx\ retrieve|wf_retrieve_countyydw_county,setitemNDAT*p@)b?IA2p@p@hp@@@\@\@([@[@4c@c@AU@U@R`@`@\j@j@jk@k@vl@l@am@m@q@@@@a@@a@@a^@^@@@@@@@%@@0@@:@@F@@R@@n@@@a@@0n@n@`@@`S@S@a8@8@8@@F@@U@@T[ v@v@[ lZc F@F@k q@DAT*q@w \|     & 8 d@d@C *@*@K X n p w_rpt_qcwindowmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecth statictextfontcharsetfontpitchfontfamilyalignmentfillpatternborderstyledropdownlistbox& DAT*ٵu_dddwdwobjectcheckboxdatawindow L!editmasktextcasemaskdatatypeXL!XL!XL! X L!commandbuttonsinglelineeditgroupboxQC CheckerDAT*QCCHECK.ICOh XOh L!Geographic Level:ArialMS Sans SerifStateCountyh $hh $hd_ref_codes_table_dddwd_units_dddw_on_qccheckerd_metric_code_dddwd_states_dddwd_matrl_code_dddwd_str_code_dddwd_pro_code_dddwd_dev_code_dddwd_src_code_dddwSCC/AMS CodeDevice SIC CodeSource SIC Coded_pro_scc_dddwd_dev_sic_dddwDAT*d_src_sic_dddwd_value_type_dddwLevel Type:GeographicSourceDeviceProcessStreamh *h *Upper Percentile###1~99Hݑ????Lines per page:Columns per page:1~176Hݑ??##1~86DAT*??Outlier reportDescriptive - long with plotsDescriptive - long without plotsDescriptive - shortLower PercentileTo Date:From Date:mm/dd/yyyy01/01/1900~12/31/2100??PN??Source Type:AreaPointBothh @h @Operation Mode:BaDAT*n FALSE end if if not f_write_line(li_file_num, ls_file, 'TRANSACTION FILE', sle_trans_file.Text) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'PLANT GENERAL', is_plant_general) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'MAILING LABEL', is_mailing_label) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'GENERAL STACK', is_general_stack) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'GENERAL PODAT*nINT', is_general_point) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SEGMENT GENERAL', is_segment_general) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SEG POLLUTANT ANNUAL', is_segment_pollutant_annual) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'SEG POLLUTANT SIP', is_segment_pollutant_sip) then return FALSE end if if not f_write_line(li_file_num, ls_file, 'FROM TIME', & String(DateTime(Date(em_from_date.TexDAT*tchInteractive=h @H N h @H N Browse...Report may take a long time to print...CloseGenerateGroup ByReport SelectionsQC Report Log File NameQC Report Output File Namemessagepointertransactionsqlca,(select rap_metrics.code from rap_metrics , rap_metric_maps where material_flag is NULL AND rap_metrics.code =rap_metric_maps.code AND rap_metric_maps.material_code is not NULL check_mDAT*aps9 ~ IAf_db_error8 IA) IAf_write_linegs_inifilef_menu_behavef_put_scroll_barsdragobjectkeycodef_sas_configf_get_odbc_connectiond Hpx8p0DAT*8Hpx(PX`\  ~  D     2 w_rpt_qc 87 wparamlparam+highlight_dddwwf_create_viewwf_check_requiredpl_parent_ridwf_retrieve_countypdw_objwf_show_dddwps_dsnps_uidwf_write_qcparm_file+wparam+lparam+activate+other+sizetype+newwidth+newheight+resize+create+destroy+constructor+row+dDAT*wo+itemfocuschanged+getfocus+losefocus+data+itemchanged+retrieve_data+key+keyflags+dwnkey+dwnprocessenterindex+selectionchanged+modified+clickedh  LULBobGQLdh-QCdatawindow.ai}BSSLG  LUIIQ LLCdwobject.+e  7LLCdwobject.S  DAT*Y^^ LCkeycode.ULI(8Tt,D\ x _initsrcwindoww_rpt_qcmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectstatictextst_geo_levelfontcharsetfontpitchfontfamilyalignmentfillpatternborderstyledDAT*ropdownlistboxddlb_geo_levelu_dddwdw_ref_codedwobjectdw_unitdw_countydw_metricdw_statedw_matrl_codedw_str_codedw_pro_codedw_dev_codedw_src_codecheckboxcbx_pro_scccbx_dev_siccbx_src_siccbx_countydatawindowdw_pro_sccdw_dev_sicdw_src_sicdw_value_typest_10ddlb_levelst_9editmaskem_lowertextcasemaskdatatypeem_upperst_8st_7em_columnem_linecbx_statecbx_outliercbx_long_plotscbx_long_wo_plotscbx_shortst_6st_5st_4em_to_dateem_from_datest_source_typeddlb_source_tDAT*ypest_2ddlb_modecommandbuttoncb_browse_2cb_browse_1singlelineeditsle_log_filesle_output_filest_rpt_msgcb_closecb_generategroupboxgb_3gb_6gb_2gb_1messagepointertransactiondragobjectkeycodel@!@&@1@=@J@[@e@s @ @ @nt_g O'@ringDAT*  t_@utan '@strien@llut'O@ataw d@tateowd dwen@riab.s@draw @rn len@ncti'@}3B@!?@O^@!eq<@zitmaatskdafrateowtbox rs * ILbjec   DAT* @ D l cb_g@ XIHB+_76AmeOU`e@nw@@ @!DAT*"ct# $%w_nu&' ())*:+?,8I @<W-(c.ho!@<~/012'm3"@4(m5h6<70DAT*$@&@'@@.@/@  !"#$%&')*+,./0123DAT*469:;<=>?@ABCDEFGHIJKMNPQRSTVWXDAT*Y }\! m*. G7%%y- 'y- 'y- 'y- 'y- 'y- 'y- 'y- 'y- 'y- '(-(-(DAT*-(--y%-y%-y%-y%. G7%%. 5G9005G900. . 5G9005G900(-DAT*(-(-(-(-. . . 5G9005G900. G7%%. G7%%L-L-ODAT*Emission factor base windowforward global type w_emission_factor_base from w_single_table end type end forward global type w_emission_factor_base from w_single_table int X=46 int Y=64 int Width=3534 int Height=1948 boolean TitleBar=true string Title="Emission Factor" string Icon="FIRE.ICO" event highlight_dddw pbm_custom10 end type global w_emission_factor_base w_emission_factor_base type variables string is_factor_type string is_old_value string is_column_name long il_selecDAT*;-##O;-##. L-L-U%U%U%U%   4,%1(,%$d" +wparam+lparam::message< %@Z DAT*  9d  N H:F@@8$8,$8!H$8!\$8!l$68t8z%@8$)89$$6e@e8$ $6e@e8($6808\z%@8p$)x89DAT* $$8$680@8$)89$$8$680@8,$)489H$P$8X$68`0@8$)89$$8~$680@8$)89$DAT*"$8"$$8$$68,0@8X$)`89|$$8$680@8$)89$$#$680@8$)89$$,$#4$68<0@8X$)`89DAT*$h$p$6@8x$$6@8#@#81N$680@8$)89$)8$18) 88"$680@8<$)D89X$,()p8x$)8$8)8DAT*&8"#N$)8$18)88"N$680@8$)89 $8($ 8$)@8H$18)P88"$ X$68`0@8$)89809  <pDAT*( 6!d"%&'(+,*-X.t1~234578"9H:v;@ABCGH0I^JzNOP(QDTNUjVWXYcd(eJgvhijkl(mDsNtjuvwxy |$ > dR ls_unitls_metricls_value_typels_materialls_meas_codell_cur_rowsqlca   ( 4 AL(@\ DAT** is_short`Ois_long_plotsais_long_wo_plots4bis_outlierPctitled No report is selected. Please select one or more reports to generatecbx_long_plotsI@setfocusem_lowerA6text+em_upper B9d The lower Percentile must be less than the Upper Percentile@A6sle_output_fileXQd Sorry! Output File Name is requiredXQsle_log_fileWPDAT*,d Sorry! Log File Name is requiredWPddlb_mode<TKd Sorry! Operation Mode is requiredsk<TKddlb_level?3d Sorry! Level Type is required?3?3Geographicddlb_geo_levelM+d Sorry! Geographic Data Level is requiredp@+ddlb_source_typeZhRId Sorry! Source Type is requiredhRIem_from_datePGd SorDAT*.ry! From Date is InvalidPGem_to_dateOFd Sorry! End Date is Invalid OFPGOFd From Date must be earlier than To DatetPGdw_metricY/!accepttext/!codegetitemstringd Sorry! Metric Code is required/!idwc_metricLi settransobject`Li getrowbLi meas_code[dw_unit--d Sorry! UnDAT*0it of Measure is required-is_material_flgkYdw_matrl_code*1#*1#d Sorry! Material Code is required8*1#k , H \ l        ( p x         , 4 H P X            $ X DAT*2` |          $ , 4 X ` h p x           < D X p x             8 @ H P X     $,(),84$8<)`8DAT*48hz%(@(8z(8z&$8z%8z&)988806@8$,()8$)8 $8z%8z&)988806@8 H  <zd: pl_parent_ridls_orig_sqlls_errls_new_sqlsqlcadDAT*6 " ) 4(@\` idwc_countyh settransobjecth datawindow.table.selectdescribeT AND (rap_geographic_locations.parent_rid = )h datawindow.table.select = ""modifyModify failedh h retriever|h  , 4 `          ~:F@@DAT*88$)$8,$84)L8dl$8t)8$8)8$8)81<B$688!z%@8,()h8)x8)81$,()8$1)8$9}($)8DAT*:$9}#>$8)81< $68(8!z%@8,()P86)X8`$,()h8p$1)x8$9}x$)8$9}<h<"B$Z%&'()* 0(344l69;=>?A:B>CZd2DAT*< pdw_objdwcll_cur_rowls_meas_codesqlcad -  ,(@\H idwc_metrici getrowsbi meas_codegetitemstring[>is_material_flgTki material_flag[>is_metric_nameli name [>dw_value_type=1value_typegetchildotitle Application Error: Value Type - Not a DataWindowChild. Contact your technical supporDAT*>t.settransobjectXgettextpretrieve}=1^X=1insertrow(=1enabled =1reset/=1 dw_unit-codeo Application Error: Unit of Measure - X}-^X-(- -/-  $ , L d l        h x     DAT*@           P X ` h p x       ,:F@@8$8z%63@386:@:@:@:]@:@:8}6:@:@:@:]@:@:8}1<8(0:)@@89L$8TX$"ZDAT*B8`0rd$6|$)81$18)88T"8`0 8`0$$8^$18) 8$$8$,$4$8"H$18)P8d$18l)t8|$$8$$DAT*D8$"$$8"$18)8$18)8$$8$$8" $($8$"0$8$8"L$18)T8h$18p)|8$$8z%$$8z%$$DAT*F^8z% 80$$8z% 800$8$8@z% 808T"8`0 T$\$6  8T"` 8`0p$x$68T"8`0!$)8$!8)8#8$18DAT*H)8$18)8 $18) 8  8T"$$8T,$"!| #,(#,( ,(84081<691d#,( ,(|$1d,(8081<#,(9,($1\ 1d<& 8080@DAT*J8\ 1<Rd#,( ,($1d ,(8081< #,(9#,(9}1} b <d%$18)$8^ 9}b  |  8,0<$)P8X$18`)h8p$18`)x88T"#@ $DAT*L$)88J81"#| (@(8 8T0$)8$18`)8$18`)88T"#R  $$)88J 8  1"#  (@(8 8T068(0@$6 8# 968H0T$DAT*N6 8#0 968\0,(l$6 8#z 968t06 8# 968x06 8# 968|0$$68#L9680$$6@8@880)@)88#9680$DAT*P$68#09680$$6@8@880)@)88#9$$8 >68+0D$L$68#:968T0t$|$68#9680$$68#968DAT*R068#"968068#b968068#968068#9680$68#*9680$68#r9680<$68#968D0X$6DAT*T8#968`0 68#B968l068#968y0$$68#9680$$6 8#&96806!8#f9680 6"8#9680 6#8#9DAT*V680 6$8#&9680 $18) 8%8#968 0 6&8#968 06'8#968* 06(8#D9687 06)8#968C 06*8#968O DAT*X06+8#968Z 06,8#D968f 06-8#968q 06.8#968{ 06/8#9,+68 08 08 0@88 8 0,+68 08 06@868 060DAT*Z8#9,+68 08 08 0@88 8 0,+68 08 06@868 0618#9/@/81<8 0:)@@8998V !"&'D(V)Z,r-./126 70:^;<?ArBEG`HMNQRUV6WLZDAT*\^[x\_`adehi2jNm`norstu x8yfz,6^x" & X \ v N Z ^ b j | @ Z x | R l & 0 p z BL&00:>"Xb *hr   8Bx&\f !#$&&(z*+DAT*^-.01:3D4z679:<=:?D@zBCEFJLDNXOjQRUW"Y6ZH\]abcgd ps_dsnps_uidlb_foundls_filels_write_linels_metric_namels_value_typels_variable_namesls_upperls_lowerls_cbx_pro_sccls_cbx_dev_sicls_cbx_src_sicls_matrl_codels_str_codels_pro_codels_pro_sccls_dev_codels_dev_sicls_ref_codels_unit_codels_src_codels_src_sicls_countyls_statels_meas_codels_priorityls_check_maps@ DAT*`dli_file_numli_ili_check_cntll_countyll_statell_cur_rowsqlcacheck_mapsgs_inifileX   ' 5 D R d m v          DAT*b    % . ; $XG-}dp)u8(@\x_D >+@  is_userdire\qcparm.txtError opening file.is_metric_name<l4<l <ldw_value_typel=1rowcount4DAT*dl=1value_typegetitemstringddlb_level?3textStreamdw_str_code2$code?3Process?3dw_pro_code<3%dw_pro_sccX:.scc_ams?3Device?3?3dw_dev_code4&dw_dev_sic;/device_sic?3Source?3?3?3dw_src_code@5'dw_src_sic\<0source_siccbx_stateDAT*fG>checked statecbx_county9, countycbx_src_sic8+ src_sicXcbx_dev_sic7* dev_siccbx_pro_scc!6) scc_amsem_lower8IA6em_upperdB9idwc_metrici getrowbi meas_code[dw_unit-dw_ref_code,dw_matrl_code1#is_material_flgkksql_error on OPEN of check_maps cursor. Contact your technical supportDAT*hsql_error on FETCH of check_maps cursor. Contact your technical supportProgram Failurewf_write_qcparm array too smalldw_metric/!NULLdw_county1. accepttextD1. name1. idwc_countyh h bridgetitemnumberWdw_state0"D0"0"idwc_stateg g bWSAS DIRECTORYis_sasdir6dSAS USERDIReCONNECTION TYPEDSNUIDAT*jDFROM DATEem_from_datePGFROM TIMEPGyyyy-mm-dd hh:mm:ssTO DATEem_to_dateOFTO TIMEOF?3GeographicGEO LEVELddlb_geo_level5+SOURCE TYPEddlb_source_type`RIMETRIC LEVEL?3METRIC NAMEUNIT CODEVALUE TYPEBY VARIABLESSHORT DESCRIPTIVEis_short`LONG PLOTSis_long_plotsaLONG NO PLOTSis_long_wo_plots*bOUTLIERSis_outlierMcOUTLIER LOWOUTLDAT*lIER HIGHLINESem_lineF=COLUMNSem_columnE<REFERENCE CODEC PROCESS SCCC DEVICE SICC SOURCE SICMETRIC CODE/!MATERIAL CODESTREAM CODEPROCESS CODEPROCESS SCCDEVICE CODEDEVICE SICSOURCE CODESOURCE SICSTATE RIDCOUNTY RIDdata code prioritynullnot found99NULL PRIORITYRO00RO PRIORITYError closing the file. L X d |           , 4 HDAT*n P d t |                ( 0 8 L T h |         0 8 T \ p x            $ , |    $ < P X h p x DAT*p               @ T l           D L t |     < X       f808 08 038,%L1Z,%$2d ::messageDAT*r%@Z base 4,%1(,%$/d" +wparam+lparam::message< %@Z  J68,%01>,%$d1 +sizetype+newwidth+newheight::messageP '%@Z DAT*t  J78* 8*@T*\l*t****** 4*<P*Xl*t******4*<L*Th*pDAT*v****** *$8*@T*\t*|****** 8*@X*`|****DAT*x**(*0D*L`*h|*****$$ $$$$$,$4$<$D$L$T$\$d$l$t$|$$$$$$$DAT*z$$$$$$$$$$$ $$$$$,$4$<$D$L$T$\$d$l$t$|$$$$$$ 6|,BXn 4J`v&<RhDAT*|~ !"#$%&'.(D)Z*p+,-./01 2 364L5b6x78d  st_geo_level*ddlb_geo_level(+(dw_ref_codeH,Hdw_unitd-ddw_county_u|. | dw_metricpa/!!dw_stateher0""dw_matrl_coderc1##dw_str_code2$$dw_pro_code 3% %dw_dev_code(4&(&dw_src_codeD5'D'cbx_pro_scc`DAT*~6)`)cbx_dev_sic|7*|*cbx_src_sic8++cbx_county9,,dw_pro_scc:..dw_dev_sic;//dw_src_sic<00dw_value_type$=1$1st_10D>2D2ddlb_level\?3\3st_9x@4x4em_lowerhecA66em_upperuntB99st_8C::st_7D;;em_columnE<<em_lineF==cbx_state,G>,>cbx_outlierHH?H?cbDAT*x_long_plotsdI@d@cbx_long_wo_plotsJAAcbx_shortKBBst_6LCCst_5MDDst_4NEEem_to_date OF Fem_from_date(PG(Gst_source_typeHQHHHddlb_source_typehRIhIst_2$SJJddlb_modeTKKcb_browse_2UMMcb_browse_1VNNsle_log_fileWPPsle_output_fileXQQst_rpt_msg8YR8Rcb_closeDAT*TZSTScb_generatep[TpTgb_3\VVgb_6]WWgb_2^XXgb_1 r_YYcontrolc@*(+H,d-|. /!0"1#2$ 3%(4&D5'`6)|7*8+9,:.;/<0$=1D>2\?3x@4A6B9C:D;E<F=,G>HH?dI@JAKBLCMDNE OF(PGHQHhRISJTDAT*KUMVNWPXQ8YRTZSp[T\V]W^X_Y  8 @T \l t       4 <P Xl t      4 <L Th p    DAT*    $8 @T \t |       8 @X `|      ( 0D L` h|            $DAT* , 4 < D L T \ d l t |                      $ , 4 < D L T \ d l t |      6$0$D$T$h$|$$DAT*$$$$$ $ $4$H$\$p$$$$$$$$$$,$<$P$d$|$$$$$$$$ $<$L$`$tDAT*$$$$$$$$$$$4$*8FT b p ~  &4BP^lz !"#$%&'()"*0+>,L-Z.h/v01234567d < st_geo_level*ddlb_geo_level +dw_ref_code8,dw_unitL-dw_countDAT*y\. dw_metricp/!dw_state 0"dw_matrl_code1#dw_str_code2$dw_pro_code3%dw_dev_code4&dw_src_code5'cbx_pro_scc6)cbx_dev_sic7*cbx_src_sic(8+cbx_county<9,dw_pro_sccP:.dw_dev_sicd;/dw_src_sicx<0dw_value_type=1st_10>2ddlb_level?3st_9@4em_lower.A6em_upperB9st_8C:st_7D;em_column EcbDAT*x_outlierXH?cbx_long_plotslI@cbx_long_wo_plots*JAcbx_shortKBst_6 sLCst_5MDst_4NEem_to_dateOFem_from_datePGst_source_typeQHddlb_source_type(RIst_2DSJddlb_modeTTKcb_browse_2hUMcb_browse_1|VNsle_log_fileWPsle_output_fileXQst_rpt_msgYRcb_closet_5ZScb_generate[Tgb_3\Vgb_6 ]Wgb_2^Xgb_1,_Y 0 DDAT* T h |           4 H \ p          , < P d |          < L ` t         $ 4   '.wxyz{|Ow'.2 DAT* +highlight_dddwwf_create_viewwf_check_requiredwf_retrieve_countywf_show_dddwwf_write_qcparm_filef_db_errorf_write_line+activatef_menu_behave+other+resizef_put_scroll_bars+create+destroyt'9LYn)n)n)y*y*y*y*y*DAT*y*y*y*y*y*y*)y*hd@y*<y*Xy*d@y*y*)!y*y*y*!y*hy*<y*y*/Aode y*5y* eubroy*y*y*y*,$DAT*y*y*y*y*LLy*y*y*y*y*~y*ly*,|8-  2 , xywidthheighttitlebartitlebackcolorcontrolmenuminboxmaxboxresizableiconst_geo_levelddlb_geo_leveldw_ref_codedw_unDAT*itdw_countydw_metricdw_statedw_matrl_codedw_str_codedw_pro_codedw_dev_codedw_src_codecbx_pro_scccbx_dev_siccbx_src_siccbx_countydw_pro_sccdw_dev_sicdw_src_sicdw_value_typest_10ddlb_levelst_9em_lowerem_upperst_8st_7em_columnem_linecbx_statecbx_outliercbx_long_plotscbx_long_wo_plotscbx_shortst_6st_5st_4em_to_dateem_from_datest_source_typeddlb_source_typest_2ddlb_modecb_browse_2cb_browse_1sle_log_filesle_output_filest_rpt_msgcb_closecb_generategb_3gb_6DAT*gb_2gb_1is_shortis_long_plotsis_long_wo_plotsis_outlieris_sasdiris_userdirib_sas_runidwc_stateidwc_countyidwc_metricis_orig_selectis_material_flgis_metric_name,   y 1"^(2>ELVi[ h w  DAT* ! " #6 $d@ % & ' ) *! +  , .  /+ 06 1D 26J 3U 4Z 6c 9el :q ;m_v <e_ =ypDAT* >om ?se @gl Afi Bs Cc D E FD G  H I J K M+ N7 PD QT R_ Sh Tt Vy W@~ X YctDAT* nu   8< (] o y 1^  1i @@DAT*@     ! " # $ % & ' ) * + , . / 0 1 2 3 4 6 9 : ; < = > ? @ A B C D E F G H I J K M N P Q R S T V WDAT* X Y    wO&$x5$xyU4(zpD8{lT|p2 t'4DAT*.57 8 2  2 xywidthheightvisibleenabledtextalignmentfocusrectangletextcolorbackcolortextsizeweightfacenamefontfamilyfontpitch@H T G!).8DAT*GQ[dkt] HTG @ @2  2  xywidthheighttabordervisibleborderstylesortedvscrDAT*ollbartextcolortextsizeweightfacenamefontfamilyfontpitchitem @ G !"*6=HR[bkv81] G! DAT*E@ @@ @1T %8 $,()88@$1)T8\$8d)t81<$688z%@8,%1,%$,()8)DAT*28,%:1H,% $8 Z   d0 ancestorreturnvaluedwcsqlca::messageP (@\&%@ZX constructordw_ref_code,settransobject^(,insertrow(H,codegetchildoititle!| Application Error: Reference Code - Not a DataWindowChild. Contact your technical support.(retriDAT*p@)b?JA1p@p@ip@@@\@\@)[@[@5c@c@BU@U@S`@`@]j@j@kk@k@wl@l@am@m@q@@@@a@@a@@a^@^@n@ @@A@@ n@n@+@@P6@@aB@@L@@W@@a@@m@@vS@S@8@8@@@@@D@@@@@@@@`0@0@F@F@DAT*q@q@S  _v@v@T@0<>epK!a w_rpt_saswindowmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecti |5u_dddwborderstyledwobjectdatawindowstatictextfontcharsetfontpitchfontfamilyalignmentfillpatterneditmasktextcaseDAT*maskdatatypeT t_checkboxsinglelineeditT t_dropdownlistbox T  t_commandbuttongroupboxrectanglelinestyleTier 1,2,3 ReportTIER.ICOi T Oi t_T DAT*t_d_rpt_units_dddwd_ref_codes_table_dddwd_rpt_materialsd_rpt_countiesd_rpt_statesLines per page:MS Sans SerifColumns per page:###1~1765??##1~865??Print individual state reportsRegion SummaryTier 3 SummaryState SummaryCounty SummaryTier 2 SummaryTier 1 SummaryRegion Title:All Toxic MaterialsAll CountiesAll StatesTo Date:From Date:mm/dd/yyyy0DAT*1/01/1900~12/31/21005??5??Source Type:AreaPointBothi }i }Operation Mode:BatchInteractivei }i }Browse...Report may take a long time to print...Reporting DAT*ParametersCloseGenerateReport SelectionsToxic Material CodeCountyStateTier Report Log File NameTier Report Output File Namepointerf_write_linetransactionsqlcags_inifilemessagef_put_scroll_barsf_menu_behavef_sas_configf_get_odbc_connectionT|@h HP`P2 w_rpt_sDAT* end on type dw_src_code from u_dddw within w_rpt_qc int X=50 int Y=973 int Width=1138 int Height=113 int TabOrder=230 boolean Enabled=false string DataObject="d_src_code_dddw" boolean Border=false BorderStyle BorderStyle=StyleBox! boolean LiveScroll=false end type on getfocus;call u_dddw::getfocus;is_child_name = 'code' is_validation_table = 'rap_sources' is_msg_name = 'Column - Source Code' is_msg_text = 'Sorry! Not a valid source code' end on type cbx_pro_scc from checkDAT*pbox within w_rpt_qc int X=1249 int Y=1175 int Width=520 int Height=71 int TabOrder=320 boolean Enabled=false string Text="SCC/AMS Code" BorderStyle BorderStyle=StyleLowered! long TextColor=8388608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type cbx_dev_sic from checkbox within w_rpt_qc int X=1249 int Y=1089 int Width=555 int Height=71 int TabOrder=310 boolean EnaDAT*as .- dw_objcbx_objwf_select_all_dw_rowswf_create_viewwf_check_requiredps_dsnps_uidwf_write_tierparm_filepdw_dw_objps_dw_field_nameps_field_data_typeew_ps_selected_itemstiw_pl_selected_itemswf_retrieve_selected_rows +wparam+lparam+other+sizetype+newwidth+newheight+resize+open+create+destroy+activate+constructor+row+dwo+itemfocuschangedxposyposrowdwo+clicked+modifiedDAT*P (QCdatawindow.Ccheckbox.BstNUBSSs~QCdatawindow.SSRS[]RL[] LUL+ 5?LUIILQLLCdwobject.:mmLIILCdwobject.DAT*<X 8x xw _initsrcwindoww_rpt_sasmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectu_dddwdw_unit_codeborderstyledwobjectdw_ref_codedatawindowdw_4dw_countydw_2statictextst_8fontcharsetfontpitchfontfamilyalignmentfillpatternst_7editmaskem_columntextcaDAT*semaskdatatypeem_linecheckboxcbx_individualcbx_regioncbx_tier3cbx_statecbx_countycbx_tier2cbx_tier1st_6cbx_all_materialssinglelineeditsle_regioncbx_all_countiescbx_all_statesst_5st_4em_to_dateem_from_datest_3dropdownlistboxddlb_source_typest_2ddlb_modecommandbuttoncb_browse_2cb_browse_1sle_log_filesle_output_filest_rpt_msgst_1cb_closecb_generategroupboxgb_6gb_5gb_4gb_3gb_2gb_1rectangler_1linestylepointertransactionmessageDAT*@"@'@2@>@K@\@f@t @ @ @ @8 @)@@z&@@8@@@ @sle_%*!4DAT*9@D!I@U<@_@idj@MEt@utan8e @ nt@ngedse@is_ lgmetr@yp om se glfisc (8D#@d 2DAT*=|N8]bgr) @$0@!@8$ $#!6"#$$9% cnera&ragb_3"6 @ gb%'b__1 *(/)4*DAT*<9+(>,iC#@<M-Q$@[&@c('@mo+@ "$')*+,-./01DAT*3456789:<=>@ABCDEFGIJKLMNP |\  b*y- 'DAT*y- 'y%y%y%. . #G900#G900(-(-(-(-(-(-(-. (DAT*-2;-##(-(-. . #G900#G900. ;G7%%. ;G7%%?-?-2;-##2;-DAT*##. . ?-?-H%H%H%H%H%H%O   :F@@8$<9}H9})8DAT*}1}<)08|  , 8 <HfdB dw_objcbx_objli_total_itemsli_cur_itemlb_select_stated  (&28 rowcount4selectrow@$  0 9d  3:F@@8DAT*$8($8!<$8!P$8!d$8!x$8!$688z%@8$)89 $$8$($6800@8T$)\89t$|$8$$680@8$)89$DAT*$8$$680@8$)89,$4$8$<$68D0@8d$)l89$$#n$680@8$)89$$#$680@8$)89$ $6@DAT*8($0$6@8#@#818$68@0@8h$)p89$)8$18)88$$18)8"|$680@8$) 89$1)481<$68D0@8t$)|89DAT*$1)81|$680@8$)89$1)81$680@8($)0899  8f,Z v#$%&*+,H-d1n23489X:;>?A(BVCrN|OPQTU(VVWrZ|[\]ad dwcDAT*ls_reference_code( 80 is_tier1WOis_tier2Xis_tier30Yis_stateDZis_countyX[is_regionl\title No report is selected. Please select one or more reports to generatecbx_tier19/setfocussle_output_fileJCtexteve Sorry! Output File Name is requiredJCsle_log_filedIB Sorry! Log File Name is requiredesdDAT*IBddlb_mode_gF> Sorry! Operation Mode is requiredF>ddlb_source_typeD< Sorry! Source Type is requiredD<em_from_datetB9 Sorry! From Date is InvalidtB9em_to_date A8 Sorry! End Date is InvalidA8tB9A8 From Date must be earlier than To DatetB9dw_unit_codex*accepttexttxDAT**codegetitemstringx* Sorry! Unit of Measure is requiredx*dw_4,getselectedrow$ Sorry! At least one material code is required,dw_2.$ Sorry! At least one state is required.dw_county-$ Sorry! At least one county is required- ( < P d x       ( T DAT*\ t |         , 4 < d l              ( 0 8 h p            4 < t |         ( 0 g:F@@8DAT*$8z%63@386:@:@:@:]@:@:8}6:@:@:@:]@:@:8}1<8*0:)@@89L$\$8dT8e0vh$p$668x0$68#9680$68#9680DAT*,)$68#P968068#96806 8#9680$$6 8#"9680$$6@8@880)@)8 8#968$08$@$6 8#96DAT*8H0P$X$6@8@880)@)8 8#968`0$$68#9680$18)88#H9680$18)88#9$8080 ),8}6DAT*840(@(88#J9 1}j  6 (@(