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 (@(8 <=68#9`P$`$#Jp$8x08|0 )8 }\1}680(@(88#9 1}  B6 (@(8 DAT* <=(@(88#>9$$#$8x08|0 )8 }1}680(@(88# 9 1}8    6 (@(8  <=(@(88# 9. 68068# 9DAT*680$68#8 9680 $68# 968(0@$68# 968H0`$68# 968h0$68#X 9680$68# 9680$$68# 9DAT*680$$68#D 9680$6 8# 9,*6808#08(0@88(* 820,*6808#06@868506!8#j 9,*6808C08(0@88(8F0,*680DAT*8C06@868I06"8#H9/@/81<8U0:)@@899 8V"#>$P%T*v+./23F6P7:;>?A"CEFHJLMOP>RHSWXYZ@\J]x^`cde2fFgJi\jlmn4p>sBt^uvwyz | }F ~ . 8 DAT*v   N X : D * ` j >Hnd( ps_dsnps_uidls_filels_regionls_material ls_null ls_priorityli_file_numli_array_lenli_counterll_statell_county8ll_nullsqlcags_inifile4H,    4(-HDAT*@-T `ly---)@S*@mX is_userdir`\tierparm.txtError opening file.sle_region!><3textTO><3TSAS DIRECTORYis_sasdir_SAS USERDIR`CONNECTION TYPEDSNUIDFROM DATEem_from_date B9TFROM TIME B9Tyyyy-mm-dd hh:mm:ssTO DATEDAT*em_to_date,A8TTO TIME,A8TSOURCE TYPEddlb_source_typelD>5checkedXdw_2h.ridnumber{STATEScbx_all_counties=4Xdw_county-{COUNTIESREGION TITLETIER 1 REPORTis_tier1WTIER 2 REPORTis_tier2DAT*XTIER 3 REPORTis_tier36YCOUNTY REPORTis_countyV[STATE REPORTis_stateuZREGION REPORTis_region\LINESem_line2'TCOLUMNSem_column1$TSINGLE STATEis_individualVdata code prioritynullnot found99NULL PRIORITYRO00RO PRIORITYError closing the file. L \ h p        8 @ P X      DAT*  , P ` p         @ `         :F@@8)818 -< )88-< JP81<R})X88 8 H \d pDAT*dw_dw_objps_dw_field_nameps_field_data_typeps_selected_items) pl_selected_itemsll_cur_rowli_counterLl  $ L7-lX-x` getselectedrowstringgetitemstring'getitemnumber @ 8 P X ,,$2B,,$1!$$!DAT*,9}@$8Hz%63@386:@:@:@9@98}1< 8T0:)@@8d=@=8}1<=@=8}1<8h$z%6@8L1<80:)@@8L1<1<"L80:)@DAT* @8/@/862@28#$68z%@8,,1,,$ DXv 2Fl !" $L(d)/d[ +wparam+lparamls_filels_textli_file_numli_bytes_readll_posmessage::message   (4BDAT* I,@TQ,@T@  ib_sas_runaais_userdir4`\sqlxrc.tieError opening file.Error generating titlez Error reading file.Empty file.z Error deleting file 3  $ , @    J%8,,01>,,$d1 +sizetype+newwidth+newheight::messageP DAT*',@T  4,,1(,,$!d ::message,@T  -.* 4*<L*Th*p******  *(<*DDAT*X*`t*|***** (*0H*P`*hx******$*,@*H\*d|****DAT*** *(8*@P*Xh*p***$$$$$$$$ $$$$$,$4$<$D$L$T$\$d$l$t$|$$DAT*$$$$$$$$$$$$$$$$ $$$$$ ,|,BXn 4J`v&<Rh~ !"#$%&'.(D)Z*p+,-.d ,( dw_unit_code*DAT*dw_ref_code(+(dw_4D,Ddw_county\-\dw_2x.xst_8 fi/st_70""em_columnx_1$$em_line2''cbx_individual3))cbx_region4**cbx_tier3 f05+0+cbx_state_lL6,L,cbx_countyh7-h-cbx_tier28..cbx_tier19//st_6rd:00cbx_all_materials;11sle_region<33DAT*cbx_all_counties=44cbx_all_states8>585st_5X?6X6st_46p@7p7em_to_dateA88em_from_dateB99st_3C::ddlb_source_typeD<<st_2p@E==ddlb_modeOF>>cb_browse_24G@4@cb_browse_1PHAPAsle_log_fileZlIBlBsle_output_fileJCCst_rpt_msg@KDDst_1LEEcb_closeMFFcb_generateDAT*NGGgb_6OIIgb_5<0PJ0Jgb_4HQKHKgb_3`RL`Lgb_2xSMxMgb_1iTNNr_1UPPcontrolc@*(+D,\-x./0"1$2'3)4*05+L6,h7-8.9/:0;1<3=48>5X?6p@7A8B9C:D<E=F>4G@PHAlIBJCKDLEMFNGOI0DAT*PJHQK`RLxSMTNUP  4 <L Th p         (< DX `t |      ( 0H P` hx      $ ,DAT*@ H\ d|        (8 @P Xh p                $ , 4 < D L T \ d l t |         DAT*              $ n,$,$<$P$`$p$$$$$$$$ $ $4$D$`$t$$$$$$$$ $0$DAT*"D$X$l$$$$$$$$$$($8$H$T$*8FT b p ~  &4BP^lz !"#$%&'()"*0+>,L-Zd \` dw_unit_code*dw_ref_code +dw_44DAT*$,dw_countyD-dw_2X.st_8h/st_7x0"em_column_81$em_line2'cbx_individual3)cbx_regiont4*cbx_tier3ie5+cbx_state6,cbx_county7-cbx_tier28.cbx_tier1(9/st_6c<:0cbx_all_materialsL;1sle_regionh<3cbx_all_counties*|=4cbx_all_states>5st_5?6st_4@7em_to_dateA8em_from_dateB9st_3C:ddlb_source_type Dcb_browse_2LG@cb_browse_1`HAsle_log_filetIBsle_output_fileJCst_rpt_msgKDst_1LEcb_closeMFcb_generateNGgb_6OIgb_5PJgb_4QKgb_3 RLgb_20SMgb_1@TNr_1PUP , < P ` p            4 D ` t        DAT*(  0 D X l          ( 8 H T f808 08 0*8,,L1Z,,$2d ::message,@T base   &'.wxyz{&'.2 wf_select_all_dw_rowswf_create_viewwf_cheDAT**ck_requiredwf_write_tierparm_filewf_retrieve_selected_rowsf_write_line+other+resizef_put_scroll_bars+open+create+destroy+activatef_menu_behave\-?Vp'p'p'p'p'p'p'p'p'p'p'p'DAT*,p'p'p'p'p'p'p'p'p'p'E=p'odp'app'"=p') p'idp'MEp'$p'ash_}hn - 2 Rie RTis COUNDAT*..is2  xywidthheighttitlebartitlebackcolorcontrolmenuminboxmaxboxresizableicondw_unit_codedw_ref_codedw_4dw_countydw_2st_8st_7em_columnem_linecbx_individualcbx_regioncbx_tier3cbx_statecbx_countycbx_tier2cbx_tier1st_6cbx_all_materialssle_regioncbx_all_countiescbx_all_statesst_5st_4em_to_dateem_from_datest_3ddlb_source_typest_2ddlb_modecb_browse_2cb_browse_1sle_log_filesle_output_filest_rpt_msgst_1cb_closecb_generategb_6gb_DAT*05gb_4gb_3gb_2gb_1r_1is_individualis_tier1is_tier2is_tier3is_stateis_countyis_regionis_selected_itemsil_selected_itemsis_sasdiris_userdirib_sas_runPpP!  9 -"(2>ELV[ h tDAT*2 y    " $8 'O ) * + , -`p . / 0 1 3 4$ 53 68 7= 8H 9ntU :edZ < kDAT*4 =IRp >ypz @DI Aro B_s C Dot E_s F G Iz J K- L M N P (2P</@p\DAT*6/| ] o!9 -  1 @@@       " $ ' ) * + DAT*8, - . / 0 1 3 4 5 6 7 8 9 : < = > @ A B C D E F G I J K L M N P@3h3 w-8x<8xy\T<DAT*:zX{$'#J.$R&&X'`( i) @ %88)$81<4$68<8\z%@DAT*<8,,1,,$,))880)8,))81)8,,&14,,$F z  d0 ancestorreturnvaluedwc::messagesqlcaP ,@T*)@S@ constructorcodegetchildotitle, Application Error: Unit Code - Not a DataWindowDAT*>Child. Contact your technical support.settransobjectDOWNSTRMDISretrieve}^insertrow($ 4       18(800L8T0l8t080,,1,,$:Tnd0 +row+dwoancestorreturnvalue::messagePDAT*b &,@T( itemfocuschangedis_child_namecodeis_validation_tablerro5"rap_unitsis_msg_name^ Column - Unit of Measureis_msg_text!Sorry! Not a valid unit code( L l   %1L%OP-/10.2 ' +constructor+itemfocuschanged(2 K xywidthheiDAT*Be string Text="To Date:" 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_4 from statictext within w_rpt_sas int X=1224 int Y=647 int Width=310 int Height=71 boolean Enabled=false string Text="From Date:" Alignment Alignment=Right! boolean FocusRectangle=false long TextColor=8388608 lDAT*Dong BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type em_to_date from editmask within w_rpt_sas int X=2312 int Y=641 int Width=427 int Height=87 int TabOrder=160 BorderStyle BorderStyle=StyleLowered! string Mask="mm/dd/yyyy" MaskDataType MaskDataType=DateTimeMask! boolean Spin=true double Increment=1 string MinMax="01/01/1900~~12/31/2100" int TextSize=-8 int Weight=700 stDAT*Fring FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on constructor;//// Set default value //This.Text = '12/31/' + String(Year(Today()) - 1) This.Text = ProfileString(gs_iniFile, 'calculation period', 'end_date', & '12/31/' + String(Year(Today()) - 1)) end on on modified;//if This.Text = '00/00/0000' then // // Set default value // This.Text = '12/31/' + String(Year(Today()) - 1) //end if end on type em_from_date from editmask DAT*Hwithin w_rpt_sas int X=1558 int Y=641 int Width=434 int Height=87 int TabOrder=150 BorderStyle BorderStyle=StyleLowered! string Mask="mm/dd/yyyy" MaskDataType MaskDataType=DateTimeMask! boolean Spin=true double Increment=1 string MinMax="01/01/1900~~12/31/2100" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on constructor;//// Set default value //This.Text = '01/01/' + String(Year(Today()) - 1)DAT*J This.Text = ProfileString(gs_iniFile, 'calculation period', 'start_date', & '01/01/' + String(Year(Today()) - 1)) end on on modified;//if This.Text = '00/00/0000' then // // Set default value // This.Text = '01/01/' + String(Year(Today()) - 1) //end if end on type st_3 from statictext within w_rpt_sas int X=2081 int Y=529 int Width=374 int Height=71 boolean Enabled=false string Text="Source Type:" Alignment Alignment=Right! boolean FocusRectangle=false long TextColor=83DAT*L88608 long BackColor=12632256 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type ddlb_source_type from dropdownlistbox within w_rpt_sas int X=2465 int Y=519 int Width=278 int Height=279 int TabOrder=140 BorderStyle BorderStyle=StyleLowered! boolean Sorted=false boolean VScrollBar=true long TextColor=33554432 int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamilyDAT*N=Swiss! FontPitch FontPitch=Variable! string Item[]={"Area",& "Point",& "Both"} end type type st_2 from statictext within w_rpt_sas int X=1153 int Y=529 int Width=449 int Height=71 boolean Enabled=false string Text="Operation Mode:" 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 FontPitch=Variable! end type type ddDAT*Plb_mode from dropdownlistbox within w_rpt_sas int X=1604 int Y=519 int Width=456 int Height=212 int TabOrder=130 BorderStyle BorderStyle=StyleLowered! 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[]={"Batch",& "Interactive"} end type type cb_browse_2 from commandbutton within w_rpt_sas int X=2418 int Y=365 int Width=289 int Height=87 stringDAT*R Text="Browse..." int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;integer li_ret_value string ls_doc_name, ls_named // Get log file name from user li_ret_value = GetFileSaveName( "Select Log File", & ls_doc_name, ls_named, "LOG", & "Log Files (*.LOG),*.LOG, All Files (*.*),*.*" ) if li_ret_value = 1 then sle_log_file.Text = ls_doc_name end if DAT*T end on type cb_browse_1 from commandbutton within w_rpt_sas int X=2418 int Y=167 int Width=289 int Height=87 string Text="Browse..." int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;integer li_ret_value string ls_doc_name, ls_named // Get log file name from user li_ret_value = GetFileSaveName( "Select Output File", & ls_doc_name, ls_named, "LST", & DAT*V "Output Files (*.LST),*.LST, All Files (*.*),*.*" ) if li_ret_value = 1 then sle_output_file.Text = ls_doc_name end if end on type sle_log_file from singlelineedit within w_rpt_sas int X=1515 int Y=369 int Width=872 int Height=81 int TabOrder=90 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 sle_output_file from sDAT*Xinglelineedit within w_rpt_sas int X=1515 int Y=173 int Width=872 int Height=81 int TabOrder=80 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 st_rpt_msg from statictext within w_rpt_sas int X=1544 int Y=1076 int Width=1124 int Height=71 boolean Visible=false boolean Enabled=false string Text="Report may take a long time to prDAT*Zint..." 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 FontPitch=Variable! end type type st_1 from statictext within w_rpt_sas int X=104 int Y=17 int Width=747 int Height=71 boolean Enabled=false string Text="Reporting Parameters" boolean FocusRectangle=false long TextColor=8388608 long BackColor=12632256 int TextSize=DAT*\-10 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type cb_close from commandbutton within w_rpt_sas int X=1540 int Y=1345 int Width=281 int Height=93 int TabOrder=230 string Text="Close" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;Close(Parent) end on type cb_generate from commandbutton within w_rpt_sas inDAT*^t X=1185 int Y=1345 int Width=281 int Height=93 int TabOrder=220 string Text="Generate" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;string ls_file, ls_run_command, ls_sasexe, & ls_dsn, ls_uid, ls_pwd, ls_dbparm, ls_newconfig, & ls_mode, ls_geinidir, ls_key, & ls_program = 'tier.sas', & ls_name = 'config.tie' long ll_pos_1, ll_pos_2, ll_pos_3, ll_pos_4 SetPointer(HouDAT*`rGlass!) // Check if all required fields are entered if Not wf_check_required() then return end if //// Get data source name, userid and password from rapids.ini //ls_dbparm = ProfileString(gs_iniFile, "sas", "dbparm", "not found") //if ls_dbparm = 'not found' or ls_dbparm = '' then // MessageBox(Parent.Title, "Error finding " + gs_iniFile + ", sas section~n" + & // "or dbparm key in the ProfileString function.~n" + & // "Contact your technical support.", StopSign!) // returnDAT*&' //end if //ls_dbparm = Upper(ls_dbparm) //ll_pos_1 = Pos(ls_dbparm, "DSN=") //ll_pos_2 = Pos(ls_dbparm, ";UID=") //ll_pos_3 = Pos(ls_dbparm, ";PWD=") //ll_pos_4 = Pos(ls_dbparm, "',", ll_pos_3) //ls_dsn = Mid(ls_dbparm, ll_pos_1 + 4, ll_pos_2 - (ll_pos_1 + 4)) //ls_uid = Mid(ls_dbparm, ll_pos_2 + 5, ll_pos_3 - (ll_pos_2 + 5)) //ls_pwd = Mid(ls_dbparm, ll_pos_3 + 5, ll_pos_4 - (ll_pos_3 + 5)) // //if ls_dsn = '' then // ls_dsn = ' ' //end if //if ls_uid = '' then // ls_uid = ' ' //DAT*dghttaborderdataobjectborderborderstylelivescroll w !dn"- 4 @ ] ow!dn @       DAT*fs%L1T %8 $,))88@$1)T8\$8d)t81<$688z%@8,,1,,$,))8)8,,:1H,, $DAT*h8 Z   d0 ancestorreturnvaluedwcsqlca::messageP )@S&,@TX constructordw_ref_code+settransobject_^(+insertrow(H+codegetchildoititleof| Application Error: Reference Code - Not a DataWindowChild. Contact your technical support.(retrievel| 8 @ T \ tDAT*j       18(800L8T0t8|080,,1,,$:Tnd0 +row+dwoancestorreturnvalue::messageP &,@T( itemfocuschangedis_child_namecodeis_validation_tablense5"rap_reDAT*lference_codesis_msg_nameh Column - Reference Codeis_msg_text!Sorry! Not a valid reference code,( L t   %1L%OP-/10.2 ' +constructor+itemfocuschanged(typedem u_n 2 K xywidthheighttaborderdataobjectborderborderstylelivescroll  mDAT*r"- 4 @ ] om @       s%L 1DAT*$t)), "yyyy-mm-dd hh:mm:ss")) 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 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 f_write_line(li_file_num, ls_file, 'REFERENCE CODE', ls_ref_code) then return FALSE end if if cbx_criteria.Checked then ls_criteria = dw_cDAT*%bled=false string Text="Device SIC 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_src_sic from checkbox within w_rpt_qc int X=1249 int Y=999 int Width=555 int Height=71 int TabOrder=300 boolean Enabled=false string Text="Source SIC Code" BorderStyle BorderStyle=StyleLowered! long TextColor=83886DAT*t )81x)$8^9)88x9)@8\$l$t$|9},,1,,$ ( @ Z ^xd3 xposyposrowdwoll_clicked_row::messagex  ),@TH getrowuisselectedDAT*va)selectrows_@,@,cbx_all_materialsH;1checkeddH;1d $ 8 @ \ l t |  \,))8),8,,B1P,,4$(d sqlca::message()@S,@T< settransobject^retrieve1  , 4 $%L%$2  +DAT*xclicked+constructor(2 F xywidthheightdataobjectborderstylevscrollbarlivescroll  6 $ 0 ; ] o6  @  @ DAT*z   h8$s%L )81x)$8^9)88x9)@8\$l$t$|9},,1,,$ ( @ Z ^xd3 xposyposrowdwoll_clicked_row::messagexDAT*  ),@TH getrowisselected)selectrow@,@,cbx_all_countiesH=4checkeddH=4d $ 8 @ \ l t |  4,,1(,,$d ::message,@T  $%L%$2  DAT*~p@dF@%A9p@djp@q-@@!2\@\@a=[@[@!Ic@c@qVU@U@ag@@as@@q}@@a@@@@A@@^@^@@@0@0@n@n@+`@Z@@*@*@ w_speciation_profilew_master_detailmenuwindowtypewindowstatewindowobjecttoolbaralignmentfontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectdwobjectlinestyledatawindows_reDAT*c_holdercodj W Emission ProfilesEMIS_PRO.ICOlj x% validdatawindowchildmj Fd_scc_ams_speckeycoded_speciation_profiles,l2 w_speciation_profile  wparamlparam+highlight_dddwwf_retrieve_dw2wf_find_sccp_dwwf_show_greywf_show_whitewf_draw_dw2wf_check_requiredwf_undo_dw1wf_cascade_del+dwescapekeyDAT*keyflags+dwnkeyx  LULQrdBQCdatawindow.olBBL" LCkeycode.U(DT x _initsrcw_master_detailw_speciation_profilemenuwindowtypewindowstatewindowobjecttoolbaralignmentw_master_detail`st_no_record_whitest_no_record_whitefontcharsetfontpitchfontfamilyalignmentfillpatternborderstylepowerobjectw_master_detail`st_no_record_greyst_no_record_greyw_master_detaDAT*+clicked+constructor(2 F xywidthheightdataobjectborderstylevscrollbarlivescroll   $0;] o  @ @ DAT* hx$s%L$)81)$8^9)88x9)@8)T81)l81 8t 8uJ8;(@(8X  8z%8uJ8;(@(8z(jDAT*1)8$)8$9}1$)81$9} $8()L8 8Tz% z&8z&$8 z%8z&)988t806@8,,1 ,,$$,))8$)81vDAT*il`dw_3dw_3dwobjectw_master_detail`dw_2dw_2w_master_detail`dw_1dw_1w_master_detail`r_1r_1linestylew_master_detail`r_2r_2datawindows_rec_holderdatawindowchildkeycoded_usl^@@!^@^@6 @ ;^@@^@F@R^@@^@_@pc@c@@@ @o_uo _d@esz tc@dwf w@DAT*nera ca@e_def_k_riwear_)+ct_o>_asaveC_d@eL#a f {  !  @!j< @Z@@li@    DAT*    " $ n' A*. . {2{2{4  ~2 +highlightDAT*_dddwwf_retrieve_dw2wf_find_sccwf_show_greywf_show_whitewf_draw_dw2wf_check_requiredwf_undo_dw1wf_cascade_del(4AO[my2 widthheightwindowtypetitlebartitleiconis_msg_nameis_msg_textis_validation_tableis_column_statusil_selected_rowidwc_dw_childis_column_nameis_old_valueis_child_name,DAT* ) / 4@L`q!] o   l1  DAT*@@@       ! U&$6$xG4(DAT*T4Db$nP~$R2  2  xywidthheightP  ]  @DAT*      @2  2  xywidthheightP  ]  @      DAT*@2  2 xy( ]  @    2  2 < xywidthheightdataobjecthscrollbarhsplitscrollDAT*   $/] o @  @  2  +dwescape+dwnkey(2 $ xywidthheightdataobjectdDAT*   ] o @    RlT2  2  ] DAT*2  2  ] DAT*  dw_1-accepttextdw_2,,-rowcount4Lwf_check_special`-emittant_material_codegetitemstringDataWindow ErrorSorry! Emittant Material Code is required-setfocus|-setrowQ-setcolumnH,-scrolltorow?H-unit_codeSorry! Emittant Unit Code is required--Q-H,-?H-DAT*throughput_material_code\Sorry! Throughput Material Code is required--Q-H,-?H-throughput_unit_codeSorry! Throughput Unit Code is required--Q-H,-?H-amtgetitemnumber Sorry! Amount is required--Q-H,-?H $ 4 < D X t |    DAT*   $ 8 @ T \ p           8 @ H P X ` h p x           $ H P X ` h p x  9d pl_cur_row *#$)$8DAT*1>,8,&4$8<JX8} `$8h)8 $8)8 $8)8$8)8$8)8$8$)@8 H$8P)h8 p$8x)8$8KDAT*8$8J8$8)8M2 6$6 6 6 6 66665@8 8 1&9$8$J(8f$19,8,18$68@8az%8z&8z&8z&@89HDAT*$8$)X8`$8ht$6)|8,8,1$8$J8I!$68@8az%8z&8z&8z&@8949 "L`@lLx !%&(P)h*x-./489,;b=f>z?D JLd ll_row_numll_cur_rowll_rid_numll_ridll_pro_ridDAT*li_exponentls_scc_ams_codels_profile_codels_throughput_material_codels_control_1_device_codels_control_2_device_codels_emittant_material_codels_throughput_unit_codels_unit_codeldec_amtld_epags_databaseT)0;G W g      DAT*>  @0 dw_1-rowcount4ORACLE-exponent_amtgetitemnumber I-emittant_material_codegetitemstring-throughput_unit_code-unit_code-scc_ams_code-profile_code-throughput_material_code-control_1_device_code-control_2_device_coderr-amtgetitemdecimalDAT*-process_rid I-epa_dategetitemdatetimeis_factor_type4-rid Ititle0 Amount, Emittant Material Code, Factor Type, Throughput Unit Code, Unit Code, Control 1 Device Code, Control 2 Device Code, Exponent Amount, Profile Code, SCC AMS Code and Throughput Material Code must be unique in the table. No changes made to the database.-setitemOP-factor_type4PP- I0  $ 4DAT* X `           @ H h p          ( 8 H X ` t |    &88 0,$,)D8,l1z,L$2 RdV ancestorreturnvaluell_row_numberll_dDAT*ebug_num_retrieval_rowssqlca::messaged*F@!L@T openis_state 0singledw_1'-settransobjectt^4 , D L vz88@8,\1j,0$ Bd? +wparam+lparamancestorreturnvaluew_filter::messaged DAT*,@"5@8 ue_open_filter_winrap_emission_factors0 8d  create8d  destroy&zFGOwPxQyRzX&.2 +highlight_dddwwf_check_requiredwf_check_specialwf_check_ridf_get_emis_facDAT*t_ridf_get_sequence+open+ue_open_filter_win+create+destroy*;H\kq2 xywidthheighttitlebartitleiconis_factor_typeis_old_valueis_column_nameil_selected_rowidwc_dw_childis_child_nameis_validation_tableis_column_statusis_msg_nameis_msg_textil_source_ridil_device_rid|DAT*. @ "X(h-<IXhv] o.@ X  DAT*1h @@@     X&$C4(DAT*xT$\& xzR 2  2  ] wpH     DAT* @2  2  ] wH @      @ : *@l@l8$1)08DAT*H$)X8`$x$$$)8)8:W@)8,1,$4Lf d- +key+keyflagsls_col_name::messageP   #@` il_selected_row7getcolumnname is_column_name86getrowP86idwc_dw_childh8DAT*7is_child_name349getitemstringoo[setitemPtriggereventtyl  0 H X ` x       "$1)08H$)X8`$x$6)8$**$6880)8,1,$DAT*0J d ls_col_name::message( @` il_selected_row7getcolumnname is_column_name86getrowP86is_old_valueh5setitemPidwc_dw_child8is_child_name97highlight_dddwpostevent 0 H X ` x       X36/8DAT*)8)488<8S"8]"8]"8r"8"r)8$6$68#*6n4L$)T8\8d0l8d08t8t)81<0$688z%@8,1*,DAT*$)810)888@JT88\8m0)x81\8P8)81<t$688z%@8,`1n,$)816)88@J818\8m0)88tDAT*8m0)8L1\8\\8\) 81<($6808z%@8,1,T$)\81\8d)p88@Jx8;)88T8dJ8,)8#!#)8!")8"T8DAT*088\) 8z'@81$$$),84$6<$68#P$6d$6@81$lt$)|8,>1L,$(@X &*Tnr0!N"#$&()+F-t/012 32466L8d9;=?D\IpJLMPDAT*RHVTWnXYZ[_$dj rowdwodataancestorreturnvaluels_col_namels_pro_sccdwcll_pro_ridll_cur_row::messagesqlca  ) 5 @ DOZ@d@! itemchangedgetrowgetcolumnname$emittant_material_codeunit_codethroughput_unit_coderap_DAT*emission_factors_control_1_device_corap_emission_factors_control_2_device_cogettextis_child_name9is_validation_table:is_column_status;il_selected_row$7idwc_dw_child<8b;valid;rap_devices_idgetchildotitle12 Application Error: Agency Device Id - Not a DataWindowChild. Contact your technical support.rowcount il_device_rid ?bridgetitemnumberWDrap_processes_idDAT*setitemPn ?rap_sources_ido Application Error: Source Id -  il_source_rid>bWD ?PnPn>o Application Error: Process Id -  process_ridbWDOnscc_ams_code DColumn - SCC/AMS CodeSorry! Not a valid SCC/AMS code for process getitemstringis_column_name69:is_msg_nameD<is_msg_texDAT*tX=$7<8b 4     4 L T \ l     0 8 T x               ( T \ p x        $ , 4 < P d l t |  7DAT*8808!0858cz%8z&8z&8z&808$9},1,,$ d< +xpos+ypos+row+dwoancestorreturnvalue::messagex 2@4 rbuttondownscc_ams_codeSCC/AMS Code Lookupselect code, desc_1, desc_2, desc_3, desc_4, devicDAT*e_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 codeib_obj_modified$ , , i18)(8808G"8Q"8j"8"8"$6680 888)81DAT*<$6887z%@8,n1|,p$,)8$)888)81<b$6887z%@8,N1\,$,)8($)088888)H81<BP$68X87z%@DAT*8,.1<,x$18)88,)8)888)81<D$68X87z%@8,01>,$18)88,)8) 88$1<)D8\6DAT*t80808080 )8)$8 8,14)<8D6L80T8\0l8t080)8)8 881)DAT*8680808 0 8(0H)P8)X8 80`1h)p8x680808080)8)8 8G  1DAT*)8$6,8048<0H8P0l8t0)8)8 8Q 1)8680808080)8) 8 8j DAT*(10)88@6H80P8<0X8`08t0)8)8 8 1)86808080800)88)@8DAT* H8P0, 1 ,T$ 8 T4"b#z%&')-B.p/2346:D;r<OPQRST U:VTWnXYZ[\](^B_\`vabcdef0gJhdi~jklmno8pRqlrstuv w& x@ yZ zt { | } ~  . H b |  6 P j & > X r DAT* dz rowdwoancestorreturnvaluels_col_namedwcll_device_ridls_device_idls_process_idls_source_id::messagesqlca $ 0 4B O ] j@t@!\ itemfocuschangedgetcolumnnameSemittant_material_codeunit_codethroughput_material_codethroughput_unit_coderap_emiDAT*ssion_factors_control_1_device_corap_emission_factors_control_2_device_cotitle coderap_devices_idgetchildo Application Error: Agency Device Id - Not a DataWindowChild. Contact your technical support.settransobjectxil_source_rid>retrieveite}rap_processes_iddo Application Error: Agency Process Id - xil_device_rid?}rap_sources_ido Application Error: Source Id - DAT*idgetitemstring8[0x|rap_emission_factors_profile_codeo profile_code[x|il_selected_row7idwc_dw_child,8ois_column_nameL6is_child_nameRod9is_validation_table|:rap_devicesis_msg_name<Column - Device Idis_msg_text=Sorry! Not a valid device idis_old_valuete5getrow7,8oL6d9|:rap_processes<DAT*Column - Process Id=Sorry! Not a valid process id57,8oL6d9|:rap_sources<Column - Source Id=Sorry! Not a valid source idf57,8oL6d9|:rap_materials<Column - Emittant_material_code=Sorry! Not a valid material codeion57,8oL6d9|:rap_units<Column - Emittant Unit CDAT*ode=Sorry! Not a valid unit code857,8oL6d9|:<Column - Throughput Material Code=57,8oL6d9|:<Column - Throughput Unit Code=57,8oL6d9|:rap_scc_ams_speciation_codes<Profile Code =Sorry! Not a valid Profile Code5L6(DAT*    p        ( 0 H P x           $ < D \ t       $ , 4 < D L T l              H P X ` h p x DAT*           $ , 4 H l                ( 0 8 @ H P X             0 8 @ H T 2$1)08H$DAT*)X8`$x$$$)8)8:W@)8_@_811 11@8 @ 810J d ls_col_name X il_selected_row7getcolumnname is_column_nameu86getrow3P86idwc_dw_childh87is_child_name9getitemstringDAT*[setitemPtriggerevent  0 H X ` x      6-8)$8<$Tl$**$6 8$180)8,1,$(@Z dB +row+dwo+dataancestorretuDAT*rnvaluels_col_name::messagex  , 8@H editchangedgetcolumnnametcis_column_namec,6il_selected_rowD7idwc_dw_child\8is_child_namet9D7D7highlight_dddwpostevent$ < T l      :6081DAT*d) rowdwodataancestorreturnvalueP   itemerror-/017OQRSTc-&/10279.A2 +dwnkey+dwescapef_dddw_search+itemchangedf_validate_code+rbuttondownf_look_up+itemfocuschangedf_retrieve_codes+dwnprocessenter+editchanged+itemerrorDAT*(5 5 ER!\n"2 , xywidthheightborderborderstylex%  [  ] % [  DAT*@    nP8v\x/7 1\ 00- =DAT*T0 "$1)08H$)X8`$x$6)8$**$6880)8,1,$0J d ls_col_name::message( @` DAT*il_selected_row7getcolumnname is_column_name86getrowP86is_old_valueh5setitemPidwc_dw_childgh8is_child_name97highlight_dddwpostevent 0 H X ` x       : *@l@l8$1)08H$)X8`$x$$DAT* Emission profile windowforward global type w_speciation_profile from w_master_detail end type end forward global type w_speciation_profile from w_master_detail int Width=2952 int Height=1588 WindowType WindowType=child! boolean TitleBar=true string Title="Emission Profiles" string Icon="EMIS_PRO.ICO" event highlight_dddw pbm_custom07 end type global w_speciation_profile w_speciation_profile type variables string is_msg_name string is_msg_text string is_validation_table stringDAT*  is_column_status = "valid" 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_dw2 () public subroutine wf_find_scc () public subroutine wf_show_grey (datawindow p_dw) public subroutine wf_show_white (datawindow p_dw) public subroutine wf_draw_dw2 () public function boolean wf_check_required () public subroutine wf_undo_dw1 () public function long wf_cascadDAT*e_del () 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_dw2 ();string ls_profile_code if dw_1.rowcount() > 0 then ls_profile_code = dw_1.getitemstring(dw_1.getrow(), "code") dw_2.retrieve(ls_profile_code) end if end subroutine public subroutine wf_find_scc ();string ls_profile_code long ll_row_number declare scc_cursor cursor foDAT*r select profile_code from rap_scc_ams_speciation_codes where scc_ams_code = :gs_scc_ams_code; if not isnull(gs_scc_ams_code) then open scc_cursor; fetch scc_cursor into :ls_profile_code; if sqlca.sqlcode = 0 then ll_row_number = Find(dw_1, "Lower(code)=~"" + Lower(ls_profile_code) + "~"", 1, dw_1.rowcount()) if ll_row_number > 0 then dw_1.scrolltorow(ll_row_number) end if end if close scc_cursor; end if end subroutine public subDAT*routine wf_show_grey (datawindow p_dw);st_no_record_grey.text = "No records present.~n Use Insert to create a new record." st_no_record_grey.Move(p_dw.X + ((p_dw.Width - st_no_record_grey.Width) / 2), & p_dw.Y + ((p_dw.Height - st_no_record_grey.Height) / 2)) st_no_record_grey.show() end subroutine public subroutine wf_show_white (datawindow p_dw);st_no_record_white.text = "No records present. Use Insert to create a new record." st_no_record_white.Move(p_dw.X + ((p_dw.Width - st_no_recorDAT*d_white.Width) / 2), & p_dw.Y + ((p_dw.Height - st_no_record_white.Height) / 2)) st_no_record_white.show() end subroutine public subroutine wf_draw_dw2 (); dw_2.SetRedraw(FALSE) //dw_3.SetRedraw(FALSE) if dw_1.RowCount() > 0 then // masterRid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") dw_2.Retrieve(dw_1.GetItemString(dw_1.GetRow(), "code")) // No dw_3 yet, so comment it out now // // Share data between dw_2 and dw_3 // dw_2.dwShareData(dw_3) end if dw_2.SetRedraw(TRUE) DAT*//dw_3.SetRedraw(TRUE) end subroutine public function boolean wf_check_required ();long ll_cur_row, ll_total_row string ls_code, ls_material_code, ls_name, ls_profile_code, ls_scc_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_code = dw_1.GetItemString(ll_cur_row, "code") if IsNull(ls_code) or ls_code = '' then MessageBox("DataWindow Error", "Sorry! Code is reqDAT*uired", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_name = dw_1.GetItemString(ll_cur_row, "name") if IsNull(ls_name) or ls_name = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_material_code = dw_1.GetItemString(ll_cur_row, "maDAT*terial_code") if IsNull(ls_material_code) or ls_material_code = '' then MessageBox("DataWindow Error", "Sorry! Material Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("material_code") 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 ls_profile_code = dw_2.GetItemString(ll_cur_row, "profile_code") if IsNull(ls_profile_code) or ls_profile_code = '' then MDAT*essageBox("DataWindow Error", "Sorry! Profile Code is required", Information!) dw_2.SetFocus() dw_2.SetRow(ll_cur_row) dw_2.SetColumn("profile_code") dw_2.ScrollToRow(ll_cur_row) return FALSE end if ls_scc_code = dw_2.GetItemString(ll_cur_row, "scc_ams_code") if IsNull(ls_scc_code) or ls_scc_code = '' then MessageBox("DataWindow Error", "Sorry! SCC AMS Code is required", Information!) dw_2.SetFocus() dw_2.SetRow(ll_cur_row) dw_2.SetColumn("scc_amDAT*s_code") dw_2.ScrollToRow(ll_cur_row) return FALSE end if next return TRUE // Commented out by swj, 7/29/94 //long ll_number_of_rows, ll_row_index // //if dw_1.accepttext() < 0 then return false //if dw_2.accepttext() < 0 then return false // //ll_number_of_rows = dw_object.rowcount() //ll_row_index = 0 //do while ll_row_index < ll_number_of_rows // ll_row_index = ll_row_index + 1 // if dw_object.classname() = "dw_1" then // if isnull(dw_object.getitemstring(lDAT* ted_row datawindowchild idwc_dw_child string is_child_name string is_validation_table string is_column_status = "valid" string is_msg_name string is_msg_text long il_source_rid = -1 long il_device_rid = -1 end variables forward prototypes public function boolean wf_check_required () public function boolean wf_check_special (long pl_cur_row) public function boolean wf_check_rid () end prototypes on highlight_dddw;call w_single_table::highlight_dddw;if il_selected_row > 0 then DAT*"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_amt string ls_emit_mat_code, ls_throu_unit_code, ls_unit_code, ls_throu_matl_code SetPointer(HourGlass!) if dw_1.AcceptText() < 0 then return false if dw_2.AcceptText() < 0 then return FALSE ll_total_row = dw_1.RowCount() for ll_cur_row = 1 to ll_total_row // Call function to validate any special fields in descendent window // if thereDAT*$ is any if Not wf_check_special(ll_cur_row) then return FALSE ls_emit_mat_code = & dw_1.GetItemString(ll_cur_row, "emittant_material_code") if IsNull(ls_emit_mat_code) or ls_emit_mat_code = '' then MessageBox("DataWindow Error", & "Sorry! Emittant Material Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("emittant_material_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_unit_code = dw_1.GetItemStriDAT*&ng(ll_cur_row, "unit_code") if IsNull(ls_unit_code) or ls_unit_code = '' then MessageBox("DataWindow Error", & "Sorry! Emittant Unit Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("unit_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_throu_matl_code = & dw_1.GetItemString(ll_cur_row, "throughput_material_code") if IsNull(ls_throu_matl_code) or ls_throu_matl_code = '' then MessageBox("DataWindow DAT*(Error", & "Sorry! Throughput Material Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("throughput_material_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_throu_unit_code = & dw_1.GetItemString(ll_cur_row, "throughput_unit_code") if IsNull(ls_throu_unit_code) or ls_throu_unit_code = '' then MessageBox("DataWindow Error", & "Sorry! Throughput Unit Code is required", Information!) dw_1.SetFocus()DAT** dw_1.SetRow(ll_cur_row) dw_1.SetColumn("throughput_unit_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if if IsNull(dw_1.GetItemNumber(ll_cur_row, "amt")) then MessageBox("DataWindow Error", "Sorry! Amount is required") dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("amt") dw_1.ScrollToRow(ll_cur_row) return FALSE end if next return TRUE end function public function boolean wf_check_special (long pl_cur_row);// PerfDAT*,orm at descendent's level if necessary, so let it pass now return TRUE end function public function boolean wf_check_rid ();long ll_row_num, ll_cur_row, ll_rid_num, ll_rid, ll_pro_rid integer li_exponent string ls_scc_ams_code, ls_profile_code, ls_throughput_material_code, & ls_control_1_device_code, ls_control_2_device_code, & ls_emittant_material_code, ls_throughput_unit_code, ls_unit_code decimal ldec_amt datetime ld_epa ll_row_num = dw_1.RowCount() for ll_cur_row = 1 to ll_rDAT*.ow_num // Check for record with duplicate key if gs_database <> 'ORACLE' then // Only for watcom li_exponent = dw_1.GetItemNumber(ll_cur_row, 'exponent_amt') ls_emittant_material_code = dw_1.GetItemString(ll_cur_row, 'emittant_material_code') ls_throughput_unit_code = dw_1.GetItemString(ll_cur_row, 'throughput_unit_code') ls_unit_code = dw_1.GetItemString(ll_cur_row, 'unit_code') ls_scc_ams_code = dw_1.GetItemString(ll_cur_row, "scc_ams_code") ls_profile_code = dw_1.GetItDAT*0emString(ll_cur_row, "profile_code") ls_throughput_material_code = dw_1.GetItemString(ll_cur_row, "throughput_material_code") ls_control_1_device_code = dw_1.GetItemString(ll_cur_row, "control_1_device_code") ls_control_2_device_code = dw_1.GetItemString(ll_cur_row, "control_2_device_code") ldec_amt = dw_1.GetItemDecimal(ll_cur_row, 'amt') ll_pro_rid = dw_1.GetItemNumber(ll_cur_row, 'process_rid') ld_epa = dw_1.GetItemDateTime(ll_cur_row, 'epa_date') // Plug the values into thDAT*2e check function ll_rid = f_get_emis_fact_rid(ll_pro_rid, ldec_amt, ls_emittant_material_code, & is_factor_type, ls_throughput_unit_code, ls_unit_code, & ls_control_1_device_code, ls_control_2_device_code, li_exponent, & ls_profile_code, ls_scc_ams_code, ls_throughput_material_code, date(ld_epa)) if ll_rid < 0 then return FALSE end if end if if IsNull(dw_1.GetItemNumber(ll_cur_row, "rid")) then // Select the next available rid from the rid_storage in database DAT*4 ll_rid_num = f_get_sequence() if ll_rid_num = -1 then return FALSE end if if gs_database <> 'ORACLE' then // Only for watcom if ll_rid > 0 then MessageBox(This.Title, 'Amount, Emittant Material Code, ' + & 'Factor Type, Throughput Unit Code, Unit Code, ' + & 'Control 1 Device Code, Control 2 Device Code, Exponent Amount, ' + & 'Profile Code, SCC AMS Code and Throughput Material Code must be ' + & 'unique in the table.~nNo changes made to the dataDAT*6base.') return FALSE end if end if dw_1.SetItem(ll_cur_row, "rid", ll_rid_num) dw_1.SetItem(ll_cur_row, "factor_type", is_factor_type) else if gs_database <> 'ORACLE' then // Only for watcom if ll_rid > 0 and ll_rid <> dw_1.GetItemNumber(ll_cur_row, "rid") then MessageBox(This.Title, 'Amount, Emittant Material Code, ' + & 'Factor Type, Throughput Unit Code, Unit Code, ' + & 'Control 1 Device Code, Control 2 Device Code, Exponent Amount, ' + & DAT*8 'Profile Code, SCC AMS Code and Throughput Material Code must be ' + & 'unique in the table.~nNo changes made to the database.') return FALSE end if end if end if next return TRUE end function on open;call w_single_table::open;long ll_row_number long ll_debug_num_retrieval_rows // Set up variable for handling menu behavior is_state = 'single' dw_1.SetTransObject(SQLCA) end on on ue_open_filter_win;call w_single_table::ue_open_filter_win;// Open the fDAT*:ilter window with parameter - table name OpenWithParm(w_filter, 'rap_emission_factors') end on on w_emission_factor_base.create call super::create end on on w_emission_factor_base.destroy call super::destroy end on type dw_2 from w_single_table`dw_2 within w_emission_factor_base event dwnkey pbm_dwnkey event dwescape pbm_dwescape int X=37 int Y=32 int Width=3419 int Height=2016 boolean Border=true BorderStyle BorderStyle=StyleLowered! end type on dw_2::dwnkey;call w_singDAT*<le_table`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 this.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) This.TriggerEvent(ItemChanged!) end if end if end if end on on dw_2::dwescape;call w_single_table`dw_2::dwescape;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnnaDAT*>me() 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 event dw_2::itemchanged;call super::itemchanged;string ls_col_name, ls_pro_scc DataWindowChild dwc long ll_pro_rid, ll_cur_row ll_cur_row = This.GetRow() ls_col_name = This.GetColumnName() if ls_col_name = "emittant_material_code" or ls_col_name = "unit_DAT*@code" or & ls_col_name = "throughput_unit_code" or ls_col_name = "throughput_unit_code" or & ls_col_name = "rap_emission_factors_control_1_device_co" or & ls_col_name = "rap_emission_factors_control_2_device_co" then if Not f_validate_code(This.GetText(), is_child_name, is_validation_table) then is_column_status = ls_col_name else il_selected_row = idwc_dw_child.GetRow() is_column_status = "valid" end if else is_column_status = "valid" end if // If the usDAT*Ber picks a device id from DropDownDataWindow, then save // the device rid to the instance variable 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 Id - " + & "Not a DataWindowChild.~nContact your technical support.") return end if if dwc.rowcount() <> 0 then // copy from dddw to instance variable il_device_rid = dwc.GetItDAT*DemNumber(dwc.GetRow(), "rid") This.SetItem(ll_cur_row, "rap_processes_id", "") else il_device_rid = -1 end if elseif ls_col_name = "rap_sources_id" then // Get the handle of the child datawindow if This.GetChild("rap_sources_id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nSource Id - " + & "Not a DataWindowChild.~nContact your technical support.") return end if if dwc.rowcount() <> 0 then // copy from dddw to dw_2 il_source_ridDAT*F = dwc.GetItemNumber(dwc.GetRow(), "rid") il_device_rid = -1 This.SetItem(ll_cur_row, "rap_processes_id", "") This.SetItem(ll_cur_row, "rap_devices_id", "") else il_source_rid = -1 end if elseif ls_col_name = "rap_processes_id" then // Get the handle of the child datawindow if This.GetChild("rap_processes_id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nProcess Id - " + & "Not a DataWindowChild.~nContact your technical support.") retDAT*Hurn end if if dwc.rowcount() <> 0 then // copy from dddw to dw_2 This.SetItem(ll_cur_row, "process_rid", & dwc.GetItemNumber(dwc.GetRow(), "rid")) end if end if if ls_col_name = "scc_ams_code" then // 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 ") // this.setactioncode(1) // end if ll_pro_rid = This.GetItemNumber(ll_cur_row, 'process_rid') select scc_ams_DAT*Jcode into :ls_pro_scc from rap_processes where rid = :ll_pro_rid; if (IsNull(ls_pro_scc) and Not IsNull(This.GetText())) or & (Not IsNull(ls_pro_scc) and IsNull(This.GetText())) or & ls_pro_scc <> This.GetText() then messagebox("Column - SCC/AMS Code", "Sorry! Not a valid SCC/AMS code for process " + & This.GetItemString(ll_cur_row, 'rap_processes_id')) return 1 end if end if if ls_col_name = is_column_name then if Not f_validate_code(This.GetText(), is_child_nameDAT*L, 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 on dw_2::rbuttondown;call w_single_table`dw_2::rbuttondown;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 " +DAT*N & "from rap_scc_ams_codes order by code", '') then This.ib_obj_modified = TRUE end if end on event dw_2::itemfocuschanged;call super::itemfocuschanged;string ls_col_name DataWindowChild dwc long ll_device_rid string ls_device_id string ls_process_id string ls_source_id ls_col_name = This.GetColumnName() if ls_col_name = "emittant_material_code" or ls_col_name = "unit_code" or & ls_col_name = "throughput_material_code" or ls_col_name = "throughput_unit_code" or & DAT*P ls_col_name = "rap_emission_factors_control_1_device_co" OR & ls_col_name = "rap_emission_factors_control_2_device_co" then f_retrieve_codes(Parent.Title, This, ls_col_name, "code") end if 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 - " + & "Not a DataWindowChild.~nContact your technical support.") return end if // Always retrieve data for child datawindowDAT*v when the column get clicked dwc.SetTransObject(SQLCA) dwc.Retrieve(il_source_rid) elseif ls_col_name = "rap_processes_id" then if This.GetChild("rap_processes_id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nAgency Process Id - " + & "Not a DataWindowChild.~nContact your technical support.") return end if // Always retrieve data for child datawindow when the column get clicked dwc.SetTransObject(SQLCA) dwc.Retrieve(il_device_rid) elseif ls_col_nDAT*TSource-specific constant factor windowforward global type w_emission_factor_a from w_emission_factor_base end type end forward global type w_emission_factor_a from w_emission_factor_base boolean TitleBar=true string Title="Source-Specific Constants (Factors)" string Icon="CONST.ICO" end type global w_emission_factor_a w_emission_factor_a type variables long il_g_source_rid long il_g_device_rid long il_g_process_rid end variables forward prototypes public function boolean wf_dDAT*Vwmodify () public function boolean wf_check_special (long pl_cur_row) end prototypes public function boolean wf_dwmodify ();// 04/10/96 SJS - this function has been commented out because outer // join is no longer used. // Purpose: Replace the sql statements of the datawindows if the dbms is // Oracle because that d_emission_factor_f and // d_emission_factor_f_freeform use outer join // in the select statement //string ls_orig_sel, ls_sel_list, ls_new_sel, ls_err // //if gs_dataDAT*Xbase = 'ORACLE' then // // // Get original sql statement out of the datawindow // ls_orig_sel = dw_1.dwDescribe('DataWindow.Table.Select') // // // Parse out the select part // ls_sel_list = Left(ls_orig_sel, Pos(ls_orig_sel, 'FROM') - 1) // // // Construct new sql select for oracle outer join // ls_new_sel = ls_sel_list + & // ' FROM rap_sources, rap_devices, rap_processes, ' + & // 'rap_emission_factors WHERE ' + & // ' ( rap_sources.rid(+) = rap_devices.source_rid ) AND ' + & //DAT*Z ' ( rap_devices.rid(+) = rap_processes.device_rid ) AND ' + & // ' ( rap_processes.rid(+) = rap_emission_factors.process_rid ) AND ' + & // ' ( rap_emission_factors.factor_type = :factor_type ) AND ' + & // ' ( rap_emission_factors.process_rid = :process_rid OR ' + & // ':process_rid = 0 )' // // // Modify the dw_1 // ls_err = dw_1.dwModify("DataWindow.Table.Select = '" + ls_new_sel + "'") // if ls_err <> '' then // MessageBox('dwModify dw_1 Failed', ls_err) // return FALSE // eDAT*\nd if // // // Modify the dw_2 // ls_err = dw_2.dwModify("DataWindow.Table.Select = '" + ls_new_sel + "'") // if ls_err <> '' then // MessageBox('dwModify dw_2 Failed', ls_err) // return FALSE // end if // //end if // //// dwModify successfully! return TRUE end function public function boolean wf_check_special (long pl_cur_row);long ll_process_rid string ls_src_id, ls_dev_id, ls_pro_id ls_src_id = dw_1.GetItemString(pl_cur_row, 'rap_sources_id') ls_dev_id = dw_1.GetItemSDAT*^tring(pl_cur_row, 'rap_devices_id') ls_pro_id = dw_1.GetItemString(pl_cur_row, 'rap_processes_id') ll_process_rid = dw_1.GetItemNumber(pl_cur_row, 'process_rid') // If the current record is pasted from the buffer, find the process rid if ls_src_id <> '' and ls_dev_id <> '' and ls_pro_id <> '' and & (ll_process_rid = 0 or IsNull(ll_process_rid)) then select rap_processes.rid into :ll_process_rid from rap_processes, rap_devices, rap_sources where rap_processes.device_ridDAT*` = rap_devices.rid and rap_devices.source_rid = rap_sources.rid and rap_sources.id = :ls_src_id and rap_devices.id = :ls_dev_id and rap_processes.id = :ls_pro_id; if f_db_error(SQLCA, 'Error selecting rid from rap_processes table.' + & ' Contact your technical support.') = 1 then return FALSE end if dw_1.SetItem(pl_cur_row, "process_rid", ll_process_rid) end if ll_process_rid = dw_1.GetItemNumber(pl_cur_row, "process_rid") if IsNull(ll_process_rid) or ll_prDAT*bocess_rid = 0 then MessageBox("DataWindow Error", "Sorry! Process Id is required") dw_1.SetFocus() dw_1.SetRow(pl_cur_row) dw_1.SetColumn("rap_processes_id") dw_1.ScrollToRow(pl_cur_row) return FALSE end if return TRUE end function on open;call w_emission_factor_base::open; is_factor_type = 'A' // Get the values of source, device, process rid when the window is open il_g_source_rid = gl_source_rid il_g_device_rid = gl_device_rid il_g_process_rid = gd_process_DAT*drid // Retrieve the data for a - Source-specific Constants Factor if isnull(il_g_process_rid) then il_g_process_rid = 0 end if // 04/10/96 SJS commented out wf_dwmodify - no longer needed because outer // join was removed from the datawindow select statement // if Not wf_dwmodify() then return dw_1.retrieve(is_factor_type, il_g_process_rid) dw_1.SetFocus() end on on w_emission_factor_a.create call w_emission_factor_base::create end on on w_emission_factor_a.destroy cDAT*fall w_emission_factor_base::destroy end on type dw_2 from w_emission_factor_base`dw_2 within w_emission_factor_a string DataObject="d_emission_factor_f_freeform" end type on dw_2::add_row;long ll_cur_row string ls_source_id, ls_device_id, ls_process_id, ls_scc_ams_code ll_cur_row = This.GetRow() // Place process rid on new inserted row if process rid is // pre-selected from other window if il_g_process_rid > 0 then This.SetItem(ll_cur_row, "process_rid", il_g_process_rid ) enDAT*hd if // place source id in new inserted row if il_g_source_rid > 0 then select id into :ls_source_id from rap_sources where rid = :il_g_source_rid; This.setitem(ll_cur_row, "rap_sources_id", ls_source_id) il_source_rid = il_g_source_rid // place device id in new inserted row if il_g_device_rid > 0 then select id into :ls_device_id from rap_devices where rid = :il_g_device_rid; This.setitem(ll_cur_row, "rap_devices_id", ls_devDAT*jice_id) il_device_rid = il_g_device_rid // place process id in new inserted row if il_g_process_rid > 0 then select id, scc_ams_code into :ls_process_id, :ls_scc_ams_code from rap_processes where rid = :il_g_process_rid; This.setitem(ll_cur_row, "rap_processes_id", ls_process_id) // place SCC/AMS code in new inserted row This.setitem(ll_cur_row, "scc_ams_code", ls_scc_ams_code) // place Throughput MDAT*laterial Code in new inserted row // This.setitem(ll_cur_row, "throughput_material_code", gs_code_value) end if end if end if end on on dw_2::rowfocuschanged;call w_emission_factor_base`dw_2::rowfocuschanged;long ll_process_rid if This.rowcount() > 0 then ll_process_rid = This.getitemnumber(This.getrow(), "process_rid") if Not (IsNull(ll_process_rid) or ll_process_rid = 0) then select rap_devices.source_rid, rap_devices.rid into :il_source_rid, :il_devicDAT*ne_rid from rap_processes, rap_devices where rap_processes.device_rid = rap_devices.rid and rap_processes.rid = :ll_process_rid; else il_source_rid = -1 il_device_rid = -1 end if end if end on type dw_1 from w_emission_factor_base`dw_1 within w_emission_factor_a string DataObject="d_emission_factor_f" end type on dw_1::add_row;call w_emission_factor_base`dw_1::add_row;long ll_cur_row string ls_source_id, ls_device_id, ls_process_id, ls_scc_ams_code ll_DAT*pcur_row = This.GetRow() // Place process rid on new inserted row if process rid is // pre-selected from other window if il_g_process_rid > 0 then This.SetItem(ll_cur_row, "process_rid", il_g_process_rid ) end if // place source id in new inserted row if il_g_source_rid > 0 then select id into :ls_source_id from rap_sources where rid = :il_g_source_rid; This.setitem(ll_cur_row, "rap_sources_id", ls_source_id) il_source_rid = il_g_source_rid // place devicDAT*re id in new inserted row if il_g_device_rid > 0 then select id into :ls_device_id from rap_devices where rid = :il_g_device_rid; This.setitem(ll_cur_row, "rap_devices_id", ls_device_id) il_device_rid = il_g_device_rid // place process id in new inserted row if il_g_process_rid > 0 then select id, scc_ams_code into :ls_process_id, :ls_scc_ams_code from rap_processes where rid = :il_g_process_rid; DAT*t This.setitem(ll_cur_row, "rap_processes_id", ls_process_id) // place SCC/AMS code in new inserted row This.setitem(ll_cur_row, "scc_ams_code", ls_scc_ams_code) // place Throughput Material Code in new inserted row // This.setitem(ll_cur_row, "throughput_material_code", gs_code_value) end if end if end if end on on dw_1::rowfocuschanged;call w_emission_factor_base`dw_1::rowfocuschanged;long ll_process_rid, ll_cur_row ll_cur_row = This.GetRowDAT*() if ll_cur_row > 0 then ll_process_rid = This.getitemnumber(ll_cur_row, "process_rid") if Not (IsNull(ll_process_rid) or ll_process_rid = 0) then select rap_devices.source_rid, rap_devices.rid into :il_source_rid, :il_device_rid from rap_processes, rap_devices where rap_processes.device_rid = rap_devices.rid and rap_processes.rid = :ll_process_rid; else il_source_rid = -1 il_device_rid = -1 end if end if end on DAT*xame = "rap_sources_id" then if This.GetChild("rap_sources_id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nSource 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() end if elseif ls_col_name = "rap_emissiDAT*zon_factors_profile_code" then if This.GetChild("rap_emission_factors_profile_code", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nSource 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, "profile_code") = '0' then dwc.SetTransObject(SQLCA) dwc.Retrieve() end if /DAT*|/elseif ls_col_name = "rap_emission_factors_control_1_device_co" OR & // ls_col_name = "rap_emission_factors_control_2_device_co" then // if This.GetChild("rap_emission_factors_control_1_device_co", dwc) = -1 then // MessageBox(Parent.Title, "Application Error:~nAgency Process 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 valDAT*~id codes for this dddw //// if dwc.GetItemString(1, "id") = '0' then // dwc.SetTransObject(SQLCA) // dwc.Retrieve() //// 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_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 = This.getitemstring(This.getrow(), ls_col_name) eDAT*lseif ls_col_name = "rap_processes_id" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "id" is_validation_table = "rap_processes" is_msg_name = "Column - Process Id" is_msg_text = "Sorry! Not a valid process id" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "rap_sources_id" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_DAT*child_name = "id" is_validation_table = "rap_sources" is_msg_name = "Column - Source Id" is_msg_text = "Sorry! Not a valid source id" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "emittant_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 - Emittant_material_code" is_msg_text = "Sorry! Not DAT*a valid material code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "unit_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_units" is_msg_name = "Column - Emittant Unit Code" is_msg_text = "Sorry! Not a valid unit code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "throughput_material_code" then DAT*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 - Throughput Material Code" is_msg_text = "Sorry! Not a valid material code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "throughput_unit_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" DAT* is_validation_table = "rap_units" is_msg_name = "Column - Throughput Unit Code" is_msg_text = "Sorry! Not a valid unit code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "rap_emission_factors_profile_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "profile_code" is_validation_table = "rap_scc_ams_speciation_codes" is_msg_name = "Profile Code" is_msg_text = "Sorry! DAT*Not a valid Profile Code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) else is_column_name = "" 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)) This.TriggerEvent(ItemChanged!) end if end if Send(Handle(This), 256, 9,DAT* Long(0,0)) return 1 end event on dw_2::editchanged;call w_single_table`dw_2::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 end on event dw_2::itemerror;call super::itemerror;return 2 end event type dw_1 from w_single_table`dw_1 within w_emission_factDAT*or_base event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=37 int Y=32 int Width=3419 int Height=1776 end type on dw_1::dwescape;call w_single_table`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 end on oDAT*n dw_1::dwnkey;call w_single_table`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_child.getitemstring(il_selected_row, is_child_name)) This.TriggerEvent(ItemChanged!) end if end if end if end on event dw_1::itemchanged;call super::itemchanged;string ls_col_name DataWindowChild dwc integer li_dw_row DAT*long ll_numFound, ll_dddw_rowcount, ll_pro_rid, ll_cur_row string ls_dw_value, ls_pro_scc ll_cur_row = This.GetRow() ls_col_name = This.GetColumnName() if ls_col_name = "emittant_material_code" or ls_col_name = "unit_code" or & ls_col_name = "throughput_unit_code" or ls_col_name = "throughput_unit_code" or & ls_col_name = "rap_emission_factors_control_1_device_co" or & ls_col_name = "rap_emission_factors_control_2_device_co" then if Not f_validate_code(This.GetText(), is_chDAT*ild_name, is_validation_table) then is_column_status = ls_col_name else il_selected_row = idwc_dw_child.GetRow() is_column_status = "valid" end if else is_column_status = "valid" end if // If the user picks a device id from DropDownDataWindow, then save // the device rid to the instance variable 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 DAT*Error:~nAgency Device Id - " + & "Not a DataWindowChild.~nContact your technical support.") return end if if dwc.rowcount() <> 0 then // copy from dddw to instance variable il_device_rid = dwc.GetItemNumber(dwc.GetRow(), "rid") dw_1.SetItem(ll_cur_row, "rap_processes_id", "" ) dw_1.SetItem(ll_cur_row, "process_rid", 0) else il_device_rid = -1 end if elseif ls_col_name = "rap_sources_id" then // Get the handle of the child datawindow if This.GetDAT*Child("rap_sources_id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nSource Id - " + & "Not a DataWindowChild.~nContact your technical support.") return end if if dwc.rowcount() <> 0 then // copy from dddw to dw_1 il_source_rid = dwc.GetItemNumber(dwc.GetRow(), "rid") il_device_rid = -1 dw_1.SetItem(ll_cur_row, "rap_processes_id", "" ) dw_1.SetItem(ll_cur_row, "process_rid", 0) dw_1.SetItem(ll_cur_row, "rap_devices_id", "" ) eDAT*lse il_source_rid = -1 end if elseif ls_col_name = "rap_processes_id" then // Get the handle of the child datawindow if This.GetChild("rap_processes_id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nProcess Id - " + & "Not a DataWindowChild.~nContact your technical support.") return end if if dwc.rowcount() <> 0 then // copy from dddw to dw_1 dw_1.SetItem(ll_cur_row, "process_rid", & dwc.GetItemNumber(dwc.GetRow(), "rid")) eDAT*nd if end if if ls_col_name = "scc_ams_code" then 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 end if ll_pro_rid = This.GetItemNumber(ll_cur_row, 'process_rid') if isNull(ll_pro_rid) then return 0 select scc_ams_code into :ls_pro_scc from rap_processes where rid = :ll_pro_rid; if (IsNull(ls_pro_scc) and Not IsNull(This.GetText())) or & (Not IsNull(lsDAT*_pro_scc) and IsNull(This.GetText())) or & ls_pro_scc <> This.GetText() then messagebox("Column - SCC/AMS Code", "Sorry! Not a valid SCC/AMS code for process " + & This.GetItemString(ll_cur_row, 'rap_processes_id')) return 1 end if end if 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 DAT*end if end event on dw_1::rbuttondown;call w_single_table`dw_1::rbuttondown;long ll_cur_row string ls_scc_ams_code ll_cur_row = This.GetRow() 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", "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_fDAT*lag, " + & "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::itemfocuschanged;call super::itemfocuschanged;string ls_col_name DataWindowChild dwc long ll_device_rid string ls_device_id string ls_process_id string ls_source_id ls_col_name = This.GetColumnName() if ls_col_name = "emittant_material_code" or ls_col_name = "unit_code" or & ls_col_name = "throughput_mDAT*aterial_code" or ls_col_name = "throughput_unit_code" or & ls_col_name = "rap_emission_factors_control_1_device_co" OR & ls_col_name = "rap_emission_factors_control_2_device_co" then f_retrieve_codes(Parent.Title, This, ls_col_name, "code") end if 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 - " + & "Not a DataWindowChild.~nContact your technical support.") DAT*return end if // Always retrieve data for child datawindow when the column get clicked dwc.SetTransObject(SQLCA) dwc.Retrieve(il_source_rid) elseif ls_col_name = "rap_processes_id" then if This.GetChild("rap_processes_id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nAgency Process Id - " + & "Not a DataWindowChild.~nContact your technical support.") return end if // Always retrieve data for child datawindow when the column get clicked dwc.SetTransObDAT*ject(SQLCA) dwc.Retrieve(il_device_rid) elseif ls_col_name = "rap_sources_id" then if This.GetChild("rap_sources_id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nSource 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) DAT* dwc.Retrieve() end if elseif ls_col_name = "rap_emission_factors_profile_code" then if This.GetChild("rap_emission_factors_profile_code", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nSource 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, "profile_code") = '0' then DAT* dwc.SetTransObject(SQLCA) dwc.Retrieve() end if //elseif ls_col_name = "rap_emission_factors_control_1_device_co" OR & // ls_col_name = "rap_emission_factors_control_2_device_co" then // if This.GetChild("rap_emission_factors_control_1_device_co", dwc) = -1 then // MessageBox(Parent.Title, "Application Error:~nAgency Process Id - " + & // "Not a DataWindowChild.~nContact your technical support.") // return // end if // // If the first value for code is 0 (the ddDAT*dw 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() //// 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_name = "id" is_validation_table = "rap_devices" is_msg_name = "Column - Device Id" is_msg_text = "Sorry! Not a valid device id" isDAT*_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "rap_processes_id" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "id" is_validation_table = "rap_processes" is_msg_name = "Column - Process Id" is_msg_text = "Sorry! Not a valid process id" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "rap_sources_id" then il_selected_row = 0 getchild(ls_cDAT*ol_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "id" is_validation_table = "rap_sources" is_msg_name = "Column - Source Id" is_msg_text = "Sorry! Not a valid source id" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "emittant_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 = "DAT*Column - Emittant_material_code" is_msg_text = "Sorry! Not a valid material code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "unit_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_units" is_msg_name = "Column - Emittant Unit Code" is_msg_text = "Sorry! Not a valid unit code" is_old_value = This.getitemstring(This.getrow(), ls_col_nDAT*ame) elseif ls_col_name = "throughput_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 - Throughput Material Code" is_msg_text = "Sorry! Not a valid material code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "throughput_unit_code" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_childDAT*) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_units" is_msg_name = "Column - Throughput Unit Code" is_msg_text = "Sorry! Not a valid unit code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "rap_emission_factors_profile_code" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "profile_code" is_validation_table = "rap_scc_ams_speciation_coDAT*des" is_msg_name = "Profile Code" is_msg_text = "Sorry! Not a valid Profile Code" is_old_value = This.getitemstring(This.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)) This.TriggerEvenDAT*t(ItemChanged!) end if end if Send(Handle(This), 256, 9, Long(0,0)) return 1 end event on dw_1::editchanged;call w_single_table`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 end on event dw_1::itemerror;call super::itemerror;return 2 end event DAT*c type r_1 from w_single_table`r_1 within w_emission_factor_base int X=27 int Y=20 end type DAT*l_row_index, "code")) or & // isnull(dw_object.getitemstring(ll_row_index, "material_code")) or & // isnull(dw_object.getitemstring(ll_row_index, "name")) then // return false // end if // elseif dw_object.classname() = "dw_2" then // if isnull(dw_object.getitemstring(ll_row_index, "profile_code")) or & // isnull(dw_object.getitemstring(ll_row_index, "scc_ams_code")) then // return false // end if // end if //loop //return true end function puDAT*blic 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() // 08-17-94 - Check return of GetRow to stop error message if dw_1.GetRow() > 0 then if IsNull(dw_1.GetItemString(dw_1.GetRow(), "code")) then dw_1.DeleteRow(dw_1.GetRow()) // wf_draw_dw2() // Add triggerevent to solve the problem about not trigger // rowfocuschange event whenDAT* the cancelled row is already the first row // or the last row of the datawindow. swj, 8/17/94 dw_1.TriggerEvent(rowfocuschanged!) else dw_1.ReselectRow(dw_1.GetRow()) end if end if end subroutine public function long wf_cascade_del ();// Override the ancestor's function string ls_dw_name, ls_code, ls_scc_ams_code long ll_cnt int li_ind SetPointer(HourGlass!) // Get the current datawindow object ls_dw_name = idw_active.DataObject if ls_dw_name = 'd_speciation_profilesDAT*' then ls_code = idw_active.GetItemString(idw_active.GetRow(), "code") // Get the count of records involved ll_cnt = f_del_speciation_profile(0, ls_code, 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) elseif ll_cnt = 1 then li_ind = 1 else DAT* li_ind = 0 // There was an error end if if li_ind = 1 then ll_cnt = f_del_speciation_profile(0, ls_code, sqlca, TRUE) elseif li_ind = 2 then ll_cnt = -1 // User answered no else ll_cnt = 0 end if // Otherwise, perform delete on d_scc_ams_spec else ls_code = dw_1.GetItemString(dw_1.GetRow(), "code") ls_scc_ams_code = idw_active.GetItemString(idw_active.GetRow(), "scc_ams_code") Delete from Rap_scc_ams_speciation_codes Where profile_code = :ls_coDAT*de and scc_ams_code = :ls_scc_ams_code; if sqlca.sqlcode <> 0 then f_db_error(sqlca, "Error deleting record from rap_scc_ams_speciation_codes." + & " Contact your technical support") ll_cnt = -1 else ll_cnt = 1 end if end if return ll_cnt end function on open;call w_master_detail::open;is_state = "master/detail" //Commented out by swj, 7/29/94 //is_style_state = "form" dw_1.settransobject(sqlca) dw_2.settransobject(sqlca) dw_2.hide() //dw_1.reDAT*trieve("G") if (not isnull(gs_scc_ams_code)) and (gs_scc_ams_code <> "") then dw_1.retrieve("G", gs_scc_ams_code) else dw_1.retrieve("G", "none") end if //wf_find_scc() if dw_1.rowcount() > 0 then dw_2.show() end if //Commented out by swj, 7/29/94 //wf_retrieve_dw2() end on on activate;call w_master_detail::activate;m_main_menu.m_view.m_freeform.enabled = false m_main_menu.m_view.m_tabular.enabled = false m_main_menu.m_view.m_freeform.checked = false end on on origDAT*inal_view;// no action end on on w_speciation_profile.create call w_master_detail::create end on on w_speciation_profile.destroy call w_master_detail::destroy end on on expand_view;// no action end on type st_no_record_white from w_master_detail`st_no_record_white within w_speciation_profile int X=939 int Y=781 int Width=889 int Height=145 end type type st_no_record_grey from w_master_detail`st_no_record_grey within w_speciation_profile int X=712 int Y=279 int Width=15DAT*86 int Height=61 end type type dw_3 from w_master_detail`dw_3 within w_speciation_profile int X=193 int Y=833 end type type dw_2 from w_master_detail`dw_2 within w_speciation_profile int X=825 int Y=573 int Width=1138 int Height=861 string DataObject="d_scc_ams_spec" boolean HScrollBar=false boolean HSplitScroll=false end type on dw_2::rbuttondown;call w_master_detail`dw_2::rbuttondown;long ll_cur_row string ls_scc_ams_code ll_cur_row = This.GetRow() if ll_cur_row > 0 thDAT*en This.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 dDAT*w_2::itemchanged;call super::itemchanged;string ls_col_name ls_col_name = this.getcolumnname() if ls_col_name = "scc_ams_code" then 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 end if end if end event on dw_2::add_row;call w_master_detail`dw_2::add_row;String ls_profile_code ls_profile_code = dw_1.GetItemString(dw_1.GetRow(), "code") This.SetItem(This.GetRow()DAT*, "profile_code", ls_profile_code) end on event dw_2::itemerror;call super::itemerror;return 2 end event on dw_2::retrieveend;call w_master_detail`dw_2::retrieveend;//if This.RowCount() = 0 then // This.InsertRow(0) //end if // Commented out by swj, 7/29/94 //// Display no record message //if This.RowCount() = 0 then // wf_show_grey(dw_2) //end if end on on dw_2::validate_delete;call w_master_detail`dw_2::validate_delete;// Commented out by swj, 7/29/94 //if dw_2.rowcount()DAT* = 0 then // st_no_record_grey.text = "No records present.~n Use Insert to create a new record." // st_no_record_grey.Move(This.X + ((This.Width - st_no_record_grey.Width) / 2), & // This.Y + ((This.Height - st_no_record_grey.Height) / 2)) // st_no_record_grey.show() //end if end on type dw_1 from w_master_detail`dw_1 within w_speciation_profile event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=75 int Y=52 int Width=2706 int Height=449 string DataObject="d_speciation_proDAT*files" 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 = "material_code" then // dw_1.setitem(dw_1.getrow(), is_column_name, is_old_value) // f_dDAT*ddw_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??. // 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.DAT*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::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 elsDAT*e il_selected_row = idwc_dw_child.GetRow() end if end if end event on dw_1::validate_delete;call w_master_detail`dw_1::validate_delete;// Commented out by swj, 7/29/94 //if dw_1.rowcount() = 0 then // dw_2.hide() // wf_show_white(dw_1) // st_no_record_grey.hide() //end if end on on dw_1::add_row;call w_master_detail`dw_1::add_row;This.SetItem(This.GetRow(), "profile_type", "P") if dw_2.visible = false then dw_2.show() st_no_record_white.BringToTop = TRUE end if DAT* end on on dw_1::rowfocuschanged;call w_master_detail`dw_1::rowfocuschanged;wf_draw_dw2() if dw_1.RowCount() > 0 then // if code is null, this means the current row is the new inserted row // then reset the dw_2 if IsNull(dw_1.GetItemString(dw_1.GetRow(), "code")) then dw_2.Reset() else if Not dw_2.Visible then dw_2.Show() end if end if else // Clean the activity datawindow buffer dw_2.Reset() end if // Commented out by swj, 7/29/94 //wf_retrieve_dw2DAT*() end on on dw_1::retrieveend;call w_master_detail`dw_1::retrieveend;// Commented out by swj, 7/29/94 //if dw_1.rowcount() = 0 then // dw_2.hide() // wf_show_white(dw_1) // st_no_record_grey.hide() //end if end on event dw_1::itemfocuschanged;call super::itemfocuschanged;string ls_col_name ls_col_name = This.GetColumnName() // if ls_col_name <> is_column_name then // if is_column_name = "material_code" then // if is_column_status <> "valid" then // MessageDAT*Box(is_msg_name, is_msg_text) // this.setcolumn(is_column_status) // return // end if // end if // end if choose case ls_col_name case "material_code" f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") end choose // is_column_status = "valid" if ls_col_name = "material_code" then il_selected_row = 0 // is_filt = "" getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validDAT*ation_table = "rap_materials" is_msg_name = "Column - Material Code" is_msg_text = "Sorry! Not a valid material code" 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) DAT*if il_selected_row > 0 then Parent.PostEvent("highlight_dddw") end if end if //if is_column_name = "material_code" then // il_selected_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_seleDAT*cted_row > 0 then // Parent.PostEvent("highlight_dddw") // end if //end if // //string ls_col_name //ls_col_name = This.GetColumnName() // //if ls_col_name = "material_code" 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::dwnprocessenter;string ls_col_name if il_selected_row > DAT*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 //string filt // //if il_selected_row > 0 then //if is_column_name = "material_code" then //// 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 DAT*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") //// filt = dw_1.gettext() // dw_1.setitem(dw_1.getrow(), is_column_name, & // idwc_dw_child.getitemstring(il_selected_row, is_child_name)) //end if //end if //dw_1.triggerevent(editchanged!) // Make the return key acts like the tab Send(Handle(This), 256, 9, Long(0,0)) return 1 end event event dw_1::iteDAT*4merror;call super::itemerror;return 2 end event DAT*$)8)8:W@)8,1,$4Lf d- +key+keyflagsls_col_name::messageP   #@` il_selected_row7getcolumnname is_column_name86getrowP86idwc_dw_childh87is_child_namew_9getitemstringld[setitemPtriggereventDAT*  0 H X ` x       ^96/8 )8)488<8S"8]"8]"8r"8"r)8$6$68#*6n4L$)T8\8d0lDAT*8d08t8t)81<0$688z%@8,1*,$)810)888@JT8d$ 8l8}0)8$ 81)8188)81<$688z%@DAT*8,1,$)81)88@J$8,14$ 8l8}0)<8D$ 81)L8T$ 8t8}0)\8d18l8l)l81<jt$68|8z%@8,V1d,$DAT*)81$ 8)88@J8;)88Z)880808#`8080@81  8J88 1  ,h )@8#! #)H8!" )P8"Z808X 8l)8z'@81DAT*$*)8$6$68#$6$6@81*$)8,D1R, $(@ X&*Tnr!0#N$%&')+,H.|02345L6x78:<=?<AjCHIJ,KTN`OQSTW YN]Z_t`abci*d DAT* rowdwodataancestorreturnvaluels_col_namedwcli_dw_rowll_numfoundll_dddw_rowcountll_pro_ridll_cur_rowls_dw_valuels_pro_scc::messagesqlca,  ) 5 9CO`kv  @@! itemchangedgetrowgetcoDAT*lumnname$emittant_material_codeunit_codethroughput_unit_coderap_emission_factors_control_1_device_corap_emission_factors_control_2_device_cogettextis_child_name9is_validation_table:is_column_status;il_selected_row$7idwc_dw_child! <8b;valid ;rap_devices_idgetchildotitle8 Application Error: Agency Device Id - Not a DataWindowChild. Contact your technical support.rowcount DAT*il_device_rid ?bridgetitemnumberWDdw_1\-rap_processes_idsetitemP~\-process_ridO~ ?rap_sources_ido Application Error: Source Id -  il_source_rid>bWD ?\-P~\-O~\-P~>o Application Error: Process Id -  \-bWDO~scc_ams_codecoderap_scc_ams_codesColumn - SCC/AMS CodeDAT*Sorry! Not a valid SCC/AMS code  DSorry! Not a valid SCC/AMS code for process getitemstringis_column_name69:is_msg_name<is_msg_text=$7<8b 4     4 L T \ l     0 8 T d           $ , DAT*4 < D L T \ d l t        8 @ H P             .78)81)0888)T88808\08p8z%8z&8z&8(z&68`9}DAT* ,1",h$(@Pb dW +xpos+ypos+row+dwoancestorreturnvaluell_cur_rowls_scc_ams_code::message 2= M@p( rbuttondowngetrowaccepttext$scc_ams_codegetitemstringESCC/AMS Code Lookupselect code, desc_1, desc_2, desDAT* c_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 codeib_obj_modifiedM 0 T ` h , i18)(8808G"8Q"8j"8"8"$6680 88DAT*8)81<$6887z%@8,n1|,p$,)8$)888)81<b$6887z%@8,N1\,$,)8($)088888)H81<DAT*BP$68X87z%@8,.1<,x$18)88,)8)888)81<D$68X87z%@8,01>,$18)88,)8) 88$1<DAT*)D8\6t80808080 )8)$8 8,14)<8D6L80T8\0l8t080)8)8 88DAT*1)8680808 0 8(0H)P8)X8 80`1h)p8x680808080)8)8 DAT*8G  1)8$6,8048<0H8P0l8t0)8)8 8Q 1)8680808080)8DAT*) 8 8j (10)88@6H80P8<0X8`08t0)8)8 8 1)86808080800DAT*)88)@8 H8P0, 1 ,T$ 8 T4"b#z%&')-B.p/2346:D;r<OPQRST U:VTWnXYZ[\](^B_\`vabcdef0gJhdi~jklmno8pRqlrstuv w& x@ yZ zt { | } ~  . H b |  6 P j DAT* & > X r dz rowdwoancestorreturnvaluels_col_namedwcll_device_ridls_device_idls_process_idls_source_id::messagesqlca $ 0 4B O ] j@t@!\ itemfocuschangedgetcolumnnameemittant_material_codeunit_codethroughpuDAT*t_material_codethroughput_unit_coderap_emission_factors_control_1_device_corap_emission_factors_control_2_device_cotitle coderap_devices_idgetchildo Application Error: Agency Device Id - Not a DataWindowChild. Contact your technical support.@settransobjectxil_source_rid>retrieve}rap_processes_ido Application Error: Agency Process Id - xil_device_rid ?}rap_sources_idoDAT*  Application Error: Source Id - idgetitemstring[0x|rap_emission_factors_profile_codeo profile_code[x|il_selected_row7idwc_dw_child,8ois_column_nameL6is_child_named9is_validation_table|:rap_devicesis_msg_name<Column - Device Idis_msg_text=Sorry! Not a valid device idis_old_value5getrow7,8oLDAT*"6d9|:rap_processes<Column - Process Id=Sorry! Not a valid process id57,8oL6d9|:rap_sources<Column - Source Id=Sorry! Not a valid source id+57,8oL6d9|:rap_materialsio<Column - Emittant_material_code=Sorry! Not a valid material code57,8oL6d9|:DAT*$rap_units<Column - Emittant Unit Code=Sorry! Not a valid unit code857,8oL6d9|:<Column - Throughput Material Code=57,8oL6d9|:<Column - Throughput Unit Code=57,8oL6d9|:rap_scc_ams_speciation_codes<Profile Code =Sorry! Not a valid Profile CodeDAT*&5L6(    p        ( 0 H P x           $ < D \ t       $ , 4 < D L T l              H PDAT*( X ` h p x            $ , 4 H l                ( 0 8 @ H P X             0 8 @ H T 2$1DAT**)08H$)X8`$x$$$)8)8:W@)8_@_811 11@8 @ 810J d ls_col_name X il_selected_row7getcolumnname is_column_nameu86getrowP86idwc_dw_childh8DAT*,7is_child_name9getitemstring[setitemPtriggerevent  0 H X ` x      6-8)$8<$Tl$**$6 8$180)8,1,$(@Z dDAT*.B +row+dwo+dataancestorreturnvaluels_col_name::messagex  , 8@H editchangedgetcolumnnametcis_column_namec,6il_selected_rowD7idwc_dw_child\8is_child_namet9D7D7highlight_dddwpostevent$ < T l      :6DAT*0081d) rowdwodataancestorreturnvalueP   itemerror-/017OPQRSTc-&/102$79<.A2 +dwescape+dwnkeyf_dddw_search+itemchangedf_validate_code+rbuttondownf_look_up+itemfocuschangedf_retrieve_codes+dwnprocessenterDAT*2+editchanged+itemerror,(5 5 5 ER!\n"2  xywidthheightP%  [ ] o% [ DAT*4  @  @  v\nP`xx/7 1 \ 0- DAT*=02  2 xy( ] oDAT*8@$8H)X8`$8h)|8$8J888!8!1"!,,88z%81<`9$8)8$8J 81"8(0890@8X$)l8t$)DAT*:8$8h)8$)899,X   V` 6!X"x%dF pl_cur_rowll_process_ridls_src_idls_dev_idls_pro_idsqlcax" , 6 @@ dw_1-rap_sources_idgetitemstring'-rap_devices_id'DAT*<-rap_processes_id'-process_ridgetitemnumberh@ Error selecting rid from rap_processes table. Contact your technical support.-setitemO- DataWindow ErrorSorry! Process Id is requiredj-setfocus `-setrowQ|-setcolumnH-scrolltorow? 8 @ X ` |        X l t    DAT*>  " &88$08,P,lQt$|1$$6$)8$)8,1,$2FZ r dQ ancestorreturnvaluegl_source_ridgl_device_ridgd_process_rid::messaged@*@DAT*@8~G@h openis_factor_type 4Ail_g_source_rid&@il_g_device_rid@Ail_g_process_ridXBXBXBdw_1- 4XBretrieve2-setfocus 8 P l t |        8d  create8dDAT*B  destroy&FGOwPxQyRzX&.2 G wf_dwmodifywf_check_specialf_db_error+open+create+destroyx%06>2 M titlebartitleiconil_g_source_ridil_g_device_ridil_g_process_ridx,DAT*D<] o.@   1 @@@    }DAT*F 0x&6>2  2  ] wpH    DAT*H  @2  2  ] wH @      @ )8,$1X84@$)PDAT*J8h$1p$,`8x6)8$$1$,86)8$$1$,86),8846)D8,1,L$ 0 Xpt(D!\#d$~'/DAT*Ldk +wparam+lparamll_cur_rowls_source_idls_device_idls_process_idls_scc_ams_codesqlca::message # 0 = K [@a@T getrowil_g_process_ridBprocess_ridBsetitemOHil_g_source_ridX@X@rap_sources_idPHil_source_rid>X@il_g_device_rDAT*NidAArap_devices_id@PHil_device_rid?ABBrap_processes_idPHscc_ams_codePH , @ P h p           , D L  <8)$81)488<JX81"#p,1DAT*P1,1,$8j dG +currentrowancestorreturnvaluell_process_ridsqlca::messaged(7@=@@ rowfocuschangedrowcount$4getrow,process_ridgetitemnumber Hil_source_rid`>il_device_ridx?`>x?$ 4 XDAT*R p     <OQRSTc-&/10279<.A2 " +add_row+rowfocuschanged(2  dataobject] % [  @   DAT*TW8 OlH<<8)84$1x8<H$)X8p$1x$,D86)8$$1$,86)8$$1DAT*V$,48 6)488<6)L8,1,T$ 8 P x $Hd!|#$'.d +wparam+lparamancestorreturnvaluell_cur_rowls_source_idls_device_idls_process_idls_scc_ams_codesqlca::message ,7 DDAT*X Q _ o@u@\ add_rowgetrowil_g_process_rid Bprocess_rid BsetitemOPil_g_source_rid`@`@rap_sources_idPPil_source_ridte>`@il_g_device_ridAArap_devices_idPPil_device_rid?A B Brap_processes_idoupPPscc_ams_codePP 4 H X p x  DAT*Z         4 L T  <8) 818(JD81"#\t,|11,1,$4D j dR +currentrowancestorreturnvaluell_process_ridll_cur_rowsqlcaDAT*\::messagex(7B@H@8 rowfocuschangedgetrowprocess_ridgetitemnumber 4il_source_rid8L>il_device_ridd?L>d? D \ t |   <OPQRSTc-&/102$79<.A2 " +add_row+rowfocuschanged(DAT*^2  dataobject!] o% [   @ !@  W8LOlHd<2  2  ] oDAT*GDAT*b8)8)8$9}$9} $9}1<99J 6Trd' messageboxreturnrownumcase9<  dw_1. ib_obj_modifieddw_20-dw_3H,title` Data have been moDAT*ddified. Save current changes?wf_savemwf_undo_dw1wf_undo_dw2wf_undo_uo@. 0-H, ( 8 @ P X h            9d  d  80)$8<80P$6X$6DAT*ft$68$)8$9}$9}$)8$)8$)8$)088$@$)T8)h8p$)81$$$$$$$<<Y5Ik@V$$$$DAT*h$$$<<Y50Ik@V)@8H$)X8`$)p86 z 0Pd ll_cur_rowxh formwf_clear_prev_style is_style_state,3is_stateD2,3is_enlarge_state`4dw_2|-accepttextdw_3r,visible|-,setfocus|-geDAT*jtrow,setrowQ ,scrolltorow?$,|-getcolumnHsetcolumnG\,rowcount4xst_no_record_grey+,x,width+)@,y,heightl + ssag@moveapp8+showge_P+hidefilh$ < P X t          DAT*l    0 8 @ T h p              $ 0@ H X ` p &$($8$@$"P$X$"#V9)t8#v9:F@@8,&8|0)89}$$\$)8#9DAT*n$99)81<F$$$$"  $)8#,*9$99)$81< ,*,$)@8H$)P8,*9}B,*X$)`8X,*9}$h$p$x$$"$$)8#9$99)81<,*DAT*p$)8$,*9}$9}$9}$9},&80)8Vv 2d  &B F!L#X$%&'()*/$0B1`3~5d# lb_resultw_mdi_mainsqlca<&@(*@* h dw_1wf_. ib_obj_modifiDAT*reddw_2sta0-dw_3H,wf_check_required~`Updating data...setmicrohelpZ. . wf_check_rid. updatef0-H,0-0-f. resetupdate{40-{4. {40-H,0-0-f0-{4. 0-H,Data updated successfully8Z ( DAT*t8 @ P X t                $ , @ H P X ` h p x               $80) 8d winname ( unfiltertriggerevent$  DAT*v80)$8<80P$6X$6t$68$)8$9}$9}$)8$$)8)8 $($)<8)P8X$)l81$$$$$$$<<Y5Ik@VDAT*x$$$$$ $<<Y5Ik@V)(80$)@8H$)X86z $Z`|d `X listwf_clear_prev_style is_style_state,3is_stateD2,3is_enlarge_state`4dw_3@|,accepttextdw_2-visible|,-setfocusDAT*z-|,getrowscrolltorow? -|,getcolumn0setcolumnGD-rowcount4`st_no_record_whitet*-x)-widtht*@-y-heightt*@move t*show8t*hideP$ < P X t             DAT*|  ( < P X l               ( 0 @ H X $)$8,$)<81D$L$)T88\Jp8x$$)8)8$:NW@)8$$)8)8DAT*~B d dw_1wf_. accepttext. getrow4. . 4ridgetitemnumber `. . 4deleterow. triggerevent . . 4reselectrow. $ , < D L T p x          F$)$8,$)@8DAT*1FH$:@)`81.h$p$)81:@)8:@ $)8*$)8B1RL@$:@)81($$)81:@)8:@$)8$$) 8<DAT*1RF > L Z *.BFT "$#(%<d rownumtotalrow(( dw_2wf_-accepttext-rowcount44-getnextmodifiedsP--getrowxgetitemstatus$p-deleterow8-reselectrow.-sP--xp--.DAT* $ , @ H ` h p                  d  d  d  9}$$68,8Sz%:)@:@1@81<r:F@@8,&8aDAT*0)880)8$#)81)8)81<,*)8,&8 0)(8:NW@)08,*,&880)L8,*l r 06Jhd dw_objw_mdi_mainsqlca< %&@(*@*T` ib_deleteDAT*5title You are about to delete this record. Are you sure?Checking related records ...setmicrohelpZ~delete_rowtriggerevent 5wf_cascade_delegetrowdeleterowresetupdate{Row deleted successfully.Z~ Row not deleted.Z~ $        ( 0 L  $L808)0@81DAT*@$)P8}1<X$<8`Jt81|$$680 : H L rd sznamenridnrow< 8 idw_active1%wf_GetCurRidNo active datawindow1%getrowH1%RIDgetitemnumber d1%None @DAT* P X t |  9d  d  )88 2D$)T8}\$<8dJ|8$<8)8$<8)863*98169DAT*81681Y(@(8z'8z&:)@:@1@8}11}1}1<r,&8)0)L86981<11 4Z&$2&\'l*+,-01&2D3n4569dY sznamesztypenridncntninDAT*dnref_ridnrowszcodedbeginreldatesqlcaw_mdi_main   %.3 : H*@*N&@(TP wf_getcurridd_legal_entity_relationsidw_active91%getrowL91%ref_ridgetitemnumber l91%codegetitemstring91%begin_relation_dategetitemdateDeDAT*leting this record will also delete child records. Do you want to continue?Deleting records...setmicrohelpZ= D T \ |     L 9d dwname % d ps_style  P.,.1<R},!61D,!$d$ gi_open_shDAT*eet_num::message(.@!@'  J"8,!01>,!$d1 +sizetype+newwidth+newheight::messageP '!@'   $($8$@$"P$X$"jh$68p8z%:)@:@@8DAT*}}1<)8# ,!1,!1,!$j1<j,!1,!V1d,!$,!1,!$J $<jd2 messageboxreturncase7message::messageP !@'(!@'h dw_1. ib_obDAT*j_modifieddw_20-dw_3H,title` Data have been modified. Save current changes?wf_save ( 8 @ P X h       .,.1<Y},.1<b808 08 0%8,!|1,!$0bd$ gi_open_sheet_numDAT*::message(.@!@' base x$6,$6H$6'8,!^1l,!P$Dd ::message!@'X is_state2is_style_state3is_enlarge_state44 , H P R,&80)8,!81F,!$$DAT*d0 +flags+xpos+yposw_mdi_main::messaged &@(&!@', ReadysetmicrohelpZ $   *$@*HX*`p*x***$$$$$$$ |DAT*,BXn d  st_no_record_white*st_no_record_grey,+,dw_3P,Pdw_2h-hdw_1. r_1/""r_20$$controlc@*,+P,h-. /"0$ $@ HX `p x          DAT* h$8$H$X$h$t$$*8FTd 8 st_no_record_white*st_no_record_greyrd$+dw_3@,dw_2P-dw_1`. r_1p/"r_2|0$ 8 H X h t   $&.wxyz{|}~     DAT*FGOwPxQyS{T|$&.2  +edit_actions+filter+unfilter+refresh+original_view+expand_viewwf_check_pendingwf_check_requiredwf_draw_dw2wf_freeform_viewwf_savewf_select_allwf_tabular_viewwf_undo_dw1wf_undo_dw2wf_detail_viewwf_select_onewf_undo_uowf_deletewf_getcurridwf_insert_okwf_general_viewwf_cascade_delwf_check_ridwf_clear_prev_stylef_copy_recordf_paste_recordf_menDAT*u_behavef_del_legal_entity_relations_recf_del_recs+open+resizef_put_scroll_bars+closequery+close+activate+mousemove+create+destroy\(1@M^p|     DAT*trhis. * <'c)stro6!CW".ps)`pe#*t't',--`/t'8)t'8z& zDAT*2 xywidthheighttitlebartitlebackcolorcontrolmenuresizablest_no_record_whitest_no_record_greydw_3dw_2dw_1r_1r_2idw_activeis_stateis_style_stateis_enlarge_stateib_deleteib_save_okistr_recordW h "(2>H [ m r wDAT* | " $%&] oWh   1  @@@DAT*     " $%& wO$ $xP, <xyQ6 TzR? l{SN |T[}l~DAT*~      DAT*!.;Kaw& X4.!#G$DAT*LF &'X`$(2):*2  2 xywidthheightvisibleenabledtextalignmentfocusrectangletextcolorbackcolortextsizeweightfacenamefontfamilyfontpitch@ ` @DAT*forward global type w_master_detail from Window end type type st_no_record_white from statictext within w_master_detail end type type st_no_record_grey from statictext within w_master_detail end type type dw_3 from u_dw_freeform within w_master_detail end type type dw_2 from u_dw_list within w_master_detail end type type dw_1 from u_dw_freeform within w_master_detail end type type r_1 from rectangle within w_master_detail end type type r_2 from rectangle within w_master_detail end DAT*type end forward global type w_master_detail from Window int X=87 int Y=360 int Width=2766 int Height=1196 boolean TitleBar=true string Title="Untitled" long BackColor=12632256 boolean ControlMenu=true boolean Resizable=true event edit_actions pbm_custom01 event filter pbm_custom02 event unfilter pbm_custom03 event refresh pbm_custom04 event original_view pbm_custom05 event expand_view pbm_custom06 st_no_record_white st_no_record_white st_no_record_grey st_no_record_grey dw_3DAT* dw_3 dw_2 dw_2 dw_1 dw_1 r_1 r_1 r_2 r_2 end type global w_master_detail w_master_detail type variables datawindow idw_active; // active datawindow string is_state; string is_style_state; string is_enlarge_state; //boolean ib_expand; boolean ib_delete; boolean ib_save_ok; // Is record saved? s_rec_holder istr_record; // structure to hold the values of the record end variables forward prototypes public function boolean wf_check_pending () public function boolean wf_checDAT*k_required () public subroutine wf_draw_dw2 () public subroutine wf_freeform_view () public function boolean wf_save () public subroutine wf_select_all (window winName) public subroutine wf_tabular_view () public subroutine wf_undo_dw1 () public subroutine wf_undo_dw2 () public subroutine wf_detail_view () public subroutine wf_select_one () public subroutine wf_undo_uo () public subroutine wf_delete (datawindow dw_obj) public function long wf_getcurrid (ref string szname) public functDAT*ion boolean wf_insert_ok () public subroutine wf_general_view () public function long wf_cascade_del () public function boolean wf_check_rid (datawindow dwname) public subroutine wf_clear_prev_style (string ps_style) end prototypes on edit_actions;// Depending on which edit menuitem was selected, take tha appropriate // action on the currently active datawindow. choose case string(message.longparm, "address") case "undo" if idw_active.CanUndo() then idw_active.Undo() else DAT* MessageBox(This.Title, "Sorry! Nothing to undo!") end if case "copy" idw_active.Copy() case "cut" idw_active.Cut() case "paste" idw_active.Paste() case "copy_record" f_copy_record(idw_active, istr_record) case "paste_record" if f_paste_record(idw_active, istr_record) then choose case idw_active.ClassName() case 'dw_1' dw_1.ib_obj_modified = TRUE case 'dw_2' dw_2.ib_obj_modified = TRUE case 'dw_3' dw_3.ib_obj_modified = TDAT*RUE end choose end if case "insert" idw_active.TriggerEvent("add_row") case "delete" // idw_active.DeleteRow(0) // idw_active.TriggerEvent(Rowfocuschanged!) // idw_active.TriggerEvent("delete_row") idw_active.TriggerEvent("validate_delete") case "first" idw_active.TriggerEvent("first_row") case "prior" idw_active.TriggerEvent("prev_row") case "next" idw_active.TriggerEvent("next_row") case "last" idw_active.TriggerEvent("last_row") case "sDAT*elect" idw_active.TriggerEvent("select_one") case "selectall" idw_active.TriggerEvent("select_all") case "tabular" wf_tabular_View() case "freeform" wf_freeform_view() case "save" idw_active.TriggerEvent("save") end choose end on event filter;integer curRow, totalRec string ls_total // Get total records and current row number before filtering totalRec = idw_active.RowCount() + idw_active.FilteredCount() curRow = idw_active.GetRow() // Filter datawindoDAT*w based on the criteria entered in w_filter idw_active.SetFilter(gs_filt) idw_active.Filter() if idw_active.FilteredCount() = totalRec then MessageBox(This.Title, "No rows match the selection criteria!", Information!) // Reselect all rows idw_active.SetFilter('') idw_active.Filter() idw_active.ScrollToRow(curRow) idw_active.TriggerEvent(Rowfocuschanged!) else // Turn total indicator on ls_total = "Total: " + String(idw_active.RowCount() + idw_active.FilteredCount()) DAT* idw_active.Modify("total_index_t.Text='" + ls_total + & "' total_index_t.Color=String(RGB(red))") idw_active.TriggerEvent(Rowfocuschanged!) end if end event on unfilter;long ll_selected_row idw_active.SetFilter('') idw_active.Filter() // Unhighlighted the clicked row before unfiltering ll_selected_row = idw_active.GetSelectedRow(0) idw_active.SelectRow(ll_selected_row, FALSE) idw_active.TriggerEvent(Rowfocuschanged!) // Turn total indicator off by changing the color tDAT*o transparent idw_active.Modify("total_index_t.Text='' total_index_t.Color=553648127") end on on original_view;// User Event // Purpose: Resize and move all datawindows to their original states // Change the attributes of expand and original toolbaritems if wf_check_pending() then w_mdi_main.SetRedraw(FALSE) wf_general_view() st_no_record_white.Hide() //// Turn off expand flag //ib_expand = FALSE w_mdi_main.SetRedraw(TRUE) end if end on DAT* on expand_view;// User Event // Purpose: Expand the dw_2, shrink the dw_1 and move dw_4 // Change the attributes of expand and original toolbaritems w_mdi_main.SetRedraw(FALSE) wf_detail_view() w_mdi_main.SetRedraw(TRUE) //// Set up expand flag //ib_expand = TRUE end on public function boolean wf_check_pending ();integer messageBoxReturn, rowNum // Have any modifications been made to the datawindow //if dw_1.ModifiedCount() > 0 or dw_2.ModifiedCount() > 0 then if dw_1.iDAT*b_obj_modified or dw_2.ib_obj_modified or dw_3.ib_obj_modified then // Beep(1) messageBoxReturn = MessageBox(This.Title, & "Data have been modified.~nSave current changes?", Question!, YesNoCancel!) choose case (messageBoxReturn) case 1 if Not wf_save() then return FALSE end if case 2 // Undo the changes wf_undo_dw1() wf_undo_dw2() wf_undo_uo() // Reset modified flag dw_1.ib_obj_modified = FALSE dw_2.ib_obj_modified = FALSE dw_3.ib_obj_modifDAT*ied = FALSE case 3 return FALSE end choose end if return TRUE end function public function boolean wf_check_required ();// Can not perform wf_check_required function here, so let it pass now return TRUE end function public subroutine wf_draw_dw2 ();// Can not perform wf_draw_dw2 function here, so let it pass now. end subroutine public subroutine wf_freeform_view ();long ll_cur_row wf_clear_prev_style('form') is_style_state = 'form' f_menu_behave(is_state, is_style_DAT*state, is_enlarge_state) // Apply the content of the edit fields to the datawindow buffer dw_2.AcceptText() dw_3.Visible = TRUE dw_2.Visible = FALSE dw_3.SetFocus() // SetFocus will make the first row the current row, so use SetRow to // set the current row the same row as in the dw_2 ll_cur_row = dw_2.GetRow() dw_3.SetRow(ll_cur_row) dw_3.ScrollToRow(ll_cur_row) dw_3.SetColumn(dw_2.GetColumn()) // Display no record message if necessary if dw_3.RowCount() = 0 then st_no_recoDAT*rd_grey.Move(dw_3.X + ((dw_3.Width - st_no_record_grey.Width) / 2), & dw_3.Y + ((dw_3.Height - st_no_record_grey.Height) / 2)) // st_no_record_white.Hide() st_no_record_grey.Show() else st_no_record_grey.Hide() end if end subroutine public function boolean wf_save ();boolean lb_result if Not (dw_1.ib_obj_modified or dw_2.ib_obj_modified or dw_3.ib_obj_modified) then return TRUE if Not wf_check_required() then return FALSE SetPointer(HourGlass!) SetMicroHelp(w_mdi_main, DAT*"Updating data...") lb_result = TRUE if dw_1.ib_obj_modified then if Not wf_check_rid(dw_1) then return FALSE if dw_1.Update(TRUE, FALSE) = 1 then if dw_2.ib_obj_modified or dw_3.ib_obj_modified then if Not wf_check_rid(dw_2) then rollback; return FALSE end if if dw_2.Update(TRUE, FALSE) = 1 then commit; dw_1.ResetUpdate() dw_2.ResetUpdate() else rollback; lb_result = FALSE end if else commit; dw_1.ResetUpdate() end if eDAT*lse rollback; lb_result = FALSE end if elseif dw_2.ib_obj_modified or dw_3.ib_obj_modified then if Not wf_check_rid(dw_2) then return FALSE if dw_2.Update(TRUE, FALSE) = 1 then commit; dw_2.ResetUpdate() else rollback; lb_result = FALSE end if end if // Reset modified flag dw_1.ib_obj_modified = FALSE dw_2.ib_obj_modified = FALSE dw_3.ib_obj_modified = FALSE if lb_result then SetMicroHelp(w_mdi_main, "Data updated successfully") return (lb_result)DAT* end function public subroutine wf_select_all (window winName);winName.TriggerEvent("unfilter") end subroutine public subroutine wf_tabular_view (); wf_clear_prev_style('list') is_style_state = 'list' f_menu_behave(is_state, is_style_state, is_enlarge_state) // Apply the contents of the edit fields to the datawindow buffer dw_3.AcceptText() dw_2.Visible = TRUE dw_3.Visible = FALSE dw_2.SetFocus() dw_2.ScrollToRow(dw_3.GetRow()) dw_2.SetColumn(dw_3.GetColumn()) // DisplDAT*ay no record message if necessary if dw_2.RowCount() = 0 then st_no_record_white.Move(dw_2.X + ((dw_2.Width - st_no_record_white.Width) / 2), & dw_2.Y + ((dw_2.Height - st_no_record_white.Height) / 2)) st_no_record_white.Show() else st_no_record_white.Hide() end if 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_DAT*1.AcceptText() // 08-17-94 - Check return of GetRow to stop error message if dw_1.GetRow() > 0 then if IsNull(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) then dw_1.DeleteRow(dw_1.GetRow()) // wf_draw_dw2() // Add triggerevent to solve the problem about not trigger // rowfocuschange event when the cancelled row is already the first row // or the last row of the datawindow. swj, 8/17/94 dw_1.TriggerEvent(rowfocuschanged!) else dw_1.ReselectRow(dw_1.GetRow()) end if end if end subDAT*routine public subroutine wf_undo_dw2 ();// This function uses GetNextModified to check if any row is modified. // If found, undo the changes by using ReselectRow function long rowNum, totalRow dw_2.AcceptText() totalRow = dw_2.RowCount() rowNum = 0 // For primary buffer do while rowNum <= totalRow rowNum = dw_2.GetNextModified(rowNum, Primary!) if rowNum > 0 then if dw_2.GetItemStatus(dw_2.GetRow(), 0, Primary!) = NewModified! then dw_2.DeleteRow(rowNum) else DAT* dw_2.ReselectRow(rowNum) end if else rowNum = totalRow + 1 end if loop // For filter buffer do while rowNum <= totalRow rowNum = dw_2.GetNextModified(rowNum, Filter!) if rowNum > 0 then if dw_2.GetItemStatus(dw_2.GetRow(), 0, Filter!) = NewModified! then dw_2.DeleteRow(rowNum) else dw_2.ReselectRow(rowNum) end if else rowNum = totalRow + 1 end if loop end subroutine public subroutine wf_detail_view ();// Expand dw_2, shrink dw_1 and move allDAT* command buttons up if there is any // This function will be performed at the descendant's level end subroutine public subroutine wf_select_one ();// Can not perform select one record here, so let it pass now end subroutine public subroutine wf_undo_uo ();// Can not perform undo user objects here, leave it to the descendant end subroutine public subroutine wf_delete (datawindow dw_obj);// This function will validate the delete, delete the current row. ib_delete = FALSE If MessagDAT*eBox(This.Title, "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 wf_cascade_del() >= 0 then // Update the data if dw_obj.DeleteRow(dw_obj.GetRow()) = 1 then commit; dw_obj.ResetUpdate() w_mdi_main.SetMicroHelp("Row deleted successfully.") dw_obj.TriggerEvenDAT*t(Rowfocuschanged!) else rollback; w_mdi_main.SetMicroHelp("Row not deleted.") end if else rollback; end if end subroutine public function long wf_getcurrid (ref string szname);// Function obtains 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") DAT* 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 szName = idw_active.DataObject else szName = "None" end if return nRid end function public function boolean wf_insert_ok ();// Check if it is ok to insert a new record in the descentant level, // So let it pass here. swj, 8/18/94 return TRUE end function public subDAT*routine wf_general_view ();// Resize and move all datawindows to their original states // This function will be performed at the descendant's level end subroutine public function long wf_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 // JNS long nRef_Rid int nRow string szCode date dBeginRelDate // JNS // Get the RID of the active record nRid = wf_GetCurRDAT*id(szName) //JNS - temporary fix to handle multiple field keys for // deletion of records from rap_legal_entity_relations // from Legal on Source screen. Currently, f_del_recs only // handles a single field primary key. This needs to be changed // to handle perhaps a structure of possible keys. if szName = 'd_legal_entity_relations' then nRow = idw_active.GetRow() nRef_Rid = idw_active.GetItemNumber(nRow, "ref_rid") // source rid szCode = idw_active.GetItDAT*emString(nRow, "code") dBeginRelDate = idw_active.GetItemDate(nRow, "begin_relation_date") f_del_legal_entity_relations_rec( nRid, nRef_Rid, szCode, dBeginRelDate, sqlca, TRUE ) return 0 end if //JNS // 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 continuDAT*e?", & Question!, YesNo!, 2) elseif nCnt = 1 then nInd = 1 else nInd = 0 // There was an error end if if nInd = 1 then w_mdi_main.SetMicroHelp('Deleting records...') nCnt = f_del_recs(nRid, szName, TRUE) elseif nInd = 2 then nCnt = -1 // User answered no else nCnt = 0 end if return nCnt end function public function boolean wf_check_rid (datawindow dwname);// Can not perform wf_check_rid function here, so let it pass now. return TRUE end functioDAT*n public subroutine wf_clear_prev_style (string ps_style);// This function will be performed at the descendant's level end subroutine on open;gi_open_sheet_num = gi_open_sheet_num + 1 //dw_1.SetFocus() //SetTransObject(dw_1, SQLCA) //SetTransObject(dw_2, SQLCA) end on on resize;f_put_scroll_bars(This) end on on closequery;integer messageBoxReturn // If the data have been modified and not saved, ask user for saving data if dw_1.ib_obj_modified or dw_2.ib_obj_modified or dwDAT*_3.ib_obj_modified then messageBoxReturn = MessageBox(This.Title, "Data have been modified.~n" + & "Save current changes?", Question!, YesNoCancel!) choose case (messageBoxReturn) case 1 if NOT wf_save() then Message.ReturnValue = 1 return end if case 3 Message.ReturnValue = 1 return end choose end if end on on close;gi_open_sheet_num = gi_open_sheet_num - 1 if gi_open_sheet_num = 0 then f_menu_behave('base', '', '') end if end on on activateDAT*;f_menu_behave(is_state, is_style_state, is_enlarge_state) end on on mousemove;SetMicroHelp(w_mdi_main, "Ready") //This.Title = wTitle end on on w_master_detail.create this.st_no_record_white=create st_no_record_white this.st_no_record_grey=create st_no_record_grey this.dw_3=create dw_3 this.dw_2=create dw_2 this.dw_1=create dw_1 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_3,& this.dw_2,& this.dw_1,& tDAT*Generic constant factor windowforward global type w_emission_factor_c from w_emission_factor_base end type end forward global type w_emission_factor_c from w_emission_factor_base boolean TitleBar=true string Title="Generic Constants (Factors)" string Icon="CONST.ICO" end type global w_emission_factor_c w_emission_factor_c on open;call w_emission_factor_base::open;long ll_debug_num_retrieval_rows is_factor_type = 'C' // Retrieve the data for c - Generic Constants Factor ll_debuDAT*g_num_retrieval_rows = dw_1.Retrieve(is_factor_type) dw_1.SetFocus() end on on w_emission_factor_c.create call w_emission_factor_base::create end on on w_emission_factor_c.destroy call w_emission_factor_base::destroy end on type dw_2 from w_emission_factor_base`dw_2 within w_emission_factor_c string DataObject="d_emission_factor_c_freeform" end type on dw_2::add_row;long ll_cur_row st_no_record_grey.Hide() ll_cur_row = This.InsertRow(This.GetRow()) This.SetRow(ll_cur_rowDAT*) This.ScrollToRow(ll_cur_row) ib_obj_modified = TRUE end on type dw_1 from w_emission_factor_base`dw_1 within w_emission_factor_c string DataObject="d_emission_factor_c" end type on dw_1::add_row;long ll_cur_row st_no_record_white.Hide() ll_cur_row = This.InsertRow(This.GetRow()) This.SetRow(ll_cur_row) This.ScrollToRow(ll_cur_row) ib_obj_modified = TRUE end on DAT*his.r_1,& this.r_2} end on on w_master_detail.destroy destroy(this.st_no_record_white) destroy(this.st_no_record_grey) destroy(this.dw_3) destroy(this.dw_2) destroy(this.dw_1) destroy(this.r_1) destroy(this.r_2) end on type st_no_record_white from statictext within w_master_detail int X=672 int Y=608 int Width=1467 int Height=64 boolean Visible=false boolean Enabled=false string Text="No records present. Use Insert to create a new record." Alignment Alignment=Center! boolDAT*ean 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 st_no_record_grey from statictext within w_master_detail int X=667 int Y=284 int Width=1467 int Height=64 boolean Visible=false boolean Enabled=false string Text="No records present. Use Insert to create a new record." Alignment Alignment=Center! boolean FocusRectangle=falDAT*se 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_3 from u_dw_freeform within w_master_detail event select_one pbm_custom21 event select_all pbm_custom22 event save pbm_custom23 event validate_delete pbm_custom24 int X=183 int Y=680 int Width=2473 int TabOrder=30 boolean Visible=false boolean Border=true BorderStyle BorderStyle=StyleBox! DAT*boolean Resizable=true end type on select_one;call u_dw_freeform::select_one;wf_select_one() end on on select_all;call u_dw_freeform::select_all;wf_select_all(Parent) end on on save;call u_dw_freeform::save;SetPointer(HourGlass!) ib_save_ok = wf_save() end on on validate_delete;call u_dw_freeform::validate_delete;wf_delete(This) end on on getfocus;call u_dw_freeform::getfocus;// Place a green focus reangle on the active datawindow dynamically r_1.Hide() r_2.Resize(ThisDAT*.Width + 45, This.Height + 35) r_2.X = This.X - 15 r_2.Y = This.Y - 15 r_2.Show() idw_active = This end on on resize;call u_dw_freeform::resize;r_2.x = This.x - 22 r_2.y = This.y - 17 r_2.Resize(This.Width + 45, This.Height + 35) end on on add_row;call u_dw_freeform::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. long ll_cur_row // If there is no row in the master table, dDAT*o not allow user to insert // any row in the detail table. if dw_1.RowCount() = 0 then MessageBox("Insert", "Please provide master information first") dw_1.SetFocus() return end if st_no_record_grey.Hide() ll_cur_row = This.InsertRow(This.GetRow()) This.SetRow(ll_cur_row) This.ScrollToRow(ll_cur_row) dw_2.ScrollToRow(ll_cur_row) // Commented out by swj, 7/19/94 //wf_apply_default() end on on delete_row;call u_dw_freeform::delete_row;// Set ib_delete to true in case thereDAT*  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_freeform::first_row;This.ScrollToRow(1) end on on last_row;call u_dw_freeform::last_row;This.ScrollToRow(This.RowCount()) end on on prev_row;call u_dw_freeform::prev_row;This.ScrollPriorRow() end on on losefocus;call u_dw_freeform::losefocus;r_2.Hide() end on on mousemovDAT* e;call u_dw_freeform::mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on on next_row;call u_dw_freeform::next_row;This.ScrollNextRow() end on type dw_2 from u_dw_list within w_master_detail event select_one pbm_custom21 event select_all pbm_custom22 event save pbm_custom23 event validate_delete pbm_custom24 int X=110 int Y=600 int Width=2469 int TabOrder=20 BorderStyle BorderStyle=StyleBox! boolean Resizable=true end type on select_one;call u_dw_list::select_one;wf_select_DAT*one() end on on select_all;call u_dw_list::select_all;wf_select_all(Parent) end on on save;call u_dw_list::save;SetPointer(HourGlass!) ib_save_ok = wf_save() end on on validate_delete;call u_dw_list::validate_delete;wf_delete(This) end on on getfocus;call u_dw_list::getfocus;// Place a green focus reangle on the active datawindow dynamically r_1.Hide() r_2.Resize(This.Width + 45, This.Height + 35) r_2.X = This.X - 15 r_2.Y = This.Y - 15 r_2.Show() //This.BorderStyle = DAT*StyleRaised! idw_active = This end on on resize;call u_dw_list::resize;r_2.x = This.x - 22 r_2.y = This.y - 17 r_2.Resize(This.Width + 45, This.Height + 35) 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 // 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_1.RowCount() = 0 then MessageDAT*Box("Insert", "Please provide master information first") dw_1.SetFocus() return end if st_no_record_white.Hide() This.InsertRow(This.GetRow()) This.ScrollPriorRow() // Commented out by swj, 7/19/94 //wf_apply_default() 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 DAT* end on on updateend;call u_dw_list::updateend;// Display no record message if This.RowCount() = 0 then if is_style_state = 'form' then st_no_record_grey.Show() else st_no_record_white.Show() end if end if end on on retrieveend;call u_dw_list::retrieveend;//if This.RowCount() = 0 then // This.InsertRow(0) //end if // Display no record message if This.RowCount() = 0 then if is_style_state = 'form' then st_no_record_grey.Move(This.X + ((This.Width - st_no_record_gDAT*rey.Width) / 2), & This.Y + ((This.Height - st_no_record_grey.Height) / 2)) st_no_record_grey.Show() else st_no_record_white.Move(This.X + ((This.Width - st_no_record_white.Width) / 2), & This.Y + ((This.Height - st_no_record_white.Height) / 2)) st_no_record_white.Show() end if else if is_style_state = 'form' then st_no_record_grey.Hide() else st_no_record_white.Hide() end if end if end on on mousemove;call u_dw_list::mousemove;SetMicroHelp(wDAT*_mdi_main, This.Tag) end on on losefocus;call u_dw_list::losefocus;r_2.Hide() //This.BorderStyle = StyleLowered! 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 first_row;call u_dw_list::first_row;This.ScrollToRow(1) end on on prev_row;call u_dw_list::prev_row;This.ScrollPriorRow() end on type dw_1 from u_dw_freeform within w_master_detail event select_one pbm_cuDAT*@stom21 event select_all pbm_custom22 event save pbm_custom23 event validate_delete pbm_custom24 int X=114 int Y=132 int Width=2459 int Height=380 int TabOrder=10 boolean Border=true BorderStyle BorderStyle=StyleBox! boolean Resizable=true end type on select_one;call u_dw_freeform::select_one;if wf_check_pending() then wf_select_one() end if end on on select_all;call u_dw_freeform::select_all;if wf_check_pending() then wf_select_all(Parent) end if end on on save;cDAT*Source-specific speciation factor windowforward global type w_emission_factor_f from w_emission_factor_base end type end forward global type w_emission_factor_f from w_emission_factor_base boolean TitleBar=true string Title="Source-Specific Speciation Factor" string Icon="EMIS_FAC.ICO" end type global w_emission_factor_f w_emission_factor_f type variables long il_g_source_rid long il_g_device_rid long il_g_process_rid end variables forward prototypes public function boolean wDAT*f_dwmodify () public function boolean wf_check_special (long pl_cur_row) end prototypes public function boolean wf_dwmodify ();// 04/10/96 SJS - this function has been commented out because outer // join is no longer used. // Purpose: Replace the sql statements of the datawindows if the dbms is // Oracle because that d_emission_factor_f and // d_emission_factor_f_freeform use outer join // in the select statement //string ls_orig_sel, ls_sel_list, ls_new_sel, ls_err // //if gs_dDAT* atabase = 'ORACLE' then // // // Get original sql statement out of the datawindow // ls_orig_sel = dw_1.dwDescribe('DataWindow.Table.Select') // // // Parse out the select part // ls_sel_list = Left(ls_orig_sel, Pos(ls_orig_sel, 'FROM') - 1) // // // Construct new sql select for oracle outer join // ls_new_sel = ls_sel_list + & // ' FROM rap_sources, rap_devices, rap_processes, ' + & // 'rap_emission_factors WHERE ' + & // ' ( rap_sources.rid(+) = rap_devices.source_rid ) AND ' + & DAT*" // ' ( rap_devices.rid(+) = rap_processes.device_rid ) AND ' + & // ' ( rap_processes.rid(+) = rap_emission_factors.process_rid ) AND ' + & // ' ( rap_emission_factors.factor_type = :factor_type ) AND ' + & // ' ( rap_emission_factors.process_rid = :process_rid OR ' + & // ':process_rid = 0 )' // // // Modify the dw_1 // ls_err = dw_1.dwModify("DataWindow.Table.Select = '" + ls_new_sel + "'") // if ls_err <> '' then // MessageBox('dwModify dw_1 Failed', ls_err) // return FALSE /DAT*$/ end if // // // Modify the dw_2 // ls_err = dw_2.dwModify("DataWindow.Table.Select = '" + ls_new_sel + "'") // if ls_err <> '' then // MessageBox('dwModify dw_2 Failed', ls_err) // return FALSE // end if // //end if // //// dwModify successfully! return TRUE end function public function boolean wf_check_special (long pl_cur_row);long ll_process_rid string ls_src_id, ls_dev_id, ls_pro_id ls_src_id = dw_1.GetItemString(pl_cur_row, 'rap_sources_id') ls_dev_id = dw_1.GetItDAT*&emString(pl_cur_row, 'rap_devices_id') ls_pro_id = dw_1.GetItemString(pl_cur_row, 'rap_processes_id') ll_process_rid = dw_1.GetItemNumber(pl_cur_row, 'process_rid') // If the current record is pasted from the buffer, find the process rid if ls_src_id <> '' and ls_dev_id <> '' and ls_pro_id <> '' and & (ll_process_rid = 0 or IsNull(ll_process_rid)) then select rap_processes.rid into :ll_process_rid from rap_processes, rap_devices, rap_sources where rap_processes.device_DAT*(rid = rap_devices.rid and rap_devices.source_rid = rap_sources.rid and rap_sources.id = :ls_src_id and rap_devices.id = :ls_dev_id and rap_processes.id = :ls_pro_id; if f_db_error(SQLCA, 'Error selecting rid from rap_processes table.' + & ' Contact your technical support.') = 1 then return FALSE end if dw_1.SetItem(pl_cur_row, "process_rid", ll_process_rid) end if ll_process_rid = dw_1.GetItemNumber(pl_cur_row, "process_rid") if IsNull(ll_process_rid) or llDAT**_process_rid = 0 then MessageBox("DataWindow Error", "Sorry! Process Id is required") dw_1.SetFocus() dw_1.SetRow(pl_cur_row) dw_1.SetColumn("rap_processes_id") dw_1.ScrollToRow(pl_cur_row) return FALSE end if return TRUE end function on open;call w_emission_factor_base::open; is_factor_type = 'F' // Get the values of source, device, process rid when the window is open il_g_source_rid = gl_source_rid il_g_device_rid = gl_device_rid il_g_process_rid = gd_proDAT*,cess_rid // Retrieve the data for F - Source-specific Speciation Factor if isnull(il_g_process_rid) then il_g_process_rid = 0 end if // 04/10/96 SJS commented out wf_dwmodify - no longer needed because outer // join was removed from the datawindow select statement // if Not wf_dwmodify() then return dw_1.retrieve(is_factor_type, il_g_process_rid) // Do not filter on scc ams code. 11/21/94, swj //if (not isnull(gs_scc_ams_code)) and (gs_scc_ams_code <> "") then // dw_1.setDAT*.filter("scc_ams_code = '"+gs_scc_ams_code+" '") // dw_1.filter() //end if dw_1.SetFocus() end on on w_emission_factor_f.create call w_emission_factor_base::create end on on w_emission_factor_f.destroy call w_emission_factor_base::destroy end on type dw_2 from w_emission_factor_base`dw_2 within w_emission_factor_f string DataObject="d_emission_factor_f_freeform" end type on dw_2::add_row;call w_emission_factor_base`dw_2::add_row;long ll_cur_row string ls_source_id, ls_devicDAT*0e_id, ls_process_id, ls_scc_ams_code ll_cur_row = This.GetRow() // Place process rid on new inserted row if process rid is // pre-selected from other window if il_g_process_rid > 0 then This.SetItem(ll_cur_row, "process_rid", il_g_process_rid ) end if // place source id in new inserted row if il_g_source_rid > 0 then select id into :ls_source_id from rap_sources where rid = :il_g_source_rid; This.setitem(ll_cur_row, "rap_sources_id", ls_source_id) il_source_rDAT*2id = il_g_source_rid // place device id in new inserted row if il_g_device_rid > 0 then select id into :ls_device_id from rap_devices where rid = :il_g_device_rid; This.setitem(ll_cur_row, "rap_devices_id", ls_device_id) il_device_rid = il_g_device_rid // place process id in new inserted row if il_g_process_rid > 0 then select id, scc_ams_code into :ls_process_id, :ls_scc_ams_code from rap_processes DAT*4where rid = :il_g_process_rid; This.setitem(ll_cur_row, "rap_processes_id", ls_process_id) // place SCC/AMS code in new inserted row This.setitem(ll_cur_row, "scc_ams_code", ls_scc_ams_code) // place Throughput Material Code in new inserted row // This.setitem(ll_cur_row, "throughput_material_code", gs_code_value) end if end if end if end on on dw_2::rowfocuschanged;call w_emission_factor_base`dw_2::rowfocuschanged;long ll_process_riDAT*6d if This.rowcount() > 0 then ll_process_rid = This.getitemnumber(This.getrow(), "process_rid") if Not (IsNull(ll_process_rid) or ll_process_rid = 0) then select rap_devices.source_rid, rap_devices.rid into :il_source_rid, :il_device_rid from rap_processes, rap_devices where rap_processes.device_rid = rap_devices.rid and rap_processes.rid = :ll_process_rid; else il_source_rid = -1 il_device_rid = -1 end if end if end on type dw_1 from w_DAT*8emission_factor_base`dw_1 within w_emission_factor_f string DataObject="d_emission_factor_f" end type on dw_1::add_row;call w_emission_factor_base`dw_1::add_row;long ll_cur_row string ls_source_id, ls_device_id, ls_process_id, ls_scc_ams_code ll_cur_row = This.GetRow() // Place process rid on new inserted row if process rid is // pre-selected from other window if il_g_process_rid > 0 then This.SetItem(ll_cur_row, "process_rid", il_g_process_rid ) end if // place source id in nDAT*:ew inserted row if il_g_source_rid > 0 then select id into :ls_source_id from rap_sources where rid = :il_g_source_rid; This.setitem(ll_cur_row, "rap_sources_id", ls_source_id) il_source_rid = il_g_source_rid // place device id in new inserted row if il_g_device_rid > 0 then select id into :ls_device_id from rap_devices where rid = :il_g_device_rid; This.setitem(ll_cur_row, "rap_devices_id", ls_device_id) il_device_rid = il_gDAT*<_device_rid // place process id in new inserted row if il_g_process_rid > 0 then select id, scc_ams_code into :ls_process_id, :ls_scc_ams_code from rap_processes where rid = :il_g_process_rid; This.setitem(ll_cur_row, "rap_processes_id", ls_process_id) // place SCC/AMS code in new inserted row This.setitem(ll_cur_row, "scc_ams_code", ls_scc_ams_code) // place Throughput Material Code in new inserted roDAT*>w // This.setitem(ll_cur_row, "throughput_material_code", gs_code_value) end if end if end if end on on dw_1::rowfocuschanged;call w_emission_factor_base`dw_1::rowfocuschanged;long ll_process_rid, ll_cur_row ll_cur_row = This.GetRow() if ll_cur_row > 0 then ll_process_rid = This.getitemnumber(ll_cur_row, "process_rid") if Not (IsNull(ll_process_rid) or ll_process_rid = 0) then select rap_devices.source_rid, rap_devices.rid into :il_source_rid, :il_deviDAT*ce_rid from rap_processes, rap_devices where rap_processes.device_rid = rap_devices.rid and rap_processes.rid = :ll_process_rid; else il_source_rid = -1 il_device_rid = -1 end if end if end on DAT*Ball u_dw_freeform::save;ib_save_ok = wf_save() end on on validate_delete;call u_dw_freeform::validate_delete;wf_delete(This) end on on losefocus;call u_dw_freeform::losefocus;//r_1.Hide() //This.BorderStyle = StyleLowered! end on on resize;call u_dw_freeform::resize;r_1.x = This.x - 22 r_1.y = This.y - 17 r_1.Resize(This.Width + 45, This.Height + 35) end on on getfocus;call u_dw_freeform::getfocus;// Place a green focus reangle on the active datawindow dynamically r_1.Resize(ThDAT*Dis.Width + 45, This.Height + 35) r_1.Move(This.X - 15, This.Y - 15) r_1.Show() //This.BorderStyle = StyleRaised! idw_active = This end on on add_row;call u_dw_freeform::add_row;if wf_insert_ok() then if wf_check_pending() then st_no_record_grey.Hide() This.InsertRow(This.GetRow()) This.ScrollPriorRow() This.TriggerEvent(Rowfocuschanged!) // NOT WORKING // // Add this to move the cursor to the first column // This.SetColumn(1) ib_obj_modified = TRUE eDAT*Fnd if else MessageBox("Insert Record", & "You must select a context before you insert") end if end on on rowfocuschanged;call u_dw_freeform::rowfocuschanged;// Call wf_draw_dw2() at the descendant level 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 DAT*Hon updateend;call u_dw_freeform::updateend;// Display no record message if This.RowCount() = 0 then st_no_record_grey.Show() end if end on on retrieveend;call u_dw_freeform::retrieveend;// Display no record message if This.RowCount() = 0 then // This.InsertRow(0) st_no_record_grey.Move(This.X + ((This.Width - st_no_record_grey.Width) / 2), & This.Y + ((This.Height - st_no_record_grey.Height) / 2)) st_no_record_grey.Show() else st_no_record_grey.Hide() end if end on oDAT*Jn mousemove;call u_dw_freeform::mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on on prev_row;call u_dw_freeform::prev_row;if wf_check_pending() then This.ScrollPriorRow() end if end on on first_row;call u_dw_freeform::first_row;if wf_check_pending() then This.ScrollToRow(1) end if end on on last_row;call u_dw_freeform::last_row;if wf_check_pending() then This.ScrollToRow(This.RowCount()) end if end on on next_row;call u_dw_freeform::next_row;if wf_check_pending() theDAT*n This.ScrollNextRow() end if end on type r_1 from rectangle within w_master_detail int X=96 int Y=112 int Width=2505 int Height=416 boolean Visible=false boolean Enabled=false int LineThickness=4 long LineColor=12632256 long FillColor=32768 end type type r_2 from rectangle within w_master_detail int X=87 int Y=580 int Width=2519 int Height=420 boolean Visible=false boolean Enabled=false int LineThickness=4 long LineColor=12632256 long FillColor=32768 end type DAT*N!).8GQ[dk8t] `@ @8 @2  2 DAT*P xywidthheightvisibleenabledtextalignmentfocusrectangletextcolorbackcolortextsizeweightfacenamefontfamilyfontpitch@  @!).8GQ[dk8t] DAT*R@ @8 @     F)8,!,1:,! $d" +wparam+lparam::message< !@'( wf_select_onehDAT*Ti  H)8,!.1<,! $d" +wparam+lparam::message< !@'( wf_select_all  n:F@@8)$8},!T1b,!,$:d" +wparam+lparam::message< DAT*V!@'4 ib_save_ok6wf_save $ , H)8,!.1<,!$d" +wparam+lparam::message< !@'$ wf_delete  V.8$)(84$D$1-<RT$1#<R)dDAT*X8l$x$1<Y}$$1<Y}$)8,!<1J,!$4 "d& ancestorreturnvalue::message(!@' getfocusr_1/"hide r_200$width<heightLresize\00$xtt00$y DAT*Z00$showentidw_active1% ( 4 D T d l x         88$ ($1<Y}0$<D$1<Y}L$\$1-<Rl$1#<R)t8,!1 ,!|$ZdEDAT*\ +sizetype+newwidth+newheightancestorreturnvalue::messaged ';!@'X resizer_20$x0$y48 80$widthTheightd  ( 0 < D L \ l t | | 8$),818408;0DAT*^@8d$)x8,!1,!$$)8)8)8)8)8$) 8,!b1p,!$ F n (HdA +wparam+lparamancestorreturnvaluell_cur_row::messaged ,7DAT*`!@'p add_rowdw_1. rowcount4 InsertPlease provide master information first. setfocuslst_no_record_greyL+hide$getrowinsertrow(setrowQscrolltorow?dw_2-? , d x            h8 9},!N1\,!DAT*b($ 4d6 +wparam+lparamancestorreturnvalue::messageP ,!@'0 delete_rowib_delete5 ( l81) 8,!R1`,!($8d6 +wparam+lparamancestorreturnvalue::messageP DAT*d,!@'0 first_rowscrolltorow? ( v8)8)08,!\1j,!8$Bd6 +wparam+lparamancestorreturnvalue::messageP ,!@'@ last_rowrowcount4scrolltorow?$ 0 8 fDAT*f8) 8,!L1Z,!($2d6 +wparam+lparamancestorreturnvalue::messageP ,!@'0 prev_rowscrollpriorrow> ( h28$)(8,!N1\,!0$4d& ancestorreturnvalue::message(DAT*h!@'8 losefocusr_20$hide  ( 0 |8,&$6)08,!b1p,!8$HdD +flags+xpos+yposancestorreturnvaluew_mdi_main::messagex /&@(:!@'@ mousemovetagsetmicrohDAT*jelpZ  0 8 f8) 8,!L1Z,!($2d6 +wparam+lparamancestorreturnvalue::messageP ,!@'0 next_rowscrollnextrow< ( .2 8    OPQRSTcdeDAT*lf-&/28.2 +select_one+select_all+save+validate_delete+getfocus+resize+add_row+delete_row+first_row+last_row+prev_row+losefocus+mousemove+next_row &7AIR^i s }   2 @DAT*n xywidthtabordervisibleborderborderstyleresizable  #*6]  h @     cDAT*p ,d Dxe \fC.X8M OV Pb Qm  Tw  RDAT*r2 'X   D S     F)8,!,1:,! $d" +wparam+lparam::message< !@'( wf_select_one  H)8,!.1DAT*t<,! $d" +wparam+lparam::message< !@'( wf_select_all  n:F@@8)$8},!T1b,!,$:d" +wparam+lparam::message< !@'4 ib_save_ok6wf_saveDAT*v $ , H)8,!.1<,!$d" +wparam+lparam::message< !@'$ wf_delete  V.8$)(84$D$1-<RT$1#<R)d8l$x$1<Y}$DAT*x$1<Y}$)8,!<1J,!$4  "d& ancestorreturnvalue::message(!@' getfocusr_1/"hide r_200$width<heightLresize\00$xtt00$y 00$showidw_active1% ( 4DAT*z D T d l x         88$ ($1<Y}0$<D$1<Y}L$\$1-<Rl$1#<R)t8,!1 ,!|$ZdE +sizetype+newwidth+newheightancestorreturnvalue::messagedDAT*| ';!@'X resizer_20$x0$y48 80$widthTheightd  ( 0 < D L \ l t | < 8$),818408;0@8d$)x8,!1,!DAT*$$)8)8)8)8,!"10,!$ F n d6 +wparam+lparamancestorreturnvalue::messageP ,!@'X add_rowdw_1. rowcount4 InsertPlease provide master information first. setfocuslst_no_record_white*hDAT*Generic emission factor windowforward global type w_emission_factor_g from w_emission_factor_base end type end forward global type w_emission_factor_g from w_emission_factor_base boolean TitleBar=true string Title="Generic Emission Factor" end type global w_emission_factor_g w_emission_factor_g forward prototypes public function boolean wf_save () end prototypes public function boolean wf_save ();MessageBox(This.Title, "Sorry! This window is read only.") return FALSE end functiDAT*on on open;call w_emission_factor_base::open; is_factor_type = 'G' // Retrieve the data for G - Generic Emission Factor dw_1.Retrieve(is_factor_type) if (gs_scc_ams_code <> '@STREAM') and (not isnull(gs_scc_ams_code)) and & (gs_scc_ams_code <> "") then dw_1.setfilter("scc_ams_code = '"+gs_scc_ams_code+" '") dw_1.filter() end if dw_1.SetFocus() end on on w_emission_factor_g.create call w_emission_factor_base::create end on on w_emission_factor_g.destroy call w_emissDAT*ion_factor_base::destroy end on type dw_2 from w_emission_factor_base`dw_2 within w_emission_factor_g string DataObject="d_emission_factor_freeform" end type on dw_2::validate_delete;MessageBox('Delete', 'Sorry! Function not implemented') end on on dw_2::add_row;MessageBox('Insert', 'Sorry! Function not implemented') end on type dw_1 from w_emission_factor_base`dw_1 within w_emission_factor_g string DataObject="d_emission_factor" end type on dw_1::validate_delete;MessageBox('DAT*Delete', 'Sorry! Function not implemented') end on on dw_1::add_row;MessageBox('Insert', 'Sorry! Function not implemented') end on DAT*ide$getrowinsertrow(scrollpriorrow> , d x        h8 9},!N1\,!($ 4d6 +wparam+lparamancestorreturnvalue::messageP ,!@'0 delete_rowib_delete5 DAT* ( A8)814$8<|T$)d8$)8,!1,!$$@\x| dN +rowsinserted+rowsupdated+rowsdeletedancestorreturnvalue::messaged#0D!@'8 updateendrowcount4is_style_statDAT*e$3formst_no_record_greyA+show\st_no_record_whitel*\ 4 T d    98) 818$8@,X$d$t$|$$<<Y5Ik@V$$$$<<Y5Ik@V)8$)8 $$$DAT*$$,$<<Y58Ik@V@$H$P$X$<<Y5`Ik@V)h8p$)x8\$8@@$)8\$)8,!v1,!$8T  ( , <@\d0 +rowcountancestorreturnvalue::message<&!@'DAT*  retrieveendrowcount84is_style_state(3formst_no_record_greyE+xT`widthlE+l@y,heightE+@moveyE+showyst_no_record_white*`l*lh@*@*(3E+hide* 8 X d t |  DAT*           $ , 8@ H P X `h p x       |8,&$6)08,!b1p,!8$HdD +flags+xpos+yposancestorreturnvaluew_mdi_main::messagex DAT*/&@(:!@'@ mousemovetagwcsetmicrohelpyleZ  0 8 h28$)(8,!N1\,!0$4d& ancestorreturnvalue::message(!@'8 losefocusr_20$hide  ( 0 v8DAT*)8)08,!\1j,!8$Bd6 +wparam+lparamancestorreturnvalue::messageP ,!@'@ last_rowrowcount4scrolltorow?$ 0 8 f8) 8,!L1Z,!($2d6 +wparam+lparamancesDAT*torreturnvalue::messageP ,!@'0 next_rowscrollnextrow< ( l81) 8,!R1`,!($8d6 +wparam+lparamancestorreturnvalue::messageP ,!@'0 first_rowscrolltorow?DAT* ( f8) 8,!L1Z,!($2d6 +wparam+lparamancestorreturnvalue::messageP ,!@'0 prev_rowscrollpriorrow> ( .2 89 A   OPQRSTcdef-&DAT*/289<.A2 +select_one+select_all+save+validate_delete+getfocus+resize+add_row+delete_row+updateend+retrieveend+mousemove+losefocus+last_row+next_row+first_row+prev_row@ &7AIR^i v   DAT* 2 1 xywidthtaborderborderstyleresizablexn X '] onX h @  @   tcDAT* d xe fC.X\8M OV PA9 'X DAT*2 m  T ( Sb @Qw XR     Z)8&)48,!@1N,!<$&d" +wparam+lparam::message< DAT*!@'D wf_check_pending}wf_select_one$ 4 < \)8()48,!B1P,!<$(d" +wparam+lparam::message< !@'D wf_check_pending}wf_select_all$ 4 < T)$8},!:1HDAT*,!,$ d" +wparam+lparam::message< !@'4 ib_save_ok6wf_save $ , H)8,!.1<,!$d" +wparam+lparam::message< !@'$ wf_delete  L2DAT*Generic speciation factor windowforward global type w_emission_factor_p from w_emission_factor_base end type end forward global type w_emission_factor_p from w_emission_factor_base boolean TitleBar=true string Title="Generic Speciation Factor" string Icon="EMIS_PRO.ICO" end type global w_emission_factor_p w_emission_factor_p forward prototypes public function boolean wf_save () public function boolean wf_dwmodify () end prototypes public function boolean wf_save ();MessageBox(TDAT*his.Title, "Sorry! This window is read only.") return FALSE end function public function boolean wf_dwmodify ();// Purpose: Replace the sql statements of the datawindows if the // generic specifiation window is open and the scc_ams_code from the // process window is not blank string ls_orig_sel, ls_sel_list, ls_new_sel, ls_err // Get original sql statement out of the datawindow ls_orig_sel = dw_1.Describe('DataWindow.Table.Select') // Parse out the select part ls_sel_list = LeftDAT*(ls_orig_sel, Pos(ls_orig_sel, 'FROM') - 1) // Construct new sql select ls_new_sel = ls_sel_list + & ' 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_speDAT*ciation_codes.scc_ams_code = :factor_type ) ' // Modify the dw_1 ls_err = dw_1.Modify("DataWindow.Table.Select = '" + ls_new_sel + "'") if ls_err <> '' then MessageBox('dwModify dw_1 Failed', ls_err) return FALSE end if // Modify the dw_2 ls_err = dw_2.Modify("DataWindow.Table.Select = '" + ls_new_sel + "'") if ls_err <> '' then MessageBox('dwModify dw_2 Failed', ls_err) return FALSE end if // dwModify successfully! return TRUE end function on open;call w_emission_facDAT*tor_base::open; is_factor_type = 'P' // Retrieve the data for P - Generic Speciation Factor if IsNull(gs_scc_ams_code) or gs_scc_ams_code = '' then dw_1.Retrieve(is_factor_type) else if Not wf_dwmodify() then return dw_1.Retrieve(gs_scc_ams_code) end if dw_1.SetFocus() end on on w_emission_factor_p.create call w_emission_factor_base::create end on on w_emission_factor_p.destroy call w_emission_factor_base::destroy end on type dw_2 from w_emission_factor_base`dw_2 withDAT*in w_emission_factor_p string DataObject="d_emission_factor_p_freeform" end type on dw_2::validate_delete;MessageBox('Delete', 'Sorry! Function not implemented') end on on dw_2::add_row;MessageBox('Insert', 'Sorry! Function not implemented') end on type dw_1 from w_emission_factor_base`dw_1 within w_emission_factor_p string DataObject="d_emission_factor_p" end type on dw_1::validate_delete;MessageBox('Delete', 'Sorry! Function not implemented') end on on dw_1::add_row;MessageDAT*<Box('Insert', 'Sorry! Function not implemented') end on DAT*8,!21@,!$d& ancestorreturnvalue::message(!@' losefocus 88$ ($1<Y}0$<D$1<Y}L$\$1-<Rl$1#<R)t8,!1 ,!|$DAT*ZdE +sizetype+newwidth+newheightancestorreturnvalue::messaged ';!@'X resizer_1/"x/"y8 8/"widthTheightd  ( 0 < D L \ l t | ".8$($1-<R8DAT*$1#<R)H8P$\$1<Yh$1<Y)x8$)8,!1,!$l d& ancestorreturnvalue::message(!@'` getfocusr_1/"width height0resize@/"x}Xydmovep/"showidw_acDAT*tive1% ( 8 H P \ h x     $ 8) 8)<8X$)h8)x8)8)8:NW@)89}8080@8,! 1,!$4Hd d6 +wparam+lparamancestorDAT*returnvalue::messageP ,!@' P add_rowwf_insert_okwf_check_pending}(st_no_record_greyD+hide`getrowpinsertrow(scrollpriorrow>triggerevent ib_obj_modifiedInsert RecordYou must select a context before you insert_i < X h x      P<DAT*8,!61D,!$d2 +currentrowancestorreturnvalue::message<(!@'  rowfocuschanged h8 9},!N1\,!($ 4d6 +wparam+lparamancestorreturnvalue::messageP DAT*,!@'0 delete_rowib_delete5 ( A8)81\8$)H8,!v1,!P$$@\dN +rowsinserted+rowsupdated+rowsdeletedancestorreturnvalue::messaged#0D!@'X updateendrowcount4st_no_recoDAT*rd_grey$+show@ 8 H P `98) 81<$H$X$`$h$<<Y5pIk@V|$$$$<<Y5Ik@V)8$)8,$)8,!F1T,!$8  ,d0 +rowcountancestorreDAT*turnvalue::message<&!@' retrieveendrowcount4st_no_record_grey(+xDwidthP(+P@yxheight(+eai@movei_t(+showess(+hide < H X ` h p|          |DAT*8,&$6)08,!b1p,!8$HdD +flags+xpos+yposancestorreturnvaluew_mdi_main::messagex /&@(:!@'@ mousemovetagwcsetmicrohelp_reZ  0 8 z8)$8F)<8,!DAT*`1n,!D$4Fd6 +wparam+lparamancestorreturnvalue::messageP ,!@'L prev_rowwf_check_pending}scrollpriorrow>,$ < D 8)$8L1)88,!f1t,!@$4Ld6 +wparam+lparamanceDAT*storreturnvalue::messageP ,!@'H first_rowwf_check_pending}scrolltorow?,$ 8 @ 8)$8V)88)L8,!p1~,!T$4Vd6 +wparam+lparamancestorreturnvalue::messageP DAT*,!@'\ last_rowwf_check_pending}rowcount4,scrolltorow?@$ 8 L T z8)$8F)<8,!`1n,!D$4Fd6 +wparam+lparamancestorreturnvalue::messageP ,!@'L next_rowwf_check_pending}scrollnextroDAT*w<,$ < D . 2 8 9 < A            OPQRSTcdef-&/289<.A2 +select_one+select_all+save+validate_delete+losefocus+resize+getfocus+add_row+rowfocuschanged+delete_row+updateend+retrieveend+mousemove+prev_row+first_row+last_row+next_rowT DAT*&7BJT]n z    2 ? xywidthheighttaborderborderborderstyleresizabler  | ")DAT*5] or |  @     c d xe f2XpDAT*8C.M O<V  PA 9 'X w $ Rb <Qm TTDAT* lS2  2 K xywidthheightvisibleenabledlinethicknesslinecolorfillcolor` p !)7A] #`p 2  2 KDAT*k xywidthheightvisibleenabledlinethicknesslinecolorfillcolorW D !)7A] #WD DAT*Source-specific emission factor windowforward global type w_emission_factor_s from w_emission_factor_base end type type gb_1 from groupbox within w_emission_factor_s end type type rb_process from radiobutton within w_emission_factor_s end type type rb_state from radiobutton within w_emission_factor_s end type type rb_county from radiobutton within w_emission_factor_s end type type st_select_factor_type from statictext within w_emission_factor_s end type type rb_source from radiobuttonDAT* within w_emission_factor_s end type type st_sccfilter from statictext within w_emission_factor_s end type end forward global type w_emission_factor_s from w_emission_factor_base gb_1 gb_1 rb_process rb_process rb_state rb_state rb_county rb_county st_select_factor_type st_select_factor_type rb_source rb_source st_sccfilter st_sccfilter end type global w_emission_factor_s w_emission_factor_s type variables //data set from other windows long il_g_source_rid long il_g_device_riDAT*d long il_g_process_rid string is_g_scc_ams_code //instance data for emission factors long il_g_state_rid long il_g_county_rid long il_g_ref_rid integer ii_g_data_level long il_prevStateRid long il_prevCountyRid long il_prevRefRid //filter for emission factors string is_curSCCFilter = "" end variables forward prototypes public function boolean wf_dwmodify () public function boolean wf_check_special (long pl_cur_row) public function integer of_setdddw (long al_row) DAT* public function integer of_setdddwkeys (datawindow adw, long al_row) end prototypes public function boolean wf_dwmodify ();// 04/10/96 SJS - this function has been commented out because outer // join is no longer used. // Purpose: Replace the sql statements of the datawindows if the dbms is // Oracle because that d_emission_factor_s and // d_emission_factor_s_freeform use outer join // in the select statement //string ls_orig_sel, ls_sel_list, ls_new_sel, ls_err // //if gs_databDAT*ase = 'ORACLE' then // // // Get original sql statement out of the datawindow // ls_orig_sel = dw_1.dwDescribe('DataWindow.Table.Select') // // // Parse out the select part // ls_sel_list = Left(ls_orig_sel, Pos(ls_orig_sel, 'FROM') - 1) // // // Construct new sql select for oracle outer join // ls_new_sel = ls_sel_list + & // ' FROM rap_sources, rap_devices, rap_processes, ' + & // 'rap_emission_factors WHERE ' + & // ' ( rap_sources.rid(+) = rap_devices.source_rid ) AND ' + & // DAT* ' ( rap_devices.rid(+) = rap_processes.device_rid ) AND ' + & // ' ( rap_processes.rid(+) = rap_emission_factors.process_rid ) AND ' + & // " ( upper(rap_emission_factors.factor_type) = :factor_type ) AND " + & // ' ( rap_emission_factors.process_rid = :process_rid OR ' + & // ':process_rid = 0 )' // // // Modify the dw_1 // ls_err = dw_1.dwModify("DataWindow.Table.Select = '" + ls_new_sel + "'") // if ls_err <> '' then // MessageBox('dwModify dw_1 Failed', ls_err) // return FALSEDAT* // end if // // // Modify the dw_2 // ls_err = dw_2.dwModify("DataWindow.Table.Select = '" + ls_new_sel + "'") // if ls_err <> '' then // MessageBox('dwModify dw_2 Failed', ls_err) // return FALSE // end if // //end if // //// dwModify successfully! return TRUE end function public function boolean wf_check_special (long pl_cur_row);long ll_process_rid long ll_countyRid, ll_stateRid, ll_sourceRid long ll_rc string ls_countyName string ls_sourceID string ls_src_id, ls_deDAT*v_id, ls_pro_id datawindowchild dwc_child //*** 1/30/02 MDY //copy the state rid into the process rid field for //state specific factor if is_factor_type = 'Q' then //if there is no state_rid for this row, the get from county_rid column ll_process_rid = dw_1.getItemNumber(pl_cur_row, "process_rid") if isNull(ll_process_rid) or ll_process_rid <= 0 then ll_stateRid = dw_1.getItemNumber(pl_cur_row, "state_rid") if ll_stateRid <= 0 or isNull(ll_stateRid) then MessageBoDAT*x("Data Entry", "Please enter State.", none!) dw_1.SetFocus() dw_1.SetRow(pl_cur_row) dw_1.SetColumn("state_rid") dw_1.ScrollToRow(pl_cur_row) return FALSE end if //set the process_rid to the county_rid ll_rc = dw_1.setItem(pl_cur_row, "process_rid", ll_stateRid) if ll_rc < 0 then MessageBox("Error", "w_emission_factor_s::wf_check_special(); " +& "copy of state RID to process RID failed.", exclamation!) dw_1.SetFocus() dw_1.SetRow(pl_cur_row) DAT* dw_1.SetColumn("state_rid") dw_1.ScrollToRow(pl_cur_row) return FALSE end if end if return TRUE end if //*** 5/17/98 MDY //copy the county rid into the process rid field for //county specific factor if is_factor_type = 'R' then //if there is no process_rid for this row, the get from county_rid column ll_process_rid = dw_1.getItemNumber(pl_cur_row, "process_rid") if isNull(ll_process_rid) or ll_process_rid <= 0 then ll_countyRID = dw_1.getItemNumbeDAT*r(pl_cur_row, "county_rid") if ll_countyRID <= 0 or isNull(ll_countyRID) then MessageBox("Data Entry", "Please enter County.", none!) dw_1.SetFocus() dw_1.SetRow(pl_cur_row) dw_1.SetColumn("county_rid") dw_1.ScrollToRow(pl_cur_row) return FALSE end if //set the process_rid to the county_rid ll_rc = dw_1.setItem(pl_cur_row, "process_rid", ll_countyRid) if ll_rc < 0 then MessageBox("Error", "w_emission_factor_s::wf_check_special(); " +& "copy of cDAT*ounty RID to process RID failed.", exclamation!) dw_1.SetFocus() dw_1.SetRow(pl_cur_row) dw_1.SetColumn("county_rid") dw_1.ScrollToRow(pl_cur_row) return FALSE end if end if return TRUE end if //*** 1/21/02 MDY //copy the source rid into the process rid field for //source specific factor if is_factor_type = 'M' then //if there is no process_rid for this row, the get from source_rid column ll_process_rid = dw_1.getItemNumber(pl_cur_row, "process_riDAT*d") if isNull(ll_process_rid) or ll_process_rid <= 0 then ll_sourceRID = dw_1.getItemNumber(pl_cur_row, "source_rid") if ll_sourceRID <= 0 or isNull(ll_sourceRID) then MessageBox("Data Entry", "Please enter Source ID.", none!) dw_1.SetFocus() dw_1.SetRow(pl_cur_row) dw_1.SetColumn("source_rid") dw_1.ScrollToRow(pl_cur_row) return FALSE end if //set the process_rid to the source_rid ll_rc = dw_1.setItem(pl_cur_row, "process_rid", ll_sourceRid) if DAT*ll_rc < 0 then MessageBox("Error", "w_emission_factor_s::wf_check_special(); " +& "copy of source RID to process RID failed.", exclamation!) dw_1.SetFocus() dw_1.SetRow(pl_cur_row) dw_1.SetColumn("source_rid") dw_1.ScrollToRow(pl_cur_row) return FALSE end if end if return TRUE end if //left this code as-is for process-specific factors MDY 1/2002 ls_src_id = dw_1.GetItemString(pl_cur_row, 'rap_sources_id') ls_dev_id = dw_1.GetItemString(pDAT*l_cur_row, 'rap_devices_id') ls_pro_id = dw_1.GetItemString(pl_cur_row, 'rap_processes_id') ll_process_rid = dw_1.GetItemNumber(pl_cur_row, 'process_rid') // If the current record is pasted from the buffer, find the process rid if ls_src_id <> '' and ls_dev_id <> '' and ls_pro_id <> '' and & (ll_process_rid = 0 or IsNull(ll_process_rid)) then select rap_processes.rid into :ll_process_rid from rap_processes, rap_devices, rap_sources where rap_processes.device_rid = rap_DAT*devices.rid and rap_devices.source_rid = rap_sources.rid and rap_sources.id = :ls_src_id and rap_devices.id = :ls_dev_id and rap_processes.id = :ls_pro_id; if f_db_error(SQLCA, 'Error selecting rid from rap_processes table.' + & ' Contact your technical support.') = 1 then return FALSE end if dw_1.SetItem(pl_cur_row, "process_rid", ll_process_rid) end if ll_process_rid = dw_1.GetItemNumber(pl_cur_row, "process_rid") if IsNull(ll_process_rid) or ll_process_rDAT*id = 0 then MessageBox("DataWindow Error", "Sorry! Process Id is required") dw_1.SetFocus() dw_1.SetRow(pl_cur_row) dw_1.SetColumn("rap_processes_id") dw_1.ScrollToRow(pl_cur_row) return FALSE end if return TRUE end function public function integer of_setdddw (long al_row); //sets up dddw lists for state, county and source specific factors /* ARGUMENTS: long al_row: the row number in the current datawindow; use -1 for pre-retrieval poDAT*pulation to stop retrieval arg dialogues */ long ll_rc long ll_stateRid long ll_countyRid long ll_sourceRid datawindowChild dwc_child //handle dropdowns for pre-retrieval (to supress retrieval dialogue boxes) if al_row < 0 then // ll_rc = dw_1.getChild("state_rid", dwc_child) // if ll_rc > 0 then // dwc_child.insertRow(0) // end if ll_rc = dw_1.getChild("county_name", dwc_child) if ll_rc > 0 then dwc_child.insertRow(0) end if ll_rc = dw_1.getChild("source_id"DAT*, dwc_child) if ll_rc > 0 then dwc_child.insertRow(0) end if return 1 end if //handle dropdowns for row changes //state dropdown if is_factor_type = 'Q' & or is_factor_type = 'R' & or is_factor_type = 'M' then //get the row's state rid if al_row > 0 then ll_stateRid = dw_1.getItemNumber(al_row, "state_rid") if isNull(ll_stateRid) then ll_stateRid = 0 end if else ll_stateRid = 0 end if //retrieve the state drop down, if not already DAT*retrieved ll_rc = dw_1.getChild("state_rid", dwc_child) if ll_rc < 0 then messageBox("Error", "w_emission_factor_s::of_setDDDW(); error obtaining state list.", exclamation!) return -1 end if if dwc_child.rowCount() <= 0 then dwc_child.setTransObject(SQLCA) ll_rc = dwc_child.retrieve() end if end if //county dropdown if is_factor_type = 'R' & or is_factor_type = 'M' then //get the row's county rid if al_row > 0 then ll_countyRid = dw_1.getItemNumber(al_rDAT*ow, "county_rid") if isNull(ll_countyRid) then ll_countyRid = 0 end if else ll_countyRid = 0 end if //initialize the county drop down ll_rc = dw_1.getChild("county_name", dwc_child) if ll_rc < 0 then messageBox("Error", "w_emission_factor_s::of_setDDDW(); error obtaining county list.", exclamation!) return -1 end if dwc_child.setTransObject(SQLCA) if ll_stateRid <= 0 then //insert a blank row into the county drop down dwc_child.reset() dwc_chiDAT*ld.insertRow(0) elseif ll_stateRid <> il_prevStateRid then //populate county drop down list, for current state ll_rc = dwc_child.retrieve(ll_stateRid) end if end if //source dropdown if is_factor_type = 'M' then //get the row's source rid if al_row > 0 then ll_sourceRid = dw_1.getItemNumber(al_row, "source_rid") if isNull(ll_sourceRid) then ll_sourceRid = 0 end if else ll_sourceRid = 0 end if //initialize the source drop down ll_rcDAT* = dw_1.getChild("source_id", dwc_child) if ll_rc < 0 then messageBox("Error", "w_emission_factor_s::of_setDDDW(); error obtaining source list.", exclamation!) return -1 end if dwc_child.setTransObject(SQLCA) if ll_countyRid <= 0 then //insert a blank row into the county drop down dwc_child.reset() dwc_child.insertRow(0) elseif ll_countyRid <> il_prevCountyRid then //populate county drop down list, for current state ll_rc = dwc_child.retrieve(ll_countyDAT* Rid) end if end if return 1 end function public function integer of_setdddwkeys (datawindow adw, long al_row); //grab the key data from the current row before any edits il_prevStateRid = -1 il_prevCountyRid = -1 if al_row <= 0 then return 0 //continue processing end if if is_factor_type = 'Q' & or is_factor_type = 'R' & or is_factor_type = 'M' then il_prevStateRid = adw.getItemNumber(al_row, "state_rid") if il_prevStateRid <= 0 or isNull(il_prevStaDAT* teRid) then il_prevStateRid = -1 end if end if if is_factor_type = 'R' & or is_factor_type = 'M' then il_prevCountyRid = adw.getItemNumber(al_row, "county_rid") if il_prevCountyRid <= 0 or isNull(il_prevCountyRid) then il_prevCountyRid = -1 end if end if return 1 end function event open;call super::open; long ll_rc //copy the global values for source, device, process rid when the window is opened il_g_source_rid = gl_source_rid if isnull(il_g_sourDAT*ce_rid) then il_g_source_rid = 0 end if il_g_device_rid = gl_device_rid if isnull(il_g_device_rid) then il_g_device_rid = 0 end if il_g_process_rid = gd_process_rid if isnull(il_g_process_rid) then il_g_process_rid = 0 end if //grab the global scc ams code value is_g_scc_ams_code = trim(gs_scc_ams_code) if il_g_process_rid > 0 and (isnull(is_g_scc_ams_code) or is_g_scc_ams_code = "") then //if process was given, but scc is not, the retrieve scc for process SELECDAT*T rap_processes.scc_ams_code INTO :is_g_scc_ams_code FROM rap_processes WHERE rap_processes.rid = :il_g_process_rid; end if if isnull(is_g_scc_ams_code) or is_g_scc_ams_code = "@STREAM" then is_g_scc_ams_code = "" end if //grab state, county and source rids MDY 1/2002 il_g_state_rid = 0 il_g_county_rid = 0 if il_g_source_rid > 0 then SELECT DISTINCT state_rid, county_rid INTO :il_g_state_rid, :il_g_county_rid DAT* FROM v_rap_sources WHERE source_rid = :il_g_source_rid; //if sql failed, set specific variables to 0 if (il_g_state_rid <=0 or isNull(il_g_state_rid)) & or (il_g_county_rid <=0 or isNull(il_g_county_rid)) then il_g_state_rid = 0 il_g_county_rid = 0 il_g_source_rid = 0 il_g_device_rid = 0 il_g_process_rid = 0 is_g_scc_ams_code = "" end if end if //set the external data level (i.e. the screen the user navigated here from) iDAT*f il_g_process_rid > 0 then ii_g_data_level = 5 //process and stream levels elseif il_g_device_rid > 0 then ii_g_data_level = 3 //device level (currently not supported; set to source level) elseif il_g_source_rid > 0 then ii_g_data_level = 3 //source level elseif il_g_county_rid > 0 then ii_g_data_level = 2 //county level elseif il_g_state_rid > 0 then ii_g_data_level = 1 //state level else ii_g_data_level = 0 //generic end if //set the scc ams code filter string (tDAT*o be applied as needed elsewhere) if (not isnull(is_g_scc_ams_code)) and (is_g_scc_ams_code <> "") then is_curSCCFilter = "scc_ams_code = '" + trim(is_g_scc_ams_code) + "'" st_sccFilter.text = "Filtered by SCC/AMS Code: " + trim(is_g_scc_ams_code) else is_curSCCFilter = "" end if // Retrieve the data for S - Source-specific Emission Factor // 04/10/96 SJS commented out wf_dwmodify - no longer needed because outer // join was removed from the datawindow select statement //DAT*  if Not wf_dwmodify() then return //*** commented out by MDY 4/27/98. Done dynamically by radio button. //is_factor_type = 'S' //dw_1.retrieve(is_factor_type, il_g_process_rid) //*** // Do not filter on scc ams code. 11/21/94, swj //if (not isnull(gs_scc_ams_code)) and (gs_scc_ams_code <> "") then // dw_1.setfilter("scc_ams_code = '"+gs_scc_ams_code+" '") // dw_1.filter() //end if dw_1.SetFocus() r_1.hide() st_select_factor_type.setPosition(toTop!) end event on w_emissDAT*ied in the contact view. Save current changes?uf_save4uf_undo_dw_contact_master<uf_undo_dw_contact_detail;#$<$$ib_new_master(:ib_new_detailen@; 4 P X         8 P $),84$8<JP8$1zX$8`t$)8DAT*$8<)8" L d tzd ll_cur_rowll_rid_num(H dw_contact_masterP#getrowm$#ridgetitemnumber @#ref_ridil_ref_ridh8setitemO|#O| , 4 P X t    $$$)488<JP8l$)8DAT*1$8J8$8)8z F h d) ll_row_numll_cur_rowll_rid_num<P dw_contact_master##getrow,ridgetitemnumber @dw_contact_detailX$rowcount4tX$rap_contact_reasons_contact_rid @X$setitemO DAT* $ 4 P l      $)081,8$@$)P88XJl8$,$)8$)8, r d ll_contact_ridsqlca($@&P dw_contact_master#rowcountetr4$##getrowHridgetitemnumber \dw_contact_detaDAT*"ilt$settransobjects^t$retrieve2 0 8 @ P l     b0$,$)H8P$X$)l8 4d ref_ridsqlca($@&t0 il_ref_ridm8dw_contact_mastertr#settransobject^8#8retrieve2` 0 H P X DAT*$l $)088$)L810T$:@)l81t$1:@)8:@$)8$)8,1RL$:@)81$1:@)8:@$)8$DAT*&)81R0 > L Z,0>jz "#%d rownumtotalrow(  dw_contact_detail$accepttextr$$rowcount4@$getnextmodifieds\$getitemstatusoup|$deleterow$reselectrow.$s\$p|$$.DAT*( 0 8 L T l t              $)08H$fP$X$)h8)|8$$)8)8)8, b f d ` dw_contact_master#accepttext$ib_new_master18:##getrowDAT**`deleterowp##`reselectrow.uf_retrieve_dw_contact_detail9 0 H P X h |      $8)(80$)@8H$1)`8h$9)|8$:NW@)8$8)8" > f d uo_namell_selected_row(DAT*, ` uidw_active7!setfiltereI7!filterm87!getselectedrowP7!selectrow@p7!triggerevent 7!total_index_t.Text='' total_index_t.Color=553648127modifyz ( 0 @ H ` h |     9}808%8Lz%:)@:@1@81<l:F@DAT*.@8,"8Z0)880)8$#)811)81<t,$)8,"80)8:NW@)8,$,"8 0)48808<0@8f l $8Vptzd dw_objw_mdi_mainsqlca< !"@%DAT*0$@&PP ib_deletee<ContactsYou are about to delete this record. Are you sure?Checking related records ...setmicrohelpZwdelete_rowtriggerevent <uf_cascade_del?deleteroworesetupdate{Row deleted successfully.RAZw Row not deleted.ZwNo records deleted.         4 ^$$68$DAT*20$8$)H88PJd86981$68l1Y(@(8z'8z&:)@:@1@8}61}1<x6981N$$)88J8$$)88)H8,$ ,$DAT*4P$1N1 "6| $6Jtx "$&')&,Nd+ sznamesztypenridncntnindsqlcax   %$@&Xx uidw_active7!d_contact%7!7!getrow@RIDgetitemnumber TDeleting this record will also delete child records. Do you want to continuDAT*6e?87!7!@RAP_CONTACT_REASONS_CONTACT_RID T7!7!@RAP_CONTACT_REASONS_REASON_CODEgetitemstring8  0 8 H d        H P p:F@@8*@8,+j+9}80)8 : B Nd& table_namew_filtergb_filter< DAT*8*@)+@$ filtertriggerevent  f$)810 )(8)881@86~@~8 68@ \$8d0l688tJ88J86$6DAT*:8`8t $8d&68# 8@!$!b8@J88J86$68`8 ` $8dX(68# 8@!0$!DAT*<8@J88# 8t!@$! 8tJH86P$680 J d | 0X&R ^!b#$&' (&*X+,-/0124 dh p_winp_dwp_col_namels_cityls_nationls_statell_templl_cur_rowls_templs_col_namecase16 "DAT*> ! &09AL T ` X getrowgetcolumnnamegettext0mail_city_ridis_city_sqlN)nullN)mail_state_ridgetitemnumber mail_country_rid N)is_state_sql((ib_itemchanged=  (is_nation_sqltc''DAT*@= = ' ( 8 \ l            ( 0 8 @ H P p%8")<81<lD$68L8hz%@8$88"08$z%8z&)88@80DAT*B6@8,$)8)88),81<4$68<8hz%@8\$8(d808|$z%8z&806@8)88806@8,$)8)88)DAT*D81<j$688hz%@8$8808$z%8z&)88>806@8,$)8) 80f l :@Xl!"%('N)t+,-0134.6d9j:=?ABC8F>GVd6DAT*F p_winp_dwdwcls_errls_new_sqlls_sqlsqlca " !   )0$@&( DataWindow.Table.Select="mail_city_ridgetchildo0 Application Error: City - Not a DataWindowChild. Contact your technical support.is_city_sql)null))"modify Modify Failedsettransobjectretrieve|mail_staDAT*Hte_rido0 Application Error: State - ))is_state_sqll(debug|mail_country_rido0 Application Error: Nation - ))is_nation_sql$'|< D       , 4 \ d |             |688DAT*J"J9808 08>0B8C8"98R08\08{0B8B808080)81<808z%8z&@89,$)L898Tz%z&1)d8)t98DAT*L1l8|z%8z%@89v9$@J \"n#%&()*+, -.02B3p58<>BC.D^EhFlda pdw_objps_col_nameps_entered_datadwcls_rid_colls_name_colls_col_textcase25sqlca !  , 0 ; G S [$@& DAT*N mail_city_ridcity_ridrap_geographic_locations_cityCitymail_state_ridstate_ridrap_geographic_locations_stateStatemail_country_ridcountry_ridrap_geographic_locations_nationCountrygetchildouf_validate_locationApplication Error: - Not a DataWindowChild. Contact your technical support.settransobject; = rowcountgeXfindlColumn - Sorry! Not a valid L d t ,$,$88,z% DAT*P81<R$$)886)8  LRd$ pl_city_ridls_countysqlca< $@& Fail on selecting county name from rap_geographic_locations table. Contact your technical support.dw_contact_masterl#l#getrowrcounty_namesetitemP    *$@DAT*R*Hd*l***$$$$$$ |,BXnd  st_no_record_whiteo!st_no_record_grey,",dw_contact_masterP#Pdw_contact_detailret$tr_1%r_2& controlc@!,"P#t$DAT*T%&  $@ Hd l          Z$8$T$p$|$$*8Fd 0 st_no_record_whiteo!st_no_record_greyrd$"dw_contact_master_c@#dw_contact_detail\$r_1x%r_2&  8 T p | DAT*V 123456789: ; < = > ?@ABCDP1o32  +filter+unfilter+highlight_dddwuf_saveuf_check_requireduf_check_pendinguf_check_master_riduf_check_detail_riduf_retrieve_dw_contact_detailuf_retrieve_dw_contact_masteruf_undo_dw_contact_detailuf_undo_dw_contact_masteruf_select_alluf_deleteuf_cascade_deluf_select_oneuf_retrieve_locationsuf_set_default_sqluf_validDAT*Xate_locationuf_find_countyf_get_sequencef_del_recsf_get_sqlf_retrieve_locationsf_db_error+create+destroy*2DUi}     "8KDAT*Z`o%:d@~(<~(-,d@-,8!-,-!,:,<,$.")92  widthheightborderbackcolorpicturemaskcolortabtextcolortabbackcolorst_no_record_whitest_no_record_greydw_contact_masterdw_contact_detailr_1r_2is_nation_sqlDAT*\is_state_sqlis_city_sqluis_nationuis_display_nameuis_orig_nation_sqluis_orig_city_sqluidwc_dw_childuis_data_nameuis_validation_tableuis_msg_nameuis_msg_textuis_old_valueuis_column_nameuil_selected_rowuis_column_statusuidw_activeil_ref_ridis_orig_sqlib_new_masterib_new_detailib_deleteib_itemchangedil_city_rid$ &7DQ DAT*^d v    an  d@(i_=JW!eu!idMEDAT*`!git] o$  @@1    @         DAT*b! 1P $2Q( <x3o8T4@T5RT6cV7wV8V9DAT*ddX: V; V<  th=  > *? D@hA~B@CdPDAT*fDLV!TV"2  2 xywidthheightvisibleenabledtextalignmentfocusrectangletextcolorbackcolortextsizeweightfacenamefontfamilyfontpitch@  D!).8GDAT*hQ[dkt] D @ @2  2 xywidthheightvisibleenabledtextalignmentfocusrectangletextcolorbacDAT*jkcolortextsizeweightfacenamefontfamilyfontpitch@  D!@).8GQ[dkt] D @DAT*l @     F)8, ,1:, $d" +wparam+lparam::message<  @$  uf_save4  \)8(DAT*n)48, B1P, <$(d" +wparam+lparam::message<  @$D uf_check_pending6uf_select_all=$ 4 < d)808$0)@8, J1X, H$0d" +wparam+lparam::message< DAT*p @$P uf_check_pending6rap_contactsuf_select_one@1 @ H  $1r)48L$r)\8d$|$)88 $8)8,$)8$)8($**D$6L88T0)p8DAT*r, 1, x$0J  Vrd( ls_col_namedwcsqlca::messageP  $@& @$ uil_selected_row5getcolumnname$uis_column_name<4getrowT<4uis_old_valuel3setitemOmail_city_ridil_city_rid2>l3mail_city_rid_2getchildosettransobjectDAT*t>retrieveOR}uidwc_dw_child. uis_display_name0+5highlight_dddwpostevent@c 4 L \ d |        ( D L p x H)8, .1<, $d" +wparam+lparam::message<  @$$ uf_deleteed>DAT*v  #: *@l@l8|$1|)48L$|)\8d$|$$$J8;)8@8@8,")8 68 @)8#1!8)880)@88DAT*x)H88PJ\8;)d88l0)|88l)88J8;)81)88J88)8,$)8$),8<)48|8l |)<8#1!>8l)D880)L8DAT*z8)T88PJ\8;)d88)l8|)t88)|8, 1, $4 L f ~(8Ld4~ !"#$'<(T)l*+,/2:3>7\F|du keykeyflagsls_col_namels_nullls_templl_cur_rowll_nulldwclw_windoww_mdi_maincase17sqlca::messageDAT*|#   ! ) 1<D H "R"@%] e$@&k @$8 uil_selected_row5getcolumnname$uis_column_name<4getrowT<4uidwc_dw_childl. 5uis_data_name/getitemnumber@WsetitemOgetactivesheet7mail_cDAT*ity_ridgettextgetchildomail_country_riduf_retrieve_locationsA)bTcountry_ridWOmail_state_ridA)bTstate_ridWOil_city_rid>getselectedrowgcity_ridWmail_city_rid_2osettransobject>retrieve} OoA)bTWOOOO 4 L \ d |     DAT*forward global type w_emission_growth_factor from w_single_table end type end forward global type w_emission_growth_factor from w_single_table int Width=2926 int Height=1564 boolean TitleBar=true string Title="Growth (factors)" end type global w_emission_growth_factor w_emission_growth_factor type variables boolean ib_retrieving boolean ib_addrec=false //process specific information long il_processRid = -1 long il_countyRid = -1 long il_stateRid = -1 string is_stateName stDAT*ring is_countyName string is_sccAmsCode //cached state rid //managed by of_sync_county_dddw() long il_stateRidLast = -1 end variables forward prototypes public function boolean wf_check_rid () public function integer of_retrieve_dddw () public function integer of_sync_county_dddw () public function integer of_get_county_rid (long al_row) public function integer of_add_row (long al_row) public function boolean of_scc_lookup (long al_row) end prototypes public function booleaDAT*n wf_check_rid (); //load rid values into any new rows long ll_row long ll_rid long ll_rc for ll_row = 1 to idw_active.rowCount() //check the record rid ll_rid = idw_active.getItemNumber(ll_row, "rid") if ll_rid < 0 then return FALSE if isNull(ll_rid) then //get new rid from database ll_rid = f_get_sequence() if ll_rid < 0 then return FALSE ll_rc = idw_active.setItem(ll_row, "rid", ll_rid) if ll_rc < 0 then return FALSE end if //check the coDAT*unty_rid ll_rid = idw_active.getItemNumber(ll_row, "county_rid") if ll_rid < 0 then return FALSE if isNull(ll_rid) then //copy county rid from county dddw ll_rc = this.of_get_county_rid(ll_row) if ll_rc < 0 then return FALSE end if next return TRUE end function public function integer of_retrieve_dddw (); //retrieve all of the dddws for dw_1 and dw_2 data window datawindowchild ldwc long ll_rc setPointer(hourGlass!) //insert row into county drDAT*op down to supress retrieval argument dialogue ll_rc = dw_1.getChild("county_name", ldwc) ll_rc = ldwc.setTransObject(SQLCA) ll_rc = ldwc.insertRow(0) ll_rc = dw_2.getChild("county_name", ldwc) ll_rc = ldwc.setTransObject(SQLCA) ll_rc = ldwc.insertRow(0) //retrieve the state drop down ll_rc = dw_1.getChild("state_rid", ldwc) ll_rc = ldwc.setTransObject(SQLCA) ll_rc = ldwc.retrieve() ll_rc = dw_2.getChild("state_rid", ldwc) ll_rc = ldwc.setTransObject(SQLCA) ll_rc = ldwc.retrieveDAT*() //retrieve the material drop down ll_rc = dw_1.getChild("material_code", ldwc) ll_rc = ldwc.setTransObject(SQLCA) ll_rc = ldwc.retrieve() ll_rc = dw_2.getChild("material_code", ldwc) ll_rc = ldwc.setTransObject(SQLCA) ll_rc = ldwc.retrieve() return 1 end function public function integer of_sync_county_dddw (); //synchronize the county list with the current state dataWindowChild ldwc long ll_row long ll_rc long ll_stateRid ll_row = idw_active.getRow() if ll_row il_stateRidLast then //clear county drDAT*op down if current state rid is null ll_rc = ldwc.retrieve(ll_stateRid) il_stateRidLast = ll_stateRid end if return 1 end function public function integer of_get_county_rid (long al_row); //get the county rid for the state rid and county name on the given row long ll_stateRid long ll_countyRid string ls_countyName long ll_rc ll_stateRid = idw_active.getItemNumber(al_row, "state_rid") if ll_stateRid < 0 then return -1 ls_countyName = idw_active.getItemString(al_row, "cDAT*ounty_name") if ls_countyName = "" then return -1 SELECT rap_geographic_locations.rid INTO :ll_countyRid FROM rap_geographic_locations WHERE ( rap_geographic_locations.parent_rid = :ll_stateRid ) AND ( rap_geographic_locations.name = :ls_countyName ) AND ( rap_geographic_locations.type = 'COUNTY' ) ; if f_sqlCheck(SQLCA) < 0 then return -1 ll_rc = idw_active.setItem(al_row, "county_rid", ll_countyRid) if ll_rc < 0 then return -1 return DAT*1 end function public function integer of_add_row (long al_row); //insert the state_rid, county_rid, county_name and scc_ams_code //if opened from process window long ll_rc if il_processRid > 0 then ll_rc = idw_active.setItem(al_row, "state_rid", il_stateRid) ll_rc = idw_active.setItem(al_row, "county_rid", il_countyRid) ll_rc = idw_active.setItem(al_row, "county_name", is_countyName) ll_rc = idw_active.setItem(al_row, "scc_ams_code", is_sccAmsCode) end if return 1 endDAT* function public function boolean of_scc_lookup (long al_row); //opens the scc code lookup window string ls_scc_ams_code if al_row > 0 then idw_active.AcceptText() ls_scc_ams_code = idw_active.GetItemString(al_row, 'scc_ams_code') else return FALSE end if return f_look_up(idw_active, "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, inveDAT*ntory_invalid_flag, " + & "mode_type, tier_code, unit_code " + & "from rap_scc_ams_codes order by code", ls_scc_ams_code) end function event open;call super::open; string ls_filter long ll_rc // Set up variable for handling menu behavior is_state = 'single' //single table window //instructions commented in ancestor dw_1.SetTransObject(SQLCA) dw_2.SetTransObject(SQLCA) dw_1.SetFocus() //handle process specific details if not isNull(gd_process_rid) and gd_process_rDAT*id > 0 then //grab the current process rid il_processRid = gd_process_rid SELECT 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 INTO :il_stateRid, :is_stateName, :il_countyRid, :is_countyName, :is_sccAmsCode FROM v_rap_ss_scc WHERE v_rap_ss_scc.source_sub2_rid = :gd_process_rid ; if fDAT*_sqlCheck(SQLCA) < 0 then post close(this) return -1 end if ls_filter = "county_rid = " + string(il_countyRid) + " AND scc_ams_code = '" +& is_sccAmsCode + "'" dw_1.setFilter(ls_filter) end if this.of_retrieve_dddw() //retrieve the growth factors dw_1.retrieve() //apply filter dw_1.filter() end event on w_emission_growth_factor.create call super::create end on on w_emission_growth_factor.destroy call super::destroy end on event ue_open_filtDAT*er_win;call super::ue_open_filter_win;// Open the filter window with parameter - table name OpenWithParm(w_filter, 'rap_growth_factors') end event type st_no_record_grey from w_single_table`st_no_record_grey within w_emission_growth_factor string Text="P:\rapids\GLC\Dev60\rap_dw1.pbl" end type type dw_2 from w_single_table`dw_2 within w_emission_growth_factor int X=73 int Y=96 int Width=2761 int Height=1232 string DataObject="d_growth_factors_freeform" boolean Border=true BorderStDAT*yle BorderStyle=StyleLowered! end type event dw_2::itemchanged;call super::itemchanged; choose case dwo.name case "county_name" //if county name changed, copy rid into county_rid column parent.post function of_get_county_rid(row) end choose return 0 //accept data value end event event dw_2::itemfocuschanged; choose case dwo.name case "county_name" //if current column is county rid, synchronize the county dddw //with current state rid by filtering outDAT* counties that are not //in the current state parent.of_sync_county_dddw() end choose end event event dw_2::add_row;call super::add_row; parent.of_add_row(this.getRow()) end event event dw_2::rbuttondown; this.ib_obj_modified = parent.of_scc_lookup(row) end event type dw_1 from w_single_table`dw_1 within w_emission_growth_factor int X=73 int Width=2761 int Height=1232 string DataObject="d_growth_factors" end type event dw_1::add_row;call super::add_row; paDAT*rent.of_add_row(this.getRow()) end event event dw_1::rbuttondown; this.ib_obj_modified = parent.of_scc_lookup(row) end event event dw_1::itemfocuschanged; choose case dwo.name case "county_name" //if current column is county rid, synchronize the county dddw //with current state rid by filtering out counties that are not //in the current state parent.of_sync_county_dddw() end choose end event event dw_1::itemchanged;call super::itemchanged; choose cDAT*ase dwo.name case "county_name" //if county name changed, copy rid into county_rid column parent.post function of_get_county_rid(row) end choose return 0 //accept data value end event DAT*   @ H \ d |          , 4 < D L T \ d l t |  F)8, ,1:, $d" +wparam+lparam::message<  @$$ accepttextd  h2DAT*8$)(8, N1\, 0$4d& ancestorreturnvalue::message( @$8 losefocusr_1%hide  ( 0 > .8$)(8,")@8)T868\,1p8x,38DAT*,5, $12, $4 Nhx6 dx ancestorreturnvaluelw_active_sheetlw_active_sheet_namew_mdi_maincase14w_legalw_sourcew_device::message ", A"@%L T1@*\3@+e5@,n @$H getfocusr_1DAT*%show getactivesheet70classnameHw_legalidw_actived1%w_sourced1%w_deviced1%uidw_active7! ( @ T p     h 98) 81<$)L8)\88dJ818)8,$)8)8)84DAT*$)8,$)<8, N1\, D$8T 4dE rowcountancestorreturnvaluell_city_riddwcsqlca::messagex%1 5$@&; @$Lp retrieveendrowcount4st_no_record_greyhe("hidelasDgetrowTmail_city_ridgetitemnumber rDAT*mail_city_rid_2getchildosettransobjectretrieve}uf_retrieve_dw_contact_detail9("show$dw_contact_detail$reset/4 < L \        , < D 8<8,")(8)<8)L8)`811!|$)8$8DAT*80)8$8"80)8$8`8$0)888JP8#8)`818h)8,$)8)88J8#d8)88$J8#8$)DAT*8)8$)8,$)<8, 1,, D$6 H ` ">`!"8#D%d&'*,014dn currentrowancestorreturnvaluelw_windowll_ridll_cur_rowll_city_riddwcw_mdi_mainsqlca::message' "18CDAT*O S"@%^$@&d @$L rowfocuschangedgetactivesheet7accepttexte0getrowsDrowcount4Tst_no_record_greyh"hideailis_city_sql)nullmail_city_riduf_retrieve_locationsAis_state_sql(mail_state_ridAis_nation_sql_c 'mail_country_rid@Agetitemnumber@ @setitemOXmail_city_rid_2getchilddw_oxsettransobjectDAT*retrieve2w} @OX @OXuf_retrieve_dw_contact_detail9h"showdw_contact_detail$reset/4( < L ` |       8 P `           , < D +6/8,")$8@8@DAT*8)<8)L88T8b"6)|8)8# 1$)88080 8#$6$6@81, 1, $(9}68T )08 # 1!8T )DDAT*88L0)t88L  )|88J8;)88b0)88b  )88J8;)8  1)88J88$ )48 ,$)L8 T$)h8)p8T8bT )x8 # 1!8DAT*b )88L0)88L  )88J8;)88T)8@)88T)89}, n1|, $( B ^ z  *f!"$%&('J(j)*+.B1234589:0;R<r=@CDH J@STd rDAT*owdwodataancestorreturnvaluell_row_numberll_nullll_cur_rowls_col_namels_nulldwcls_cityls_statels_nationls_templw_windoww_mdi_main::messagecase34sqlca|  )7?J V ^ bjs}  ""@%DAT* @$ $@&@ itemchangedgetactivesheet7getcolumnname,getrowDmail_city_ridmail_state_ridgettextquf_validate_locationCuis_column_name4qridrap_geographic_locationsuis_msg_name1uis_msg_text#2ib_itemchanged=qgetchildo8mail_country_riduf_retrieve_locationsA]bDcountry_ridgetitemnumberWsetitemOA]DAT*bDstate_ridWOil_city_rid>getselectedrowgcity_ridWmail_city_rid_2o8settransobject<>retrieve }\Oqo8A]bDWOOOO=$ < L |       ( 0 D t |          4 L T h pDAT* x            8)$8@$)P8)`8)t8)8:NW@)89}9}1, 1, $4Pr d6 +wparam+lparamancestorreturnvalue::messageP DAT*, @$X add_rowuf_check_pending86st_no_record_grey8,"hideHgetrowXinsertrow(hscrollpriorrow>|triggerevent ib_obj_modifiedib_new_master:il_city_rid>$ @ P ` t       2%18)(8,")@86)DAT*`88h1)86808$0D8L0t8|080)8J88 1)8$6,840T8\0h8L0pDAT*8x080)8J881)86808$008L088@0P8X0t)|8J880, 1&, $ 8 R r DAT*(B\4 N!h"#$%&'&(@)Z*t+,./2dj rowdwoancestorreturnvaluels_col_namels_cityls_statels_nationlw_windoww_mdi_main::message $ 08AK "U"@%` @$H itemfocuschangedgetcolumnnamegetacDAT*tivesheet70uf_retrieve_locationsAHmail_city_riduil_selected_rowv5uidwc_dw_child. getchildouis_column_name4uis_display_name+rap_geographic_locations_cityuis_data_name/city_riduis_validation_table-0rap_geographic_locationsuis_msg_namee1Column - Cityuis_msg_text2Sorry! Not a valid cityuis_old_value3getrowgetitemnumber mail_country_ridv5. o4DAT*+rap_geographic_locations_nation/country_rid-0e1Column - Nation2Sorry! Not a valid nation3 mail_state_ridv5. o4+rap_geographic_locations_state/state_rid-0e1Column - State2Sorry! Not a valid state3 4( @ `       D t       DAT*  $ , T h p           0 8 P t |    8$1)48L$d$l$$J8)8$)88\8) 8,$)$8DAT*,$)@8,")X88)`88h0)88h)88J8;)880)88)88J8;)88@8@88)8_@_811 11@8 @ DAT*810 J &F`Xp"#&dY ls_col_namels_nullll_geo_ridll_nullll_cur_rowdwclw_windowsqlcaw_mdi_main  '/: > "H$@&N"@% uil_selected_row85getcolumnname$uis_column_name<4uidwc_dwDAT*_childT. 5uis_data_namet/getitemnumber1Wgetrow<4setitemOmail_city_ridil_city_rid>mail_city_rid_2getchildosettransobject>retrieve}4getactivesheet@7Homail_country_riduf_retrieve_locationssAybcountry_ridWOmail_state_ridAybstate_ridmnWOO 4 L d l      DAT*   $ , @ X `          6-8)$8<$Xp$**$68$180)8, 1, $(@Z dB +row+dwo+dataancestorreturnvaluelsDAT*_col_name::messagex  , 8 @$H editchangedgetcolumnnameuis_column_name,4uil_selected_rowidwD5uidwc_dw_child`. uis_display_namex+D5D5highlight_dddwposteventeti$ < X p      :6081dDAT*) rowdwodataancestorreturnvalueP   itemerrorh8 9}, N1\, ($ 4d6 +wparam+lparamancestorreturnvalue::messageP , @$0 delete_rowib_delete< ( DAT*|8,"$6)08, b1p, 8$$HdD +flags+xpos+yposancestorreturnvaluew_mdi_main::messagex /"@%: @$@ mousemovetagsetmicrohelpZ  0 8 8)$8VDAT*)88)L8, p1~, T$4Vd6 +wparam+lparamancestorreturnvalue::messageP , @$\ last_rowuf_check_pending6rowcount4,scrolltorow?@$ 8 L T 8)$8L1)88, f1t, @$DAT*4Ld6 +wparam+lparamancestorreturnvalue::messageP , @$H first_rowuf_check_pending6scrolltorow?,$ 8 @ z8)$8F)<8, `1n, D$4Fd6 +wparam+lparamancestorreturnvalue::messagePDAT* , @$L prev_rowuf_check_pending6scrollpriorrow>,$ < D z8)$8F)<8, `1n, D$4Fd6 +wparam+lparamancestorreturnvalue::messageP , @$L next_rowuf_check_pendiDAT*ng6scrollnextrow<,$ < D -./ 01 29 <  OPQRSTcdef}-&/1029<.2 4 +save+select_all+select_one+dwescape+validate_delete+dwnkey+gettextf_dddw_search+losefocus+getfocus+retrieveend+rowfocuschanged+itemchangedf_validate_code+add_rowDAT*+itemfocuschanged+dwnprocessenter+editchanged+itemerror+delete_row+mousemove+last_row+first_row+prev_row+next_row&0AIR/`ku   6  R/DAT* $ *2 @ xywidthheighttaborderdataobjectborderborderstyle  ! "1-4] o !  @ 1DAT*   \e tc xd  f+3 }]2hDAT*. {dX9 dh< t/   O1 - 0 0P1lHDAT*windows for adding seasonal adjustment factors - 3/12/98 mlkforward global type w_emission_saf from w_single_table end type end forward global type w_emission_saf from w_single_table int Width=2930 int Height=1564 boolean TitleBar=true string Title="Seasonal Adjustment (factors)" end type global w_emission_saf w_emission_saf type variables boolean ib_retrieving end variables forward prototypes public function integer wf_retrieve_dddw (string as_column, any a_retrieve) public DAT*subroutine wf_freeform_view () public subroutine wf_tabular_view () public function boolean of_scc_lookup (long al_row) end prototypes public function integer wf_retrieve_dddw (string as_column, any a_retrieve); DataWindowChild state_child integer rtncode rtncode = idw_active.GetChild(as_column, state_child) IF rtncode = -1 THEN MessageBox( "Error", "Not a DataWindowChild") return -1 // Establish the connection if not already connected else // Set the transaction oDAT*bject for the child state_child.SetTransObject(SQLCA) // Populate the child with values for eastern states state_child.Retrieve(a_retrieve) end if return 1 end function public subroutine wf_freeform_view ();idw_active = this.dw_2 if dw_1.rowCount() = 0 then wf_retrieve_dddw("name",895004) elseif isnull(dw_1.object.geographic_state_rid[dw_1.GetRow()]) then wf_retrieve_dddw("name",895004) else wf_retrieve_dddw("name",dw_1.object.geographic_state_rid[dw_1.GetRow(DAT*)]) end if super::wf_freeform_view() end subroutine public subroutine wf_tabular_view ();super::wf_tabular_view() idw_active = this.dw_1 if idw_active.rowCount() = 0 then wf_retrieve_dddw("name",895004) elseif isnull(idw_active.object.geographic_state_rid[idw_active.GetRow()]) then wf_retrieve_dddw("name",895004) else wf_retrieve_dddw("name",idw_active.object.geographic_state_rid[idw_Active.GetRow()]) end if end subroutine public function boolean of_scc_lookup (long al_DAT*row); //opens the scc code lookup window string ls_scc_ams_code if al_row > 0 then idw_active.AcceptText() ls_scc_ams_code = idw_active.GetItemString(al_row, 'scc_ams_code') else return FALSE end if return f_look_up(idw_active, "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_codeDAT* " + & "from rap_scc_ams_codes order by code", ls_scc_ams_code) end function event open;call super::open;long ll_row_number long ll_debug_num_retrieval_rows // Set up variable for handling menu behavior is_state = 'single' idw_active = this.dw_1 if wf_retrieve_dddw("name",895004) > 0 then dw_1.SetTransObject(SQLCA) if dw_1.Retrieve() > 0 then wf_retrieve_dddw("name",dw_1.object.geographic_state_rid[dw_1.GetRow()]) end if dw_1.SetFocus() else messagebox('ErrDAT*or','Unable to populate Seasonal adj factor tables') close(this) end if end event on w_emission_saf.create call super::create end on on w_emission_saf.destroy call super::destroy end on event ue_open_filter_win;call super::ue_open_filter_win;// Open the filter window with parameter - table name OpenWithParm(w_filter, 'rap_seasonal_adj_factor') end event type dw_2 from w_single_table`dw_2 within w_emission_saf int X=101 int Y=104 int Width=2551 int Height=1216 string DataDAT*Object="d_seasonal_adj_factor_freeform" end type event dw_2::mousemove; if this.GetColumnName() ='saf' then W_mdi_main.SetMicroHelp("Enter A Number Between 0 and 1") else W_mdi_main.SetMicroHelp("Ready") End if end event event dw_2::itemchanged;call super::itemchanged;datawindowchild ldw_child string ls_str int li_int setnull(ls_str) setnull(li_int) choose case dwo.name case 'geographic_state_rid' wf_retrieve_dddw("name",long(data)) // blank out county nameDAT* because state/county is no longer valid this.object.name[row] = ls_str this.object.geographic_county_rid[row] = li_int case 'name' // update county name to = county rid this.getchild('name',ldw_child) this.object.geographic_county_rid[row] = & ldw_child.getitemNumber(ldw_child.getrow(),'rid') end choose end event event dw_2::itemfocuschanged;call super::itemfocuschanged;if dwo.name ='saf' then W_mdi_main.SetMicroHelp("Enter A Number Between 0 and 1") else DAT*w_mdi_main.SetMicroHelp("Ready") End if end event event dw_2::retrieveend;call super::retrieveend;ib_retrieving = false end event event dw_2::retrievestart;call super::retrievestart;ib_retrieving = true end event event dw_2::rowfocuschanged;call super::rowfocuschanged;datawindowchild ldw_child long ll_row string ls_string if not ib_retrieving then if isnull(currentrow) and this.RowCount() > 0 then currentrow = this.GetRow() end if if currentrow > 0 and this.GetRow() DAT*> 0 then if not isnull(this.object.geographic_state_rid[currentrow]) then wf_retrieve_dddw("name",this.object.geographic_state_rid[currentrow]) else wf_retrieve_dddw("name",895004) end if this.getchild("name",ldw_child) ls_string = "rid="+string(this.object.geographic_county_rid[currentrow]) ll_row = ldw_child.find(ls_string,1,ldw_child.rowCount()) if ll_row > 0 then ldw_child.ScrollToRow(ll_row) ldw_child.SelectRow(ll_row,true) end if end if eDAT* nd if end event type dw_1 from w_single_table`dw_1 within w_emission_saf int Width=2583 int Height=1240 string DataObject="d_seasonal_adj_factor" end type event dw_1::itemchanged;call super::itemchanged;datawindowchild ldw_child string ls_str int li_int setnull(ls_str) setnull(li_int) choose case dwo.name case 'geographic_state_rid' wf_retrieve_dddw("name",long(data)) // blank out county name because state/county is no longer valid this.object.name[row] = ls_strDAT*  this.object.geographic_county_rid[row] = li_int case 'name' // update county name to = county rid this.getchild('name',ldw_child) this.object.geographic_county_rid[row] = & ldw_child.getitemNumber(ldw_child.getrow(),'rid') end choose end event event dw_1::rowfocuschanged;call super::rowfocuschanged;datawindowchild ldw_child long ll_row string ls_string if not ib_retrieving then if isnull(currentrow) then currentrow = this.GetRow() end if if currentDAT*!row > 0 then if not isnull(this.object.geographic_state_rid[currentrow]) then wf_retrieve_dddw("name",this.object.geographic_state_rid[currentrow]) else wf_retrieve_dddw("name",895004) end if this.getchild("name",ldw_child) ls_string = "rid="+string(this.object.geographic_county_rid[currentrow]) ll_row = ldw_child.find(ls_string,1,ldw_child.rowCount()) if ll_row > 0 then ldw_child.ScrollToRow(ll_row) ldw_child.SelectRow(ll_row,true) end if end iDAT*< tTF QQ R[ S     d)808$0)H8, J1X, P$0d" +wparam+lparam::message<pe fin DAT*@$X uf_check_pending6rap_contact_reasonsuf_select_one@8 H P \)8()48, B1P, <$(d" +wparam+lparam::message<  @$D uf_check_pending6uf_select_all=$ 4 < F)8, ,1:, DAT*$d" +wparam+lparam::message<  @$  uf_save4  H)8, .1<, $d" +wparam+lparam::message<  @$$ uf_delete>  > .8$)(8DAT*,")@8)T868\,1p8x,38,5, $12, $4 Nhx dx ancestorreturnvaluelw_active_sheetlw_active_sheet_namew_mdi_maincase14w_legalw_sourcew_device::message "DAT*, A"@%L T1@*\3@+e5@,n @$H getfocusr_2& show getactivesheet70classnameHw_legalidw_actived1%w_sourced1%w_deviced1%uidw_active7! ( @ T p     <8)$81X@$)P8tDAT*X$)h8, 1, p$8TXtd2 +currentrowancestorreturnvalue::message<( @$x0 rowfocuschangedrowcounthow4st_no_record_white,!shownamH,!hide`$ @ P X h p ^6/8)$88,*8,)XDAT*81<h$68p8z%@8, 1, $)88)88)8) 8, D1R, ($(H v *d7 rowdwodataancestorreturnvaluedwc::messagex  ) - @$0H itemchangedgeDAT*tcolumnnameowrap_contact_reasons_reason_codegetchildoLtitle` Application Error: Reason Code - No DataWindowChild. Contact your technical support.getrowrap_reasons_namebnamegetitemstring[setitemP$ X h       ( 98) 81X<$)L8tT$)d8, 1DAT* , l$8TXtd0 +rowcountancestorreturnvalue::message<& @$t0 retrieveendrowcount4st_no_record_white(!showD(!hide\ < L T d l 8$$)8818@08G0@8p$)8, 1DAT*", $n$$)88J8n8@080@8$)8, Z1h, $$$)48)<8)P8)h89}, 1, $ F n $@nd6 +wparam+lparamancestorreturnvalue::messagePDAT*$ , @$ add_rowdw_contact_master#rowcountwhi4,InsertPlease provide contact information first#setfocusx##getrowridgetitemnumber Please save contact information first#xst_no_record_white!hide,insertrow(Dscrollpriorrow>Xib_new_detailp;$ 8 p DAT*&         $ 4 < P h   h8 9}, N1\, ($ 4d6 +wparam+lparamancestorreturnvalue::messageP , @$0 delete_rowib_deleteste< ( f8DAT*() 8, L1Z, ($2d6 +wparam+lparamancestorreturnvalue::messageP , @$0 next_rowscrollnextrow< ( h28$)(8, N1\, 0$4d& ancestorreturnvalue::message(DAT** @$8 losefocusr_2& hide  ( 0 l81) 8, R1`, ($8d6 +wparam+lparamancestorreturnvalue::messageP , @$0 first_rowscrolltorow? ( |8,"DAT*,$6)08, b1p, 8$HdD +flags+xpos+yposancestorreturnvaluew_mdi_main::messagex /"@%: @$@ mousemovetagsetmicrohelpZ  0 8 v8)8)08, \1j, 8$DAT*.Bd6 +wparam+lparamancestorreturnvalue::messageP , @$@ last_rowrowcount4scrolltorow?$ 0 8 f8) 8, L1Z, ($2d6 +wparam+lparamancestorreturnvalue::messageP DAT*0, @$0 prev_rowscrollpriorrow> ( ./2 9<    OPQRSTcdef-&/29<.2 +select_one+select_all+save+validate_delete+getfocus+rowfocuschanged+itemchanged+retrieveend+add_row+delete_row+next_row+losefocus+first_row+mousemove+last_row+prev_row@DAT*2 &7AR_lu     2 E xywidthheighttaborderdataobjecthscrollbarhsplitscroll Q $";DAT*4-8] oQ $ @ ;@   c d (xe  @fh.DAT*6d</{d9 O ( P[ @ S]2 F X Q1lp < TQ DAT*8R2  2 I ywidthheightvisibleenabledlinethicknesslinecolorfillcolor  A' 5?]   A2  2 I ywidthheightvisibleenabledlinethiDAT*%cknesslinecolorfillcolorA  M'5?] A MDAT*<pe Type is required$setfocus$setrow@Q$setcolumnH $scrolltorow?<$ref_ridgetitemnumber@ `$il_ref_rid1setitemO4#4\4#sequence_no `Sorry! Sequence No is required4#4#Q4#H 4#?<4#sub_typeSorry! Sub Type is required4#4#Q4#H 4#?< , D L DAT*>T h p         , 4 H P p x               ( 0 D h p x      \$0$H$P$"L8X08f0:)@:@@8}}1<)8#9DAT*@L1<L)8)8$9} $9},9}D9}92lx $8Ld$ li_messagebox_returncase7(Lh dw_loc_master$ib_obj_modified dw_loc_detail8# Location ViewData have been modified in the location view. Save current chaDAT*Bnges?uf_save3uf_undo_dw_loc_master8uf_undo_dw_loc_detail7$ 8# ib_new_master3ib_new_detail44 0 H P         , D $),814$)D81"PL$T$)\88dJx8$)8Pd llDAT*D_group_ridP dw_loc_master$rowcountdif4 $getrowi<$$<ridgetitemnumber hdw_loc_detailvi#retrievecha2 , 4 D L T \ x   $),84$)H810P$:@)h81p$1:@)8:@DAT*F$)8$)8,1RL$:@)81$1:@)8:@$)8$)81R0 > L Z,0>jz "#%d rownumtotalrow(DAT*H dw_loc_detail#accepttextf #rowcount4<#getnextmodifiedsX#getitemstatuspx#deleterow#reselectrow.#sX#px##. , 4 H P h p              $),8D$fL$DAT*JT$)d8)x8$$)8)8)8, b f d ` dw_loc_master8$accepttext ib_new_master43$$getrow\deleterowl$$\reselectrow.uf_retrieve_dw_loc_detail6 , D L T d x      bDAT*L,$,#)D8L$T$)h8 4d ref_ridsqlca(#@%p0 il_ref_ride1dw_loc_master$settransobject^4$1retrieve2\ , D L T h $),814$)D8L$8TJh8$1DAT*Np$8T)8& H r d ll_cur_rowll_rid_num(@ dw_loc_master$rowcount4 $getrow<$ridgetitemnumber X$setitemOx , 4 D L h p  $ $)0888JL8d$)x81DAT*P$8J8$8)8z F h d) ll_row_numll_cur_rowll_rid_num<P dw_loc_master$$getrow(ridgetitemnumber <dw_loc_detailT#rowcount4lT#group_rid1 <T#setitemO  0 L d x  DAT*R   $8)(80$)@8H$1)`8h$9)|8$:NW@)8$8)8" > f d" uo_objectll_selected_row( ` uidw_active'!setfilterI'!filteri8'!getselectedrowiP'!selectrow@pDAT*T'!triggerevent '!total_index_t.Text='' total_index_t.Color=553648127modifyez ( 0 @ H ` h |     9}808%8Lz%:)@:@1@81<l:F@@8,!8Z0)880)8$#)8}1<1)8DAT*V1<99)81<,#)8,!80)8:NW@)$8,#,!8,0)@8808H0@8  fl8bh| "#d% dw_objncntw_mdi_mainsqlcaP !!@$#@%^X ib_deletee5LocationYou are about DAT*Xto delete this record. Are you sure?Validate the delete...setmicrohelpZqdelete_rowtriggerevent 5uf_cascade_del>deleterowgeupdateefresetupdate{Row deleted successfully.Zq Row not deleted.ZqCould not delete row.         $ @  $$68$8$@$)P88XJlDAT*Z88t0981 808(@(8z'8z&:)@:@1@8}21}1<v8t0981" 6 |  2Frvd! szwinnamenridncntnindP 0 uidw_activDAT*\e'!d_loc_coord_group:'!'!getrowHRIDgetitemnumber \d_loc_coordLocation GroupsDeleting this record will also delete child records. Do you want to continue?  8 @ P l p:F@@8)@8,*j*9}80)8 : B Nd& table_namew_filtergb_filter< )@(*DAT*@$ filtertriggerevent  *$@*H`*h***$$$$$$ |,BXnd st_no_record_white!st_no_record_grey,",dw_loc_detailP#Pdw_loc_masterp$prDAT*`Geographic location windowforward global type w_geo from w_master_detail end type type cb_parent from commandbutton within w_geo end type type cb_member from commandbutton within w_geo end type type cb_group from commandbutton within w_geo end type type cb_activity from commandbutton within w_geo end type type cb_location from commandbutton within w_geo end type type cb_member_2 from commandbutton within w_geo end type type uo_loc from u_dw_loc within w_geo end type type uo_act frDAT*bom u_dw_act_geo within w_geo end type type uo_group from u_dw_group_geo within w_geo end type type r_buttons from rectangle within w_geo end type end forward global type w_geo from w_master_detail int Width=2917 int Height=1564 boolean TitleBar=true string Title="Geographic" string Icon="GEO.ICO" event current_view pbm_custom31 event history_view pbm_custom32 event highlight_dddw pbm_custom33 cb_parent cb_parent cb_member cb_member cb_group cb_group cb_activity cb_activity cbDAT*d_location cb_location cb_member_2 cb_member_2 uo_loc uo_loc uo_act uo_act uo_group uo_group r_buttons r_buttons end type global w_geo w_geo type variables string is_unit_sql = "null" string is_msg_name string is_msg_text string is_validation_table string is_column_status = "valid" long il_selected_row datawindowchild idwc_dw_child string is_column_name string is_old_value string is_child_name string is_orig_sql_statement; string is_member_dw; string is_member_dw_freeform; sDAT*ftring is_activity_dw; string is_activity_dw_freeform; string is_level; string is_level_type; string is_selected_child_name; string is_highest_type='NATION'; integer ii_dw1_height; integer ii_dw2_height; integer ii_dw2_y; integer ii_cb_y; integer ii_parent_y; string is_current_btn; nvo_locations invo_locations; // declare an instance variable of the nonvisual type string is_use_type; string is_use_type_list; str_use_type istr_use_type; end variables forward prototypes public fuDAT*hnction boolean wf_check_required () public subroutine wf_draw_dw2 () public subroutine wf_row_changed () public subroutine wf_set_var () public subroutine wf_set_btns () public subroutine wf_detail_view () public subroutine wf_select_one () public subroutine wf_undo_uo () public subroutine wf_dropdown (string p_event, string p_screen, datawindow p_dw, window p_window) public subroutine wf_retrieve_city_dddw (datawindow dw_obj) public subroutine wf_retrieve_county_dddw (datawindow dw_obj)DAT*j public subroutine wf_enable_btn (boolean pb_enable) public function boolean wf_check_rid (datawindow dw_obj) public subroutine wf_clear_prev_style (string ps_style) public subroutine wf_get_from_rms (string as_level, long al_rid) end prototypes on current_view;call w_master_detail::current_view;// User Event // Purpose: Make uo_1 visible, show the snapshot view of activity data if Not wf_check_pending() then return SetPointer(HourGlass!) is_style_state = 'current' f_menu_behaveDAT*l(is_state, is_style_state, is_enlarge_state) // Show uo_1 uo_act.uf_prepare_dw(gl_geo_rid, is_level, is_style_state, '', '', '', '') uo_act.Show() uo_act.BringToTop = TRUE uo_act.dw_act_detail.SetFocus() 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, show the history view of activity data if Not wf_check_pending() then return SetPointer(HourGlass!) is_style_state = 'history' f_DAT*nmenu_behave(is_state, is_style_state, is_enlarge_state) // Show uo_act uo_act.uf_prepare_dw(gl_geo_rid, is_level, is_style_state, '', '', '', '') uo_act.Show() uo_act.BringToTop = TRUE w_mdi_main.is_act_style = is_style_state end on on highlight_dddw;call w_master_detail::highlight_dddw;////////////////////////////////////////////////////////////////////////// // // Purpose: Highlight the row which matches the closest to what is typed // in the edit portion of dddw // // Log: DAT*p // 5/31/94 SWJ Initial version // ////////////////////////////////////////////////////////////////////////// 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 i, totalRow if dw_1.AcceptText() < 0 then return false if dw_2.AcceptText() < 0 then return false if dw_3.AcceptText() < 0 then return false // Move to f_validate_act() for checking recursively //if is_state = "geo activity" thenDAT*r // if not f_check_dates(dw_2, "start_date_time", "end_date_time", "Start Date Time", "End Date Time") then // return false // end if //end if if Not f_validate_geo_loc(dw_1, dw_1.GetRow()) then return FALSE totalRow = dw_2.RowCount() for i = 1 to totalRow if is_current_btn = "Activity" or is_current_btn = 'Dimensions' then if Not f_validate_act(dw_2, i, is_level, '', '', '', '') then return FALSE end if elseif Right(is_current_btn, 6) = "Member" then if Left(iDAT*ts_current_btn, 6) = "Source" then if Not f_validate_src(dw_2, i) then return FALSE end if if not f_check_dates_nt(dw_2, i, "begin_operation_date", "end_operation_date", "Begin Operation Date", & "End Operation Date") then return false end if else if Not f_validate_geo_loc(dw_2, i) then return FALSE end if end if end if next return TRUE end function public subroutine wf_draw_dw2 ();long ll_master_rid, ll_cur_row string ls_sql, lsDAT*v_err uo_act.Hide() uo_group.Hide() uo_loc.Hide() dw_2.SetRedraw(FALSE) dw_3.SetRedraw(FALSE) if dw_1.RowCount() > 0 then ll_cur_row = dw_1.GetRow() if ll_cur_row > 0 then ll_master_rid = dw_1.GetItemNumber(ll_cur_row, "rid") end if if is_state = 'geo member' then if is_style_state = 'form' then dw_3.Show() else dw_2.Show() end if // Only replace the datawindow object when the button is changed if dw_2.DataObject <> is_member_dw then DAT*x dw_2.DataObject = is_member_dw dw_3.DataObject = is_member_dw_freeform SetTransObject(dw_2, SQLCA) end if // Check for source if (Upper(is_selected_child_name) = "SOURCE") then // Are we at a state, county or a city? choose case is_level_type case 'STATE' dw_2.Retrieve(ll_master_rid, 0, 0) case 'COUNTY' dw_2.Retrieve(0, ll_master_rid, 0) case 'CITY' dw_2.Retrieve(0, 0, ll_master_rid) end choose // Get the original sql stateDAT*zments for county and city dddw. SWJ 6/16 invo_locations.uf_get_orig_sql(dw_2) else dw_2.Retrieve(ll_master_rid) // Location end if // Share data between dw_2 and dw_3 dw_2.ShareData(dw_3) // If dw_2 and dw_3 are for source, // retrieve the data for county and city child datawindows on dw_3 if (Upper(is_selected_child_name) = "SOURCE") then wf_retrieve_county_dddw(dw_3) wf_retrieve_city_dddw(dw_3) end if elseif is_state = 'geo activitDAT*|y' then // Only replace the datawindow object when the radiobutton 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) ls_sql = dw_2.Describe('DataWindow.Table.Select') if is_use_type = 'on' then // For ag profile ls_sql = 'DataWindow.Table.Select="' + ls_sql + & " and metric_code in (select code from rap_metric_maps" + & " where use_type in ("DAT*~ + is_use_type_list + ')) and ' + & "(material_code in (select material_code from rap_metric_maps" + & " where use_type in (" + is_use_type_list + ')) or material_code is null)"' else ls_sql = dw_2.Describe('DataWindow.Table.Select') ls_sql = 'DataWindow.Table.Select="' + ls_sql + & " and metric_code in (select code from rap_metric_maps" + & " where use_type = 'DESCRIPTIVE INFORMATION AND CODES')~"" end if // ls_sql = ls_sql + " metric_code.DDDW.Name=d_metrics_gDAT*eo" ls_err = dw_2.Modify(ls_sql) if ls_err <> '' then MessageBox('Modify d_activity Error', ls_err) return end if ls_err = dw_3.Modify(ls_sql) if ls_err <> '' then MessageBox('Modify d_activity_freeform Error', ls_err) return end if // dw_2.Modify("metric_code.DDDW.Name=d_metrics_geo") // dw_3.Modify("metric_code.DDDW.Name=d_metrics_geo") // end if dw_2.Retrieve(ll_master_rid, is_level) dw_3.TriggerEvent(RowFocusChanged!) // Share data betweDAT*en dw_2 and dw_3 dw_2.ShareData(dw_3) end if end if dw_2.SetRedraw(TRUE) dw_3.SetRedraw(TRUE) end subroutine public subroutine wf_row_changed ();long ll_cur_row string ls_parent_type SetPointer(HourGlass!) wf_set_btns() if dw_1.RowCount() > 0 then ll_cur_row = dw_1.GetRow() if ll_cur_row > 0 then gl_geo_rid = dw_1.GetItemNumber(ll_cur_row, "rid") end if // if gl_geo_rid = 0, this means the current row is the new inserted row // then reset the dw_2 DAT* if IsNull(gl_geo_rid) then dw_2.Reset() end if // Make Parent button visible if is_level_type <> 'NATION' then // Find out the parent geo type of the current geo type select distinct parent_type into :ls_parent_type from rap_geographic_members where child_type = :is_level_type; if f_db_error(SQLCA, "Fail on selecting parent type on " + & "rap_geographic_members table. Contact your technical support.") = 1 then return end if DAT* cb_parent.Text = Upper(Left(ls_parent_type, 1)) + & Lower(Right(ls_parent_type, Len(ls_parent_type) - 1)) cb_parent.Show() else cb_parent.Hide() end if else gl_geo_rid = 0 // Clean the activity datawindow buffer dw_2.Reset() // Make Parent button insivible cb_parent.Hide() end if if is_state = "geo location" then uo_loc.uf_check_pending() uo_loc.uf_retrieve_dw_loc_master(gl_geo_rid) elseif is_state = "geo group" then uo_group.uf_check_penDAT*ding() ll_cur_row = dw_1.GetRow() if ll_cur_row > 0 then uo_group.uf_retrieve_select_list(dw_1.GetItemString(dw_1.GetRow(), "type"), gl_geo_rid) else uo_group.uf_retrieve_select_list(is_level_type, gl_geo_rid) end if uo_group.uf_retrieve_group_member(gl_geo_rid) elseif is_state = 'geo member' or is_state = 'master/detail' or & (is_state = 'geo activity' and Not uo_act.Visible) then wf_draw_dw2() end if // If uo_act is visible, then check if there is any modificatioDAT*n in uo_act. // When checking is done, retrieve the dw_act_master data based on the // new values. if uo_act.Visible then if uo_act.uf_check_pending() then SetPointer(HourGlass!) uo_act.uf_prepare_dw(gl_geo_rid, is_level, is_style_state, '', '', '', '') end if end if // Commented out by swj, 7/18/94 //// Refresh the source window //if gb_source_open then // w_source.wf_retrieve_data() //end if end subroutine public subroutine wf_set_var ();// This function sets up inDAT*stance variables if is_level_type = 'NATION' or is_level_type = 'STATE' or & is_level_type = 'COUNTY' or is_level_type = 'CITY' then if Upper(is_selected_child_name) = "SOURCE" then is_member_dw = "d_cit_member" is_member_dw_freeform = "d_source" else is_member_dw = "d_geo_member" is_member_dw_freeform = "d_geo_loc" end if is_activity_dw = "d_activity" is_activity_dw_freeform = "d_activity_freeform" is_level = "GEO" end if end subroutine public subroutineDAT* wf_set_btns ();string ls_prev_level_type, ls_child_type, ls_child_type_name integer li_counter string ls_cur_type CommandButton lcb_cur_btn // Save the current is_level_type value for comparison ls_prev_level_type = is_level_type // Get the is_level_type for the current row only it is not null if dw_1.GetRow() > 0 then ls_cur_type = dw_1.GetItemString(dw_1.GetRow(), "type") if Not IsNull(ls_cur_type) then is_level_type = ls_cur_type end if end if // if is_level_type dDAT*oes not change and command button has been set, // skip the rest of the actions if is_level_type = ls_prev_level_type and is_current_btn <> '' then return // Otherwisw, set the buttons based on the current is_level_type li_counter = 1 declare childTypeNameCur cursor for select type, name from rap_geographic_types, rap_geographic_members where rap_geographic_types.type = rap_geographic_members.child_type and parent_type = :is_level_type; open childTypeNameCur; DAT*fetch childTypeNameCur into :ls_child_type, :ls_child_type_name; if f_db_error(SQLCA, "Fail on selecting type, name from " + & "rap_geographic_types and rap_geographic_members table. " + & "Contact your technical support.") = 1 then return end if do while sqlca.sqlcode = 0 if li_counter = 1 then // is_selected_child_name store the first child type of the current // level type in geo info area. It is used to determined which // dataobject should put in dw_2 and dw_3 DAT* is_selected_child_name = ls_child_type_name cb_member.Text = Upper(Left(ls_child_type_name, 1)) + & Lower(Right(ls_child_type_name, Len(ls_child_type_name) - 1)) is_current_btn = cb_member.Text + ' Member' // if is_state = 'geo member' then // //wf_enable_btn() // //cb_member.Enabled = FALSE // f_highlight_button(r_buttons, cb_member, "on") // end if // Re-position all command buttons cb_member_2.Visible = FALSE cb_group.X = cb_member.X + cb_member.Width + DAT*425 cb_activity.X = cb_group.X + cb_group.Width + 425 cb_location.X = cb_activity.X + cb_activity.Width + 425 elseif li_counter = 2 then // The way it sets up now, it can only handle no more than 2 child // members. Need to re-visit the code in the future cb_member_2.Text = Upper(Left(ls_child_type_name, 1)) + & Lower(Right(ls_child_type_name, Len(ls_child_type_name) - 1)) // Re-position all command buttons cb_member_2.X = cb_member.X + cb_member.Width + 225 cDAT*b_member_2.Visible = TRUE cb_group.X = cb_member_2.X + cb_member_2.Width + 225 cb_activity.X = cb_group.X + cb_group.Width + 225 cb_location.X = cb_activity.X + cb_activity.Width + 225 end if // Fetch the next record and increase the counter fetch childTypeNameCur into :ls_child_type, :ls_child_type_name; li_counter = li_counter + 1 loop close childTypeNameCur; commit; if f_db_error(SQLCA, "Fail on selecting child type on " + & "rap_geographic_members table. CDAT*ontact your technical support.") = 1 then return end if choose case is_state case 'geo member' cb_member_2.Enabled = TRUE lcb_cur_btn = cb_member case 'geo group' lcb_cur_btn = cb_group case 'geo activity' lcb_cur_btn = cb_activity case 'geo location' lcb_cur_btn = cb_location end choose f_highlight_button(r_buttons, lcb_cur_btn, "on") wf_set_var() end subroutine public subroutine wf_detail_view ();if uo_act.Visible then if uo_act.uf_check_pending() theDAT*n 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 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 if is_current_btn = 'Activity' or is_currDAT*ent_btn = 'Dimensions' then OpenWithParm(w_filter, 'rap_activities') elseif Right(is_current_btn, 6) = 'Member' then if Left(is_current_btn, 6) = "Source" then OpenWithParm(w_filter, 'rap_sources') else OpenWithParm(w_filter, 'rap_geographic_locations') end if end if else OpenWithParm(w_filter, 'rap_geographic_locations') end if // If filter flag is set to true, then trigger the filter event to perform // filter if gb_filter then gb_filter = FALSE TDAT*his.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 if uo_group.Visible then uo_group.uf_retrieve_select_list(dw_1.GetItemString(dw_1.GetRow(), "type"), & dw_1.GetItemNumber(dw_1.GetRow(), "rid")) uo_group.uf_retrieve_group_member(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) end if if uo_act.Visible then // uo_act.uf_prepare_dw(gl_geoDAT*_rid, is_level, is_style_state, is_level_type) uo_act.uf_prepare_dw(gl_geo_rid, is_level, is_style_state, '', '', '', '') end if if uo_loc.Visible then uo_loc.uf_retrieve_dw_loc_master(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) end if end subroutine public subroutine wf_dropdown (string p_event, string p_screen, datawindow p_dw, window p_window);// //string ls_col_name //ls_col_name = This.GetColumnName() // // //if ls_col_name = "type" or ls_col_name = "group_type" then // ilDAT*_selected_row = f_dddw_search(p_dw, idwc_dw_child, is_child_name, il_selected_row) // if il_selected_row > 0 then // P_win.PostEvent("highlight_dddw") // end if // 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 subroutine public subroutine wf_retrieve_city_dddw (datawindow dw_obj);// This function retrDAT*ieves a list of cities based on the geo type field in // its parent dw (dw_1) long ll_rid string ls_geo_type, ls_sql_stmnt, ls_err DataWindowChild dwc ll_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") ls_geo_type = dw_1.GetItemString(dw_1.GetRow(), "type") // Change data source for dwc choose case ls_geo_type case "STATE" ls_sql_stmnt = "DataWindow.Table.Select=~"" + & invo_locations.is_city_orig_sql + & " AND RAP_GEOGRAPHIC_LOCATIONS_A.PARENT_RID in ( SELECT RID FROM " DAT*+ & "RAP_GEOGRAPHIC_LOCATIONS WHERE PARENT_RID = " + & String(ll_rid) + ")~"" case "COUNTY" ls_sql_stmnt = "DataWindow.Table.Select=~"" + & invo_locations.is_city_orig_sql + & " AND RAP_GEOGRAPHIC_LOCATIONS_A.PARENT_RID = " + String(ll_rid) + "~"" case "CITY" ls_sql_stmnt = "DataWindow.Table.Select=~"" + & invo_locations.is_city_orig_sql + & " AND RAP_GEOGRAPHIC_LOCATIONS_A.RID = " + String(ll_rid) + "~"" end choose // Get the handle of the child datawindow DAT* if dw_obj.GetChild("geographic_incorp_rid", dwc) = -1 then MessageBox(This.Title, "Application Error:~nCity - " + & "Not a DataWindowChild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) ls_err = dwc.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("Modify Failed", ls_err) return end if dwc.Retrieve() end subroutine public subroutine wf_retrieve_county_dddw (datawindow dw_obj);// This function retrieves a list of counties based on the geDAT*o type field // in its parent dw (dw_1) long ll_rid, ll_county_rid, ll_parent_rid string ls_geo_type, ls_sql_stmnt, ls_err DataWindowChild dwc ll_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") ls_geo_type = dw_1.GetItemString(dw_1.GetRow(), "type") // Change data source for dwc choose case ls_geo_type case "STATE" ls_sql_stmnt = "DataWindow.Table.Select=~"" + & invo_locations.is_county_orig_sql + & " AND PARENT_RID = " + String(ll_rid) + "~"" case "COUNTY" ls_sql_sDAT*tmnt = "DataWindow.Table.Select=~"" + & invo_locations.is_county_orig_sql + & " AND RID = " + String(ll_rid) + "~"" case "CITY" select parent_rid into :ll_county_rid from rap_geographic_locations where rid = :ll_rid; if f_db_error(SQLCA, "Fail on selecting parent_rid on " + & "rap_geographic_locations table. Contact your technical support.") = 1 then return end if ls_sql_stmnt = "DataWindow.Table.Select=~"" + & invo_locations.is_county_orig_sql + & DAT* " AND RID = " + String(ll_county_rid) + "~"" end choose // Get the handle of the child datawindow if dw_obj.GetChild("geographic_county_rid", dwc) = -1 then MessageBox(This.Title, "Application Error:~nCounty - " + & "Not a DataWindowChild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) ls_err = dwc.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("Modify Failed", ls_err) return end if dwc.Retrieve() // Display state name only for dwDAT*_3 - sharing datawindow does not retrieve // child datawindow automatically if dw_obj.ClassName() = 'dw_3' then if dw_obj.GetChild("geographic_state_rid", dwc) = -1 then MessageBox(This.Title, "Application Error:~nState - " + & "Not a DataWindowChild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) dwc.Retrieve() end if end subroutine public subroutine wf_enable_btn (boolean pb_enable);cb_member.Enabled = pb_enable cb_member_2.Enabled = pb_enaDAT*ble cb_group.Enabled = pb_enable cb_activity.Enabled = pb_enable cb_location.Enabled = pb_enable cb_activity.Text = 'Activity' end subroutine public function boolean wf_check_rid (datawindow dw_obj);long ll_row_num, ll_cur_row, ll_rid_num, ll_rid, ll_parent_rid, ll_geo_rid string ls_type, ls_name ll_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") 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 // SelecDAT*t 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_2" then if is_current_btn = "Activity" or is_current_btn = 'Dimensions' then dw_obj.SetItem(ll_cur_row, "ref_rid", ll_rid) dw_obj.SetItem(ll_cur_row, "metric_level_type", is_level) dw_obj.SetItem(ll_cur_row, "creation_date_time", today()) dw_obj.SetItem(ll_cur_row, "user_id", gs_user_id) if Left(sDAT*qlca.dbms, 2) <> 'OR' then if Not f_check_dup_act(dw_obj, ll_rid, is_level) then return FALSE end if elseif Right(is_current_btn, 6) = "Member" then if Left(is_current_btn, 6) <> "Source" then if Left(sqlca.dbms, 2) <> 'OR' then ls_type = dw_obj.GetItemString(ll_cur_row, 'type') ls_name = dw_obj.GetItemString(ll_cur_row, 'name') ll_geo_rid = f_getgeorid(ls_name, ls_type, ll_rid) if ll_geo_rid > 0 then MessageBox('Geographic Location', 'Type anDAT*d Name must be unique in the table.~n' + & 'No changes made to the database') return FALSE elseif ll_geo_rid < 0 then return FALSE end if end if dw_obj.SetItem(ll_cur_row, "parent_rid", ll_rid) end if end if dw_obj.SetItem(ll_cur_row, "rid", ll_rid_num) elseif dw_obj.ClassName() = 'dw_1' then if Left(sqlca.dbms, 2) <> 'OR' then ls_type = dw_1.GetItemString(ll_cur_row, 'type') ls_name = dw_1.GetItemString(ll_cur_row, 'name') DAT*ll_parent_rid = dw_1.GetItemNumber(ll_cur_row, 'parent_rid') ll_geo_rid = f_getgeorid(ls_name, ls_type, ll_parent_rid) if ll_geo_rid > 0 then MessageBox('Geographic Location', 'Type and Name must be unique in the table.~n' + & 'No changes made to the database') return FALSE elseif ll_geo_rid < 0 then return FALSE end if end if dw_obj.SetItem(ll_cur_row, "rid", ll_rid_num) end if else if dw_obj.GetItemStatus(ll_cur_row, 0, Primary!) <> NotMDAT*odified! then // If the activity record is updated. if dw_obj.DataObject = 'd_activity' then dw_obj.SetItem(ll_cur_row, "creation_date_time", today()) dw_obj.SetItem(ll_cur_row, "user_id", gs_user_id) if Left(sqlca.dbms, 2) <> 'OR' then if Not f_check_dup_act(dw_obj, ll_rid, is_level) then return FALSE end if elseif dw_obj.DataObject = 'd_geo_member' or dw_obj.DataObject = 'd_geo_loc' then if Left(sqlca.dbms, 2) <> 'OR' then ls_type = dw_obj.GetItemStDAT*ring(ll_cur_row, 'type') ls_name = dw_obj.GetItemString(ll_cur_row, 'name') ll_geo_rid = f_getgeorid(ls_name, ls_type, ll_rid) if ll_geo_rid > 0 and ll_geo_rid <> dw_obj.GetItemNumber(ll_cur_row, 'rid') then MessageBox('Geographic Location', 'Type and Name must be unique in the table.~n' + & 'No changes made to the database') return FALSE elseif ll_geo_rid < 0 then return FALSE end if end if end if end if end if next DAT*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 = 'geo activity' then w_mdi_main.is_act_style = ps_style end if end subroutine public subroutine wf_get_from_rms (string as_level, long al_rid);long ll_row_num long ll_where_pos string ls_sql_stmnt, ls_err, ls_cur_sql_stmnt if as_level = 'nat' then // Change data source for DAT*dw_1 ll_where_pos = Pos(is_orig_sql_statement, " WHERE", 1) ls_sql_stmnt = Left(is_orig_sql_statement, ll_where_pos - 1) ls_sql_stmnt = "DataWindow.Table.Select=~"" + ls_sql_stmnt + & " WHERE TYPE = 'NATION' and rid > :rid~"" ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("Modify Failed", ls_err) end if is_current_btn = 'State Member' f_highlight_button(r_buttons, cb_member, "on") dw_1.Retrieve(0) else // Change the data source for dw_1DAT* ls_cur_sql_stmnt = dw_1.Describe("DataWindow.Table.Select") if ls_cur_sql_stmnt <> is_orig_sql_statement then ls_sql_stmnt = "DataWindow.Table.Select=~"" + is_orig_sql_statement + & + " ORDER BY TYPE, NAME~"" ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("Modify Failed", ls_err) end if end if dw_1.Retrieve(al_rid) wf_row_changed() end if end subroutine event open;call super::open; string ls_sql_stmnt, ls_err long ll_where_pos // Get uDAT*se type indicator from rapids.ini is_use_type = ProfileString(gs_iniFile, "ag profile", "use_type", "none") if is_use_type = '' then MessageBox('Geographic', "An error occured in function ProfileString.~n" + & "Contact your technical support.", StopSign!) elseif is_use_type = 'none' then if SetProfileString(gs_iniFile, 'ag profile', 'use_type', 'off') = -1 then MessageBox('Geographic', "An error occured in function SetProfileString.~n" + & "Contact your technical support.", StopSiDAT*gn!) end if else is_use_type = Lower(is_use_type) end if // Make the instance variable a pointer to an instance of the non-visual // user object invo_locations = create nvo_locations // for dddw use is_column_status = "valid" // Set up variable for handling menu behavior is_state = 'geo member' f_window_count('geo') // Save the height and X, Y position of the objects into instance variables ii_dw1_height = dw_1.Height ii_dw2_height = dw_2.Height ii_dw2_y = dw_2.Y ii_cbDAT*_y = cb_member.Y ii_parent_y = cb_parent.Y is_level_type = is_highest_type wf_set_var() SetTransObject(dw_1, SQLCA) // Change data source for dw_1 is_orig_sql_statement = dw_1.Describe("DataWindow.Table.Select") ll_where_pos = Pos(is_orig_sql_statement, " WHERE", 1) ls_sql_stmnt = Left(is_orig_sql_statement, ll_where_pos - 1) ls_sql_stmnt = "DataWindow.Table.Select=~"" + ls_sql_stmnt + & " WHERE TYPE = 'NATION' and rid > :rid~"" ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err DAT*<> "" then MessageBox("Modify Failed", ls_err) end if is_current_btn = 'State Member' f_highlight_button(r_buttons, cb_member, "on") dw_1.Retrieve(0) end event event activate;call super::activate; //if dw_1.RowCount() > 0 then // gl_geo_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") //end if end event on closequery;call w_master_detail::closequery;if is_state = "geo activity" then uo_act.uf_check_pending() elseif is_state = "geo group" then uo_group.uf_check_pendDAT*ing() elseif is_state = "geo location" then uo_loc.uf_check_pending() end if end on on close;call w_master_detail::close; f_window_close('geo') // Destroy the variable and the instance it points to destroy invo_locations end on on clicked;call w_master_detail::clicked;// JOHN, I DON'T UNDERSTAND THE PURPOSE OF THE FOLLOWING CODE. SO, I // COMMENT THEM OUT TO SEE IF IT WILL STILL WORK WITHOUT THIS PART. //if not (isnull(is_old_value) or is_old_value = "") then //if idw_acDAT*tive = dw_1 then // if is_column_name = "type" 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 //elseif idw_active = dw_2 then // if is_state = 'geo 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 // dwDAT*_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 = 'geo 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_vaDAT*lue) // f_dddw_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_geo.create int iCurrent call super::create this.cb_parent=create cb_parent 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_member_2=create cb_member_2 this.uo_loc=create uo_loc this.uo_act=create uo_act this.uo_group=create uo_group this.r_buttonsDAT*=create r_buttons iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_parent this.Control[iCurrent+2]=this.cb_member this.Control[iCurrent+3]=this.cb_group this.Control[iCurrent+4]=this.cb_activity this.Control[iCurrent+5]=this.cb_location this.Control[iCurrent+6]=this.cb_member_2 this.Control[iCurrent+7]=this.uo_loc this.Control[iCurrent+8]=this.uo_act this.Control[iCurrent+9]=this.uo_group this.Control[iCurrent+10]=this.r_buttons end on on w_geo.destroy call super:DAT*:destroy destroy(this.cb_parent) destroy(this.cb_member) destroy(this.cb_group) destroy(this.cb_activity) destroy(this.cb_location) destroy(this.cb_member_2) destroy(this.uo_loc) destroy(this.uo_act) destroy(this.uo_group) destroy(this.r_buttons) end on type dw_3 from w_master_detail`dw_3 within w_geo event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=37 int Y=524 int Width=2793 int Height=908 string Tag="Related information (freeform view)" end type on dw_3::dwescaDAT*pe;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 //if is_state = 'activity' then //if is_column_name = "material_code" or is_column_name = "metric_code" or & // is_column_name = "value_unit_codeDAT*" 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) // // 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 //elsDAT*eif is_state = "geo member" then //if is_selected_child_name = "Source" then // if is_column_name = "code" or is_column_name = "group_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 //else //if is_column_name = "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_selecDAT*ted_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??. // Parent.PostEvent("highlight_dddw") //end if //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 =DAT* 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_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) il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) if il_selected_row > 0 then Parent.PostEventDAT*("highlight_dddw") end if end if end event event dw_3::itemfocuschanged;call super::itemfocuschanged;string ls_col_name, ls_geo_type, ls_sql_stmt, ls_err, ls_rtn long ll_rid, ll_county_rid, ll_row_num DataWindowChild dwc ls_col_name = This.GetColumnName() // Retrieve data for dddw for source datawindow (d_cit_member) if Left(is_current_btn, 6) = 'Source' then choose case ls_col_name case "code" f_retrieve_codes(Parent.Title, This, ls_col_name, "code") DAT*case "geographic_incorp_rid" wf_retrieve_city_dddw(This) case "geographic_county_rid" wf_retrieve_county_dddw(This) end choose end if // Call the function to retrieve code values //if is_state = "activity" then f_act_dddw_retrieve(This, Parent, is_level, "") string ls_source, ls_device, ls_process, ls_stream ls_source = "" ls_device = "" ls_process = "" ls_stream = "" if ls_col_name = "metric_code" then // For Ag Profile if is_use_type = 'on' then ls_rtnDAT* = This.Modify("metric_code.DDDW.Name=d_metrics_ag") if ls_rtn <> '' then MessageBox('Modify d_metrics_ag Error', ls_rtn) return end if if This.GetChild("metric_code", dwc) = -1 then MessageBox(This.Title, "Application Error:~nMetric Code - " + & "Not a DataWindowChild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) dwc.Retrieve(is_level, istr_use_type.use_type) else //dw_2.Modify("metric_code.DDDW.Name=d_metrics_geo")DAT* f_retrieve_metric_codes(parent, this, is_level, ls_source, ls_device, ls_process, ls_stream) end if elseif ls_col_name = "group_type" then if this.dataobject = "d_source" or & this.dataobject = "d_cit_member" then f_retrieve_group_types(parent, this, "SRC") else f_retrieve_group_types(parent, this, "GEO") 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_metriDAT*c_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, "GEO", "") end if //choose case ls_col_name // case "geographic_incorp_rid", "geographic_county_rid" // f_retrieve_county_city(Parent.Title, dw_1, ls_col_name, "rid") //end choose if ls_col_name = "material_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = DAT*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_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 = "SorryDAT*! 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_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_3.getitemstring(dw_3.getrow(), ls_col_name) elseif ls_col_name = "method_type" then DAT*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 valid 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 = "rapDAT*_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 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_source_codes" is_msg_name = "Column - Source Code" is_msg_text = "Sorry! Not a valid source code" is_old_value = dw_3.getitemstring(dw_1.getrDAT*ow(), 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_text = "Sorry! Not a valid group type" is_old_value = dw_3.getitemstring(dw_1.getrow(), ls_col_name) // Commented out by swj, 8/17/94 // Geo type is display only. //elseif ls_col_name = "type" then // il_selected_row = 0DAT* // // is_filt = "" // Getchild(ls_col_name, idwc_dw_child) // is_column_name = ls_col_name // is_child_name = "type" // is_validation_table = "rap_geographic_types" // is_msg_name = "Column - Type" // is_msg_text = "Sorry! Not a valid geographic type" // 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_DAT*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(), ls_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" DAT* 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_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" is_msg_text = "Sorry! Not a valid data code" is_old_value = This.getitemstring(This.getrow(), lsDAT*_col_name) else is_column_name = "" end if end event on dw_3::add_row;call w_master_detail`dw_3::add_row;long ll_cur_row ll_cur_row = This.GetRow() if is_current_btn = "Activity" or is_current_btn = 'Dimensions' then This.SetItem(ll_cur_row, "user_id", gs_user_id) This.SetItem(ll_cur_row, "creation_date_time", today()) This.ib_obj_modified = TRUE // Not sure if this is right elseif Right(is_current_btn, 6) = 'Member' and & Left(is_current_btn, 6) <> 'Source' then ThisDAT*.SetItem(ll_cur_row, 'type', Upper(cb_member.Text)) end if end on on dw_3::rowfocuschanged;call w_master_detail`dw_3::rowfocuschanged;// Used for the old design //long ll_county_rid; // //if is_current_btn = "Source Member" and dw_1.RowCount() > 0 then // // if dw_1.GetItemString(dw_1.GetRow(), "type") = 'COUNTY' then // // dw_3.SetItem(dw_3.GetRow(), "geographic_county_rid", gl_geo_rid) // f_retrieve_county_city(Parent, dw_3, "geographic_county_rid", gl_geo_rid) // // elseiDAT*f dw_1.GetItemString(dw_1.GetRow(), "type") = 'CITY' then // // dw_3.SetItem(dw_3.GetRow(), "geographic_incorp_rid", gl_geo_rid) // f_retrieve_county_city(Parent, dw_3, "geographic_incorp_rid", gl_geo_rid) // // select parent_rid // into :ll_county_rid // from rap_geographic_locations // where rid = :gl_geo_rid; // // // If there is a database error (return value = 1), stop the system; // if f_db_error(SQLCA, "Fail on selecting the parent_rid from " + & // " rap_geographic_loDAT*cations table.~nContact your technical support.") = 1 then // halt // end if // // dw_3.SetItem(dw_3.GetRow(), "geographic_county_rid", ll_county_rid) // f_retrieve_county_city(Parent, dw_3, "geographic_county_rid", ll_county_rid) // // end if // //end if end on event dw_3::rbuttondown;call super::rbuttondown;long ll_cur_row string ls_sic_code, ls_obj_name_str, ls_obj_name ls_obj_name_str = this.GetObjectAtPointer() ls_obj_name = Left(ls_obj_name_str, Pos(ls_obj_name_strDAT*, "~t") - 1) // Only continue if the sic code column is clicked if ls_obj_name <> "sic_code" then return 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_define_flag from rap_sic_codes order by code", & ls_sic_code) then This.ib_obj_modified = TRUE end if end event event dw_3::clicked;call super::clicked;long lDAT* l_cur_row string ls_sic_code, ls_obj_name_str, ls_obj_name ls_obj_name_str = this.GetObjectAtPointer() ls_obj_name = Left(ls_obj_name_str, Pos(ls_obj_name_str, "~t") - 1) // Only continue if the sic code text is clicked if ls_obj_name <> "sic_code_t" then return ll_cur_row = row 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_t", "SIC Code Lookup", & "select code, name, user_define_flag fDAT* rom rap_sic_codes order by code", & ls_sic_code) then This.ib_obj_modified = TRUE end if end event on dw_3::delete_row;call w_master_detail`dw_3::delete_row; long ll_rid, ll_cur_row string ls_type ll_cur_row = This.GetRow() if ll_cur_row > 0 and idw_active.DataObject = 'd_geo_loc' then // Get rid and geographic level type from the datawindow ll_rid = This.GetItemNumber(ll_cur_row, "rid") ls_type = This.GetItemString(ll_cur_row, "type") // Call function if f_deleteDAT*_geo_loc(ll_rid, ls_type) = 1 then ib_delete = TRUE else ib_delete = FALSE 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 "value" // Call function to copy value to value_amt f_set_value_amt(This, This.GetText(), "value", "value_amt", This.GetRow()) case "geographic_incorp_rid" if invo_locations.uf_validate_data(This, ls_col_naDAT*me, This.GetText()) then invo_locations.uf_itemchange_on_city(This) else return 1 end if case "geographic_county_rid" if invo_locations.uf_validate_data(This, ls_col_name, This.GetText()) then invo_locations.uf_itemchange_on_county(This) else return 1 end if 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 ilDAT*_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("Column - SIC Code", "Sorry! Not a valid SIC code ") return 1 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' then This.GetChild(ls_col_name, dwc) This.SetItem(This.GetRow(), 'value_unit_code', & dwc.GetDAT*ItemString(dwc.GetRow(), 'unit_code')) end if end event 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 //if il_selected_row <> 0 then //if is_state = 'activity' then //if is_column_name = "material_code" or is_column_name = "metric_code" or & // DAT*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) //// // 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") // dw_3.setitem(dw_3.getrow(), is_DAT*column_name, & // idwc_dw_child.getitemstring(il_selected_row, is_child_name)) //// dw_3.triggerevent(editchanged!) //end if //elseif is_state = "geo member" then //if is_selected_child_name = "Source" then //if il_selected_row <> 0 then //if is_column_name = "code" or is_column_name = "group_type" then // //f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) // dw_3.setitem(dw_3.getrow(), is_column_name, & // idwc_dw_child.getitemstring(il_selected_row, is_chilDAT*d_name)) //// dw_3.triggerevent(editchanged!) //end if //end if //else //if is_column_name = "type" then //// 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??. //// Parent.PostEvent("highlight_dddw") //// filt = dw_3.gettext() // dw_3DAT*.setitem(dw_3.getrow(), is_column_name, & // idwc_dw_child.getitemstring(il_selected_row, is_child_name)) //end if //end if //end if //end if //dw_3.triggerevent(editchanged!) Send(Handle(This), 256, 9, Long(0,0)) return 1 end event event dw_3::itemerror;call super::itemerror;return 2 end event type dw_2 from w_master_detail`dw_2 within w_geo event dwescape pbm_dwescape event set_column pbm_custom31 event dwnkey pbm_dwnkey int X=37 int Y=516 int Width=2793 int HeightDAT*=908 string DragIcon="GEO.ICO" string Tag="Related information (tabular view)" end type on dw_2::dwescape;call w_master_detail`dw_2::dwescape;string ls_col_name 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 //if is_state = 'activity' then //if is_column_name = "material_code" or is_coDAT* lumn_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) // // 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 DAT*"pbm_custom??. // Parent.PostEvent("highlight_dddw") //end if //elseif is_state = "geo member" then //if is_selected_child_name = "Source" then // if is_column_name = "code" or is_column_name = "group_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 //else //if is_column_name = "type" then // dw_2.setitem(dw_2.getrow(), is_column_name, is_old_DAT*$value) // 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??. // Parent.PostEvent("highlight_dddw") //end if //end if //end if end on on dw_2::set_column;call w_master_detail`dw_2::set_column;if is_column_name = "material_code" then this.setcolDAT*&umn("material_code") end if if is_column_name = "metric_code" then this.setcolumn("metric_code") end if if is_column_name = "value_unit_code" then this.setcolumn("value_unit_code") end if if is_column_name = "method_type" then this.setcolumn("method_type") end if if is_column_name = "value_type" then this.setcolumn("value_type") 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_DAT*(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 if end on event dw_2::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) il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_name, il_selected_row) DAT** Parent.PostEvent("highlight_dddw") end if end event event dw_2::doubleclicked;call super::doubleclicked;string ls_sql_stmnt, ls_err, ls_cur_sql_stmnt long ll_row_num // Do not perform double click function when there is no row in datawindow if This.RowCount() = 0 then return if Right(is_current_btn, 6) = "Member" then if Left(is_current_btn, Pos(is_current_btn, " Member") - 1) = "Source" then // // NOT WORKING // // Check if any modifications have been made to dataDAT*,window // if wf_check_pending() then // // Refresh the datawindow // masterRid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") // dw_2.Retrieve(masterRid) // return // end if // Get the value of the primary key gl_cur_row = This.GetItemNumber(row, "rid") gb_double_click = TRUE m_main_menu.m_data.m_source.TriggerEvent(Clicked!) else gl_cur_row = This.GetItemNumber(row, "rid") wf_set_var() dw_2.Reset() dw_1.SetRedraw(FALSE) // Change the dDAT*.ata source for dw_1 ls_cur_sql_stmnt = dw_1.Describe("DataWindow.Table.Select") if ls_cur_sql_stmnt <> is_orig_sql_statement then ls_sql_stmnt = "DataWindow.Table.Select=~"" + is_orig_sql_statement + & + " ORDER BY TYPE, NAME~"" ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("Modify Failed", ls_err) end if end if dw_1.Retrieve(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) // Scroll to the clicked row ll_row_num = dw_1.Find("rid = " + StrDAT*0ing(gl_cur_row), 1, dw_1.RowCount()) dw_1.ScrollToRow(ll_row_num) wf_row_changed() dw_1.SetRedraw(TRUE) end if end if end event event dw_2::itemfocuschanged;call super::itemfocuschanged;string ls_col_name, ls_rtn long ll_row_num DataWindowChild dwc ls_col_name = This.GetColumnName() // Retrieve data for dddw for source datawindow (d_cit_member) if Left(is_current_btn, 6) = 'Source' then choose case ls_col_name case "code" f_retrieve_codes(ParenDAT*2t.Title, This, ls_col_name, "code") case "geographic_incorp_rid" wf_retrieve_city_dddw(This) case "geographic_county_rid" wf_retrieve_county_dddw(This) end choose end if // Call the function to retrieve code values //if is_state = 'activity' then // f_act_dddw_retrieve(This, Parent, is_level, "") //end if string ls_source, ls_device, ls_process, ls_stream ls_source = "" ls_device = "" ls_process = "" ls_stream = "" if ls_col_name = "metric_code" then DAT*4 // For Ag Profile if is_use_type = 'on' then ls_rtn = This.Modify("metric_code.DDDW.Name=d_metrics_ag") if ls_rtn <> '' then MessageBox('Modify d_metrics_ag Error', ls_rtn) return end if if This.GetChild("metric_code", dwc) = -1 then MessageBox(This.Title, "Application Error:~nMetric Code - " + & "Not a DataWindowChild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) dwc.Retrieve(is_level, istr_use_type.use_type) else DAT*6 //dw_2.Modify("metric_code.DDDW.Name=d_metrics_geo") f_retrieve_metric_codes(parent, this, is_level, ls_source, ls_device, ls_process, ls_stream) end if elseif ls_col_name = "group_type" then if this.dataobject = "d_source" or & this.dataobject = "d_cit_member" then f_retrieve_group_types(parent, this, "SRC") else f_retrieve_group_types(parent, this, "GEO") end if elseif ls_col_name = "value_unit_code" then if is_unit_sql = "null" then is_unit_sql = DAT*8f_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, "GEO", "") end if 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 - MateriaDAT*:l 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 = "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 =DAT*< "value_unit_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_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 = "tDAT*>ype" 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! Not a valid value type" is_old_vDAT*@alue = 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_source_codes" is_msg_name = "Column - Source Code" is_msg_text = "Sorry! Not a valid source 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_dDAT*Bw_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_2.getitemstring(dw_2.getrow(), ls_col_name) // Commented out by swj, 8/17/94 // Geo type is display only. //elseif ls_col_name = "type" then // il_selected_row = 0 // // is_filt = "" // getchild(ls_col_name, idwc_dw_child) // is_column_name = ls_col_name // iDAT*Ds_child_name = "type" // is_validation_table = "rap_geographic_types" // is_msg_name = "Column - Type" // is_msg_text = "Sorry! Not a valid geographic type" // is_old_value = dw_2.getitemstring(dw_2.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_msgDAT*F_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 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 DAT*H= "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" is_msg_text = "Sorry! Not a valid data code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) else is_column_name = "" end if end event on dw_2::add_row;call w_master_detail`dw_2::add_row;long ll_cur_row ll_cur_row = This.GetRow() if is_currentDAT*J_btn = "Activity" or is_current_btn = 'Dimensions' then This.SetItem(ll_cur_row, "user_id", gs_user_id) This.SetItem(ll_cur_row, "creation_date_time", today()) dw_2.ib_obj_modified = TRUE // Not sure if this is right elseif Right(is_current_btn, 6) = 'Member' and & Left(is_current_btn, 6) <> 'Source' then This.SetItem(ll_cur_row, 'type', Upper(cb_member.Text)) end if end on event dw_2::rbuttondown;call super::rbuttondown;long ll_cur_row string ls_sic_code, ls_obj_name_str, DAT*Lls_obj_name ls_obj_name_str = this.GetObjectAtPointer() ls_obj_name = Left(ls_obj_name_str, Pos(ls_obj_name_str, "~t") - 1) // Only continue if the sic code column is clicked if ls_obj_name <> "sic_code" then return 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_define_flag from rap_sic_codes order by code", & lsDAT*N_sic_code) then This.ib_obj_modified = TRUE end if end event on dw_2::delete_row;call w_master_detail`dw_2::delete_row; long ll_rid, ll_cur_row string ls_type ll_cur_row = This.GetRow() if ll_cur_row > 0 and idw_active.DataObject = 'd_geo_member' then // Get rid and geographic level type from the datawindow ll_rid = This.GetItemNumber(ll_cur_row, "rid") ls_type = This.GetItemString(ll_cur_row, "type") // Call function if f_delete_geo_loc(ll_rid, ls_type) = 1 then DAT*P ib_delete = TRUE else ib_delete = FALSE 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 "value" // Call function to copy value to value_amt f_set_value_amt(This, This.GetText(), "value", "value_amt", This.GetRow()) case "geographic_incorp_rid" if invo_locations.uf_validate_data(This, ls_col_name, This.GetText()) then invo_locDAT*Rations.uf_itemchange_on_city(This) else return 1 end if case "geographic_county_rid" if invo_locations.uf_validate_data(This, ls_col_name, This.GetText()) then invo_locations.uf_itemchange_on_county(This) else return 1 end if 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.GetRowDAT*T() end if end if if ls_col_name = "sic_code" then if not f_validate_code(this.gettext(), "code", "rap_sic_codes") then messagebox("Column - SIC Code", "Sorry! Not a valid SIC code ") return 1 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' then This.GetChild(ls_col_name, dwc) This.SetItem(This.GetRow(), 'value_unit_code', & dwc.GetItemString(dwc.GetRow(), 'unit_code'DAT*V)) 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 //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_tDAT*Xype" or & // is_column_name = "value_type" then //// 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??. //// Parent.PostEvent("highlight_dddw") // dw_2.setitem(dw_2.getrow(), is_column_name, & // idwc_dw_child.getitemstring(il_selected_rDAT*Zow, is_child_name)) //end if //elseif is_state = "geo member" then // if is_selected_child_name = "Source" then // if il_selected_row <> 0 then // if is_column_name = "code" or is_column_name = "group_type" 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)) // // dw_2.triggerevent(editchanged!) // end if DAT*\// end if // else // if is_column_name = "type" then // dw_2.setitem(dw_2.getrow(), is_column_name, & // idwc_dw_child.getitemstring(il_selected_row, is_child_name)) // end if // end if //end if //end if //dw_2.triggerevent(editchanged!) Send(Handle(This), 256, 9, Long(0,0)) return 1 end event event dw_2::itemerror;call super::itemerror;return 2 end event type dw_1 from w_master_detail`dw_1 within w_geo event dwescape pbm_dwescape event dwnkey pbm_dwnkeDAT*^y event ue_get_from_rms pbm_custom31 int X=37 int Y=68 int Width=2784 int Height=288 string Tag="General information" string DataObject="d_geo_loc" 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("highDAT*`light_dddw") end if end if //if is_column_name = "type" or is_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) // // 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")DAT*b //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_child.getitemstring(il_selected_row, is_child_name)) end if end if end if end on event dw_1::ue_get_from_rms;call super::ue_get_from_rms;long ll_row_num ll_row_num = Message.LongParm ll_row_num DAT*d= dw_1.Find('rid = ' + String(ll_row_num), 1, dw_1.RowCount()) dw_1.ScrollToRow(ll_row_num) end event on dw_1::rowfocuschanged;call w_master_detail`dw_1::rowfocuschanged;wf_row_changed() 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_sDAT*felected_row = idwc_dw_child.GetRow() end if end if end event event dw_1::validate_delete;long ll_geo_rid, ll_where_pos string ls_sql_stmnt, ls_err if dw_1.RowCount() = 1 then select a.parent_rid into :ll_geo_rid from rap_geographic_locations a, rap_geographic_locations b where b.rid = :gl_geo_rid and b.parent_rid = a.rid; if f_db_error(SQLCA, "Fail on selecting parent_rid on " + & "rap_geographic_locations table. Contact your technical support.") = 1 tDAT*hhen return end if wf_delete(This) ls_sql_stmnt = "DataWindow.Table.Select=~"" + is_orig_sql_statement + "~"" ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("Modify Failed", ls_err) end if dw_1.Retrieve(ll_geo_rid) else wf_delete(This) end if end event on dw_1::delete_row;call w_master_detail`dw_1::delete_row;long ll_rid string ls_type // Get rid and geographic level type from the datawindow ll_rid = This.GetItemNumber(This.GetRoDAT*jw(), "rid") ls_type = This.GetItemString(This.GetRow(), "type") // Call function if f_delete_geo_loc(ll_rid, ls_type) = 1 then ib_delete = TRUE else ib_delete = FALSE end if end on 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 // Make theDAT*l return key acts like the tab Send(Handle(This), 256, 9, Long(0,0)) return 1 end event on dw_1::add_row;long ll_cur_row if is_level_type = 'NATION' then // Get current row number ll_cur_row = This.GetRow() if wf_check_pending() then This.InsertRow(ll_cur_row) This.ScrollPriorRow() This.TriggerEvent(Rowfocuschanged!) ib_obj_modified = TRUE end if This.SetItem(ll_cur_row, 'type', 'NATION') dw_2.Reset() else MessageBox("Insert", "Sorry! Insert is DAT*nnot allowed in the general " + & "information area for non-nation record") end if end on event dw_1::itemfocuschanged;call super::itemfocuschanged;string ls_col_name long ll_cur_row ls_col_name = This.GetColumnName() // if ls_col_name <> is_column_name then // if is_column_name = "type" or is_column_name = "group_type" then // if is_column_status <> "valid" then // MessageBox(is_msg_name, is_msg_text) // this.setcolumn(is_column_status) // return DAT*p // end if // end if // end if choose case ls_col_name case "type" ll_cur_row = This.GetRow() // Set data for geographic type for all levels This.SetItem(ll_cur_row, 'type', This.GetItemString(ll_cur_row, 'type')) case "group_type" f_retrieve_group_types(parent, this, "GEO") end choose // is_column_status = "valid" if ls_col_name = "type" then il_selected_row = 0 // is_filt = "" getchild(ls_col_name, idwc_dw_child) is_column_name = ls_DAT*rcol_name is_child_name = "type" is_validation_table = "rap_geographic_types" is_msg_name = "Column - Type" is_msg_text = "Sorry! Not a valid geographic type" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "group_type" then il_selected_row = 0 // is_filt = "" 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 = DAT*t"Column - Group Type" is_msg_text = "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 on dw_1::updateend;call w_master_detail`dw_1::updateend;if This.RowCount() > 0 then gl_geo_rid = This.GetItemNumber(This.GetRow(), "rid") else gl_geo_rid = 0 end if end on event dw_1::itemerror;call super::itemerror;return 2 end event on dw_1::editchanged;call w_master_detail`dw_1::edDAT*vitchanged;////////////////////////////////////////////////////////////////////////// // // Purpose: To call function to find the row which matches the closest to // what is typed in the edit portion of dddw // // Log: // 5/94 JBW Initial version // 5/31/94 SWJ Deleted the fourth parameter is_filt in f_dddw_search, // Added postevent to highlight the matched row in dddw. // 6/11/94, JBW ////////////////////////////////////////////////////////////////////////// string ls_col_namDAT*xe 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 = "type" or is_column_name = "group_type" then // il_selected_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 // // DAT*zcorrect 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() // //if ls_col_name = "type" or ls_col_name = "group_type" then // if Not f_validate_code(This.GetText(), is_child_name, is_validation_table) then // is_column_DAT*|status = ls_col_name // else // is_column_status = "valid" // end if //else // is_column_status = "valid" //end if // // // ////filt = left(idwc_dw_child.getitemstring(il_selected_row, is_child_name), len(filt)) then // end on on dw_1::losefocus;call w_master_detail`dw_1::losefocus;//if is_column_status <> "valid" and len(is_column_status) > 0 then // messagebox(is_msg_name, is_msg_text) // dw_1.setfocus() // dw_1.setcolumn(is_column_status) //end if end on onDAT*~ dw_1::retrievestart;call w_master_detail`dw_1::retrievestart;//string sqlStatement, err //long wherePos // //if levelType = "NAT" then // OrigSqlStatement = dw_1.dwDescribe("DataWindow.Table.Select") // wherePos = Pos(OrigSqlStatement, " WHERE", 1) // sqlStatement = Left(OrigSqlStatement, wherePos - 1) // sqlStatement = "DataWindow.Table.Select=~"" + sqlStatement + "~"" //else // sqlStatement = "DataWindow.Table.Select=~"" + OrigSqlStatement + "~"" //end if // //err = dw_1.dwMoDAT*dify(sqlStatement) //if err <> "" then // MessageBox("dwModify Failed", err) //end if end on type r_1 from w_master_detail`r_1 within w_geo int X=41 int Y=36 end type type r_2 from w_master_detail`r_2 within w_geo int X=32 int Y=540 end type type cb_parent from commandbutton within w_geo int X=2423 int Y=260 int Width=361 int Height=80 boolean Visible=false string Tag="Show parent information" boolean BringToTop=true string Text="Parent" int TextSize=-8 int Weight=700DAT* string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type event clicked;string ls_sql_stmnt, ls_err, ls_cur_type, ls_parent_type long ll_where_pos, ll_child_rid, ll_row_num, ll_cur_row, ll_parent_rid ll_cur_row = dw_1.GetRow() ls_cur_type = dw_1.GetItemString(ll_cur_row, "type") if ls_cur_type <> is_highest_type then // Find out the parent geo type of the current geo type select distinct parent_type into :ls_parent_type fromDAT* rap_geographic_members where child_type = :ls_cur_type; if sqlca.sqlcode = 100 then MessageBox(Parent.Title, 'No parent types found for child type~n' + & ls_cur_type + 'in rap_geographic_members') return elseif f_db_error(SQLCA, "Fail on selecting parent type on " + & "rap_geographic_members table. Contact your technical support.") = 1 then return end if ll_child_rid = dw_1.GetItemNumber(ll_cur_row, "parent_rid") if ls_parent_type <> 'NATION' then // FDAT*ind the parent rid of parent type select parent_rid into :ll_parent_rid from rap_geographic_locations where rid = :ll_child_rid; if f_db_error(SQLCA, "Fail on selecting parent rid on " + & "rap_geographic_locations table. Contact your technical support.") = 1 then return end if end if ll_where_pos = Pos(is_orig_sql_statement, " WHERE", 1) ls_sql_stmnt = Left(is_orig_sql_statement, ll_where_pos - 1) // ls_sql_stmnt = "DataWindow.Table.Select=~"" + ls_sql_DAT*stmnt + & // "WHERE RID = " + String(dw_1.GetItemNumber(ll_cur_row, "parent_rid")) + & // "~"" if ls_parent_type = 'NATION' then ls_sql_stmnt = "DataWindow.Table.Select=~"" + ls_sql_stmnt + & "WHERE TYPE = '" + ls_parent_type + "' and rid > :rid ~"" else ls_sql_stmnt = "DataWindow.Table.Select=~"" + ls_sql_stmnt + & "WHERE TYPE = '" + ls_parent_type + "' and parent_rid = :rid ~"" end if ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("ModifDAT*y Failed", ls_err) end if if ls_parent_type = 'NATION' then dw_1.Retrieve(0) else dw_1.Retrieve(ll_parent_rid) end if ll_row_num = dw_1.Find("rid = " + String(ll_child_rid), 1, dw_1.RowCount()) dw_1.ScrollToRow(ll_row_num) wf_row_changed() end if dw_1.SetFocus() end event type cb_member from commandbutton within w_geo int X=64 int Y=404 int Width=361 int Height=80 string Tag="Show member information" boolean BringToTop=true string Text="State" int TextSiDAT*ze=-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_act.Visible then if uo_act.uf_check_pending() then uo_act.uf_save() end if end if if uo_loc.Visible then if uo_loc.uf_check_pending() then uo_loc.uf_save() end DAT*if end if SetPointer(HourGlass!) wf_enable_btn(TRUE) f_highlight_button(r_buttons, this, "on") is_current_btn = This.Text + ' Member' // Change attributes of menu items is_state = 'geo 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 is_selected_child_name = Left(is_current_btn, Pos(is_current_btn, " Member") - 1) wf_set_var() wf_draw_dw2() dw_2.SetFocus() end on type cb_grouDAT*p from commandbutton within w_geo int X=855 int Y=404 int Width=361 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 if uo_act.Visible then if uo_act.uf_check_pending() then uo_act.uf_save() end if end if if uo_loc.VisiDAT*ble then if uo_loc.uf_check_pending() then uo_loc.uf_save() end if end if SetPointer(HourGlass!) wf_enable_btn(TRUE) f_highlight_button(r_buttons, this, "on") is_current_btn = This.Text // Change the attributes of menu items is_state = 'geo group' f_menu_behave(is_state, is_style_state, is_enlarge_state) uo_act.Hide() uo_loc.Hide() // Change the size of dw_1, move buttons and display group user object uo_group.uf_retrieve_select_list(dw_1.GetItemString(dw_1.GetRow(),DAT* "type"), & dw_1.GetItemNumber(dw_1.GetRow(), "rid")) uo_group.uf_retrieve_group_member(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) uo_group.Show() uo_group.dw_select_list.SetFocus() end on type cb_activity from commandbutton within w_geo int X=1650 int Y=404 int Width=361 int Height=80 string Tag="Show activity current view" boolean BringToTop=true string Text="Activity" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPiDAT*tch=Variable! end type on clicked;integer li_row string ls_action 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 // For Ag Profile if is_use_type = 'on' then OpenWithParm(w_use_type, istr_use_type) istr_use_type = Message.PowerObjectParm if istr_use_type.actiDAT*on = 'cancel' then return else is_use_type_list = '' for li_row = 1 to istr_use_type.upper_bound if is_use_type_list = '' then is_use_type_list = "'" + istr_use_type.use_type[li_row] + "'" else is_use_type_list = is_use_type_list + ", '" + & istr_use_type.use_type[li_row] + "'" end if next end if end if SetPointer(HourGlass!) wf_enable_btn(TRUE) f_highlight_button(r_buttons, this, "on") if is_use_type = 'on' then This.Enabled = TRUE This.Text DAT*= 'Dimensions' end if is_current_btn = This.Text uo_group.Hide() uo_loc.Hide() is_state = 'geo activity' choose case w_mdi_main.is_act_style case 'current', '' Parent.TriggerEvent("current_view") case 'history' Parent.TriggerEvent('history_view') case 'form' wf_draw_dw2() m_main_menu.m_view.m_freeform.TriggerEvent(Clicked!) case 'list' wf_draw_dw2() m_main_menu.m_view.m_tabular.TriggerEvent(Clicked!) end choose end on type cb_location from commandbuttonDAT* within w_geo int X=2441 int Y=404 int Width=361 int Height=80 string Tag="Show location information" boolean 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 if uo_group.Visible then if uo_group.uf_check_pending() then uo_group.uf_save() end if end if if uo_act.Visible theDAT*n if uo_act.uf_check_pending() then uo_act.uf_save() end if end if SetPointer(HourGlass!) wf_enable_btn(TRUE) f_highlight_button(r_buttons, this, "on") is_current_btn = This.Text // Change the attributes of menu items is_state = 'geo location' f_menu_behave(is_state, is_style_state, is_enlarge_state) uo_act.Hide() uo_group.Hide() // Change the size of dw_1, move buttons and display location user object uo_loc.uf_retrieve_dw_loc_master(dw_1.GetItemNumber(dw_1.GetRow()DAT*, "rid")) uo_loc.Show() uo_loc.dw_loc_master.SetFocus() end on type cb_member_2 from commandbutton within w_geo int X=594 int Y=404 int Width=361 int Height=80 boolean Visible=false string Tag="Show member information" boolean BringToTop=true int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;SetPointer(HourGlass!) wf_enable_btn(TRUE) f_highlight_button(r_buttons, this, "on") if NoDAT*t wf_check_pending() then return is_current_btn = This.Text + ' Member' // Change attributes of menu items is_state = 'geo 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 is_selected_child_name = Left(is_current_btn, Pos(is_current_btn, " Member") - 1) wf_set_var() wf_draw_dw2() dw_2.SetFocus() end on type uo_loc from u_dw_loc within w_geo int X=0 int Y=496 int Height=940 booleaDAT*n Visible=false string Tag="Location information" boolean Border=false BorderStyle BorderStyle=StyleBox! end type on uo_loc.destroy call u_dw_loc::destroy end on type uo_act from u_dw_act_geo within w_geo int X=0 int Y=512 int Width=2889 int Height=932 boolean Visible=false boolean Border=false BorderStyle BorderStyle=StyleBox! end type on uo_act.destroy call u_dw_act_geo::destroy end on type uo_group from u_dw_group_geo within w_geo int X=32 int Y=516 int Width=2802DAT*A boolean Visible=false end type on uo_group.destroy call u_dw_group_geo::destroy end on type r_buttons from rectangle within w_geo int X=576 int Y=372 int Width=160 int Height=144 boolean Visible=false boolean Enabled=false int LineThickness=4 long LineColor=12632256 long FillColor=32768 end type DAT*_1%r_2& controlc@!,"P#p$%&  $@ H` h          Z$8$P$h$t$$*8Fd 0 st_no_record_white!st_no_record_greyrd$"dw_loc_detail@#dw_loc_DAT*masterX$r_1p%r_2|&  8 P h t  123456789: ; < = > ?P2o12 3 +highlight_dddw+filteruf_saveuf_check_requireduf_check_pendinguf_retrieve_dw_loc_detailuf_undo_dw_loc_detailuf_undo_dw_loc_masteruf_retrieve_dw_loc_masteruf_check_master_riduf_check_detail_riduf_select_alluf_deleteuf_cascade_deluf_select_onef_get_sequencef_del_recsDAT*+create+destroy (:Ke{     %''"*2 h widthheightborderbackcolorpicturemaskcolortabtextcolorDAT*tabbackcolorst_no_record_whitest_no_record_greydw_loc_detaildw_loc_masterr_1r_2uidw_activeidwc_dw_childis_validation_tableis_column_nameis_old_valueis_msg_nameis_msg_textis_child_nameil_selected_rowis_column_statusil_ref_ridis_orig_sqlib_new_masterib_new_detailib_delete0H &7DQ d v DAT*   ! Ud@ +6B!P^] oH  @@1 DAT*   @        !  1o& $2P.<x36<4H<5DAT*Y>6s>7>8L@9>: >; \P< xl= > ,?DAT*>>2  2 xywidthheightvisibleenabledtextalignmentfocusrectangletextcolorbackcolortextsizeweightfacenamefontfamilyfontpitch@  G!@).8GQ[DAT*dkt] G @ @2  2 xywidthheightvisibleenabledtextalignmentfocusrectangletextcolorbackcolortextsizeweightfacenameDAT*fontfamilyfontpitch@  G!).8GQ[dkt] G @ DAT*@     d)808$0)L8,J1X,T$0d" +wparam+lparam::message< @#\ uf_check_pending5rap_location_coordinatesuf_select_one?= LDAT* T \)8()48,B1P,<$(d" +wparam+lparam::message< @#D uf_check_pending5uf_select_all<$ 4 < F)8,,1:,$d" +wparam+lparam::message< DAT*@#  uf_save3  H)8,.1<,$d" +wparam+lparam::message< @#$ uf_delete=  b%8,#)$8,H1V,,$.d, ancestorreturnvaluesqlca::meDAT*ssage<#@%"@#4 constructorsettransobject^$ , 8 $)4818<08C0@8t$)8,1,$n$$)88J8n8<080@8$) 8,Z1h,DAT*$0$)@8)H8)\8)t89},1,$ F n $@nd6 +wparam+lparamancestorreturnvalue::messageP ,@# add_rowdw_loc_master$rowcount4(InsertPlease provide location group information first$DAT*setfocus|$$getrowridgetitemnumber Please save location group information firstErr$|st_no_record_white!hide98insertrow(Pscrollpriorrow>dib_new_detailer|4 4 t           0 @ H \ t   <8)$81DAT*X@$)P8tX$)h8,1,p$8TXtd2 +currentrowancestorreturnvalue::message<(@#x0 rowfocuschangedrowcount4st_no_record_whitee,!showH,!hide`$ @ P X h p 98) 81XDAT*<$)L8tT$)d8,1,l$8TXtd0 +rowcountancestorreturnvalue::message<&@#t0 retrieveendrowcountunt4st_no_record_whitei(!showhowD(!hide\ < L T d l h8 9},N1DAT*\,($ 4d6 +wparam+lparamancestorreturnvalue::messageP ,@#0 delete_rowib_deleteunt5 ( l81) 8,R1`,($8d6 +wparam+lparamancestorreturnvalue::messageP DAT*,@#0 first_rowscrolltorow? ( > .8$)(8,!)@8)T868\,-p8x,/8,1,$12,$4 Nhx dv DAT* ancestorreturnvaluelw_active_sheetlw_active_sheet_namew_mdi_maincase14w_geow_sourcew_device::message ), A!@$L T-@*Z/@+c1@,l@#H getfocusr_2& show getactivesheet70classnameHw_geoidw_activeb1%w_sourceemb1%w_deviceb1%uidw_active'! (DAT* @ T p     h28$)(8,N1\,0$4d& ancestorreturnvalue::message(@#8 losefocusr_2& hide  ( 0 |8,!$6)08,b1p,8$DAT*HdD +flags+xpos+yposancestorreturnvaluew_mdi_main::messagex /!@$:@#@ mousemovetagsetmicrohelpZ  0 8 v8)8)08,\1j,8$Bd6 +wparam+lparamancestorreturnvalue::messageDAT*P ,@#@ last_rowrowcount4scrolltorow?$ 0 8 f8) 8,L1Z,($2d6 +wparam+lparamancestorreturnvalue::messageP ,@#0 next_rowscrollnextrow< DAT* ( f8) 8,L1Z,($2d6 +wparam+lparamancestorreturnvalue::messageP ,@#0 prev_rowscrollpriorrow> ( %. 2 9<   L%OPQRSTcdef-&DAT*/29<.2 +select_one+select_all+save+validate_delete+constructor+add_row+rowfocuschanged+retrieveend+delete_row+first_row+getfocus+losefocus+mousemove+last_row+next_row+prev_row@ &7DM^kw    DAT* 2 E xywidthheighttaborderdataobjecthscrollbarhsplitscroll$  "-8] o$  @ @ DAT* : cF dR xeX f%L |O<9 P  QDAT* . 2 2 =  TG $SQ <R     d)808$0)T8,J1X,\$0DAT*d" +wparam+lparam::message< @#d uf_check_pending5rap_location_coordinate_groupsuf_select_one?C T \ \)8()48,B1P,<$(d" +wparam+lparam::message< @#D uf_check_pending5DAT*uf_select_all<$ 4 < F)8,,1:,$d" +wparam+lparam::message< @#  uf_save3  "$1)08H$)X8`$x$6)8$**$6DAT*880)8,1,$0Jd ls_col_name::message( @#` il_selected_row/getcolumnname is_column_name8*getrowP8*is_old_valueh+setitemPidwc_dw_child( is_child_name./highlight_dddwpostevent 0 H X `DAT* x       H)8,.1<,$d" +wparam+lparam::message< @#$ uf_deleted_=  : *@l@l8$1)08H$)X8`$x$$$)DAT*8)8,1,$4Lf d- +key+keyflagsls_col_name::messageP"   #@#X il_selected_row/getcolumnname is_column_name8*getrowP8*idwc_dw_childh( /is_child_name.getitemstringte[setitemP 0 H X ` x DAT*     <8)$81j@$)P8)t8|$)8$)8,1,$8Tfj d2 +currentrowancestorreturnvalue::message<(@#H rowfocuschangedrowcount4st_no_record_grey0,"hideDAT*Huf_retrieve_dw_loc_detail6X,"showddw_loc_detail#resetd/$ @ P t |     l 8)$88@$)P8)`8)t8)8880)89}9})88J 88)(88<$)DDAT*8,R1`,L$ 4Px 8d; +wparam+lparamancestorreturnvaluenrow::messaged ,1@#Tx add_rowuf_check_pending5st_no_record_grey0,"hideHgetrowXinsertrow(hscrollpriorrow>|rap_location_coordinate_groups_shape_typPsetitemPib_obj_DAT*modifiedib_new_master3Xref_ridgetitemnumber Xil_ref_rid01O$ @ P ` t        ( < D L h8 9},N1\,($ 4d6 +wparam+lparamancestorreturnvalue::messageP DAT*,@#0 delete_rowib_deleteing5 ( 18)(880TP1h)|86808080(800`x$$)8)88p1)DAT*8680808048<0`h$p$)x8)880,1,$ 8LbP h!~"#$%& '$(l)p-d: rowdwoancestorreturnvaluels_col_name::messaged DAT*$ 0@# itemfocuschangedgetcolumnnameaccuracy_typeil_selected_row>/idwc_dw_childX( getchildopis_column_name*is_child_namee_.typeis_validation_table)rap_accuracy_methodsis_msg_name,Column - Accuracy Typeis_msg_text-Sorry! Not a valid accuracy methodis_old_valueS+dw_loc_masterh$h$getrowfgetitemstringtFcalcuDAT*lation_typeont>/X( op*.)rap_coordinate_calc_types,Column - Calculation Type-Sorry! Not a valid calculation typeS+h$h$*( P h |     ( ` x           4 ` h p x    98) DAT*81j<$)L8)p8x$)8$)8,1,$8Tf j d0 +rowcountancestorreturnvalue::message<&@#H retrieveendrowcountolu4st_no_record_greyyp("hide_roDuf_retrieve_dw_loc_detail6T("shows_cdw_loc_detailDAT*_c#reset/ < L p x     > .8$)(8,!)@8)T868\,-p8x,/8,1,$12,$4 Nhx dv DAT* ancestorreturnvaluelw_active_sheetlw_active_sheet_namew_mdi_maincase14w_geow_sourcew_device::message ), A!@$L T-@*Z/@+c1@,l@#H getfocusr_1owc%show getactivesheet70classnameHw_geoidw_activeb1%w_sourceb1%w_deviceB b1%uidw_active'! (DAT* @ T p     |8,!$6)08,b1p,8$$HdD +flags+xpos+yposancestorreturnvaluew_mdi_main::messagex /!@$:@#@ mousemovetagwcsetmicrohelpZ  0 8 DAT*8)$8V)88)L8,p1~,T$4Vd6 +wparam+lparamancestorreturnvalue::messageP ,@#\ last_rowuf_check_pending5rowcount4,scrolltorow?@$ 8 L T h28$)(8,DAT*N1\,0$4d& ancestorreturnvalue::message(@#8 losefocusr_1%hide  ( 0 8)$8L1)88,f1t,@$4Ld6 +wparam+lparamancestorreturnvalue::messageP DAT*,@#H first_rowuf_check_pending5scrolltorow?,$ 8 @ z8)$8F)<8,`1n,D$4Fd6 +wparam+lparamancestorreturnvalue::messageP ,@#L prev_rowuf_check_pending5scrollpriorrow>,DAT* $ < D z8)$8F)<8,`1n,D$4Fd6 +wparam+lparamancestorreturnvalue::messageP ,@#L next_rowuf_check_pending5scrollnextrow<,$ < D 6-8)$8DAT* <$Tl$**$68$180)8,1,$(@ZdB +row+dwo+dataancestorreturnvaluels_col_name::messagex  , 8@#H editchangedgetcolumnnameiDAT*s_column_name,*il_selected_rowD/idwc_dw_child\( is_child_namet.D/D/highlight_dddwpostevent$ < T l      $1)08H$)X8`$x$$$)8)8_@_811 11@8 @ 81DAT*0Jd ls_col_name P il_selected_row/getcolumnname is_column_name8*getrowP8*idwc_dw_childh( /is_child_nameve.getitemstringve[setitemP 0 H X ` x     :6081d) rowdwodataancestorreturnvaluDAT*eP   itemerror6/8)$8<$)L8d$6$68#$6$6@81,1 ,$(@Z d? rowdwodataancestorreturnvaluels_col_name::messagexDAT*  ) 5@#@ itemchangedgetcolumnnameis_column_name,*gettextDis_child_nameT.is_validation_tablel)is_msg_name,is_msg_text-$ < L d     -. /01 29 <  DAT*OPQRSTcdef-&/1029<.2 + +select_one+select_all+save+dwescape+validate_delete+dwnkeyf_dddw_search+rowfocuschanged+add_row+delete_row+itemfocuschanged+retrieveend+getfocus+mousemove+last_row+losefocus+first_row+prev_row+next_row+editchanged+dwnprocessenter+itemerror+itemchangedf_validate_code &0DAT*AI2Whq}     I2=d@<d@32 @ xywidthheighttaborderdataobjectborderborderstyleDAT*$ ! ] "*-4] o$! ]  @ *  : cF dR (xDAT*eiX @fpXT< `O x Pr1 9  . 2 DAT*=  T2 QQ RG 0SlH-l|0l/2  2 K xywidthheightvisibDAT* leenabledlinethicknesslinecolorfillcolor  w!) 7A]   w2  2 K xywidthheightvisibleenabledlinethicknesslinecolorfillcolor  DAT*!)7A]  DAT*$       ( 8 @ H P X ` h x             , @ b$),8@$X`$18H)x8$$18)8$$18)8$$18DAT*&) 8($<D$18L)\8\ d d dw_act_query$accepttexti istr_acttte43'start_date_timeH$getitemdatetimeh43'end_date_time8$h43'method_type$getitemstring@43'ref_code$reference_codec43'ref_typeou_0$reference_typeeDAT*( , @ X ` x              ( < D \  $0$8808O0:)@:@@8}}1<)8#91<)8$9}9}9}9T` t DAT**d$ li_messagebox_returncase7(@ dw_act_detail!ib_obj_modified Activity Specific ViewData have been modified in this specific view. Save current changes?uf_save2uf_undo_dw_act_detailth6! ib_new_detail@2ib_no_insert4 0        $),84$)H8DAT*,1P$:@)h81p$)81RL > L Zd rownumtotalrow(@ dw_act_detail!accepttextf !rowcountifi4<!getnextmodifiedsX!reselectrow.x , 4 H P h p  X e@DAT*.8 @8)8,*8 8Bz%81<,(,*,*8c8Bz%81<,(,*8{8Bz%81<"   ,( 01},*$1 8 z%8z&#8z%z&8z&DAT*08z%#J8z%z&8 z&0$18$)L8)\81d$1)x8  ,*,*88z%8z&81<4,( ,*,*88z%8z&81<,(,*L,*8G8z%8z&81< DAT*2,(p$8x)8$8 6)8$8 6)8J1808 z%8z&@8,(J$8$)888@"#JD$8xJ\8} d$8)l8t$1)|8$8x)8DAT*4$8 6)8$8 6)8$8)8$85)8$8$6)8 $8(<$)D8L$8T5)d8l$8t 6)|8$8$ 6)8$86)8$86)DAT*68$86)8$85)8#8@"$86)(80$886)D8L$8T6)d8l$8t6)8$8M2)8$86)8$8 6)8# $86)DAT*88$86)8   ,( 1<R},(,*88z% 81< <$8D)x8$)8$8R $)81r D $8T)8$8)8DAT*:#!" 5  #!"@  5h  "#  $8$58@0)@)8z'8Kz& 58@0)@)8z(R #. P$X8$58@0)@)8z'R `$h8@0 8J!$"*|+-./1256":J>@CEGJDAT*<K.N4P8RJUVZ\^abf g6hdkmopvxy"z@{p|}~Jt 8fLj" P ~  n  4 V 0 @ D X * . d sql_statementll_ridll_row_numll_tempridll_total_rowldt_start_date_timeldt_end_date_timeldt_creation_date_timeldt_min_startldt_max_endls_metric_codels_user_idls_valuels_desclsDAT*>_commentsls_confidential_flagls_data_codels_material_codels_method_typels_reference_codels_reference_typels_value_typels_value_unit_codels_dwfindls_act_valueldec_value_amtcounterli_seq_nosqlsametriccursorsqlcal (3@ T f }     DAT*@       " 4 B U  _ l {(@-|>*@.p uf_clear_detail:Fail on declaring dynamic cursor Contact your technical support.Fail on preparing sqlsaFail on open dynamic curDAT*Bsor metric_code = '' and (value_type = '' or IsNull(value_type)) and IsNull(value_type) and (material = '' or material = '@')dw_act_detail ! !rowcount4@find kT !insertrow(lFail on selecting name from rap_metrics table in uf_retrieve_dw_act_detail. Contact your technical support.Fail on selecting minimum rid from rap_metric_maps table in uf_retrieve_dw_act_detail. Fail on selecting view_sequence_no from !view_seq_nosetitDAT*DemO !metric_descP !metric_codePApplication ErrorError finding metric code - . Contact your technical support !valuegetitemstring*red !getitemnumbergg L !* !(l !O !P !P !ridO !creation_date_timeO !metric_level_typeis_level,P !ref_ridil_ref_rid0+O !start_date_timeO !user_idPDAT*F !P !comments$P !confidential_flagP !data_code0P !end_date_time@O !material_codeP !method_typeP !reference_codeP !reference_typeP !value_amtO !value_typeP !old_valueP !unit_codeP !value_unit_codePFail on close dynamic cursor. !view_seq_no A material_code A, value_type AsetsoDAT*HrtXp !sortcis_view_style)1current !4@ !getitemdatetime !st_current_heading%textShowing activity data from mm/dd/yyyy to %%  0 8 L \ d x p       8 D \ d l t |          DAT*J      < D L d l |            ( 0 D L d l            < x             P X ` h  886z%8Xz&8z&8z&8DAT*Lz&,$(@(8z(84z&X$z&8`z&p$x$)88)8$$)88)88z%,*5!8z(f8z%8z%,*5"8z(6)L8`$)p8 BLbf#&dE ls_sql_statementDAT*Nldt_start_date_timeldt_end_date_timesqlcaP  - ?*@.xh 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 = il_ref_rid+ and metric_level_type = 'is_levelO,'dw_act_masterDAT*Pb&b&getrowstart_date_timegetitemdatetimeb&b&end_date_time and start_date_time = and end_date_time is null and end_date_time = uf_retrieve_dw_act_detail71cb_selectT"showh, X p x       L ` p  886z%8Xz&8z&8z&8z&,$(@(8z(84z&X$z&8`zDAT*R&l$$8z%8z%,*$$5#8z($$<8z%8z%,*0$8$5$8z(8@z&6)x8"8<"d ls_sql_statementsqlca( *@.X Select rid, creation_date_time, metric_code, start_datDAT*Te_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 = il_ref_rid+ and metric_level_type = 'is_levelO,'istr_actb3'start_date_timet and ((start_date_time is null) and (start_date_time >= b3'tb3'end_date_time and (end_date_time is null)) and (end_date_time <= b3DAT*V' or end_date_time is null))uf_retrieve_dw_act_detail7\, X l      0 8 x p@8@8@8@8$),81j4$8<)H8P$8X5)l8t$8|6)8$DAT*X8)8$85)8$86)8$86)8$86)8$8$6)88@$8H6)T8\$8d5)t8|$86)8$86)8$86)8$DAT*Z8M2)8  8 T pBl$R  8#fdC ll_row_numll_total_rowll_nullldt_nullls_nullldec_nullx ( 1 9>  dw_act_detailea!rowcountetr4 !ridsetitemO@!creation_date_timeO@!metric_level_typeP@!DAT*\ref_ridO@!start_date_timeO@!user_idP@!valueP@!comments)P@!confidential_flagP@!data_codedP@!end_date_timeO@!method_typeP@!reference_codeP@!reference_typeP@!value_amtO@ , 4 H P l t             8 DAT*^@ T \ t |        L \$),84$)H81Z<  P$8X)l8t$8|)8 #!h$8J8,* 0,*88z%%81<^,*9d,*8  # 8" DAT*`"!8 $8J8$8)88 @$8H)X8`$8h)t8 |$8X)8 $8)8 $8)8 $8)8$8)8 $8) 8($80)@8DAT*bH$8P)`8h$8pJ|8$8)8$8)8$8)8$8)8$8J8&$19$8)8665)<81b9,*D$1o@DAT*do88Lv\$p$65 5666 66' 8 1\8x088z%8z&@89v1v9$$     M,* ,*8 8Gz%(81<(,*9|1v5)8b,*r,*9DAT*f|,*8 ,*$1o@o88L$$65 5666 66) 8 1!8x088z%8z&@8919     M,* ,*88z%*81<2 ,*98 ,*P9 >hDAT*h"$&J'P(Z)^/d3456&7R8~9:;<.=Z>?@AB:CfFIJKNTUHVbWZ[^N_X`lkvlmnoqstu$v(w8xXy^zb{h}r~v|$@x $ . 2 8 < d/ ll_row_numll_ill_rid_numll_ridll_rid_rtnll_act_ridld_value_amtldt_createldt_startldt_endls_valuels_commls_conf_flgls_data_codeDAT*jls_material_codels_method_typels_ref_codels_ref_typels_value_typels_value_unit_codels_createls_startls_endls_metricls_old_valuels_user_idsqlca#*5@> M X b j s {     DAT*l   ba  f  i th d  te ow)*@. dw_act_detail!accepttext !rowcount@4<!valuegetitemstring^!old_value^@^!ridgetitemnumber Fail on deleting rap_activities record. Contact your technical support.! !start_date_timegetDAT*nitemdatetime(!end_date_time@(!metric_code^!^!comment_textngl^!confidential_flags^!data_code^!material_code8^!method_type^!reference_code^!reference_type^!value_amt !value_type^!unit_code^!creation_date_time(!user_id^! !setitemOuDAT*pf_check_prev_metric_rec)I ORil_ref_rid$O+is_leveld,ActivityStart Date Time, End Date Time, Metric Code, Value Type, Material Code, Data Code, and Reference Code must be unique in table rap_activitiesd,O+Fail on insert rap_activities record. Contact your technical support.uf_close_off_prev_metric_rec>hO+d,Fail on update rap_activities record.  , 4 H P l t   DAT*r    8 @ X ` t |              ( @ H ` h |             < D \ p       2.:F@@8$)(8<$L9}d$)tDAT*t81)8$)8$1)8$$$1)8$9},$68$08408?0@88?8I08Y,$z%8hz&8z&8z&:)@@8,$68$0808?0@88?t8I08Y,$z%8hz&8z&8z&:)@DAT*v@8,$68$0808?0@88?8I08Y,$z%8hz&8z&8z&:)@@8,$68$08J08?0@88?8I08Y,$z%8hz&8Sz&8z&:)@@88j6@8 6.@.8$183 4@DAT*x8)88  6@8 6.@.8$18 3 4@8)8)8$$$1) 8)$83@3$8,0)@)81 o@o8@81@8.@.8@8@$)T81TDAT*z\$8d$6)8$8$)8$8,/6)8J9}$)8  6 T p  `t "n%t&'*-.^/r25678 :j;~<=A BGZKlLQS8UbVXikmd ll_row_numll_total_rowls_todayls_start_datels_end_datels_stDAT*|art_timels_end_timeldt_todayld_startld_endlt_startlt_endgs_inifilegs_user_id ) 7 C Q ] g p w $@/@@ st_no_record#hidette cb_select0"visibleDdw_act_detailT!reset/luf_DAT*~retrieve_parameterE|dw_act_query@$/l$insertrow($$widthresize$bringtotop activity insertstart_datenot foundActivity InsertError finding , activity insert section or start_date key in the ProfileString function. Contact you technical support.start_timeor start_time key in the ProfileString function. end_dateor end_date key in the ProfileString function. end_timeor end_time key in the ProfileStriDAT*ng function. $start_date_timesetitemO$end_date_timerROuf_resize_detailE @T!T!xmoveuf_clear_detail:mm/dd/yyyy hh:mm:ssT!rowcount4HT!metric_level_typeis_levelv,PT!ref_ridil_ref_ride+OT!user_idPib_no_insert4$setfocus ( < L d t       DAT*               $ @ T \           d  h,* l ,*881z%+81<X9b9 J T Xd( rid_valuedate_time_valuesqlca< DAT*"*@.Q Fail on updating rap_activities record. Contact your technical support.d  d  V*$8 (<$)L8,$68T08b08m0@88m8w08,$z%8z&8z&8z&:)@@8,$68T0808m0@DAT*88m8w08,$z%8z&8 z&8z&:)@@8,$68T08;08m0@88m68w08,$z%8z&8Dz&8z&:)@@8,$68T08t08m0@88m8w08,$z%8z&8}z&8z&:)@@886@8DAT*6.@.8$1834@8)88$6@86.@.8$1834@8)8P$8 P $1  )88 @8 @8@$18 5)H8 #&P$1DAT*8 5)X8  "#`$p8x 580)@)8z'8z& 580)@)8z(4 #$8x 580)@)8z'4$80$)8 8x"6 !"%0(6)v*-012385678;$@DA\B~CDGHIL&M:OPR SUDAT*4d ls_start_datels_start_timels_end_datels_end_timels_todayld_startld_endlt_startlt_endldt_startldt_endgs_inifile  $ 0 < E N U ^ e o w$@ is_view_style1historyst_current_heading(%hideDactivity viewstart_daDAT*tenot foundActivity ViewError finding , activity view section or start_date key in the ProfileString function. Contact you technical support.start_timeor start_time key in the ProfileString function. end_dateor end_date key in the ProfileString function. end_timeor end_time key in the ProfileString function. dw_act_queryt$start_date_timesetitemO$end_date_timeO1currentil_ref_rid+uf_select_datesF($O$ODAT*(%text@hShowing activity data from mm/dd/yyyy to (%h(%h(%show@ < L        8 @ H P X ` p       4:F@@8)80$)@8H$1)\8)t8$9)8$)8$DAT*1)8)81~ $)84$8<zT$)\8d$)x8$)8$)8$8)8$8<$,*) 8)081X)L88T08j$$580)@)8z'8z&$DAT*$580)@)8z(@89}$9)8 , H j|! "&#B$^&z(~)+-./1&3B4T5X>Bd ll_countsqlca(*@. 0 uf_reshape_dw?dw_act_query $reset,/8 $insertrowar(Puf_get_datesAddw_act_detail f|!setredraw v!|!/8DAT*il_ref_rid+uf_get_items4uf_count_actGst_no_record#showis_view_style$1historydw_act_masterD&/8D&setfocusl#hidein +uf_retrieve_parameterueE$1currentuf_retrieve_current9$1D&settransobject^uf_retrieve_dw_act_masterecHuf_retrieve_history88Activity History ViewNo activity data between istr_act fr3'start_date_timeDAT*mm/dd/yyyy and 3'end_date_timeib_no_insert4|!! 0 @ H \ t           4 T \ d x           0 L        $$,*)08DX6p6DAT*66669})8$,*)8$1),8)D8L$9)`8h$)x8$1)8)81@$)8$8<$)8$)$81,DAT*$)<8D$)d8l$8t)8$8$,*)8)81F)8$)8808<$T$58\0)@)8z'8gz&p$$58\0)@)8z(@8$9)8 4 L d | ,>^&DAT*z(*,/012 4<9P:l<>?@BDE&FBGFQda ref_ridlevelview_stylesource_codedevice_codeprocess_codestream_codell_countsqlca  ! - 9 F R[*@. dw_act_detail!settransobject^ il_ref_rid8+is_leveltroL,is_view_style`1DAT*is_src_codex-is_dev_code.is_pro_code/is_str_code0ib_no_insert 4uf_reshape_dw?dw_act_queryord$^ $insertrow( uf_get_datesncA4!setredraw!T!reset/p8+uf_get_items4uf_count_actaraGst_no_record#showtri`1historydw_act_master&/p&setfocusw_a#hidef_r48+uf_retrieve_parameterryELDAT*`1currentuf_retrieve_current9|`1&^ uf_retrieve_dw_act_masterHuf_retrieve_history8&Activity History ViewNo activity data between istr_act03'start_date_timeDmm/dd/yyyy and 03'end_date_timex!!T 0 D X p          , D L ` h x     DAT*     $ , < D d l         < T p    |.$>8 08'0@8,#)P8)d868l,2)8,4)8$9}9}v8,6)DAT*8,6 $,6($)888@JT8)\8d$l9}t9}v8|t,8)8p,8$6,9)8$9}9}v8,;)8,;$6$,<),84$<9}D9}v8LDAT*,>)X8l,>$6Q?)8$9}9}v8v,A)8v,A$6,A $)8$$9},9}8 > Xr2 !"#$,%>&\)p*+,-./2304F5h678DAT*;<=>?2@DAbd lw_cur_winls_win_namew_mdi_maincase15w_geogl_geo_ridw_legalw_sourcegl_source_ridw_devicegl_device_ridw_processgd_process_ridw_stream / #@+* 22@084@C6@2K8@3T9@b;@4k<@y>@5?~A@64 ib_noDAT*_insert4InsertAlready in insert modegetactivesheet7>classnameXw_geowf_check_pending}ril_ref_rid@+uf_insert_rowc@<dw_act_detaile@!ib_obj_modifiedib_new_detail2w_legal}r+dw_1. . getrow0ridgetitemnumber D<!2w_source.Te}ris_src_code-is_source_code]+<!2w_device}ris_dev_codeDAT*.is_device_code V+<!2w_process}ris_pro_code`/is_process_codetW+<!2w_stream}ris_str_code0is_stream_codeT+il_stream_ridS<!2 P d           ( 8 T \ d l t       DAT*     $ , 4 < D X l               $ , d pl_ref_rid $($,*,*808az%8z&,81<x-#-5  2 rDAT*xd. pdt_startpdt_endldt_max_startsqlcaP   (*@. il_ref_rid+is_level,Fail on selecting the earliest start date time, the latest end date time, and the latest start date time. Contact your technical support. ( |$($,*,*808lz%-81<l1DAT* * `ld ll_countsqlca(*@. il_ref_rid+is_level,Fail on performing count function on rap_activities table. Contact your technical support. ( v$,$@$6T$l$5t$$5)8d @ dw_act_master&il_ref_rid +is_leveltin4,istr_actDAT*artH3'start_date_time\H3'end_date_time|retrieve 2 , @ T l t    $($,*$,*0$1d`1,*888bz%.81<1    $6P\`dJ metric_code_valuematerial_code_valueend_date_valuell_ridsqlcad DAT* . =D*@. il_ref_ride+is_levelf_r,Fail on selecting rap_activities record. Contact your technical support. ( 0 P$)$8, 61D, ,$d ::message @)4 cb_selecte"hidevel $ , r * DAT*4*<T*\t*|******(0$8$@$H$P$X$`$h$p$x$ |,BXn d  dw_act_detail!cb_select("(st_no_recoDAT*rdD#Ddw_act_queryd$dst_current_heading@%dw_act_masterc@&r_1'!!r_2(##ln_1)%%ln_2*&&control c@!("D#d$%&'!(#)%*&  4 <T \t |      ( 0 8 @ HDAT* P X ` h p x  $,$D$\$x$$$$$$*8FT b p ~d P dw_act_detail!cb_select_s "st_no_record4#dw_act_queryL$st_current_headingd%dw_act_master&r_1'!r_2(#ln_1*)%ln_2e@*& , DDAT* \ x      "123456789: ; < = > ?@ABCDEFGHIL"o12 1 +highlight_dddwuf_saveuf_check_requireduf_get_itemsuf_check_pendinguf_undo_dw_act_detailuf_retrieve_dw_act_detailuf_retrieve_historyuf_retrieve_currentuf_clear_detailuf_check_riduf_insert_rowuf_set_row_statusuf_close_off_prev_metDAT*ric_recuf_reshape_dwuf_resize_detailuf_get_datesuf_out_of_insert_modeuf_prepare_dwuf_add_rowuf_retrieve_parameteruf_select_datesuf_count_actuf_retrieve_dw_act_masteruf_check_prev_metric_recf_validate_actf_db_errorf_compare_date_timef_get_sequencef_get_activity_rid+constructor+create+destroy 2?PfDAT*     !.DR]=d@s<,d@%!+++!+=+<++,DAT*,,,T+-ouchni.t!+teing.ed!+be +*+ +!+PO tion(2  widthheightborderbackcolorpicturemaskcolortabtextcolortabbackcolordw_act_detailcb_selectst_no_recorddw_act_queryst_current_headingdw_act_masterr_1r_2ln_1lnDAT*_2il_ref_ridis_levelis_src_codeis_dev_codeis_pro_codeis_str_codeis_view_styleib_new_detailistr_actib_no_insertuis_msg_nameuis_msg_textuis_old_valueuil_selected_rowuidwc_dw_childuis_child_nameuis_validation_tableuis_column_statusuis_column_nameis_unit_sqlW \&7DQ _ i v DAT*   ! # % &d@,'!,9FTe tDAT*] oW \ @@1    @         ! # % &' DAT* 1o&$2.$x3@&4M$5^&64(7&8&9&: $DAT*; &< &= P8> 8&?F&@W&Ad&BTC&DEDAT*F G-H|I"/L&0&1     \8080@8, B1DAT*P, D$(d" +wparam+lparam::message<  @)L Filter on ActivitySorry! This function is not availableD \8080@8, B1P, D$(d" +wparam+lparam::message<  @)L Show All on ActivitySorry!DAT* This function is not availableD `:F@@8)8, F1T, $,d" +wparam+lparam::message<  @)  uf_save2  \8080@8, B1P, @$(d" +wparam+lparam::message<DAT*  @)H Delete ActivitySorry! This function is not available@ "$1)48L$)\8d$|$6)8$**$6880)8, 1, $0J d ls_col_name::message(DAT*  @)` uil_selected_row8getcolumnname$uis_column_name<=getrowT<=uis_old_valuel7setitemPuidwc_dw_child@9 uis_child_name:8highlight_dddwpostevent  4 L \ d |       : *@l@l8$1)48L$DAT*)\8d$|$$$)8)8, 1, $4Lf d- +key+keyflagsls_col_name::messageP(   # @)X uil_selected_row8getcolumnname$uis_column_name<=getrowT<=uidwc_dw_childl9 8uis_child_namew:getitemstringil[DAT*setitemP 4 L \ d |      f8)8, L1Z, $$2d6 +wparam+lparamancestorreturnvalue::messageP , @), add_rowuf_add_rowD $ t.8$)(DAT*84$D$1<RT$1<R)d8l$x$1 <Y$1 <Y)8$)8,#)8)868h,2@8,6@8 ,8@8 ,;,@84,>@@8HDAT*@,AT, Z1h, \$4 ,<Pd|,@d ancestorreturnvaluelw_active_sheetlw_active_sheet_namew_mdi_maincase17w_geow_legalw_sourcew_devicew_processw_stream::message /, A#@+L T2@0Z6@2b8@3k;@DAT*4t>@5~A@6 @)d getfocusr_1'!hide r_20(#width<heightLresize\0(#xty$move0(#show)getactivesheet7classnamew_geoidw_active1%w_legal1%w_source@1%w_device1%w_process@1%w_stream1% ( 4 D T d l x  DAT*        , @ T \ Z K18)(86808>"8H068V0 8T8[8H068g0 8T8l88H068g0 8T8{8H068V0 8T8DAT*T,#)8$88)88)8$668 680  18)L8d6|8V0808080$<$D$)L8)T8& 8 DAT*\1d)l8t6|8V0808080$$)8)8& 8[ 1 )86$8g0,840@8H0`8h0DAT*$$)8)8& 8l 1)868g0808080@H$P$)X8)`8& 8{ h1p)x868V080DAT*8080$$)8)8& 8>   1()0886@8V0H8P0`8h0|80$$)8)8& 80, @ 1N , $ 8HDAT*n  4L~"Tdx !"#4$|%&'()*+6,P-./012384R5l6789: ;:<T=n>?@AB$C<DVEpFGHIJK@LXMrNOPQ R U& dq rowdwoancestorreturnvaluels_col_namedwccase6lw_windoww_mdi_mainls_metric_codecase26::message $ 0DAT* 4 ; /E#@+P _ g @) itemfocuschangedgetcolumnnamematerial_codedata_codeActivity Viewcodemethod_typetypereference_typereference_codeunit_codegetactivesheet7is_unit_sql>null>getrowmetric_codegetitemstring>uil_selected_rowg 8uidwc_dw_child(9 getchildo@uis_column_nameT=DAT*uis_child_namel:uis_validation_table;rap_materialsuis_msg_name5Column - Material Codeuis_msg_text6Sorry! Not a valid material codeuis_old_value7dw_act_detail,!,! 8(9 o@T=l:;rap_units5Column - Unit Code6Sorry! Not a valid unit code7,!,! 8(9 o@T=l:;rap_methods5Column - Method TypeDAT*6Sorry! Not a valid method type7,!,! 8(9 o@T=l:;rap_reference_types5Column - Reference Type6Sorry! Not a valid reference type7,!,! 8(9 o@T=l:;rap_reference_codes5Column - Reference Code6Sorry! Not a valid reference code7,!,! 8(9 o@T=l:;rap_dataDAT*_codes5Column - Data Code6Sorry! Not a valid data code7,!,!T=(         8 L d |    $ < D L T \ d l t |              $ , @ `      DAT*        @ H P X ` h p x             ( 0 8 @ H ` |        z6/8)$868,)@8)P88X6)pDAT*88x)88x080)88$)8$6$68#$6$6@818P$)X8)`88h3@3$)|8)88,/6)8, `1n, $(@Pd | DAT*(pFd^ rowdwodataancestorreturnvaluels_col_namels_unit_codecase6gs_user_id::message  ) 5 B I/@T @) itemchangedgetcolumnnamenaunit_codegettextda6getrowyHvalue_unit_codesetitemPhvalue6value_amtHuis_column_namDAT*e=6uis_child_name:uis_validation_table;uis_msg_name5uis_msg_text 6uil_selected_row$8uidwc_dw_child@9 bHHcreation_date_timeOhHuser_idPh$ @ P p         8 P X ` |    P6-8)$868,DAT*)@8)P88X6)p88x)88x080)88$$**$68$180),8)488<3@3$)P8)X88`,/6)h8, 61D, p$DAT*(@Pd | (da +row+dwo+dataancestorreturnvaluels_col_namels_unit_codecase6gs_user_id::message  , 8 E L/@W @)x editchangedgetcolumnname8unit_codegettext6getrowHvalue_unit_codesetitemPhvalue6vDAT*alue_amtHuis_column_name=uil_selected_row8uidwc_dw_child9 uis_child_name:88highlight_dddwposteventHcreation_date_timeOhHuser_idPh$ @ P p         , 4 P X h p h28$)(8, N1\, 0$DAT*4d& ancestorreturnvalue::message( @)8 losefocusr_2(#hide  ( 0 $1)48L$)\8d$|$$$)8)8_@_811 11@8 @ 810JdDAT*  ls_col_name P uil_selected_row8getcolumnname$uis_column_name<=getrowT<=uidwc_dw_childl9 8uis_child_name:getitemstring+i[setitemP 4 L \ d |     h8$9}, N1\, ,$4d6 +wparam+lparamancDAT* estorreturnvalue::messageP , @)4 delete_rowib_obj_modified$ , l81) 8, R1`, ($8d6 +wparam+lparamancestorreturnvalue::messageP , @)0 first_rowscrolltorow?DAT* ( |8,#$6)08, b1p, 8$HdD +flags+xpos+yposancestorreturnvaluew_mdi_main::messagex /#@+: @)@ mousemovetagsetmicrohelpZ  0 8 v8DAT*)8)08, \1j, 8$Bd6 +wparam+lparamancestorreturnvalue::messageP , @)@ last_rowrowcount4scrolltorow?$ 0 8 f8) 8, L1Z, ($2d6 +wparam+lparamancestoDAT*rreturnvalue::messageP , @)0 next_rowscrollnextrow< ( f8) 8, L1Z, ($2d6 +wparam+lparamancestorreturnvalue::messageP , @)0 prev_rowscrollpriorrow> DAT* ( :6081d) rowdwodataancestorreturnvalueP   itemerror- ./ 012   OPQRSTcdef-&/102<.2 S +select_one+select_all+savDAT*e+validate_delete+dwescape+dwnkeyf_dddw_search+add_row+getfocus+itemfocuschangedf_retrieve_codesf_get_unit_sqlf_retrieve_unit_codes+itemchangedf_set_value_amtf_validate_code+editchanged+losefocus+dwnprocessenter+delete_row+first_row+mousemove+last_row+next_row+prev_row+itemerrorl &7AIBW`jDAT*|C|C|C|CDE FG kee.UFIB     *4 >H2 1 xywidthheighttabordertagdataobjectDAT*  H("@&] o H( @ @   c (d @xeDAT* Xfp  lO).;1 R/ o- |2   DAT* P QX4 `T xS R0():F@@8)8,$D$L$d$!8l08s0@8$84)8, DAT* 1, $ $$v8l080@8$84)8, ^1l, $  $($ 8l0800@8P$8T)X8, 1, `$h$p$x$$8l080@8$84)8, 1,DAT*" $$8)8 $8,$,*)D8)h81X)88l080@8$84)8, 1, $$184)8580)@)81 o@o81@8$18T)8DAT*$580)@)81 o@o81@8,$680806@8,$6808)06@8,$6808406@8,$6808=06@8, 1, H$ , b "Dr @h "#$&&(B)T*X+DAT*&,234*5N7r89:<=L>?@dy ldt_startldt_endls_startls_endls_start_datels_start_timels_end_datels_end_time::messagesqlcags_inifile   # * 8 F R ^ @)h*@.n$@P@ uf_get_items4istr_act 3'start_date_time4 DAT*(3'end_date_timeTSelectPlease fill out Start Date Time and End Date Timedw_act_query$setcolumnH 3'4Please fill out Start Date Time$H 3'TPlease fill out End Date Time@$H 3'4 3'TStart Date Time must be before End Date Time$His_view_style1currentuf_retrieve_current91historydw_act_master&settransobject^DAT**4uf_retrieve_dw_act_masterHLuf_retrieve_history8pNo records found within this date range$H$getitemdatetimemm/dd/yyyy hh:mm:ss$activity viewstart_datestart_timeend_dateend_time , D L d           ( P X ` h p x         , DDAT*, h         H ""2  +clickedtype f2 a xywidthheighttabordervisibletagtexttextsizeweightfacenamefontfamilyfontpitch   T"*).R3<CYLDAT*.W] ) T @Y @R"2  2  xywidthheightvisibleenabledtextfocusrectangletextcolorbackcolortextsizeweightfacenamefontfamilyfontpitch,  7HDAT*0!)g.=GQZaYju] 7H @Y g@DAT*2     F)8, ,1:, $d" +wparam+lparam::message<  @)  uf_save2  \8080@8, B1P, D$(d" +wparam+lparam::message<  DAT*4@)L Filter on ActivitySorry! This function is not availableD \8080@8, B1P, D$(d" +wparam+lparam::message<  @)L Show All on ActivitySorry! This function is not availableD \8080@8, B1P, @$DAT*6(d" +wparam+lparam::message<  @)H Delete ActivitySorry! This function is not available@ "$1)48L$)\8d$|$6)8$**$6880)8, 1, $DAT*80J d ls_col_name::message(  @)` uil_selected_row8getcolumnname$uis_column_name<=getrowT<=uis_old_valuel7setitemPuidwc_dw_child9 uis_child_name:8highlight_dddwpostevent 4 L \ d |       : *@l@l8DAT*:$1)48L$)\8d$|$$$)8)8, 1, $4Lf d- +key+keyflagsls_col_name::messageP(   # @)X uil_selected_row8getcolumnname$uis_column_name<=getrowT<=DAT*<uidwc_dw_childl9 8uis_child_namew:getitemstringil[setitemP 4 L \ d |      .8,#) 8)4868<,2P`8X,6``8h,8t`8| ,;`88,>DAT*>`8`,A, z1, $2 L \ p 4L`d ancestorreturnvaluelw_active_sheetlw_active_sheet_namew_mdi_maincase11w_geow_legalw_sourcew_devicew_processw_stream::message /, A#@+L T2@0Z6@2b8@3kDAT*@;@4t>@5~A@6 @)H getfocusgetactivesheet7classname(w_geoidw_activeB1%w_legalB1%w_sourceB1%w_deviceB1%w_process$B1%w_streamB1% 4 P ` t     D 6/8)$8<$)L8d$6$6 8DAT*B#$6$6@81$)8, *18, $(@Z d? rowdwodataancestorreturnvaluels_col_name::messagex  ) 5 @)X itemchangedgetcolumnnameuis_column_name,=gettextDuis_chiDAT*Dld_nameT:uis_validation_table l;uis_msg_nameew5uis_msg_textil6uil_selected_row8uidwc_dw_child9 getrowb$ < L d        f8)8, L1Z, $$2d6 +wparam+lparamancestorreturnvalue::messageP DAT*F, @), add_rowuf_add_rowmD $  28 $)88P$)d81xl$8t$$5)8$8$$5)8$8$$6)8 $8$$8$6)@8H$DAT*H8P`$t$6)|8n, 1, $ (:\F!d> ancestorreturnvaluell_total_rowll_row_num::messageP)4 @) losefocusib_new_detail2uf_get_items4(dw_act_detail@!rowcount4X@!start_date_timeistr_actis_3'tsetitemO@!DAT*Jend_date_time 3'O@!method_type3'P@!reference_type3'ref_type ,P@!reference_code3'ref_codehP 8 P d l              $ 8 @ H ` t |  &18)(8680DAT*L8<068J0 88O8<068J08680p1)868J08080<8D0t$$)8)8V8O 1)DAT*N868J08080(800T\$d$)l8)t8V8|<1)8680808080$,$4$)<8)D8VDAT*PL8T0, p1~, X$ 8H\ 8Pj.Tl !"#4%J&p'()*+,8-</VdM rowdwoancestorreturnvaluels_col_namedwccase6case13::message $ 0 4 ; C @)`P itemDAT*Rfocuschangedgetcolumnnamemethod_typeActivity Viewtypereference_typeuil_selected_row^8uidwc_dw_childx9 getchildOouis_column_name=uis_child_name:uis_validation_table;rap_methodsuis_msg_name5Column - Method Typeuis_msg_text-6Sorry! Not a valid method typeuis_old_valuec7dw_act_query|$|$getrowgetitemstring^8x9 o=:;rap_reference_DAT*Ttypes5Column - Reference Type-6Sorry! Not a valid reference typec7|$|$reference_code^8x9 o=:code;rap_reference_codes5Column - Reference Code-6Sorry! Not a valid reference codec7|$|$=( p       < t          DAT*V  ( T \ d l t         $ , 4 < D L X |8,#$6)08, b1p, 8$$HdD +flags+xpos+yposancestorreturnvaluew_mdi_main::messagex /DAT*X#@+: @)@ mousemovetagsetmicrohelpZ  0 8 6-8)$8<$Xp$**$68$180)8, 1, $(@Z dB +row+dwo+dataancestorreturnvaluels_cDAT*Zol_name::messagex  , 8 @)H editchangedgetcolumnnameuis_column_name,=uil_selected_rowD8uidwc_dw_child`9 uis_child_name@x:D8D8highlight_dddwpostevent$ < X p      :6081d)DAT*\ rowdwodataancestorreturnvalueP   itemerror$1)48L$)\8d$|$$$)8)8_@_811 11@8 @ 810J d ls_col_nameDAT*^ P uil_selected_row8getcolumnname$uis_column_name<=getrowT<=uidwc_dw_childl9 8uis_child_name:getitemstringte[setitemP 4 L \ d |     - ./0 1 2  Oefgh-&/102.2 +save+select_oDAT*`ne+select_all+validate_delete+dwescape+dwnkeyf_dddw_search+getfocus+itemchangedf_validate_code+add_row+losefocus+itemfocuschangedf_retrieve_codes+mousemove+editchanged+itemerror+dwnprocessenter&7AIBWanG~  CDAT*bC  IB 2 1 xywidthheighttabordertagdataobject  R \ "&] oR \  @  DAT*d@  e f xg h).R/   O|2 DAT*f;1 X  oD- h0 2  2 z xywidthheightvisibleenabledfocusrectangletextcolorbackcolortextsizeweightfacenamefontfamilyfontpitch   XDAT*h!)8BLU\Yep]   X @Y  @  DAT*j   F)8, ,1:, $d" +wparam+lparam::message<pe m in @)  uf_save2  \8080@8, B1P, D$(d" +wparam+lparam::message<  @)L Filter DAT*lon ActivitySorry! This function is not availableD \8080@8, B1P, D$(d" +wparam+lparam::message<  @)L Show All on ActivitySorry! This function is not availableD \8080@8, B1P, @$(d" DAT*n +wparam+lparam::message<  @)H Delete ActivitySorry! This function is not available@ .8$)(8,#)@8)T868\,2p|8x,6|8,8|8(,;|8T,DAT*p>|8|,A, 1, $4 Nhx$<Ph|d ancestorreturnvaluelw_active_sheetlw_active_sheet_namew_mdi_maincase14w_geow_legalw_sourcew_devicew_processw_stream::message /, A#@+L T2@0Z6@2b8DAT*r@3k;@4t>@5~A@6 @)X getfocusr_1'!show getactivesheet70classnameHw_geoidw_activeb1%w_legalb1%w_sourceb1%w_device@b1%w_process0@b1%w_streamb1% ( @ T p       ~<8)$81J)@8, d1DAT*tr, H$8Jd2 +currentrowancestorreturnvalue::message<( @)P rowfocuschangedrowcounthow4uf_retrieve_history8,$ @ H f8)8, L1Z, $$2d6 +wparam+lparamancestorreturnvalue::messageP DAT*v, @), add_rowuf_add_rowD $ h28$)(8, N1\, 0$4d& ancestorreturnvalue::message( @)8 losefocusr_1'!hide  ( 0 |8,#$6)08,DAT*x b1p, 8$HdD +flags+xpos+yposancestorreturnvaluew_mdi_main::messagex /#@+: @)@ mousemovetagsetmicrohelpZ  0 8 8)$8L1)88, f1t, @$4DAT*zLd6 +wparam+lparamancestorreturnvalue::messageP , @)H first_rowuf_check_pending5scrolltorow?,$ 8 @ z8)$8F)<8, `1n, D$4Fd6 +wparam+lparamancestorreturnvalue::messageP DAT*|, @)L prev_rowuf_check_pending5scrollpriorrow>,$ < D z8)$8F)<8, `1n, D$4Fd6 +wparam+lparamancestorreturnvalue::messageP , @)L next_rowuf_check_pending5scrollneDAT*~xtrow<,$ < D 8)$8V)88)L8, p1~, T$4Vd6 +wparam+lparamancestorreturnvalue::messageP , @)\ last_rowuf_check_pending5rowcount4,scrolltorow?@$ 8 L T .2<DAT*    OQRSTcdef-&/2<.2 +save+select_one+select_all+validate_delete+getfocus+rowfocuschanged+add_row+losefocus+mousemove+first_row+prev_row+next_row+last_row&7AR[fq DAT*|   2 ( xywidthheighttagdataobjectx   H] o H @  @  cDAT* $d <xe Tf). <  O|2X  Q  R DAT* S  T2  2 K xywidthheightvisibleenabledlinethicknesslinecolorfillcolor | E p!) 7A] " |E p2 DAT* 2 K xywidthheightvisibleenabledlinethicknesslinecolorfillcolor  E !) 7A] " E 2  2 @ enabledbeginxbeginyendxendylinethicknesslinecolorDAT*xR #x(6] o"xR x2  2 9 enabledbeginyendxendylinethicknesslinecolorxi !/] o"iDAT* DAT*8L$<846)T8\$<8d)p8x$<8$6)8$<8$)8$<8,6)8$<1:@:@)8$<1:@:@)8 $<1:@:@)(81<R} DAT*, x ,,808Sz%81<HJMNP:S@TVVY\]^ab@crdrst:uNvwy|}0~f Fbd pl_ref_ridls_codels_descls_unit_codels_value_typels_material_codels_sql_stmntcounterli_seq_nosqlsametriccursorsqlcags_user_id  # 0DAT* > O \dn@$t>@%@t( 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, rap_metrics where (rap_metric_maps.source_code = '@' or rap_metric_maps.source_code = 'is_src_DAT*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' order by rap_metric_maps.view_sequence_no, rap_metric_maps.material_code, rap_metric_maps.value_typeFail on declaring dynamic cursor metricCursor. Contact your technical support.Fail on preparing sqlsa.Fail on open dynamic cursor metricCursor. Contact your technical suppoDAT*rt.dw_act_detailzH!insertrow8(`H!metric_descsetitemPH!unit_codePH!metric_codePH!value_unit_codePH!value_typePH!materialP@H!material_codedwOH!PH!view_seq_noOH!metric_level_typeis_level,PH!ref_ridil_ref_rid+OH!user_idPH!setitemstatusH!H!DAT*Fail on close metricCursor cursor Contact your technical support.L  @ X l t              , D L T \ p x              ( 8d  create8d DAT* destroy?@EL"o12 Y uf_reshape_dwuf_resize_detailuf_retrieve_parameterf_db_error+create+destroy'====HP2  ] oW \ @@0DAT*1    @           !"#?@2 xEDAT*HPOPQRSTcdef-&/102<.2  2  ] ]o H( @ @  "2 DAT* 2  ]  T @   @2  2  ] 7H @    DAT*@Oefgh-&/102.2  2  ] HoR \  @ s @ 2  2  ]   X DAT*@    @OQRSTcdef-&/2<.2  2  width ] o H @ DAT* @ 2  2  xywidthheightP  A m]  A m2  2  ]  E 2  2  DAT* ] oxR x2  2  ] oi DAT*@%&-@-4 tagsetmicrohelp_rZ $ , $)(81R@$1)X81}1T`$1)t8)89}$)8< 1<R}$)81RdDAT*1<Y}1<$<=)81<Y}p,-1,-$* R d t<PT!p"#$%dT ll_cur_rowll_selected_rowll_row_numli_array_size::message0d0#-<J-@- x dw_group%rowcount4DAT*dw_select_list0&getselectedrowH%insertrow(huf_setitem_on_dw_group7|ib_obj_modified+%uf_assign_active_dw30&H0&deleterow ( @ X ` t          "-"-2  +mousemove+clicked(2 t xywidthheighttaborderpictDAT*urenamehtextalignoriginalsizetextsizeweightfacenamefontfamilyfontpitch  $ x".9FOV_j] o $x @ DAT*@  @@ |-j"X, $6)$8,->1L,-,$$d0 +flags+xpos+yposw_mdi_main::messaged @%&-@-4 tagsetmicrohelpDAT*Z $ , B$),81R@$1)X81}1"`$1)t8)8< 1<R}$)81Rd1<Y}1<$<=)89}$)81<YDAT*}> $8)(80$)@8,-(16,-H$* R d t ">R~!#$&'(dT ll_cur_rowll_selected_rowll_row_numli_array_size::message0d0#-<J-@-P dw_select_list&rowcount4 dw_group4%getselecDAT*Legal entity windowforward global type w_legal from w_master_detail end type type cb_children from commandbutton within w_legal end type type cb_source from commandbutton within w_legal end type type cb_activity from commandbutton within w_legal end type type uo_act from u_dw_act_leg within w_legal end type type r_buttons from rectangle within w_legal end type type uo_contact from u_dw_contact within w_legal end type type cb_parent from commandbutton within w_legal end type type cDAT*b_contact from commandbutton within w_legal end type end forward global type w_legal from w_master_detail int Width=2917 int Height=1564 boolean TitleBar=true string Title="Legal" string Icon="LEGAL.ICO" event current_view pbm_custom31 event history_view pbm_custom32 event highlight_dddw pbm_custom33 cb_children cb_children cb_source cb_source cb_activity cb_activity uo_act uo_act r_buttons r_buttons uo_contact uo_contact cb_parent cb_parent cb_contact cb_contact end type glDAT*obal w_legal w_legal type variables string is_unit_sql = "null" string is_msg_name string is_msg_text string is_validation_table string is_column_status = "valid" long il_selected_row datawindowchild idwc_dw_child string is_column_name string is_old_value string is_child_name string is_orig_sql_statement; string is_member_dw; string is_member_dw_freeform; string is_activity_dw; string is_activity_dw_freeform; string is_src_dw string is_src_dw_freeform string is_form_dw stringDAT* is_form_dw_freeform string is_level; integer ii_dw1_height; integer ii_dw2_height; integer ii_dw2_y; integer ii_cb_y; integer ii_parent_y; string is_current_btn; end variables forward prototypes public function boolean wf_check_required () public subroutine wf_draw_dw2 () public subroutine wf_row_changed () public subroutine wf_set_var () public subroutine wf_set_btns () public subroutine wf_detail_view () public subroutine wf_select_one () public subroutine wf_undo_uo () publDAT*ic subroutine wf_enable_btn (boolean pb_enable) public function boolean wf_check_rid (datawindow dw_obj) public subroutine wf_clear_prev_style (string ps_style) public subroutine wf_get_from_rms (string as_level, long al_rid) public subroutine wf_retrieve_data (long al_rid) end prototypes on current_view;call w_master_detail::current_view;// User Event // Purpose: Make uo_1 visible, show the snapshot view of activity data if Not wf_check_pending() then return SetPointer(HourGlass!) DAT* is_style_state = 'current' f_menu_behave(is_state, is_style_state, is_enlarge_state) // Show uo_1 uo_act.uf_prepare_dw(dw_1.GetItemNumber(dw_1.GetRow(), "rid"), & is_level, is_style_state, '', '', '', '') uo_act.Show() uo_act.BringToTop = TRUE uo_act.dw_act_detail.SetFocus() 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, show the history view of activity data if Not wf_check_penDAT*ding() then return SetPointer(HourGlass!) is_style_state = 'history' f_menu_behave(is_state, is_style_state, is_enlarge_state) // Show uo_act uo_act.uf_prepare_dw(dw_1.GetItemNumber(dw_1.GetRow(), "rid"), is_level, & is_style_state, '', '', '', '') uo_act.Show() uo_act.BringToTop = TRUE w_mdi_main.is_act_style = is_style_state end on on highlight_dddw;call w_master_detail::highlight_dddw;////////////////////////////////////////////////////////////////////////// // // PurposDAT*e: Highlight the row which matches the closest to what is typed // in the edit portion of dddw // // Log: // 5/31/94 SWJ Initial version // ////////////////////////////////////////////////////////////////////////// if il_selected_row > 0 then idwc_dw_child.SelectRow(il_selected_row, TRUE) end if end on public function boolean wf_check_required ();// Function: wf_check_required // // Purpose: To validated data entered in the columns. // // Scope: public // // Parameter: noDAT*ne // // Returns: boolean - TRUE denotes validation passed; // FALSE denotes validation failed. // // Logs: // When Who What // -------- ----- ------------------------ // 9/17/96 SWJ Initial version long ll_cur_row, ll_total_row 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() if ll_cur_row > 0 then if IsNull(dw_1.GetItemString(ll_cur_row, "name")) then MeDAT*ssageBox("Data Error", "Sorry! Name is required") dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("Name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if end if ll_total_row = dw_2.RowCount() for ll_cur_row = 1 to ll_total_row choose case is_current_btn case "Activity" if Not f_validate_act(dw_2, ll_cur_row, is_level, '', '', '', '') then return FALSE end if case "Source" if IsNull(dw_2.GetItemNumber(ll_cur_row, "ref_rid")) then DAT* MessageBox("Data Error", "Sorry! Agency Source ID is required") dw_2.SetFocus() dw_2.SetRow(ll_cur_row) dw_2.SetColumn("ref_rid") dw_2.ScrollToRow(ll_cur_row) return FALSE end if if Not f_validate_legal_relation(dw_2, ll_cur_row) then return FALSE end if 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 if DAT* case "Children" if IsNull(dw_2.GetItemString(ll_cur_row, "name")) then MessageBox("Data Error", "Sorry! Name is required") dw_2.SetFocus() dw_2.SetRow(ll_cur_row) dw_2.SetColumn("Name") dw_2.ScrollToRow(ll_cur_row) return FALSE end if case 'Form' if IsNull(dw_2.GetItemString(ll_cur_row, "type")) then MessageBox("Data Error", "Sorry! Type is required") dw_2.SetFocus() dw_2.SetRow(ll_cur_row) dw_2.SetColumn("Type"DAT*) dw_2.ScrollToRow(ll_cur_row) return FALSE end if if IsNull(dw_2.GetItemString(ll_cur_row, "id")) then MessageBox("Data Error", "Sorry! ID is required") dw_2.SetFocus() dw_2.SetRow(ll_cur_row) dw_2.SetColumn("id") dw_2.ScrollToRow(ll_cur_row) return FALSE end if if IsNull(dw_2.GetItemString(ll_cur_row, "name")) then MessageBox("Data Error", "Sorry! Name is required") dw_2.SetFocus() dw_2.SetRow(ll_cur_rowDAT*) dw_2.SetColumn("Name") dw_2.ScrollToRow(ll_cur_row) return FALSE end if end choose next return TRUE end function public subroutine wf_draw_dw2 ();long ll_master_rid, ll_cur_row string ls_sql, ls_err uo_act.Hide() uo_contact.Hide() dw_2.SetRedraw(FALSE) dw_3.SetRedraw(FALSE) if dw_1.RowCount() > 0 then ll_cur_row = dw_1.GetRow() if ll_cur_row > 0 then ll_master_rid = dw_1.GetItemNumber(ll_cur_row, "rid") end if choose case is_state DAT* case 'leg member', 'leg source', 'leg form' // Only replace the datawindow object when the button is changed choose case is_state case 'leg member' 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 case 'leg source' if dw_2.DataObject <> is_src_dw then dw_2.DataObject = is_src_dw dw_3.DataObject = is_src_dw_freeform SetTDAT*ransObject(dw_2, SQLCA) end if case 'leg form' if dw_2.DataObject <> is_form_dw then dw_2.DataObject = is_form_dw dw_3.DataObject = is_form_dw_freeform SetTransObject(dw_2, SQLCA) end if end choose 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) case 'leg activity' // Only replace the datawindow DAT*object when the radiobutton 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) ls_sql = dw_2.Describe('DataWindow.Table.Select') ls_sql = "DataWindow.Table.Select='" + ls_sql + & "' metric_code.DDDW.Name=d_metrics_leg" ls_err = dw_2.Modify(ls_sql) if ls_err <> '' then MessageBox('Modify d_activity Error', ls_err) return end if ls_err = DAT*dw_3.Modify(ls_sql) if ls_err <> '' then MessageBox('Modify d_activity_freeform Error', ls_err) return end if // end if dw_2.Retrieve(ll_master_rid, is_level) dw_3.TriggerEvent(RowFocusChanged!) // Share data between dw_2 and dw_3 dw_2.ShareData(dw_3) end choose end if dw_2.SetRedraw(TRUE) dw_3.SetRedraw(TRUE) end subroutine public subroutine wf_row_changed ();long ll_cur_row, ll_leg_rid string ls_parent_type SetPointer(HourGlass!) wf_setDAT*_btns() ll_cur_row = dw_1.GetRow() if ll_cur_row > 0 then ll_leg_rid = dw_1.GetItemNumber(ll_cur_row, "rid") // if ll_leg_rid = 0, this means the current row is the new inserted row // then reset the dw_2 if IsNull(ll_leg_rid) then dw_2.Reset() end if // Make Parent button visible if necessary if Not IsNull(dw_1.GetItemNumber(ll_cur_row, 'parent_rid')) then cb_parent.Show() else cb_parent.Hide() end if else // Clean the activity datawinDAT*dow buffer dw_2.Reset() // Make Parent button insivible cb_parent.Hide() end if if is_state = 'leg contact' then uo_contact.uf_check_pending() uo_contact.uf_retrieve_dw_contact_master(ll_leg_rid) elseif is_state = 'leg member' or is_state = 'leg source' or is_state = 'leg form' or & (is_state = 'leg activity' and Not uo_act.Visible) then wf_draw_dw2() end if // If uo_act is visible, then check if there is any modification in uo_act. // When checking is done, retDAT*rieve the dw_act_master data based on the // new values. if uo_act.Visible then if uo_act.uf_check_pending() then SetPointer(HourGlass!) uo_act.uf_prepare_dw(ll_leg_rid, is_level, is_style_state, '', '', '', '') end if end if end subroutine public subroutine wf_set_var ();// This function sets up instance variables is_member_dw = "d_legal_member" is_member_dw_freeform = "d_legal_entity" is_activity_dw = "d_activity" is_activity_dw_freeform = "d_activity_freeform" is_src_dDAT*w = 'd_src_leg_ent_rel' is_src_dw_freeform = 'd_src_leg_ent_rel_freeform' is_form_dw = 'd_form' is_form_dw_freeform = 'd_form_freeform' is_level = "LEG" end subroutine public subroutine wf_set_btns ();CommandButton lcb_cur_btn choose case is_current_btn case 'Children' lcb_cur_btn = cb_children case 'Source' lcb_cur_btn = cb_source case 'Activity' lcb_cur_btn = cb_activity case 'Contact' lcb_cur_btn = cb_contact end choose f_highlight_button(r_buttons, lcb_cur_DAT*btn, "on") wf_set_var() end subroutine public 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_contact.Visible then if uo_contact.uf_check_pending() then uo_contact.uf_save() end if end if 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" theDAT*n choose case is_current_btn case 'Activity' OpenWithParm(w_filter, 'rap_activities') case 'Children' OpenWithParm(w_filter, 'rap_legal_entities') case 'Source' OpenWithParm(w_filter, 'rap_legal_entity_relations') case 'Form' OpenWithParm(w_filter, 'rap_forms') end choose else OpenWithParm(w_filter, 'rap_legal_entities') end if // If filter flag is set to true, then trigger the filter event to perform // filter if gb_filter then gb_filter = FALSE ThiDAT*s.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 if uo_act.Visible then uo_act.uf_prepare_dw(dw_1.GetItemNumber(dw_1.GetRow(), "rid"), & is_level, is_style_state, '', '', '', '') end if if uo_contact.Visible then uo_contact.uf_retrieve_dw_contact_master(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) end if end subroutine public subroDAT*utine wf_enable_btn (boolean pb_enable);cb_children.Enabled = pb_enable cb_source.Enabled = pb_enable cb_activity.Enabled = pb_enable cb_contact.Enabled = pb_enable end subroutine public function boolean wf_check_rid (datawindow dw_obj);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_obj.RowCount() for ll_cur_row = 1 to ll_row_num if IsNull(dw_obj.GetItemNumber(ll_cur_row, "rid")) then // Select the next avDAT*ailable 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_2" then choose case is_current_btn case "Activity" dw_obj.SetItem(ll_cur_row, "ref_rid", ll_rid) dw_obj.SetItem(ll_cur_row, "metric_level_type", is_level) dw_obj.SetItem(ll_cur_row, "creation_date_time", today()) dw_obj.SetItem(ll_cur_row, "user_id", gs_user_id) if Left(sqlca.dbms, 2) <> 'OR' then iDAT*f Not f_check_dup_act(dw_obj, ll_rid, is_level) then return FALSE end if dw_obj.SetItem(ll_cur_row, "rid", ll_rid_num) case "Children" dw_obj.SetItem(ll_cur_row, "parent_rid", ll_rid) dw_obj.SetItem(ll_cur_row, "rid", ll_rid_num) case 'Source' dw_obj.SetItem(ll_cur_row, 'rid', ll_rid) case 'Form' dw_obj.SetItem(ll_cur_row, 'rid', ll_rid_num) dw_obj.SetItem(ll_cur_row, 'legal_entity_rid', ll_rid) end choose elseif dw_obj.ClassName() = 'dw_1' thDAT*en dw_obj.SetItem(ll_cur_row, "rid", ll_rid_num) end if else if dw_obj.GetItemStatus(ll_cur_row, 0, Primary!) <> NotModified! then // If the activity record is updated. if dw_obj.DataObject = 'd_activity' then dw_obj.SetItem(ll_cur_row, "creation_date_time", today()) dw_obj.SetItem(ll_cur_row, "user_id", gs_user_id) if Left(sqlca.dbms, 2) <> 'OR' then if Not f_check_dup_act(dw_obj, ll_rid, is_level) then return FALSE end if end if end if DAT* 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 = 'leg activity' then w_mdi_main.is_act_style = ps_style end if end subroutine public subroutine wf_get_from_rms (string as_level, long al_rid);//long ll_row_num //long ll_where_pos //string ls_sql_stmnt, ls_err, ls_cur_sql_stmnt // //if as_level = 'nat' thenDAT* // // // Change data source for dw_1 // ll_where_pos = Pos(is_orig_sql_statement, " WHERE", 1) // ls_sql_stmnt = Left(is_orig_sql_statement, ll_where_pos - 1) // ls_sql_stmnt = "DataWindow.Table.Select=~"" + ls_sql_stmnt + & // " WHERE TYPE = 'NATION' and rid > :rid~"" // // ls_err = dw_1.dwModify(ls_sql_stmnt) // if ls_err <> "" then // MessageBox("dwModify Failed", ls_err) // end if // // is_current_btn = 'children' // f_highlight_button(r_buttons, cb_children, "on") // /DAT*/ dw_1.Retrieve(0) // //else // // // Change the data source for dw_1 // ls_cur_sql_stmnt = dw_1.dwDescribe("DataWindow.Table.Select") // if ls_cur_sql_stmnt <> is_orig_sql_statement then // ls_sql_stmnt = "DataWindow.Table.Select=~"" + is_orig_sql_statement + & // + " ORDER BY TYPE, NAME~"" // ls_err = dw_1.dwModify(ls_sql_stmnt) // if ls_err <> "" then // MessageBox("dwModify Failed", ls_err) // end if // end if // dw_1.Retrieve(al_rid) // wf_row_changed() // //end if eDAT*nd subroutine public subroutine wf_retrieve_data (long al_rid);long ll_parent, ll_row_num string ls_sql_stmnt, ls_err boolean lb_change_dw if al_rid = 0 then lb_change_dw = TRUE else select parent_rid into :ll_parent from rap_legal_entities where rid = :al_rid; if f_db_error(SQLCA, "Fail on selecting parent rid on " + & "rap_legal_entities table. Contact your technical support.") = 1 then return end if if IsNull(ll_parent) then lb_change_dw = TRUE end if eDAT*nd if if lb_change_dw then // Change data source for dw_1 ls_sql_stmnt = Left(is_orig_sql_statement, & Pos(is_orig_sql_statement, " WHERE", 1) - 1) // Use rid > :legrid to supress the retrieval argument popup ls_sql_stmnt = "DataWindow.Table.Select='" + ls_sql_stmnt + & " WHERE parent_rid is null and rid > :legrid'" ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("Modify Failed", ls_err) end if dw_1.Retrieve(0) else ls_sql_stmnt = "DataWindoDAT*w.Table.Select='" + is_orig_sql_statement + "'" ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("Modify Failed", ls_err) end if dw_1.Retrieve(ll_parent) end if if al_rid > 0 then ll_row_num = dw_1.Find("rid = " + String(al_rid), 1, dw_1.RowCount()) dw_1.ScrollToRow(ll_row_num) end if end subroutine on open;call w_master_detail::open;string ls_sql_stmnt, ls_err long ll_rid, ll_row_num, ll_parent boolean lb_change_dw ll_rid = Message.DoubleParm // DAT*for dddw use is_column_status = "valid" // Set up variable for handling menu behavior is_state = 'leg member' //f_window_count('geo') // Save the height and X, Y position of the objects into instance variables ii_dw1_height = dw_1.Height ii_dw2_height = dw_2.Height ii_dw2_y = dw_2.Y ii_cb_y = cb_children.Y ii_parent_y = cb_parent.Y wf_set_var() is_current_btn = 'Children' wf_retrieve_data(ll_rid) //if ll_rid = 0 then // lb_change_dw = TRUE //else // select parent_rid DAT*// into :ll_parent // from rap_legal_entities // where rid = :ll_rid; // if f_db_error(SQLCA, "Fail on selecting parent rid on " + & // "rap_legal_entities table. Contact your technical support.") = 1 then // return // end if // if IsNull(ll_parent) then // lb_change_dw = TRUE // end if //end if // //if lb_change_dw then // // Change data source for dw_1 // is_orig_sql_statement = dw_1.dwDescribe("DataWindow.Table.Select") // ls_sql_stmnt = Left(is_orig_sql_statement, & // DAT* Pos(is_orig_sql_statement, " WHERE", 1) - 1) // // Use rid > :legrid to supress the retrieval argument popup // ls_sql_stmnt = "DataWindow.Table.Select='" + ls_sql_stmnt + & // " WHERE parent_rid is null and rid > :legrid'" // // ls_err = dw_1.dwModify(ls_sql_stmnt) // if ls_err <> "" then // MessageBox("dwModify Failed", ls_err) // end if // // dw_1.Retrieve(0) //else // dw_1.Retrieve(ll_parent) //end if // //if ll_rid > 0 then // ll_row_num = dw_1.dwFind("rid = " + String(lDAT*l_rid), 1, dw_1.RowCount()) // dw_1.ScrollToRow(ll_row_num) //end if end on on activate;call w_master_detail::activate;// If this window is activated by double-clicked from the src window // then, refresh the data if gb_double_click then // wf_retrieve_data() // This function will use gb_double_click gb_double_click = FALSE end if end on on closequery;call w_master_detail::closequery;if is_state = "leg activity" then uo_act.uf_check_pending() elseif is_state = "leg contacDAT*t" then uo_contact.uf_check_pending() end if end on on close;call w_master_detail::close;//f_window_close('geo') end on on w_legal.create int iCurrent call super::create this.cb_children=create cb_children this.cb_source=create cb_source this.cb_activity=create cb_activity this.uo_act=create uo_act this.r_buttons=create r_buttons this.uo_contact=create uo_contact this.cb_parent=create cb_parent this.cb_contact=create cb_contact iCurrent=UpperBound(this.Control) this.ContDAT*rol[iCurrent+1]=this.cb_children this.Control[iCurrent+2]=this.cb_source this.Control[iCurrent+3]=this.cb_activity this.Control[iCurrent+4]=this.uo_act this.Control[iCurrent+5]=this.r_buttons this.Control[iCurrent+6]=this.uo_contact this.Control[iCurrent+7]=this.cb_parent this.Control[iCurrent+8]=this.cb_contact end on on w_legal.destroy call super::destroy destroy(this.cb_children) destroy(this.cb_source) destroy(this.cb_activity) destroy(this.uo_act) destroy(this.r_buttons) desDAT* troy(this.uo_contact) destroy(this.cb_parent) destroy(this.cb_contact) end on type st_no_record_white from w_master_detail`st_no_record_white within w_legal int X=617 int Y=444 end type type st_no_record_grey from w_master_detail`st_no_record_grey within w_legal int X=649 int Y=368 end type type dw_3 from w_master_detail`dw_3 within w_legal event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=37 int Y=524 int Width=2793 int Height=908 string Tag="Related information (DAT* 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 end on on dw_3::dwnkey;call w_master_detail`dw_3::dwnkey;string ls_col_name if keydown(keytab!) then iDAT*f 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 if end on event dw_3::editchanged;call super::editchanged;string ls_col_name ls_col_name = this.getcolumnname() if ls_col_name = is_column_name then // idwc_dw_child is overwritten by editchange event of dw_2 // if the dddw column is the fiDAT*rst column of dw 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_3::itemfocuschanged;call super::itemfocuschanged;string ls_col_name, ls_source, ls_device, ls_process, ls_stream, & ls_metric_code ls_col_name = This.GetColumnName() choose case is_current_btn case 'Source' if ls_col_name = 'raDAT*p_sources_id' then f_retrieve_codes(Parent.Title, This, ls_col_name, "id") il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "id" is_validation_table = "rap_sources" is_msg_name = "Column - Agency Source ID" is_msg_text = "Sorry! Not a valid agency source id" is_old_value = This.getitemstring(This.getrow(), ls_col_name) elseif ls_col_name = "code" then f_retrieve_codes(Parent.Title, This, ls_col_name, DAT*"code") 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_legal_relationship_codes" is_msg_name = "Column - Legal Relationship Code" is_msg_text = "Sorry! Not a valid legal relationship code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) end if case 'Activity' ls_source = "" ls_device = "" ls_process = "" ls_stream = "" f_act_dddw_retrieve(ThisDAT*, Parent, 'LEG', '') choose case ls_col_name case "material_code" 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 = This.getitemstring(This.getrow(), ls_col_name) case "metric_code" f_retrieve_metric_codes(parent, this, is_level, ls_source, ls_deDAT*vice, ls_process, ls_stream) 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 = This.getitemstring(This.getrow(), ls_col_name) case "value_unit_code" if is_unit_sql = "null" then is_unit_sql = f_get_unit_sql(parent, this) end if ls_metric_codeDAT* = this.getitemstring(this.getrow(), "metric_code") f_retrieve_unit_codes(parent, this, is_unit_sql, ls_metric_code) 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_units" is_msg_name = "Column - Value Unit Code" is_msg_text = "Sorry! Not a valid value unit code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) case "method_type" il_selected_rowDAT* = 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 valid method type" is_old_value = This.getitemstring(This.getrow(), ls_col_name) case "value_type" 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_tyDAT*pes" is_msg_name = "Column - Value Type" is_msg_text = "Sorry! Not a valid value type" is_old_value = This.getitemstring(This.getrow(), ls_col_name) case "reference_type" 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 = This.getitemstDAT* ring(This.getrow(), ls_col_name) case "reference_code" f_retrieve_codes(Parent.Title, This, ls_col_name, "code") 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_reference_codes" is_msg_name = "Column - Reference Code" is_msg_text = "Sorry! Not a valid reference code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) case "data_code" il_selecDAT*"ted_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) case else f_act_dddw_retrieve(This, Parent, "LEG", "") is_column_name = "" end choose case 'Children' if ls_col_name = "type" then f_retrieve_codes(Parent.TDAT*$itle, This, ls_col_name, "type") 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_legal_entity_types" is_msg_name = "Column - Type" is_msg_text = "Sorry! Not a valid type" is_old_value = This.getitemstring(This.getrow(), ls_col_name) end if case 'Form' if ls_col_name = "type" then f_retrieve_codes(Parent.Title, This, ls_col_name, "type") il_selected_row = 0 DAT*&Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "type" is_validation_table = "rap_form_types" is_msg_name = "Column - Type" is_msg_text = "Sorry! Not a valid type" is_old_value = This.getitemstring(This.getrow(), ls_col_name) end if end choose end event event dw_3::itemchanged;call super::itemchanged; string ls_col_name long ll_cur_row, ll_dwc_cur_row DataWindowChild dwc ls_col_name = This.GetColumnName() choose casDAT*(e ls_col_name case "value" // Call function to copy value to value_amt 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 fiDAT**rst. 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_sources_id' then ll_cur_row = This.GetRow() This.GetChild(ls_col_name, dwc) ll_dwc_cur_row = dwc.GetRow() This.SetItem(ll_cur_row, 'ref_rid', & dwc.GetItemNumber(ll_dwc_cur_row, 'rid')) This.SetItem(ll_cur_row, 'rap_sources_name', & dwc.GetItemString(ll_dwc_cur_row, 'nDAT*,ame')) end if end event on dw_3::delete_row;call w_master_detail`dw_3::delete_row;long ll_rid, ll_cur_row ll_cur_row = This.GetRow() if ll_cur_row > 0 and idw_active.DataObject = 'd_legal_member' then // Get rid from the datawindow ll_rid = This.GetItemNumber(ll_cur_row, "rid") // Call function if f_delete_leg_ent(ll_rid) = 1 then ib_delete = TRUE else ib_delete = FALSE end if end if end on on dw_3::add_row;call w_master_detail`dw_3::add_row;long ll_DAT*.cur_row ll_cur_row = This.GetRow() if is_current_btn = "Activity" then This.SetItem(ll_cur_row, "user_id", gs_user_id) This.SetItem(ll_cur_row, "creation_date_time", today()) This.ib_obj_modified = TRUE // Not sure if this is right end if end on 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.getitemstriDAT*0ng(il_selected_row, is_child_name)) end if end if Send(Handle(This), 256, 9, Long(0,0)) return 1 end event event dw_3::itemerror;call super::itemerror;return 2 end event type dw_2 from w_master_detail`dw_2 within w_legal event dwescape pbm_dwescape event set_column pbm_custom31 event dwnkey pbm_dwnkey int X=37 int Y=516 int Width=2793 int Height=908 string DragIcon="GEO.ICO" string Tag="Related information (tabular view)" end type on dw_2::dwescape;call w_master_detail`dDAT*2w_2::dwescape;string ls_col_name 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 on on dw_2::set_column;call w_master_detail`dw_2::set_column;if is_column_name = "material_code" then this.setcolumn("material_code") end if if is_column_name = "metric_code" then this.setcolumn("metrDAT*4ic_code") end if if is_column_name = "value_unit_code" then this.setcolumn("value_unit_code") end if if is_column_name = "method_type" then this.setcolumn("method_type") end if if is_column_name = "value_type" then this.setcolumn("value_type") 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 this.setitem(thDAT*6is.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::editchanged;call super::editchanged;string ls_col_name ls_col_name = This.GetColumnName() if ls_col_name = is_column_name then // idwc_dw_child is overwritten by itemfocuschange event of dw_3 // if the dddw column is the first column of dw getchild(ls_col_name, idwc_dw_child) il_selected_row = f_dddw_search(this, idwc_dw_child, is_childDAT*8_name, il_selected_row) Parent.PostEvent("highlight_dddw") end if end event event dw_2::itemfocuschanged;call super::itemfocuschanged;string ls_col_name, ls_source, ls_device, ls_process, ls_stream, & ls_metric_code ls_col_name = This.GetColumnName() choose case is_current_btn case 'Source' if ls_col_name = 'rap_sources_id' then f_retrieve_codes(Parent.Title, This, ls_col_name, "id") il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_nameDAT*: = ls_col_name is_child_name = "id" is_validation_table = "rap_sources" is_msg_name = "Column - Agency Source ID" is_msg_text = "Sorry! Not a valid agency source id" is_old_value = This.getitemstring(This.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_legal_relationship_codes" is_msg_name = "Column - Legal ReDAT*<lationship Code" is_msg_text = "Sorry! Not a valid legal relationship code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) end if case 'Activity' ls_source = "" ls_device = "" ls_process = "" ls_stream = "" f_act_dddw_retrieve(This, Parent, 'LEG', '') choose case ls_col_name case "material_code" il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_tableDAT*> = "rap_materials" is_msg_name = "Column - Material Code" is_msg_text = "Sorry! Not a valid material code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) case "metric_code" f_retrieve_metric_codes(parent, this, is_level, ls_source, ls_device, ls_process, ls_stream) 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 DAT*@- Metric Code" is_msg_text = "Sorry! Not a valid metric code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) case "value_unit_code" if is_unit_sql = "null" then is_unit_sql = f_get_unit_sql(parent, this) end if ls_metric_code = this.getitemstring(this.getrow(), "metric_code") f_retrieve_unit_codes(parent, this, is_unit_sql, ls_metric_code) il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name DAT*B 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 = This.getitemstring(This.getrow(), ls_col_name) case "method_type" 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 vDAT*Dalid method type" is_old_value = This.getitemstring(This.getrow(), ls_col_name) case "value_type" 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 = This.getitemstring(This.getrow(), ls_col_name) case "reference_type" il_selected_row = 0 GetchiDAT*Fld(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 = This.getitemstring(This.getrow(), ls_col_name) case "reference_code" 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_refereDAT*Hnce_codes" is_msg_name = "Column - Reference Code" is_msg_text = "Sorry! Not a valid reference code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) case "data_code" 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" is_msg_text = "Sorry! Not a valid data code" is_old_value = This.getitemstring(TDAT*Jhis.getrow(), ls_col_name) case else f_act_dddw_retrieve(This, Parent, "LEG", "") is_column_name = "" end choose case 'Children' if ls_col_name = "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_legal_entity_types" is_msg_name = "Column - Type" is_msg_text = "Sorry! Not a valid type" is_old_value = This.getitemstring(This.getrow(), ls_col_name) DAT*L end if case 'Form' if ls_col_name = "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_form_types" is_msg_name = "Column - Type" is_msg_text = "Sorry! Not a valid type" is_old_value = This.getitemstring(This.getrow(), ls_col_name) end if end choose end event event dw_2::doubleclicked;call super::doubleclicked;string ls_sql_stmnt, ls_err, ls_cur_DAT*Nsql_stmnt long ll_row_num, ll_child_rid // Do not perform double click function when there is no row in datawindow if This.RowCount() = 0 then return if is_current_btn = "Source" then // Get the value of the source rid gl_cur_row = This.GetItemNumber(row, "ref_rid") gb_double_click = TRUE m_main_menu.m_data.m_source.TriggerEvent(Clicked!) elseif is_current_btn = 'Children' then ll_child_rid = This.GetItemNumber(row, "rid") wf_set_var() dw_2.Reset() dw_1.SetReDAT*Pdraw(FALSE) // Change the data source for dw_1 ls_sql_stmnt = "DataWindow.Table.Select='" + is_orig_sql_statement + "'" ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("Modify Failed", ls_err) end if dw_1.Retrieve(dw_1.GetItemNumber(dw_1.GetRow(), 'rid')) // Scroll to the clicked row ll_row_num = dw_1.Find("rid = " + String(ll_child_rid), 1, dw_1.RowCount()) dw_1.ScrollToRow(ll_row_num) wf_row_changed() dw_1.SetRedraw(TRUE) end if eDAT*Rnd event event dw_2::itemchanged;call super::itemchanged;string ls_col_name long ll_cur_row, ll_dwc_cur_row DataWindowChild dwc ls_col_name = This.GetColumnName() choose case ls_col_name case "value" // Call function to copy value to value_amt 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_nDAT*Tame, 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' 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_sources_id' then ll_cur_row = This.GetRow() This.GetChild(ls_col_name, dwc) ll_dwc_cur_row =DAT*V dwc.GetRow() This.SetItem(ll_cur_row, 'ref_rid', & dwc.GetItemNumber(ll_dwc_cur_row, 'rid')) This.SetItem(ll_cur_row, 'rap_sources_name', & dwc.GetItemString(ll_dwc_cur_row, 'name')) end if end event on dw_2::delete_row;call w_master_detail`dw_2::delete_row;long ll_rid, ll_cur_row ll_cur_row = This.GetRow() if ll_cur_row > 0 and idw_active.DataObject = 'd_legal_member' then // Get rid from the datawindow ll_rid = This.GetItemNumber(ll_cur_row, "rid") // Call functDAT*Xion if f_delete_leg_ent(ll_rid) = 1 then ib_delete = TRUE else ib_delete = FALSE end if end if end on on dw_2::add_row;call w_master_detail`dw_2::add_row;long ll_cur_row ll_cur_row = This.GetRow() if is_current_btn = "Activity" then This.SetItem(ll_cur_row, "user_id", gs_user_id) This.SetItem(ll_cur_row, "creation_date_time", today()) dw_2.ib_obj_modified = TRUE // Not sure if this is right end if end on event dw_2::dwnprocessenter;string ls_col_namDAT*Ze 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::itemerror;call super::itemerror;return 2 end event type dw_1 from w_master_detail`dw_1 within w_legal event dwescape pbm_dwescape event dwnkey pbm_dwnkey event ue_get_from_DAT*\rms pbm_custom31 int X=37 int Y=68 int Width=2793 int Height=288 string Tag="General information" string DataObject="d_legal_entity" 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") enDAT*^d 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_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if end if end on on dw_1::ue_get_from_rms;call w_master_detail`dw_1::ue_get_from_rms;//long ll_row_num // //ll_row_num = Message.LDAT*`ongParm //ll_row_num = dw_1.dwFind('rid = ' + String(ll_row_num), 1, dw_1.RowCount()) //dw_1.ScrollToRow(ll_row_num) end on event dw_1::constructor;call super::constructor;SetTransObject(dw_1, SQLCA) is_orig_sql_statement = dw_1.Describe("DataWindow.Table.Select") end event on dw_1::rowfocuschanged;call w_master_detail`dw_1::rowfocuschanged;wf_row_changed() end on event dw_1::itemfocuschanged;call super::itemfocuschanged;string ls_col_name long ll_cur_row ls_col_name = This.GetCDAT*bolumnName() if ls_col_name = "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_legal_entity_types" is_msg_name = "Column - Type" is_msg_text = "Sorry! Not a valid type" is_old_value = This.getitemstring(This.getrow(), ls_col_name) else is_column_name = "" end if end event on dw_1::editchanged;call w_master_detail`dw_1::editchanged;// Purpose: ToDAT*d call function to find the row which matches the closest to // what is typed in the edit portion of dddw // 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 end on event dw_1::validate_delete;string ls_sql_stmnt, ls_err long ll_parent_rid, ll_parent, ll_row_num ifDAT*f dw_1.RowCount() = 1 then ll_parent_rid = dw_1.GetItemNumber(dw_1.GetRow(), "parent_rid") select parent_rid into :ll_parent from rap_legal_entities where rid = :ll_parent_rid; if f_db_error(SQLCA, "Fail on selecting parent rid on " + & "rap_legal_entities table. Contact your technical support.") = 1 then return end if wf_delete(This) ls_sql_stmnt = "DataWindow.Table.Select='" + is_orig_sql_statement + "'" ls_sql_stmnt = Left(is_orig_sql_statement, & Pos(iDAT*hs_orig_sql_statement, " WHERE", 1) - 1) if IsNull(ll_parent) then // When the root is reached, also display other roots // Use rid > :legrid to supress the retrieval argument popup ls_sql_stmnt = "DataWindow.Table.Select='" + ls_sql_stmnt + & " WHERE parent_rid is null and rid > :legrid'" else // Display its parent only ls_sql_stmnt = "DataWindow.Table.Select='" + ls_sql_stmnt + & " WHERE rid = :legrid'" end if ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err "" then MessageBox("Modify Failed", ls_err) end if if IsNull(ll_parent) then dw_1.Retrieve(0) else dw_1.Retrieve(ll_parent_rid) end if ll_row_num = dw_1.Find("rid = " + String(ll_parent_rid), 1, dw_1.RowCount()) dw_1.ScrollToRow(ll_row_num) wf_row_changed() else wf_delete(This) end if end event on dw_1::delete_row;call w_master_detail`dw_1::delete_row;long ll_rid // Get rid from the datawindow ll_rid = This.GetItemNumber(This.GetRow(), "rid") // CallDAT*l function if f_delete_leg_ent(ll_rid) = 1 then ib_delete = TRUE else ib_delete = FALSE 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 end event event dw_1::dDAT*nwnprocessenter;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 // Make the return key acts like the tab Send(Handle(This), 256, 9, Long(0,0)) return 1 end event event dw_1::itemerror;call super::itemerror;return 2 end event type r_1 from w_master_detail`r_1 within w_leDAT*pgal int X=41 int Y=36 end type type r_2 from w_master_detail`r_2 within w_legal int X=32 int Y=540 end type type cb_children from commandbutton within w_legal int X=55 int Y=404 int Width=361 int Height=80 string Tag="Show member information" boolean BringToTop=true string Text="Children" 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_DAT*rpending() then return if uo_act.Visible then if uo_act.uf_check_pending() then uo_act.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 SetPointer(HourGlass!) wf_enable_btn(TRUE) f_highlight_button(r_buttons, this, "on") is_current_btn = This.Text // Change attributes of menu items is_state = 'leg member' is_style_state = 'list' f_menu_behave(is_state, is_style_state, is_enlarge_state)DAT*t // Change the size of dw_1, move buttons and draw dw_2 wf_set_var() wf_draw_dw2() dw_2.SetFocus() end on type cb_source from commandbutton within w_legal int X=649 int Y=404 int Width=361 int Height=80 string Tag="Show group information" boolean BringToTop=true string Text="Source" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;SetPointer(HourGlass!) wf_enable_btn(TRUE) f_hDAT*vighlight_button(r_buttons, this, "on") if Not wf_check_pending() then return is_current_btn = This.Text // Change attributes of menu items is_state = 'leg source' is_style_state = 'list' f_menu_behave(is_state, is_style_state, is_enlarge_state) wf_set_var() wf_draw_dw2() dw_2.SetFocus() end on type cb_activity from commandbutton within w_legal int X=1248 int Y=404 int Width=361 int Height=80 string Tag="Show activity current view" boolean BringToTop=true string Text="AcDAT*xtivity" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;integer li_row string ls_action SetPointer(HourGlass!) if Not wf_check_pending() then return if uo_contact.Visible then if uo_contact.uf_check_pending() then uo_contact.uf_save() end if end if SetPointer(HourGlass!) wf_enable_btn(TRUE) f_highlight_button(r_buttons, this, "on") is_current_btn = This.Text is_statDAT*ze = 'leg activity' choose case w_mdi_main.is_act_style case 'current', '' Parent.TriggerEvent("current_view") case 'history' Parent.TriggerEvent('history_view') case 'form' wf_draw_dw2() m_main_menu.m_view.m_freeform.TriggerEvent(Clicked!) case 'list' wf_draw_dw2() m_main_menu.m_view.m_tabular.TriggerEvent(Clicked!) end choose end on type uo_act from u_dw_act_leg within w_legal int X=0 int Y=512 int Height=932 boolean Visible=false boolean Border=false BordeDAT*|rStyle BorderStyle=StyleBox! end type on uo_act.destroy call u_dw_act_leg::destroy end on type r_buttons from rectangle within w_legal int X=576 int Y=372 int Width=160 int Height=144 boolean Visible=false boolean Enabled=false int LineThickness=4 long LineColor=12632256 long FillColor=32768 end type type uo_contact from u_dw_contact within w_legal int X=37 int Y=512 int TabOrder=40 boolean Visible=false boolean Border=false BorderStyle BorderStyle=StyleBox! end type DAT*~ on uo_contact.destroy call u_dw_contact::destroy end on type cb_parent from commandbutton within w_legal int X=2423 int Y=260 int Width=361 int Height=80 boolean Visible=false boolean BringToTop=true string Text="Parent" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type event clicked;string ls_sql_stmnt, ls_err long ll_row_num, ll_cur_row, ll_parent_rid, ll_parent ll_cur_row = dw_1.GetRow() DAT* ll_parent_rid = dw_1.GetItemNumber(ll_cur_row, "parent_rid") select parent_rid into :ll_parent from rap_legal_entities where rid = :ll_parent_rid; if f_db_error(SQLCA, "Fail on selecting parent rid on " + & "rap_legal_entities table. Contact your technical support.") = 1 then return end if if IsNull(ll_parent) then // When the root is reached, also display other roots // Use rid > :legrid to supress the retrieval argument popup ls_sql_stmnt = Left(is_orig_sql_statemeDAT*nt, & Pos(is_orig_sql_statement, " WHERE", 1) - 1) ls_sql_stmnt = "DataWindow.Table.Select='" + ls_sql_stmnt + & " WHERE parent_rid is null and rid > :legrid'" else // Display its parent and other record has the same parent as its ls_sql_stmnt = "DataWindow.Table.Select='" + is_orig_sql_statement + "'" end if ls_err = dw_1.Modify(ls_sql_stmnt) if ls_err <> "" then MessageBox("Modify Failed", ls_err) end if if IsNull(ll_parent) then dw_1.Retrieve(0) else dw_1.RetrievDAT*e(ll_parent) end if ll_row_num = dw_1.Find("rid = " + String(ll_parent_rid), 1, dw_1.RowCount()) dw_1.ScrollToRow(ll_row_num) wf_row_changed() dw_1.SetFocus() end event type cb_contact from commandbutton within w_legal int X=1842 int Y=404 int Width=361 int Height=80 string Tag="Show location information" boolean BringToTop=true string Text="Contact" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! eDAT*nd type on clicked;SetPointer(HourGlass!) if Not wf_check_pending() then return if uo_act.Visible then if uo_act.uf_check_pending() then uo_act.uf_save() end if end if SetPointer(HourGlass!) wf_enable_btn(TRUE) f_highlight_button(r_buttons, this, "on") is_current_btn = This.Text // Change the attributes of menu items is_state = 'leg contact' f_menu_behave(is_state, is_style_state, is_enlarge_state) uo_act.Hide() uo_contact.uf_retrieve_dw_contact_master(dw_1.GeDAT*jtItemNumber(dw_1.GetRow(), "rid")) uo_contact.Show() uo_contact.dw_contact_master.SetFocus() end on DAT*tedrowH&insertrow(huf_setitem_on_dw_select_list8|4%H4%deleterowib_obj_modified+4%uf_assign_active_dw3&1 A, 2 AsetsortRX&sortSwic8 , @ X ` t           ( 0 @ H "-"-2  +mousemove+clicked(DAT*2 t xywidthheighttaborderpicturenamehtextalignoriginalsizetextsizeweightfacenamefontfamilyfontpitch   x(".9FOV_j] o x( DAT*@ @  @@ -j"2  2 w xywidthheightenabledtextfocusrectangletextcolorbackcolortextsizeweightfacenamefontfamilyfontpitch  w8DAT*!& 5?IRYbm] o w8 @ @ 2  2 w xywidthheighDAT*tenabledtextfocusrectangletextcolorbackcolortextsizeweightfacenamefontfamilyfontpitch7  8!& 5?IRYbm] o78 @DAT* @  X, $6)$8,->1L,-,$$d0 +flags+xpos+yposw_mdi_main::messaged @%&-@-4 tagsetmicrohelpZ DAT*$ , F)8,-,1:,-$d" +wparam+lparam::message< -@-  uf_save1  \8080@8,-B1P,-@$(d" +wparam+lparam::message< -@-H FiDAT*lter on groupSorry! This function is not available@ \8080@8,-B1P,-@$(d" +wparam+lparam::message< -@-H Show All on groupSorry! This function is not available@ \8080@8,-B1P,-8$(d" DAT*+wparam+lparam::message< -@-@ DeleteSorry! This function is not available8 \8080@8,-B1P,-8$(d" +wparam+lparam::message< -@-@ InsertSorry! This function is not available8 d$,$DAT*8,-J1X,-4$0d( +xpos+ypos+row+dwo::messaged -@-< il_last_clicked_member_row**$ , 4 d $)8)88,-J1X,-@$0d ::message-@-H DAT* r_2(#showuf_assign_active_dw3$  8 @ P $)8,-61D,-$$d ::message-@-, r_2(#hide  $ $.2cdefg2$.2 y +mousemove+save+select_one+select_all+validate_delete+aDAT*dd_row+clickedf_highlight_row+getfocus+losefocus%1BKT.dn2 H xywidthheighttabordertagborderstylevscrollbarlivescroll T $"&2DAT*=] oT$ @  @  c xd $e,<f=TDAT*gj$$.2 X, $6)$8,->1L,-,$$d0 +flags+xpos+yposw_mdi_main::messaged @%&-@-4 tagDAT*setmicrohelpZ $ , \8080@8,-B1P,-@$(d" +wparam+lparam::message< -@-H Filter on groupSorry! This function is not available@ \8080@8,-B1P,-@$(d" +wparam+lparDAT*am::message< -@-H Show All on groupSorry! This function is not available@ \8080@8,-B1P,-8$(d" +wparam+lparam::message< -@-@ DeleteSorry! This function is not available8 \8080@8DAT*,-B1P,-8$(d" +wparam+lparam::message< -@-@ InsertSorry! This function is not available8 P $)8,-61D,-$$d ::message-@-, r_1'!hide  $ d $)DAT*8)88,-J1X,-@$0d ::message-@-H r_1'!showuf_assign_active_dw3$  8 @ d$$8,-J1X,-,$0d$ xposyposrowdwo::messaged DAT* -@-4 il_last_clicked_row)) $ , $.2cdef2$.2 s +mousemove+select_one+select_all+validate_delete+add_row+losefocus+getfocus+clickedf_highlight_row+<EPZc.2DAT* S xywidthheighttabordertagborderstylehscrollbarvscrollbarlivescroll7 X $ "7&2=H] 7o7X$  @  @ DAT* lc xd,e=f2.j$4$2  2 K xywidthheightvisibleenabledlinethicknesslinecoDAT*lorfillcolor) H D!)7A] ")HD2  2 K xywidthheightvisibleenabledlinethicknesslinecolorfillcolor H DDAT*!)7A] "HDDAT*L"-2  2 xy(J ] oJx @   @   @ @ "-2  2  xytext<J DAT* |] oJx( @   @|  @ @ 2  2  xtext(A ~] oA w8 @  DAT* ~ @ 2  2  xheighttext<E 5] oE5 @    @ cDAT*defg2$.2  2 " xwidthheightdataobjectPE A] oETA @ @  cdef2$.2  2 " xwidthheDAT*ightdataobjectPJ ] oJX  @ @  2  2  xwidthheight<7 ] DAT*7H2  2  xwidthheight<3 e] 3HeDAT*w_6D^codegetitemstring@),-is_levelHUis_device_code\Vmember,-legal,-,-begin_relation_dateend_relation_dateBegin Relation DateEnd Relation Date $ 4 < L T \ p x          8 @ T l |   N%$)$81H,$4$)D88LDAT*J`8t$8|$$$($$6$$6 $,8)$88$L$8T08h$8px$)8$)8$)8$$)8H$8$$$DAT*$$,$64$<\$6d$,8)l8t$8|)8$8|)8$$8T08$$6)8$:NW@)8 $($)08H8$8@HH$P$d$rl$t|$6$DAT*$6$,8)8$$8T08$8p$)8$)8$)8$ $)(8&l (^zJt!"8#h%'*+,(-R/r012357 d ll_master_ridsqlca(8@e0DAT* dw_1$. rowcount4. . getrow<ridgetitemnumber9 Pis_stateh2memberdw_2-dataobjectis_member_dwO-Odw_3,is_member_dw_freeformeP-settransobjecty^r_buttons,C\cb_member@8"onis_style_stateW3form ,showtai--retrieve2-,sharedatah2activityDAT*-is_activity_dwQ-Q,is_activity_dw_freeformDR-^-metric_code.DDDW.Name=d_metrics_devmodifyz,z,C\cb_activity:--is_levelU2,triggerevent -,h2legalse-is_legal_dwXS-XS,is_legal_dw_freeformn T-^,C\cb_legal?:W3DAT*,--2-, $ , 4 D ` t            $ 8 L h x              $ , 4 < \ d l t            DAT* ( 0 8 H P d l t |                  ( 8 0D8L0h8p0808080(8004Nh d 48 is_member_dw8Od_deDAT*v_memberis_member_dw_freeform-Pd_processis_activity_dwVQd_activityis_activity_dw_freeform{Rd_activity_freeformis_legal_dwSd_legal_entity_relationsis_legal_dw_freeformTd_legal_entity_relations_freeformis_levelUDEV D h    ( &$8<,$)H8P$8Xxl$)t8|$8$)DAT*8$8$)8,;$$9}$$,$D$)T8\$p9}x$$$$)8$$$1-<R$$1#<R)8$$ $1<Y}$ ($0$1<Y}<DAT*$L$T$1-<R\$d$1#<R)l8t$|$$1<Y}$$$1<Y}$$$$)8$$ $$)80$8$@$H$)P8d$l$t$|$)8$$DAT*$$)8$$$$)8$ $$$)$89)<8P$X$8`08d$)t8$)8$)8$)8$)8$)8$)88080,80DAT*4$6<$6D$688Xt TrX@:x !$2%H)~*+,-. 0&2B3\4v5d m_main_menu;@gL is_state_dw2activityuo_act%ADuf_check_pending542contactuo_contact`>2642groupuo_groupBQ242locationuo_loc@<54m_DAT*view(m_original$7toolbaritemvisible dw_1 . . width$ii_dw1_height4XresizeL . vscrollbard . . xii_dw1_yYmover_1/" . $ . heightL/" . /"yos  . r_280$dw_2cusD-$D-L80$D-80$ D-cb_member+uDAT*8"8"ii_cb_yZcb_groupged9,9,Zcb_activity$:-$:-Zcb_locationX;.X;.Zcb_contact=0=0Zcb_legaloun?:?:Zcb_connection</</Zwf_enable_btn,r_buttonsDC\8"offD-hideldw_3 |,l%ADl`>2lBDAT*Ql@<l . setfocus2masteris_style_state3is_enlarge_state4234 , H P l t |           , D T \ p x                   ( 0 < L T \DAT* d l t |                  0 8 @ H P d l t |                 $ < P X d t             DAT*  , 4 < D |#$ $T($)D8TL$)\8p$x$$)8$)8$$$)8$)8$$P$)8P$) 8(800@$6X$6`$68l$)|DAT*8$$$1)8$9}$$$$)8$ $($1-<R0$@$1#<R)H8P$X`$h$1<Y}p$|$$1<Y}$$$$$1<R)8$$DAT*$$$1<R)8$ $($0$8$1<R)@8T$\$d$l$t$1<R)|8$$$$$1<R)8$$$$$1<R)8 $$$$$,$1<R)48DAT*D$)L8\$)d8p$)x8$)8$)8$)8$)88Tn 4Pj !"$%b&' *J+,-R./0Z34567"8>9Zd x uo_actADvisibleADuf_check_pending50ADuf_save2Tuo_groupdBQDAT*dBQ20dBQ1Tuo_loc@<@<50@<3Tuo_contact>2>260>24Tis_enlarge_stateidt4detailis_state72is_style_stateH34r_1h/"hidetdw_1$. . widthroresizeo. vscrollbar@. . xii_dw1_yYmoveh/". . height8h/". hDAT*/"y(x . xcb_member8"8". xcb_group9,9,. xcb_activity :- :-. xcb_locationH;.H;.. xcb_contactn=0=0. xcb_legaldi?:?:. xcb_connection</</. xdw_2<-tdw_3T,DAT*tr_2l0$tADtdBQt@<t>2t  ( D L \ p x                  ( @ X ` l |               ( 0 @ H P X ` h p DAT*|                  ( 0 8 @ T \ d l t |                 $ , 4 D L \ d p x         :F@@8DAT*$)(8808$)@88H"P$)X88`"Zx$8=8@8V$8=8@8V$8V=8@8$)88=8@8=8 @8,>>9}80)08DAT*  4 Vd w_filtergb_filter(=@h>@8` idw_active1%classname)dw_2T1%dw_381%dw_act_detailis_staten2activityrap_activitiesn2memberrap_processesn2legalrap_legal_entity_relations@1%dw_act_masteract_masterrap_devicesfiltertriggerevent  ( 8 @ P X xDAT*     0 p $$$,$<$D$)T88\Jp8)8$$$)88\J8)8$$$18 ) 8($,-<$6T$66l$68t08t0)8$$$$$)DAT*88\J8)8$$j $$$)$88\J,8)T8t d% ls_source_codegl_device_rid( -@\8 uo_groupBQvisibleBQdw_14. 4. getrowLridgetitemnumber `uf_retrieve_group_membervit4xBQ4. 4. LDAT* `uf_retrieve_select_list5uo_actADdw_6acD^codegetitemstringADis_level0Uis_style_stateD3is_device_code\Vuf_prepare_dwCuuo_loc@<@<4. 4. L `uf_retrieve_dw_loc_master9uo_contact>2>24. 4. L `uf_retrieve_dw_contact_master:4 $ , < D T p    DAT*         ( < T l                $ , T R$) 88(B9}" Bd lb_checkls_rid( ) dw_6oupD^gettext  $$DAT*}8$@}T$\}p$x}$}$}$}<Zxd pb_enablep cb_member8"enabledcb_group,9,cb_activityH:-cb_locationd;.cb_contact=0cb_legal8?:cb_connection</DAT* $ 8 @ T \ p x       !$$)(880JD8)X81|zl$8t8z)8v80J8d$1 980)8)888,1)8DAT*`)88`$88z)88$6)88$3@3$)888@,@6)H8,8P$1o@o88X\$6 8#9`d$8l"8s)8`$8t`8z)8v$8DAT*1:@)8:@!v8$3@3$)88@,@6)8,8$1o@o88Xv$6!8#v9r9F`  Bd F!l"$%&'>+`.d0123<;v=zdY dw_objectll_row_numll_cur_rowll_rid_numll_ridgl_source_ridgs_user_idDAT* sqlca (3:1@H@@S8@e dw_1mbe. . getrow ridgetitemnumber 4rowcount4Lis_state`2legalref_ridsetitemO 4Oclassname:source_ridoOdw_2`2activityOmetric_level_typeis_level UPcreation_date_timeOuser_iDAT* dPOR U`2memberdevice_ridO`2Od_activitygetitemstatuspOP U  ( D X l           8 H P \ d          $8 ($80"Z)H8)\8pDAT*$8x,066HZvd ps_stylew_mdi_main( 0@d0 is_style_state3current3historywf_detail_view8wf_draw_dw2Pis_stated2activityis_act_styleic+ ( H \ p   &88 088@08F0#8\l$DAT*|$}$$}$$})8$,8)8$,8)8)88@$:W@)T8,)|1,)\$2 L j .@bd, ancestorreturnvaluesqlca::message<8@e")@ad openis_state 2masteris_columnDAT*_status'Gvaliddeviceii_dw1_heightMXdw_1d. heighttii_dw1_yufYd. yecii_cb_yZcb_member@8"wf_set_var@d. settransobject^dw_6en D^^wf_retrieve_data$d. posteventH 8 \ l |            8 @ T \ r8,DDAT*>D9})$8,)X1f,),$ , >d6 ancestorreturnvaluegb_double_click::message<D@,)@a4 activatewf_retrieve_data$$ , j880&8,)P1^,)$6d& ancestorreturnvalue::message(DAT*)@a  closedevice X8,)>1L,)$%$d9 +flags+xpos+yposancestorreturnvalue::messaged /)@a clicked 8*$8*@T*\p*xDAT*******0*8L*Td*l|$}1<R$1<R$1<R$1<R$1<R$1<R$DAT*1<R$1<R$1 <R $1 <R$$1 <R,$41 <R<$D1 <RL$(>Tj 0Lx(T0\d icurrentT createcb_memberDAT*8""cb_group,9,,,cb_activityH:-H-cb_locationd;.d.cb_connection <//cb_contact=00uo_contactd>22cb_legal@?::uo_loc@<<uo_act AD Duo_group$BQ$Qr_buttons@C\@\dw_6\D^\^controltc@tc@8"tc@,9,tc@H:-tc@d;.tc@</tc@=0tc@>2tc@?:tc@DAT*@2cb_legal$?:uo_loc@26<2groupuo_groupBQ2<2locationuo_loc@<5< 4 P X t |        &~ DAT*&    FGOwPxQyS{T|mnoP$&.2  +current_view+history_view+highlight_dddwwf_retrieve_datawf_check_requiredwf_draw_dw2wf_set_varwf_general_viewwf_detail_viewwf_select_onewf_undo_uowf_insert_okwf_enable_btnwf_check_ridwf_clear_prev_stylef_menu_behavef_highlight_buttonf_validate_dev_prof_check_dates_ntf_validate_actf_validate_legal_relationf_get_sequencef_check_dDAT*(up_act+openf_window_count+activate+closef_window_close+clicked+create+destroy+closequery\$4EWcn~     +,+,3\DAT**4 '53 664 ,, ,,, +d+ P?_A _A_lionowash_uChE SPUP2  widthheighttitlebarDAT*,titleiconcb_membercb_groupcb_activitycb_locationcb_connectioncb_contactuo_contactcb_legaluo_locuo_actuo_groupr_buttonsdw_6is_unit_sqlis_validation_tableis_column_statusis_msg_nameis_msg_textil_selected_rowidwc_dw_childis_column_nameis_old_valueis_child_nameis_member_dwis_member_dw_freeformis_activity_dwis_activity_dw_freeformis_legal_dwis_legal_dw_freeformis_levelis_device_codeis_selected_child_typeii_dw1_heightii_dw1_yii_cb_yistr_connect_context4DAT*.e $) "3 ,< -H .T /b 0m 2x : < D Q \ ^!d@(DAT*0!*8E[j_] oWhe   81DAT*2 @@@       " , - . / 0 2 : < D Q \ ^!(DAT*4_ m$ $n2 <xoBTSV~eTqT|TTT DAT*6T V dX th <&"B$L%Ff'PoT(wTDAT*8)*G2  2  ] `@ @     @2  2  ] @DAT*: @     @   "$1)08H$)X8`$x$6)8$**$6880)8,)1DAT*<,)$0Jd ls_col_name::message( )@a` il_selected_rowJgetcolumnnameo_ is_column_namen8LgetrowP8Lis_old_valuehMsetitemPidwc_dw_child K(is_child_nameg NJhighlight_dddwpostevent en 0 H X ` x       DAT*>: *@l@l8$1)08H$)X8`$x$$$)8)8,)1,)$4Lf d- +key+keyflagsls_col_name::messageP`   #)@aX il_selected_rowJgetcolumnnameo_ is_column_namen8DAT*@LgetrowP8Lidwc_dw_childhK(Jis_child_namew_Ngetitemstringld[setitemP 0 H X ` x      J6/8)$868,)D88L08Q08#8c08y0@81686)88080DAT*B)88$)8$6$68#$$68$6@81Ph$)p88x)8)88)88)8)88)8)88)88J,8;)DAT*D48,)01>,)<$(@P d 6P8 !"$dJ rowdwodataancestorreturnvaluels_col_namedwccase7::message  ) 5 (9 @)@aD itemchangedgetcolumnnamescc_ams_codegettext9coderap_scc_DAT*Fams_codesColumn - SCC/AMS CodeSorry! Not a valid SCC/AMS codevalue9value_amtgetrow)is_column_nameL9is_child_nameNis_validation_tableFis_msg_nameHis_msg_text,Iil_selected_row@Jidwc_dw_childXK(bmetric_codegetchildQovalue_unit_codebunit_codegetitemstring[setitemPrap_legal_entities_nameoridbgetitemnumberWO$ DDAT*H       $ 8 P h p         , 4 < @6-8)$8<$ T)h8$**$68$1 80)8,)&14,)$DAT*J(@Z d? rowdwodataancestorreturnvaluels_col_name::messagex  ) 5)@aX editchangedgetcolumnname8is_column_name,Lidwc_dw_childDK(getchildo\il_selected_rowpJDK(is_child_nameNpJpJhighlight_dddwposteventer$ < T h DAT*L       b18)(88$)H81P$X$)`88h)|8$)81 $$)88h)880808$66666 8$8DAT*N:$8 $8"80 868"0 8$8&D$8LT 8 )\88)d8l$6 68$t$68"088|@1)868h0DAT*P8088@0d8l0$$)8)8.8\1)868h08080(800PX$`$)h8)p8.8&xx1)DAT*R868h0808080 $$)8)$8.8,81@)H8P6X8`0h8p0|8080$$)8)8.DAT*T81)868`0 8(088@0T8\0|$$)8)8.8h 1)868h0808080(DAT*V0$8$)@8)H8.8P \1d)l8t6|8`0808080$$)8)8.8 1 )(80688h0@80DAT*XH80P8l0X`$h$)p8)x8.8 1)868`0808080 $$)8)$8.8,<@1H)P8XDAT*Z6`8h0h8p08080$$) 8) 8.8 X( 10 )8 8@ 6H 8h0P 8X 0x 8 0 8 0  $ $) 8) 8.8 tDAT*\ 1 ) 8 6( 8`00 88 0L 8T 0l 8t 0  $ $) 8) 8.8  1 ) 8 $,8) 8 $) 8$ 6, 8h04 8< 0P 8X 0DAT*^p 8x 0  $ $) 8) 8.8  1 ) 8 6 8h0 8 0 8 0, 84 0T )\ 8)d 8.8l  $668 08 1 ) 8DAT*` 6 8 0 8 0 8 0 8 04 )< 8)D 8.L 80,)H1V,)T $ 8 Zj 2DX !#6$N%j()*+F$G8HNItJKLMNO<PTQjRSTUVWXXYpZ[\]^_`,atbcdefgh.iHDAT*bjklmnop0qJrdstuv w x2 yL zf { | } ~  4 N h  8 P j  . T l  4 J p 8Pf Tl(p2Lf4Nh 6\t.d rowdwoancestorreturnvaluels_col_namels_sourcels_deviceDAT*dls_streamls_processll_cur_rowls_metric_codesqlca::message $ 0 : D N Yd s8@ey)@a\  itemfocuschangedgetcolumnnamedw_60D^getrow@0D^0D^@codegetitemstringmdw_1. @. . @mDAT*fmetric_codeis_level7Ugroup_typedataobjectd_dev_memberd_processPRODEVvalue_unit_codeis_unit_sql6Enull6E@m6EUmaterial_codeil_selected_rowJidwc_dw_childK(getchildois_column_nameLis_child_nameNis_validation_tableFrap_materialsis_msg_name*HColumn - Material Codeis_msg_textWISorry! Not a valid material codeis_old_value8Mdw_3,DAT*h,@mJK(oLNFrap_metrics*HColumn - Metric CodeWISorry! Not a valid metric codeM,,@mJK(oLNFrap_units*HColumn - Value Unit Code0WISorry! Not a valid value unit codeM,,@mmethod_typeJK(oLNtypeFrap_methods*HColumn - Method TypeWISorryDAT*j! Not a valid method typeM,,@mvalue_typeJK(oLNFrap_value_types*HColumn - Value TypeWISorry! Not a valid value type)M,,@mJK(oLNFrap_process_codes*HColumn - CodeWISorry! Not a valid process codeM,,@mmode_type$JK(oLNFrap_modes*HDAT*lColumn - TypeWISorry! Not a valid mode typeM,,@mprimary_material_codeJK(oLNF*HWIM,,@mJK(oLNFrap_group_types*HColumn - Group TypeWISorry! Not a valid group typeM,,@mdaily_schedule_codeJK(oLNFrap_operating_daily_schedules*HDAT*nColumn - Daily Schedule CodeWISorry! Not a valid daily schedule codeM,,@mweekly_schedule_code@ JK(oLNFrap_operating_weekly_schedules*HColumn - Weekly Schedule CodeWISorry! Not a valid weekly schedule codeM,,@mreference_typeJK(oLNFrap_reference_types*HColumn - Reference TypeWISorry! Not a valid refeDAT*prence typeM,,@mreference_codeJK(oK(settransobject K(retrieve| LNFrap_reference_codes*HColumn - Reference CodeWISorry! Not a valid reference codeM,,@mdata_codeJK(oLNFrap_data_codes*HColumn - Data CodeWISorry! Not a valid data code$M@mrap_legal_entities_naDAT*rmetitle nameJK(oLNFrap_legal_entities*HColumn - Legal Entity NameWISorry! Not a valid legal entity nameM@mL( 8 H P X ` |           D T \ d l t       8 d      DAT*t       ( P X ` h p x             $ 8 @ H P X h |              8 T |             ( 0 8 @DAT*v H \ d l t |            ( 0 8 @ H P X ` h p x              $ @ H P X ` h        ( 0 8 @ H P x   DAT*x        ( 0 L l             $ , 4 P p             , T \ d          4 < D L T .7DAT*z8)(880@81Yo@o8828?8mz%8z&8z&8z& )8 1),8 84)H81r8Pz%8gz&z&8gz&  82)l88tz%820806 689},)1DAT*|",)$(@ (@rd xposyposrowdwoancestorreturnvaluels_obj_name_strls_obj_namels_sqlls_process_codels_scc_ams_codell_cur_row::message  . > J Q a q|)@a8 DAT*~rbuttondowngetobjectatpointert scc_ams_codeselect 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_codesgetrowaccepttextn codegetitemstringd9 where process_code = '9 order by codeSCC/AMS Code Lookupib_obj_modified(  , H l   "DAT*$8)$88,@81Yo@o88.8=8kz%8z&8z&8z&  1)8 8 )481f8<z%8Sz&z&8Sz&  8U)d88lz%8.08{06 689},)1DAT*,)$(@ 4fd xposyposrowdwoancestorreturnvaluels_obj_name_strls_obj_namels_sqlls_process_codels_scc_ams_codell_cur_row::message  . > J Q a q|)@a0 DAT* clickedgetobjectatpointert scc_ams_code_tselect 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_codesaccepttext codegetitemstringC% where process_code = 'scc_ams_codel% order by codeSCC/AMS Code Lookupib_obj_modified$  4 d   $1DAT*)08H$)X8`$x$$$)8)8_@_811 11@8 @ 810J d ls_col_name P il_selected_rowJgetcolumnname is_column_name8LgetrowP8Lidwc_dw_childhK(Jis_child_nameDAT*Ngetitemstringz[setitemP 0 H X ` x     8$8$)488<,@6)L8)T88\3@3$)p8,)1,)x$ <ldA +wparam+lparamancestorreturnvaluegs_user_id::messaged DAT*,@@7)@a0 add_rowis_state2activitygetrow-user_idsetitemPD-creation_date_timeOD 4 L T p x .8$($N0$)@8,)h1v,)H$2 Nd& ancestorreturnvalue::message()@aP( getfocDAT*usuo_actADvisible ADhide8 ( 0 @ H :6081d) rowdwodataancestorreturnvalueP   itemerror$-. /0 17OPQRSTcdef-&/102$78.2DAT* < +dwescape+dwnkeyf_dddw_search+itemchangedf_validate_codef_set_value_amt+editchanged+itemfocuschangedf_retrieve_metric_codesf_retrieve_group_typesf_get_unit_sqlf_retrieve_unit_codesf_act_dddw_retrievef_retrieve_codes+rbuttondownf_look_up+clicked+dwnprocessenter+add_row+getfocus+itemerrorF(5GEH5GUFDAT*btIJJKLMNOO ' y1 2 & xywidthheighttabordertagx  h("hDAT*] h h( @     $<x/<L-p1 7DAT*f$ O. < 0     "$1)08H$)X8`$x$6)8$**$6DAT*880)8,)1,)$0Jd ls_col_name::message(pe r_)@a` il_selected_rowJgetcolumnname is_column_name8LgetrowP8Lis_old_valuehMsetitemPidwc_dw_childK(is_child_nameNJhighlight_dddwpostevent@ 0 H X `DAT* x       : *@l@l8$1)08H$)X8`$x$$$)8)8,)1,)$4Lf d- +key+keyflagsls_col_name::messageP`   #)@aX il_sDAT*elected_rowJgetcolumnname is_column_name8LgetrowP8Lidwc_dw_childhK(Jis_child_namew_Ngetitemstringld[setitemP 0 H X ` x      b6/8)$868,)D88L08Q08#8c08y0@81DAT*686)88080)88)8$)8$6$68#,$6@$6@81Xp$)x88)8)88)88)8)8.8.)DAT*8)88)88J48;)<8,)H1V,)D$(@P d 6Nh2 P"#$&.dJ rowdwodataancestorreturnvaluels_col_namedwccase7::message  ) 5 (9 @)@aLDAT* itemchangedgetcolumnnamescc_ams_codegettext9coderap_scc_ams_codesColumn - SCC/AMS CodeSorry! Not a valid SCC/AMS codevalue9value_amtgetrowetiis_column_nameL9is_child_nameNis_validation_tableFis_msg_name His_msg_text4Iil_selected_rowHJidwc_dw_child`K(bmetric_codegetchildovalue_unit_codebunit_codegetitemstring[setitemPrap_leDAT*gal_entities_nameoridbgetitemnumberW$O$ D        , @ X p x         4 < D @6-8)$8<$ T)h8$**$68DAT*$1 80)8,)&14,)$(@Z d? rowdwodataancestorreturnvaluels_col_name::messagex  ) 5)@aX editchangedgetcolumnname8is_column_name,Lidwc_dw_childDK(getchildo\il_selected_rowpJDK(is_child_DAT*nameNpJpJhighlight_dddwpostevent$ < T h         )81J,)61D,)$0$8828?JT8D9},;d$x$:W@)8b$8b28?J8D9}:F@@8Q,01:@DAT*@8,)|1,)$Jf 2bd^ xposyposrowdwo::messagegl_cur_rowgb_double_clickm_main_menuw_legalw_mdi_main  )@a$2@/D@?;@gKQ@jS0@dP rowcount64is_state$2memberridDAT*getitemnumber Cm_data\:m_processl?triggerevent^@ $2legalb@ C  0 T d x     L18)(88$)H81P$X$)`88h)|8$)81 $$)88h)880DAT*808$66666 8"8:$8 $8"80 868"0 8"8&D$8LT8 )\88)d8l$6 68"t$668DAT*$8.81)8680$8,0L8T0t8|0*8h*1)868h080808 0DT$\$)d8DAT*)l88tJ1)868h0808080$ $)(8)088hf81@)H8P6X8h0`8h0|808DAT*0$$)8)881)86 8h080(800H8P0px$$)8)88& 1)868h0DAT*808080$,$4$)<8)D88L X1`)h8p6x80808080$$)8)88  1 )(DAT*806880@8H0X8`0t8|0$$)8)88h 1)868h08h080 80$$$),8)48DAT*8<H1P)X8`6h80p8x08080$$)8)88* 1 ) 8 6$ 8h0, 804 80< 80D DAT*L $T $)\ 8)d 88Fl 1t )| 8 6 80 8 0 8 0 8 0  $ $) 8) 88 b, 14 )< 8D 6L 8h0T 8\ 0DAT*| 8 0 8 0  $ $) 8) 88 ~ 1 )$ 8, 64 8h0< 8D 0d 8l 0 8 0  $ $) 8) 88  1 ) 8DAT* 6 80 8$ 08 8@ 0X 8` 0  $ $) 8) 88  1 ) 8 6 8h0 8 0 8 0 8( 0L T $\ $)d 8)l 88t DAT* 1 ) 8 6 8h0 8 0 8 0 8 0) 8)88<$668D08L1T)\8d6l8D0t8,0|808DAT*0)8)880,)21@,)$ 8 Z j 2DX!6"N#j&'()C"E>FRGhHIJKLNO&P<QbRzSTUVY*\.]B^X_~`abcdeFf^gthijklmnbozpqrstuv6w~xyz{| } ~8 R  : T n DAT* " < V p & > X r   B Z t "8^v&>TzBZp^v2z4N6Pj8Rl  F^xd} rowdwoancestorreturnvaluels_col_namels_sourcels_devicels_processls_sDAT*treamll_cur_rowls_metric_code::message $ 0 : D O Yd s)@a itemfocuschangedgetcolumnnamedw_6,0D^getrow@0D^0D^@codegetitemstringmdw_1. @. . @mmetric_codeis_levelUgroup_typeDAT*dataobjectd_dev_memberd_processPRODEVvalue_unit_codeis_unit_sql6Enull6E@m6EUis_state|2legalridil_selected_row8Jidwc_dw_childK(getchildois_column_nameLis_child_nameNis_validation_tableFrap_legal_entitiesis_msg_name?HLegal Entity Nameis_msg_textfISorry! Not a valid Legal Entity NameJK(oLNFrap_legaDAT*l_relationship_codes?HCodefISorry! Not a valid legal relationship codeis_old_value7Mdw_2L-L-@mmaterial_codeJK(oLNFrap_materials?HColumn - Material CodefISorry! Not a valid material code7ML-L-@mJK(oLNFrap_process_codes?HColumn - Process Code6fISorry! Not a valid process code7ML-DAT*L-@mJK(oLNFrap_metrics?HColumn - Metric CodefISorry! Not a valid metric code7ML-L-@mJK(oLNFrap_units?HColumn - Value Unit Code fISorry! Not a valid value unit code7ML-L-@mmethod_typeJK(oLNtypeFrap_methods?HColumn - Method TypefISorrDAT*y! Not a valid method type7ML-L-@mvalue_typeJK(oLNFrap_value_types?HColumn - Value TypefISorry! Not a valid value type87ML-L-@mJK(oLNF?HColumn - CodefI7ML-L-@mmode_typeJK(oLNFrap_modes$?HColumn - TypepfISorry! Not a valid mode tyDAT*pe7ML-L-@mprimary_material_codeJK(oLNF?HfI7ML-L-@mJK(oLNFrap_group_types?HColumn - Group TypefISorry! Not a valid group type7ML-L-@mdaily_schedule_codeJK(oLNFrap_operating_daily_schedules?HColumn - Daily Schedule Code$fISorry! NDAT*ot a valid daily schedule code7ML-L-@mweekly_schedule_codeJK(oLNFrap_operating_weekly_schedules?HColumn - Weekly Schedule Code8fISorry! Not a valid weekly schedule code7ML-L-@mreference_typeJK(oLNFrap_reference_types?HColumn - Reference TypefISorry! Not a valid reference type7ML-L-@mDAT*reference_codeJK(oLNFrap_reference_codes?HColumn - Reference CodefISorry! Not a valid reference code7ML-L-@mdata_code)JK(oLNFrap_data_codes?HColumn - Data CodefISorry! Not a valid data code7M@mrap_legal_entities_nametitle4 nameJK(oLNF?HColumn - Legal Entity NameDAT*fISorry! Not a valid legal entity name7M@mL( 8 H P X ` |           D T \ d l t       $ L t         D T \ d l         DAT*    ( 0 8 @ H P X ` |              ( H p x            $ , 4 < D X ` h p x            ( 0 8 @DAT* X t                 $ , 4 H P X ` h p            $ , 4 < D L T \ d l t |           , 4 < D DAT* L T |         $ , 4 < d             8 X              L T \ d l             < L T DAT*\ d l t |       .78)(880@81Yo@o8828?8mz%8z&8z&8z& )8 1),8 84)H81r8Pz%8gz&z&8gz&  82)l8DAT*8tz%820806 689},)1",)$(@ (@rd xposyposrowdwoancestorreturnvaluels_obj_name_strls_obj_namels_sqlls_process_codels_scc_ams_codell_cur_row::message  . > DAT*J Q a q|)@a8 rbuttondowngetobjectatpointert scc_ams_codeselect 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_codesgetrowaccepttext codegetitemstring9 where process_code = ' 9 order by codeSCC/ADAT*MS Code Lookupib_obj_modified(  , H l   <8$$8,)<81)L812)T88\Jp8,)1,)x$8Tpd= +currentrowancestorreturnvaluegl_cur_row::messageP(2@3)@aDAT*0 rowfocuschangedis_state82memberrowcount43getrowDDridgetitemnumber `$ < L T p x 8$8$)488<,@6)L8)T88\3@3$)p8,)1,)x$ <ldA +wparam+lparamancestorreturnvaluegs_user_id::messagDAT*ed ,@@7)@a0 add_rowis_state2activitygetrow-user_idsetitemPD-creation_date_timeOD 4 L T p x $1)08H$)X8`$x$$$)8)8_@_811 1DAT*1@8 @ 810J !d ls_col_name P il_selected_rowJgetcolumnname8 is_column_name8LgetrowP8Lidwc_dw_childhK(Jis_child_name)Ngetitemstring[setitemP 0 H X ` x     .8$($NDAT*0$)@8,)h1v,)H$2Nd& ancestorreturnvalue::message()@aP( getfocusuo_actADvisible ADhidelum8 ( 0 @ H :6081d) rowdwodataancestorreturnvalueP  DAT* itemerror(-. /0 17< OPQRSTcdef-&/102(789<.A2 S +dwescape+dwnkeyf_dddw_search+itemchangedf_validate_codef_set_value_amt+editchanged+doubleclicked+itemfocuschangedf_retrieve_metric_codesf_retrieve_group_typesf_get_unit_sqlf_retrieve_unit_codesf_act_dddw_retrievef_retrieve_codes+rbuttondownDAT*f_look_up+rowfocuschanged+add_row+dwnprocessenter+getfocus+itemerrorF(5GEH5GUFbqIJJKLMN O6 DAT*$8- J> H 2 . xywidthheighttabordervisibletag) , `"*] ), ` @  @  DAT* $<Dx/<h-( 1 75< O DAT*. <,0      "$1)08H$)X8`$x$6)8$**$6880)8,)1,)$0Jd ls_col_name::messDAT*age( )@a` il_selected_rowJgetcolumnname is_column_name8LgetrowP8Lis_old_valuehMsetitemPidwc_dw_childK(is_child_nameNJhighlight_dddwpostevent_re 0 H X ` x       : *@l@l8$1)08H$DAT*)X8`$x$$$)8)8,)1,)$4Lf d- +key+keyflagsls_col_name::messageP`   #)@aX il_selected_rowJgetcolumnname is_column_name8LgetrowP8Lidwc_dw_childhK(Jis_child_namew_Ngetitemstringld[DAT*setitemP 0 H X ` x      6$8)$88,@81Yo@o8 68. L1)D88L)d88.08l08|068H9}8 1DAT*)88)880808068X9},)1*,)`$(@ !$'4)H*`+l,|-037do xposyposrowdwoancestorreturnvaluell_cur_rowls_obj_name_strls_obj_namels_codecase28::message  .DAT*9 I U ] e)@ah@ clickedgetobjectatpointert sic_code_taccepttext9sic_codegetitemstringUSIC Code Lookupselect code, name, user_define_flag from rap_sic_codes order by codeib_obj_modifiednaics_code_t9naics_codeUNAICS Code Lookupselect code, short_desc from rap_naics_codes order by coder_p$ D d DAT*   X `  78)81)0888)P88808X08h0689},)1,)$(@Pb dS +xpos+ypos+row+dwoancestorreturnvaluell_cur_rowls_sic_code::messageDAT* 2= I)@a( rbuttondowngetrownaccepttextl$sic_codegetitemstring_ASIC Code Lookupselect code, name, user_define_flag from rap_sic_codes order by codeib_obj_modified 0 P   F<8 $)481<$)L81!69)d8-l$DAT*t$)|88J8$$)88)8,-2$)8v-1 $)89)80$88H$)d8l$,-)8&$8.$)8$,-)8&$8 $)8$,-)@8DAT*H$,-)h8&p$8x$8$$#!"$8"&)8$$$)8:F@@8$18)8 $,- $68$66@$68H08H0)X8,),1:,)`$  f |  26D`vDAT*  * J!f"#$*&+@,^.x/9dO +currentrowancestorreturnvaluels_source_codegl_device_rid::messaged( 7-@E)@ah rowfocuschangeddw_1. rowcount)4(. getrowDwf_enable_btnT. . Dridgetitemnumberns is_device_codeV. . Dcodegetitemstring@DAT* dw_2-reset/-/Tis_state$2locationuo_locA@26P>2uf_retrieve_dw_contact_master:$2groupuo_groupBQ2PBQuf_retrieve_group_member4$BQuf_retrieve_select_list5P$2member$2activityuo_actADvisible$2legalwf_draw_dw2ADDAT*AD5Pdw_6D^ADis_levelcebUis_style_state@(3Vuf_prepare_dw@CI 4 < L d l t |             0 H d l            @ H h p          DAT*      8 @ X `  6/8)$8<$)L8d$6$6 8#$6$6@81$)88)8808 0 8#808)0@81,)1,DAT*owfocuschanged!) end if end event event clicked;call super::clicked;if not wf_check_pending() then return 1 else 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 return 0 end if end event on getfocus;call u_dddw::getfocus;is_child_name = 'id' isDAT*_validation_table = 'rap_sources' is_msg_name = 'Column - Source Id' is_msg_text = 'Sorry! Not a valid source Id' end on DAT*)H$(@Z $`d? rowdwodataancestorreturnvaluels_col_name::messagex  ) 5)@aP` itemchangedgetcolumnname is_column_name,LgettextDis_child_name!TNis_validation_tablelFis_msg_nameHis_msg_textIil_selected_rowJidwc_dw_childDAT*K(getrowbsic_codeDcoderap_sic_codesColumn - SIC CodeSorry! Not a valid SIC code $ < L d        H N18)(880<$6L$6800 88T8_0880t1)8DAT*6800808088@0lt$|$)8)88T1)86808080808@$H$)P8)X8`8hDAT*0,)41B,)l$ 8L 0Jd~4Lf"d: rowdwoancestorreturnvaluels_col_name::messaged $ 0)@at itemfocuschangedgetcolumnnamecodetitle5 dw_1xtD. group_typeDEVil_selected_rowcJidwc_dw_child|K(getDAT*childois_column_nameLis_child_nameNis_validation_tableFrap_device_codesis_msg_nameHColumn - Codeis_msg_text*ISorry! Not a valid device codeis_old_value_MD. D. getrowgetitemstringcJ|K(oLNtypeFrap_group_typesHColumn - Group Type*ISorry! Not a valid group type_MD. D. L( < L tDAT*        8 l t |           8 @ H P X ` l $1)08H$)X8`$x$$$)8)8_@_811 11@8 @ 81DAT*"0J d ls_col_name P il_selected_rowJgetcolumnname is_column_name8LgetrowP8Lidwc_dw_childhK(Jis_child_nametcNgetitemstringum[setitemP 0 H X ` x     b8$#`,)L1Z,) $0$@$DAT*$.:F@@8P$18X)l8t$,-$6$66$68080)8,)H1V,)$ ` z .dS +wparam+lparamancestorreturnvaluels_source_code::messagegl_device_ridx , ;)@aE-@` saveDAT*&ib_save_ok 6uo_act(ADvisible8dw_6HD^codegetitemstring](ADis_level|Uis_style_state3is_device_codeVuf_prepare_dwC  0 @ P l t      A8)81-),884JH8`)h88p)8-1DAT*(@8,)1,)$@rd\ +rowsinserted+rowsupdated+rowsdeletedancestorreturnvaluegl_device_rid::messagex#0D-@R)@a@ updateendrowcount4getrow$ridgetitemnumber 8is_device_codePV$codegetitemstringuPVDAT** , H ` h    T8,):1H,)$ d6 +wparam+lparamancestorreturnvalue::messageP ,)@a add_row 6-8)$8<$Tl$**$6DAT*,8$180)8,)1,)$(@Z%dB +row+dwo+dataancestorreturnvaluels_col_name::messagex  , 8)@aH editchangedgetcolumnnameis_column_name,Lil_selected_rowDJidwc_dw_child\K(is_chiDAT*.ld_nametNDJDJhighlight_dddwposteventtri$ < T l      :6081d) rowdwodataancestorreturnvalueP   itemerror98) 81N9)88,)h1v,)@$DAT*08Nd0 +rowcountancestorreturnvalue::message<&)@aH retrieveendrowcount4wf_enable_btn( 8 @ $- /0 179 <A  OPQRSTcdef-&/102$789<.A2  +dwescape+dwnkeyf_dddw_searDAT*2ch+clickedf_look_up+rbuttondown+rowfocuschanged+itemchangedf_validate_code+itemfocuschangedf_retrieve_codesf_retrieve_group_types+dwnprocessenter+save+updateend+add_row+editchanged+itemerror+retrieveendF(1O1O;1OHYfGfGvNDAT*4J   8F@ $ 2 1 xywidthheighttabordertagdataobject)  "&] o)  @ DAT*6   $fPx$75<</ 1 PDAT*8 e~4A  < O<T- <x0 9 2  2 xy( ]  2  DAT*: 2 xy(2 t] 2t b :F@@8)8#^,)J1X,)$$:F@@89)<8P8X0p8x0)8)8$808$)8,)HDAT*<1V,)$^x .d ::message)@aX wf_check_pending}wf_enable_btn,is_stateD2memberis_style_state_3listwf_detail_view}wf_draw_dw2r_buttons8C\ondw_2-setfocus $ < P p       """2 $ +cDAT*>lickedf_highlight_button(type fcomm,wi2 [ xywidthheighttagbringtotoptexttextsizeweightfacenamefontfamilyfontpitch%  eP(-6=F Q ] o%eP DAT*@@    @f" :F@@8)8#^,)J1X,)$$:F@@89)<8P8X0)p8$$$)88J8)8$$$) 88JDAT*B8)48<$)L8`$8h08l$$)8,)1,)$^x nd ::message)@a wf_check_pending}wf_enable_btn1,is_stateD2groupwf_detail_view^uo_groupxBQdw_1P. . getrowridgetitemnumber DAT*Duf_retrieve_group_membercti4xBQ. .  uf_retrieve_select_list5xBQshowct.Dr_buttonsTC\onxBQdw_select_listt&setfocusle $ < P p             4 < L ` l    ","2 $ +clickedf_highlight_button(typefrommaDAT*F,it2 [ xywidthheighttagbringtotoptexttextsizeweightfacenamefontfamilyfontpitch  eP(-6=F  Q  ] oeP @     DAT*H @f"h:F@@8)8#^,)J1X,)$$8$H$P$)l8t$)8$$$)8$)8$$Z$)8Z$)8:F@@89)8DAT*J$8,0,0D$68L8T"8U0)p88x880)88)8)8,;$$:W@)88)8)8,; $ $:W@)(8<$8D08,)N1\,)H$^xDAT*L  >Zt%&'()*4+L,^-p./01454d1 ::messagew_mdi_maincase37m_main_menuP)@a0@d %;@gP( wf_check_pending}uo_group,BQvisible@,BQuf_check_pending2X,BQuf_save1|uo_loc@<@@<5X@<3|uo_contact>2@>26X>24|DAT*Nwf_enable_btnis_state82activityis_act_style5+currentcurrent_viewtriggerevent bhistoryhistory_view bformwf_detail_viewwf_draw_dw2m_view(m_freeform1 blist(m_tabularE=2 br_buttons0C\onp $ 8 H P l t              DAT*P $ D p             ( < H "-"2 $ +clickedf_highlight_button(typetym co,n 2 [ xywidthheighttagbringtotoptexttextsizeweightfacenamefontfamilyfontpitchR  eP(-DAT*R6=F Q ] oReP @    @f" :F@@8)8#^,)J1X,)$$:F@@89)<8P8X0DAT*T)p8$$$)88J8)8$)8$808 $8$)L8,)1,)T$^x 0\d ::message)@a\ wf_check_pending}wf_enable_btn1,is_stateD2locationwf_detail_viewauo_locDAT*Vx@2dw_1ele. . getrowridgetitemnumber uf_retrieve_dw_contact_master:x>2showr_buttonsC\onx>DAT*b2dw_contact_master0#setfocus9L $ < P p          ( D X ` "0"2 $ +clickedf_highlight_button(typet  com, w2 [ xywidthheighttagbringtotoptexttextsizeweightfacenamefontfamilyfontpitch  ePDAT*dl(-6=F Q ] loeP @    @f"18d  destroy2P1o32 DAT*f +destroy2 ' xyvisibleborderborderstyled $ ] $$  @@31       4 5 6 7 8DAT*h 9(!wT :F@@8)8#^,)J1X,)$$:F@@89)<8P8X0p8x0)8)8$DAT*j808$6$6$68$)8,)1,)$  ^xVrd ::message)@ap wf_check_pending}wf_enable_btn,is_stateD2legalis_style_state^3listwf_detail_view}wf_draw_dw2r_buttonsC\onnD2^3is_enDAT*llarge_stateect4dw_2-setfocus $ < P p          ":"2 2 +clickedf_highlight_buttonf_menu_behave<typefromma,itw_de$+X=2 [ xywidthheighttagbringtotoptexttextsizeweightfacenamefontfamilyfontpitch  ePDAT*n(-6=F Q ] oeP @    @f";8d  destroy ? DAT*r@ A B(!wTT1C8,):1H,)$ d6 +wparam+lparamancestorreturnvalue::messageP ,)@a  highlight_dddw DAT*tC8d  destroyD1DL"o12 ! +highlight_dddw+destroy(2 ' xyvisibleborderborderstyled T ] TW \ @@31   DAT*v    E F G H I J K L M NO(!2 1owTP8d DAT*x destroyQ2  +destroy2  xyvisible<)  ] )  e @@3(1    @   R S T U V W X YDAT*zZwT2  2 K xywidthheightvisibleenabledlinethicknesslinecolorfillcolor  !@)7A] DAT*|]8) 88("8)0870@8)X818`)l81<$8t088z%@8,)1,)$18)88)8)818 )(88 )08)881)@88HJ\8DAT*~l$,1)81R$)8$:NW@)8$:NW@)8,11$)8$:NW@)8,)1,)$ 8T| $l0Rt"dN wparamlparamancestorreturnvaluels_datadwc::messagegl_source_rid DAT** 2 (6)@a@1@ retrieve_datagettextContext ErrorSource Id is requiredsetfocusMidgetchildocSource ContextApplication Error: Source Id - Not a DataWindowChild. Contact your technical support.codegetrowbgetitemstring[setitemPnameb[PbridgetitemnumberWLdw_1 d. retrieve2tdw_2-reset/DAT*-triggerevent d. -/-  X l     ( 0 8 @ \ l             z $]8)$8#N1F8$8@P$)l8:t$8|$)8:DAT*$8$)8:$8:$)81,)`1n,)$>JNj  :Fd8 xposyposrowdwoancestorreturnvalue::messagex  .)@ap clickedwf_check_pending}is_state,2activityuDAT*o_actIADuf_check_pending5X,2contactuo_contactE>26X,2groupuo_groupBQ2X,2locationuo_loc@<5X$ 8 P l t          .]8 8(0@8H0`8h080,)1,)$2Lfd&DAT* ancestorreturnvalue::message()@a( getfocusis_child_nameidis_validation_table+"rap_sourcesis_msg_nameT Column - Source Idis_msg_textc{!Sorry! Not a valid source Iduo @ `   $^.^^OPQ-/0$.2 * +retrieve_data+clicked+getfocus< DAT*2 K xywidthheighttaborderdataobjectborderborderstylelivescroll  \ "P-4@] o \  @ P  DAT*( Qf$x.DAT*8P$)X8`$8)h8p$)x89$8)88"t 8080:)@@8$)8$)8$8)8$)89 $8)(88"r 80800:)@@8X$DAT*)`8h$)p8x$8)8$)8918 8 "8 "8 "8 "8 "8 "8+ "89 "8A "8N "8[ "P h$8$)p88"N 80840:)@@8x$)8$DAT*)8$8$)8$)89$8)88"L 8080:)@@8$)8$)8$8)8$)8918 b$8)88"b8080:)@@8$DAT*$),84$)<8D$8)L8T$)\89d$8l)|88"`8080:)@@8$)8$)8$8l)8$)89$8)88"^8080:)@@8DAT*$)8$) 8$8)8$$),89184 vD$8L)X88"t808`0:)@@8$)8$)8$8L)8$)89$8)88"r8080DAT*:)@@8$)8$)8 $8) 8 $) 8918$  0 $8$)8 88"80840:)@@8@ $)H 8P $)X 8` $8$)h 8p $)x 89 $8 ) 88DAT*"8080:)@@8 $) 8 $) 8 $8 ) 8 $) 89  $8 J 8  $8 J$ 8M M 808, 0:)@@8h $)p 8x $) 8 $8 ) 8 $) 8918  DAT* $8) 88"8080:)@@8 $) 8 $) 8 $8) 8 $) 89 $8 ) 88"808 0:)@@8< $)D 8L $)T 8\ $8 )d 8l $)t 8DAT*9| $8 ) 88"808 0:)@@8 $) 8 $) 8 $8 ) 8 $) 89  $8 J 8  $8 J 8M M 808, 0:)@@8 $) 8( $)0 88 $8 DAT*)@ 8H $)P 89X $8` Jt 8}1<808| 0:)@@8 $) 8 $) 8 $8` ) 8 $) 8918   $8 ) 88"808$ 0:)@@8L $)T 8\ $)d DAT*8l $8 )t 8| $) 89 $8$) 88"80840:)@@8 $) 8 $) 8 $8$) 8 $) 89 $8 J 8}8080:)@@80$)88@$)H8DAT*P$8 )X8`$)h891<808p0:)@@8$)8$)8$8 )8$)8918 #$8)88"808$0:)@@8L$)T8\$)d8l$8DAT*)t8|$)89$8)88" 8080:)@@8$)8$)8$8)8$)89!6e@e81<6e@e81<"!8080:)@@8,$)48<$)D8DAT*L$8)T8\$)d89l$8 Jt8}"8080:)@@8|$)8$)8$8 )8$)89#1<#808p0:)@@8$)8$)8$8 )8$)DAT*8918 l($8)088"$80880:)@@8`$)h8p$)x8$8)8$)89$8$)88"%80840:)@@8$)8$)8$8$)DAT*8$)89&6e@e81<6e@e81 <"&8080:)@@8 $)8$)$8,$8$)48<$)D89L$8 JT8}'8080:)@@8\$)d8l$)t8|$8 DAT*)8$)89h(1<h(808p0:)@@8$)8$)8$8 )8$)8918 *$8)88"~)8080:)@@8,$)48<$)D8L$8)T8DAT*\$)d89l$8t)88"|*8080:)@@8$)8$)8$8t)8$)8918 -$8$)88"+80840:)@@8$)8 $)8DAT*$8$)$8,$)489<$8)D88",8080:)@@8L$)T8\$)d8l$8)t8|$)89$8)88"-8080:)@@8$)8$)8DAT*$8)8$)8918  1$8) 88".8080:)@@8($)088$)@8H$8)P8X$)`89h$8)p88"/8080:)@@8x$)8DAT*$)8$8)8$)89$8)88"08080:)@@8$)8$) 8$8)8$$),894$8<JL8}1<"1808T0:)@@8t$)|DAT*8$)8$8<)8$)899  2 fT(H R!~"#$%&&'F*P+h,-./01<2\5f6789:;:<Z?d@ABCDE8FXIbJzKLMN O,PNQnTxUVWX Y*ZL[l^v_`ab c( dJ ej ht i j k l m& nH oh rr wP x| y z { | }$ ~D N DAT*z " B L d 8Xb6V`4T^v(Jjt&Hhr<^~:\|">^ 8Tt6Rr4Pp   * X t$Rn :!h"#$%DAT*()*8+f,-./234(5V6r789:;<$=@>`?@CDEF G:HVIvJKNOP Q8 RT St T U V W!XD!Y`!Z![!\!_!`!a"b4"cP"dp"e"f"g"h"i#j#k>#l`#m#p#q#r#s#t$u4$vT$wv$x${$|$}$~%2%R%t%%%%"&>&^&&&&&&'.'N'p''''''(>(^(h((((()2)T)t)~))))*0*R*r*|**** +&+F+DAT*h+++++,$,D,f,,,,,-"-B-d------.8.X.z...../6/V/x/////040T0v00000161V1x1111d ls_tablell_cur_rowll_total_rowls_col1ls_col2ls_col3ls_col4li_colli_value_length_amtld_min_amtld_max_amtcase17 ) 1 9 A DAT*IPd> o> z  is_current_table6dw_1$-accepttext4$-rowcount4Paccuracy methodscoordinate calculation typeslegal entity typesmethodsmodesreference typesvalue typesform types_r$-typegetitemstringDataWindow ErrorSorry! Type is required$-setfocus@4$-setrow@QP$-setcolumnHh$-scrolltorowDAT*?$-namep`rSorry! Name is required$-4$-QP$-Hh$-?calculation methods$-codeSorry! Code is required$-4$-QP$-Hh$-?$-function_name"Sorry! Function Name is required$-4$-QP$-Hh$-?$-$-4$-QP$-Hh$-?conversion lookup codes$-systemDAT*_codeSorry! System Code is required$-4$-QP$-Hh$-?$-rapids_field_name\Sorry! Rapids Field Name is requiredt$-4$-QP$-Hh$-?$-rapids_value_nameSorry! Rapids Value Name is required8$-4$-QP$-Hh$-?$-system_value_name_1Sorry! System Value Name 1 is required$-4$-QP$DAT*-Hh$-?data codesdevice codeslegal relationship codesmeasurement codesoperating daily schedulesoperating weekly schedulesoperating yearly schedulesprocess codesreasonssource codesstream codestier codes8$-$-4$-QP$-Hh$-?$-$-4$-QP$-Hh$-?group types$-$-4$-QP$-Hh$-?$-metricDAT*_levelSorry! Metric Level is required$-4$-QP$-Hh$-?$-$-4$-QP$-Hh$-?metric lookups$-metric_codeSorry! Metric Code is required$-4$-QP$-Hh$-?$-valid_value_name$-4$-QP$-Hh$-?metric maps$-$-4$-QP$-DAT*Hh$-?$-view_prompt_name$-4$-QP$-Hh$-?$-minimum_amtgetitemnumber  $-maximum_amt  Minimum Amount must be less than or equal to Maximum Amount$-4$-QP$-Hh$-?metrics$-$-4$-QP$-Hh$-?$-level_typeSorry! Level Type is required $-4$-QP$DAT*-Hh$-?$-format_typeSorry! Format Type is required$-4$-QP$-Hh$-?$-  $-  $-4$-QP$-Hh$-?$-value_length_amt  Value Field Length must be a positive integer!$-4$-QP$-Hh$-?operating days$-weekly_schedule_code8Sorry! Weekly Schedule Code is required$-DAT*4$-QP$-Hh$-?$-$-4$-QP$-Hh$-?$-relative_activity_amt  Sorry! Relative Activity Amt is required$-4$-QP$-Hh$-?Relative Activity Amt must be greater than or equal to zero!$-4$-QP$-Hh$-?operating hours$-daily_schedule_codeSorry! Daily Schedule Code is requiredDAT*$-4$-QP$-Hh$-?$-start_codeSorry! Start Code is required$-4$-QP$-Hh$-?Start Code must be in range 00-23 $-4$-QP$-Hh$-?$-  $-4$-QP$-Hh$-?$-4$-QP$-Hh$-?operating months8$-yearly_schedule_codeSorry! YDAT*early Schedule Code is required$-4$-QP$-Hh$-?$-$-4$-QP$-Hh$-?Code must be in range 01-12$-4$-QP$-Hh$-?$-  $-4$-QP$-Hh$-?$-4$-QP$-Hh$-?scc ams relationships$-scc_codeSorry! SCC Code is required$-DAT*4$-QP$-Hh$-?$-ams_code Sorry! AMS Code is required$-4$-QP$-Hh$-?units$-$-4$-QP$-Hh$-?$-$-4$-QP$-Hh$-?$-meas_codeSorry! Measurement Code is required$-4$-QP$-Hh$-?use types$-$DAT*-4$-QP$-Hh$-?$-$-4$-QP$-Hh$-?$-group_nameSorry! Group Name is required$-4$-QP$-Hh$-?$-dimension_no  Sorry! Dimension is required $-4$-QP$-Hh$-? , @ H \   , @ H X ` t | DAT*            , L T \ d l t |                ( 0 8 @ H P X x            @ H P X ` h p x  DAT*           ( X ` h p x    h p x                    $ , 4 < D L T \ d |             DAT*     $ , D X                   0 8 @ H P X ` h p x              $ h p x           DAT*       < D L T \ d l t |                ( 0 8 @ H P X t           L T \ d l t |        DAT*      0 8 @ H P X ` h           L T \ d l t |            , 4 < D L T \ d l t |          DAT*       0 ` h p x                   $ , 4 < D L T \ d l t |              , 4 < D L T \ d l DAT*                 $ , 4 < D L T \ d l t |               ( 0 8 @ H P X ` h p x            DAT*     $ , 4 L t |       H $($8$@$"8P$68X8rz%:)@:@@8}}1<)8#981<$9}$9}981<8992x  DAT*.8d$ li_messagebox_returncase8(P dw_1-ib_obj_modifieddw_20,title1H Data have been modified. Save current changes?wf_save|-0, ( 8 @ P       68V800880 8O8c0DAT*|80 88080 8(8048<0 8Xn8c0t8|0 88080 88080 8@80(800 8I8b0DAT*80 88080 8808 0 8X8)0<8D0 8Y8e0x80 88080 8*8080 8p808$DAT*0 8D8S0h8p0 88080 8B8080 88*0L8T0 8u8080 88080 8Z8 0,840 DAT*8B8R0h8p0 88080 8,8080 8r8$088@0 8S8^0p8x0 88080 8D8080 8DAT*8080 880,840 8E 8Y0t8|0 8\ 8080 8 80 8 0 8#  8= 0P 8X 0 8t . 8 0 8 0 8 t DAT*8 0 8 0 8  8 0 8 0 8*  8= 0T 8\ 0 8k F 8{ 0 8 0 8  8 0 8 0 8  8 08 8@ 0 8Z  8v 0 8 0 8 ^ 8 0DAT* 8 0 8  8 0$ 8, 0 8=  8K 0` 8h 0 8x 0 8 0 8 0 68 0@8 $ 8$ 08$ 06$6 R j | $<Nj!"# %<&T'f)*+-./12&3DAT*85T6l7~9:;=>? A&B>CPElFGIJKMNO"Q>RVShUVWYZ[]^(_:aVbncefgijk m(n@oRqnrsuvwyz{$}@~Xj * < X p  * B T p  & B Z l  , > Z r  , 0 V z d' as_tableadw_objls_rtncDAT*ase3P    %  accuracy methodsrap_accuracy_methodsd_accuracy_methods_refcalculation methodsrap_calculation_methodsd_calculation_methods_refconversion lookup codesrap_conversion_lookup_codesd_conversion_lookup_codes_refcoordinate calculation typesrap_coordinate_calc_types0d_coordinate_calc_types_refdata codesrap_data_codesd_data_codes_refdevice codDAT*esrap_device_codesd_device_codes_refgroup typesrap_group_codesd_group_types_reflegal entity typesrap_legal_entity_typesd_legal_entity_types_reflegal relationship codesrap_legal_relationship_codesd_legal_relationship_codes_refmeasurement codesrap_measurement_codesud_measurement_codes_refmethodsrap_methodsd_methods_refmetric lookupsrap_metric_lookupsd_metric_lookups_refmetric mapsrap_metric_mapsd_metric_mapsDAT*_refmetricsrap_metricsd_metrics_refmodesrap_modesd_modes_refoperating daily schedulesrap_operating_daily_schedulesd_operating_daily_schedules_refoperating daysrap_operating_days d_operating_days_refoperating hoursrap_operating_hoursd_operating_hours_refoperating monthsrap_operating_monthsd_operating_months_refoperating weekly schedulesrap_operating_weekly_schedulesd_operating_weekly_schedules_refoperating yearDAT*ly schedulesrap_operating_yearly_schedulescd_operating_yearly_schedules_refprocess codesrap_process_codesd_process_codes_refreasonsrap_reasonsd_reasons_refreference typesrap_reference_types>d_reference_types_refscc ams relationshipsrap_scc_ams_relationshipsd_scc_ams_relationships_refsource codesrap_source_codesd_source_codes_refstream codesrap_stream_codesd_stream_codes_reftier codesrap_tier_codesl_dDAT*_tier_codes_refunitsrap_unitsd_units_refuse typesrap_use_typesd_use_typesvalue typesrap_value_typesd_value_types_refform typesrap_form_typesd_form_types_refaircraft categoriesrap_aircraft_categoriesd_aircraft_cataircraft default time-in-moderap_aircraft_time_in_modesd_aircraft_def_timaircraft enginesrap_aircraft_enginesd_aircraft_enginesaircraft emission factorsrap_aircraft_efd_aircraft_emission_facDAT*torsseason codesrap_vv_seasond_season_codesvehicle typesrap_vehicle_typesd_vehicle_typearea facility typesrap_area_facility_typesd_area_facility_typesvehicle categoriesrap_vehicle_categoriesd_vehicle_catssurrogate codesrap_surrogate_codesid_surrogate_codesscc/ams surrogate codesrap_scc_ams_surrogate_codesd_scc_ams_surrogate_codesscc/ams default factorsrap_scc_ams_default_factorsd_scc_ams_default_factorsgeographic DAT*equipment countsrap_geographic_equipment_countsd_geo_equipment_countsgeographic surrogatesrap_geographic_surrogatesd_geo_surrogatesemission typesrap_emission_typesd_emission_typesroadway typesrap_roadway_typesn@d_roadway_typesarea facility roadway typesrap_area_facility_roadway_typesd_area_facility_roadway_typesSorry! Not a valid reference table nameddlb_1 4text  0 |  4 t   DAT*(    < x    h   L   , h   8 p    , t   P    T   8   $ `    ( m $68$j8$)L81jf,8T\DAT* $8d)x8$8)8$8)8$8)8$8)8$8)8$8)$8,$84)D8L$8T)`8 h$8p)|8 66666666DAT* 6 6 8  19$8J8$1$9$8)8,8T 18$088z%8z&8Ez&@89b,8Tb 1 |$8J8I!b8$088z%8z&8Ez&@89` 8DAT*$)81$8J8 $8)8 $8)8 $8)8    ,# ,#$18$08*0@89,#$1d $ 1^8$080@89$8 DAT*)8 8$)81$8J8 $8)8 $$8,)<8   ,# ,#D$18$08L8z%@89,#$1d $ 1Z8$080@89$8DAT* )8 8 $)81 $8J8~  $8)8$8J 8  ,# ,#($1 8$0800@89~ ,#$1d~   $ 1T 8$080@89~ $DAT*8 )8 8 $)81  $8:@)8:@  $ $809n,98Y  ,# ,#4$1 8$08<0@89 `$h$8p0 )98 9 ,Nx<hDAT*D !%'( ),$.N/b0r489:;?XCbEfF~GHJK LLNxP|QRTUWXYZ[(\P]Z^^bdefgijFlrnvozqrtuvwx$yLzV{Z B r v z   F P T ~  j n   d ls_codels_src_codels_src_typels_dev_codels_pro_codels_mode_typels_str_codels_mat_codelDAT*s_value_typels_use_typels_makels_modells_typell_ridll_rowll_row_numll_rid_numll_aft_ridldwc_childcase11gs_databasesqlca   ( 4 @ M Y e s    DAT* $ @#@+p is_current_tablerap6Metric Mapsdw_10-rowcounts_r4@ORACLEm0-codegetitemstringi0-source_codei0-source_typei0-device_codei0-process_codei0-mode_type8i0-stream_codei0-material_codei0-value_typei0-use_type i0-ridgetitemnumberol DAT*0-setitemOCode, Source Code, Source Type, Device Code, Process Code, Mode Type, Stream Code, Material Code, Value Type and Use Type must be unique in the table. No changes made to the database.0- Aircraft Engines0-4@0- 0-aircraft_makei0-aircraft_modeli0-engine_typeiErrorMake, Model, and Type must be unique in the table. No changes made to the database.Unable to get DAT*RID for record%0-OArea Facility Types0-4@0-area_facility_type_rid 0-Area_typei0-Facility_typeiArea type, and Facility Type must be unique in the table. No changes made to the database.0-OVehicle Categories0-4@0- 0-vehicle_typei0- Area type, and Facility Type must be unique in the table. No changes made to the database.DAT* )0-OGeographic Surrogates0-4@0-ref_ridgetitemstatuseyq0-object@__get_attribute_itemCould not retrieve location type00-@type__set_attribute_itemu 8 L \ x            $ , D L ` h |     |   DAT*"                   $ < D             (           , 4 ` h  &88 088@0H$)X8h$DAT*()|8,&1,&$2Lh d& ancestorreturnvalue::message(&@-8 openis_statele 0singleis_current_table'6r_1untA.!hideRACPdw_1`-setfocusp 8 H X h |  z8$$4$:F@@8L$DAT*&Window to access reference tablesforward global type w_reference from w_single_table end type type ddlb_1 from dropdownlistbox within w_reference end type type st_1 from statictext within w_reference end type end forward global type w_reference from w_single_table integer width = 3104 integer height = 1864 string title = "Reference" string icon = "REF.ICO" ddlb_1 ddlb_1 st_1 st_1 end type global w_reference w_reference type variables string is_current_table long il_selected_DAT*(row datawindowchild idwc_dw_child string is_column_name string is_child_name string is_validation_table string is_msg_name string is_msg_text string is_rap_table string is_factor_type string is_old_value string is_column_status = "valid" long il_source_rid = -1 long il_device_rid = -1 end variables forward prototypes public subroutine wf_freeform_view () public function boolean wf_check_required () public function boolean wf_check_pending () public function string wf_assign_tabDAT**le (string as_table, datawindow adw_obj) public function boolean wf_check_rid () end prototypes public subroutine wf_freeform_view ();// Function overriding. Freeform style not implemented for reference // table windows. MessageBox('FreeForm', 'Sorry! This function is not ready') end subroutine public function boolean wf_check_required ();string ls_table long ll_cur_row, ll_total_row string ls_col1, ls_col2, ls_col3, ls_col4 integer li_col, li_value_length_amt decimal ld_min_amtDAT*,, ld_max_amt SetPointer(HourGlass!) ls_table = Lower(is_current_table) if dw_1.AcceptText() < 0 then return false ll_total_row = dw_1.RowCount() for ll_cur_row = 1 to ll_total_row CHOOSE CASE ls_table CASE "accuracy methods", "coordinate calculation types", & "legal entity types", "methods", "modes", "reference types", & "value types", "form types" ls_col1 = dw_1.GetItemString(ll_cur_row, "type") if IsNull(ls_col1) or ls_col1 = '' then MessDAT*.ageBox("DataWindow Error", "Sorry! Type is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("type") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "name") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetDAT*0Column("name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "calculation methods" ls_col1 = dw_1.GetItemString(ll_cur_row, "code") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.DAT*2GetItemString(ll_cur_row, "function_name") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Function Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("function_name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col3 = dw_1.GetItemString(ll_cur_row, "name") if IsNull(ls_col3) or ls_col3 = '' then MessageBox("DataWindow ErrorDAT*4", "Sorry! Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "conversion lookup codes" ls_col1 = dw_1.GetItemString(ll_cur_row, "system_code") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! System Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_roDAT*6w) dw_1.SetColumn("system_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "rapids_field_name") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Rapids Field Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("rapids_field_name") dw_1.ScrollToRow(ll_cur_row) return FALSE DAT*8 end if ls_col3 = dw_1.GetItemString(ll_cur_row, "rapids_value_name") if IsNull(ls_col3) or ls_col3 = '' then MessageBox("DataWindow Error", "Sorry! Rapids Value Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("rapids_value_name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col4 = dw_1.GetItemString(ll_cur_row, "system_value_name_1") if IsNull(ls_col4) orDAT*: ls_col4 = '' then MessageBox("DataWindow Error", "Sorry! System Value Name 1 is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("system_value_name_1") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "data codes", "device codes", "legal relationship codes", & "measurement codes", "operating daily schedules", & "operating weekly schedules", "operating yearly schedules", & DAT*<"process codes", "reasons", "source codes", "stream codes", & "tier codes" ls_col1 = dw_1.GetItemString(ll_cur_row, "code") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "name") if DAT*>IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "group types" ls_col1 = dw_1.GetItemString(ll_cur_row, "type") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! Type is required", Information!) DAT*@ dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("type") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "metric_level") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Metric Level is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("metric_level") dw_1.ScrollToRow(ll_curDAT*B_row) return FALSE end if ls_col3 = dw_1.GetItemString(ll_cur_row, "name") if IsNull(ls_col3) or ls_col3 = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "metric lookups" ls_col1 = dw_1.GetItemString(ll_cur_row, "metric_code") if IsDAT*DNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! Metric Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("metric_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "valid_value_name") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) DAT*F dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("valid_value_name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "metric maps" ls_col1 = dw_1.GetItemString(ll_cur_row, "code") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("code") dw_1.ScrollDAT*HToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "view_prompt_name") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("view_prompt_name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ld_min_amt = dw_1.GetItemNumber( ll_cur_row, "minimum_amt"DAT*J ) ld_max_amt = dw_1.GetItemNumber( ll_cur_row, "maximum_amt" ) if ld_min_amt > ld_max_amt then MessageBox("DataWindow Error", "Minimum Amount must be less than or equal to Maximum Amount", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("minimum_amt") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "metrics" // ls_col1 = dw_1.GetItemString(ll_cur_row, "unit_code") // if IsDAT*LNull(ls_col1) or ls_col1 = '' then // MessageBox("DataWindow Error", "Sorry! Code is required", Information!) // dw_1.SetFocus() // dw_1.SetRow(ll_cur_row) // dw_1.SetColumn("code") // dw_1.ScrollToRow(ll_cur_row) // return FALSE // end if ls_col2 = dw_1.GetItemString(ll_cur_row, "name") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_1.DAT*NSetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col3 = dw_1.GetItemString(ll_cur_row, "level_type") if IsNull(ls_col3) or ls_col3 = '' then MessageBox("DataWindow Error", "Sorry! Level Type is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("level_type") dw_1.ScrollToRow(ll_cur_row) rDAT*Peturn FALSE end if ls_col4 = dw_1.GetItemString(ll_cur_row, "format_type") if IsNull(ls_col4) or ls_col4 = '' then MessageBox("DataWindow Error", "Sorry! Format Type is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("format_type") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ld_min_amt = dw_1.GetItemNumber( ll_cur_row, "minimum_amt" ) ld_max_amt = dw_1.GetIDAT*RtemNumber( ll_cur_row, "maximum_amt" ) if ld_min_amt > ld_max_amt then MessageBox("DataWindow Error", "Minimum Amount must be less than or equal to Maximum Amount", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("minimum_amt") dw_1.ScrollToRow(ll_cur_row) return FALSE end if li_value_length_amt = dw_1.GetItemNumber( ll_cur_row, "value_length_amt" ) if li_value_length_amt <= 0 then DAT*T MessageBox("DataWindow Error", "Value Field Length must be a positive integer!", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn( "value_length_amt" ) dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "operating days" ls_col1 = dw_1.GetItemString(ll_cur_row, "weekly_schedule_code") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! Weekly Schedule Code is DAT*Vrequired", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("weekly_schedule_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "code") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("code") dwDAT*X_1.ScrollToRow(ll_cur_row) return FALSE end if li_col = dw_1.GetItemNumber( ll_cur_row, "relative_activity_amt" ) if IsNull( li_col ) then MessageBox("DataWindow Error", "Sorry! Relative Activity Amt is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("relative_activity_amt") dw_1.ScrollToRow(ll_cur_row) return FALSE elseif li_col < 0 then MessageBox("DataWiDAT*Zndow Error", "Relative Activity Amt must be greater than or equal to zero!", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("relative_activity_amt") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "operating hours" ls_col1 = dw_1.GetItemString(ll_cur_row, "daily_schedule_code") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! Daily Schedule Code is requirDAT*\ed", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("daily_schedule_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "start_code") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Start Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("start_code") DAT*^ dw_1.ScrollToRow(ll_cur_row) return FALSE elseif integer( ls_col2 ) < 0 or integer( ls_col2 ) > 23 then MessageBox("DataWindow Error", "Start Code must be in range 00-23", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("start_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if li_col = dw_1.GetItemNumber(ll_cur_row, "relative_activity_amt") if IsNull( li_col ) thenDAT*` MessageBox("DataWindow Error", "Sorry! Relative Activity Amt is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("relative_activity_amt") dw_1.ScrollToRow(ll_cur_row) return FALSE elseif li_col < 0 then MessageBox("DataWindow Error", "Relative Activity Amt must be greater than or equal to zero!", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetCoDAT*blumn("relative_activity_amt") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "operating months" ls_col1 = dw_1.GetItemString(ll_cur_row, "yearly_schedule_code") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! Yearly Schedule Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("yearly_schedule_code") dw_1.ScrollToRow(ll_cur_row) DAT*d return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "code") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("code") dw_1.ScrollToRow(ll_cur_row) return FALSE elseif integer( ls_col2 ) < 1 or integer( ls_col2 ) > 12 then MessageBox("DataWindow Error", "Code must be DAT*fin range 01-12", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if li_col = dw_1.GetItemNumber(ll_cur_row, "relative_activity_amt") if IsNull( li_col ) then MessageBox("DataWindow Error", "Sorry! Relative Activity Amt is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("relative_acDAT*htivity_amt") dw_1.ScrollToRow(ll_cur_row) return FALSE elseif li_col < 0 then MessageBox("DataWindow Error", "Relative Activity Amt must be greater than or equal to zero!", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("relative_activity_amt") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "scc ams relationships" ls_col1 = dw_1.GetItemString(ll_cur_row, "scc_codDAT*je") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! SCC Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("scc_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "ams_code") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! AMS Code is required", InformationDAT*l!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("ams_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "units" ls_col1 = dw_1.GetItemString(ll_cur_row, "code") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("code") dw_1.ScrollToRow(llDAT*n_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "name") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col3 = dw_1.GetItemString(ll_cur_row, "meas_code") if IsNull(ls_col3) or ls_col3DAT*p = '' then MessageBox("DataWindow Error", "Sorry! Measurement Code is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("meas_code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if CASE "use types" ls_col1 = dw_1.GetItemString(ll_cur_row, "type") if IsNull(ls_col1) or ls_col1 = '' then MessageBox("DataWindow Error", "Sorry! Type is required", Information!) dw_1.DAT*rSetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("type") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_col2 = dw_1.GetItemString(ll_cur_row, "name") if IsNull(ls_col2) or ls_col2 = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("name") dw_1.ScrollToRow(ll_cur_row) return FALSE DAT*t end if ls_col3 = dw_1.GetItemString(ll_cur_row, "group_name") if IsNull(ls_col3) or ls_col3 = '' then MessageBox("DataWindow Error", "Sorry! Group Name is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("group_name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if li_col = dw_1.GetItemNumber(ll_cur_row, "dimension_no") if IsNull(li_col) or li_col = 0 then MDAT*vessageBox("DataWindow Error", "Sorry! Dimension is required", Information!) dw_1.SetFocus() dw_1.SetRow(ll_cur_row) dw_1.SetColumn("dimension_no") dw_1.ScrollToRow(ll_cur_row) return FALSE end if END CHOOSE next return TRUE end function public function boolean wf_check_pending ();integer li_messagebox_return // If the data have been modified and not saved, ask user for saving data //if dw_1.ModifiedCount() > 0 then if dw_1.DAT*xib_obj_modified or dw_2.ib_obj_modified then li_messagebox_return = MessageBox(This.Title, "Data have been modified.~n" + & "Save current changes?", Question!, YesNoCancel!) choose case (li_messagebox_return) case 1 if Not wf_save() then return FALSE end if case 2 dw_1.ib_obj_modified = FALSE dw_2.ib_obj_modified = FALSE return TRUE case 3 return FALSE end choose end if return TRUE end function public function string wf_assign_table (DAT*zstring as_table, datawindow adw_obj);string ls_rtn CHOOSE CASE as_table CASE "accuracy methods" ls_rtn = 'rap_accuracy_methods' adw_obj.DataObject = 'd_accuracy_methods_ref' CASE "calculation methods" ls_rtn = 'rap_calculation_methods' adw_obj.DataObject = 'd_calculation_methods_ref' CASE "conversion lookup codes" ls_rtn = 'rap_conversion_lookup_codes' adw_obj.DataObject = 'd_conversion_lookup_codes_ref' CASE "coordinate calculation tyDAT*|pes" ls_rtn = 'rap_coordinate_calc_types' adw_obj.DataObject = 'd_coordinate_calc_types_ref' CASE "data codes" ls_rtn = 'rap_data_codes' adw_obj.DataObject = 'd_data_codes_ref' CASE "device codes" ls_rtn = 'rap_device_codes' adw_obj.DataObject = 'd_device_codes_ref' CASE "group types" ls_rtn = 'rap_group_codes' adw_obj.DataObject = 'd_group_types_ref' CASE "legal entity types" ls_rtn = 'rap_legal_entity_types' DAT*~ adw_obj.DataObject = 'd_legal_entity_types_ref' CASE "legal relationship codes" ls_rtn = 'rap_legal_relationship_codes' adw_obj.DataObject = 'd_legal_relationship_codes_ref' CASE "measurement codes" ls_rtn = 'rap_measurement_codes' adw_obj.DataObject = 'd_measurement_codes_ref' CASE "methods" ls_rtn = 'rap_methods' adw_obj.DataObject = 'd_methods_ref' CASE "metric lookups" ls_rtn = 'rap_metric_lookups' adw_obj.DataObDAT*ject = 'd_metric_lookups_ref' CASE "metric maps" ls_rtn = 'rap_metric_maps' adw_obj.DataObject = 'd_metric_maps_ref' CASE "metrics" ls_rtn = 'rap_metrics' adw_obj.DataObject = 'd_metrics_ref' CASE "modes" ls_rtn = 'rap_modes' adw_obj.DataObject = 'd_modes_ref' CASE "operating daily schedules" ls_rtn = 'rap_operating_daily_schedules' adw_obj.DataObject = 'd_operating_daily_schedules_ref' CASE "operating days" DAT* ls_rtn = 'rap_operating_days' adw_obj.DataObject = 'd_operating_days_ref' CASE "operating hours" ls_rtn = 'rap_operating_hours' adw_obj.DataObject = 'd_operating_hours_ref' CASE "operating months" ls_rtn = 'rap_operating_months' adw_obj.DataObject = 'd_operating_months_ref' CASE "operating weekly schedules" ls_rtn = 'rap_operating_weekly_schedules' adw_obj.DataObject = 'd_operating_weekly_schedules_ref' CASE "operating yearlDAT*y schedules" ls_rtn = 'rap_operating_yearly_schedules' adw_obj.DataObject = 'd_operating_yearly_schedules_ref' CASE "process codes" ls_rtn = 'rap_process_codes' adw_obj.DataObject = 'd_process_codes_ref' CASE "reasons" ls_rtn = 'rap_reasons' adw_obj.DataObject = 'd_reasons_ref' CASE "reference types" ls_rtn = 'rap_reference_types' adw_obj.DataObject = 'd_reference_types_ref' CASE "scc ams relationships" ls_rtn = DAT*Material windowforward global type w_material from w_master_detail end type type cb_group from commandbutton within w_material end type type r_buttons from rectangle within w_material end type type uo_group from u_dw_group_mat within w_material end type end forward global type w_material from w_master_detail int Width=2930 int Height=1565 boolean TitleBar=true string Title="Material" string Icon="MATERIAL.ICO" event highlight_dddw pbm_custom21 cb_group cb_group r_buttons r_buttDAT*ons uo_group uo_group end type global w_material w_material type variables integer ii_dw1_y; integer ii_dw1_height; integer ii_cb_y; string is_old_value string is_column_name long il_selected_row datawindowchild idwc_dw_child string is_child_name string is_validation_table string is_msg_name string is_msg_text end variables forward prototypes public function boolean wf_check_required () public subroutine wf_select_one () public subroutine wf_detail_view () public subroutinDAT*e wf_general_view () public function boolean wf_check_rid (datawindow dw_obj) 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 function boolean wf_check_required ();long ll_cur_row string ls_code, ls_name SetPointer(HourGlass!) if dw_1.AcceptText() < 0 then return false ll_cur_row = dw_1.GetRow() ls_code = dw_1.GetItemString(ll_cur_row, "code") if IsNull(lDAT*s_code) or ls_code = '' then MessageBox("DataWindow Error", "Sorry! Code is required", Information!) dw_1.SetRow(ll_cur_row) dw_1.SetColumn("code") dw_1.ScrollToRow(ll_cur_row) return FALSE end if ls_name = dw_1.GetItemString(ll_cur_row, "name") if IsNull(ls_name) or ls_name = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_1.SetRow(ll_cur_row) dw_1.SetColumn("name") dw_1.ScrollToRow(ll_cur_row) return FALSE end if return TRDAT*UE end function public subroutine wf_select_one (); SetPointer(HourGlass!) // Open the filter window with parameter - table name OpenWithParm(w_filter, 'rap_materials') // 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_detail_view ();if uo_group.Visible then if uo_group.uf_check_pending() then uo_group.uf_save() // else // DAT*return end if end if is_enlarge_state = 'detail' f_menu_behave(is_state, is_style_state, is_enlarge_state) // Shrink the dw_1 dw_1.Resize(dw_1.Width, 252) dw_1.Move(dw_1.X, ii_dw1_y) dw_1.ScrollToRow(dw_1.GetRow()) //// Get the original vertical scroll box position //is_prev_vertical_scroll_pos = dw_1.dwDescribe('DataWindow.VerticalScrollPosition') // Resize the green focus r_1.Resize(dw_1.Width + 45, dw_1.Height + 35) r_2.Resize(dw_2.Width + 45, dw_2.Height + 35) r_2.Move(DAT*dw_2.X - 15, dw_2.Y - 15) // Move all command buttons up cb_group.Move(cb_group.X, dw_1.Y + 290) // Make user objects off uo_group.Hide() end subroutine public subroutine wf_general_view ();m_main_menu.m_view.m_original.ToolbarItemVisible = FALSE // Resize dw_1 to its original size dw_1.Resize(dw_1.Width, ii_dw1_height) 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.Move(dw_1.X - 15, dw_1.Y - 15) r_2.ResizeDAT*(dw_2.Width + 45, dw_2.Height + 35) r_2.Move(dw_2.X - 15, dw_2.Y - 15) // Move all command buttons back to original postions cb_group.Move(cb_group.X, ii_cb_y) // Enable group button f_highlight_button(r_buttons, cb_group, "off") uo_group.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 public function boolean wf_check_rid (datawindow dw_obj);long ll_row_num, ll_curDAT*_row, ll_rid_num 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 // 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 dw_obj.SetItem(ll_cur_row, "rid", ll_rid_num) end if next return TRUE end function on closequery;call w_master_detail::closequery;if is_state = "group" then uo_group.uf_check_DAT*pending() end if end on on open;call w_master_detail::open;string ls_scc_ams string ls_material // Set up variable for handling menu behavior is_state = 'master' // Save the height and X, Y position of the objects into instance variables ii_dw1_height = dw_1.Height ii_cb_y = cb_group.Y ii_dw1_y = dw_1.Y dw_1.SetTransObject(SQLCA) if (not isnull(gs_scc_ams_code)) and (gs_scc_ams_code <> "") then ls_scc_ams = gs_scc_ams_code else ls_scc_ams = "none" end if if (not DAT*isnull(gs_material)) and (gs_material <> "") then ls_material = gs_material else ls_material = "none" end if dw_1.Retrieve(ls_scc_ams, ls_material) dw_1.SetFocus() end on on w_material.create int iCurrent call w_master_detail::create this.cb_group=create cb_group this.r_buttons=create r_buttons this.uo_group=create uo_group iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=cb_group this.Control[iCurrent+2]=r_buttons this.Control[iCurrent+3]=uo_group end on oDAT*n w_material.destroy call w_master_detail::destroy destroy(this.cb_group) destroy(this.r_buttons) destroy(this.uo_group) end on type dw_2 from w_master_detail`dw_2 within w_material boolean Visible=false end type type dw_1 from w_master_detail`dw_1 within w_material event ue_vertical_scroll pbm_custom31 event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=65 int Y=49 int Width=2756 int Height=1220 string DataObject="d_material_display" boolean HScrollBar=true boolean VSDAT*crollBar=true boolean HSplitScroll=true boolean LiveScroll=true end type on dw_1::ue_vertical_scroll;call w_master_detail`dw_1::ue_vertical_scroll;//string ls_new_vertical_scroll_pos //integer li_new_vertical_scroll_pos // //// Get the new vertical scroll box position //ls_new_vertical_scroll_pos = & // This.dwDescribe('DataWindow.VerticalScrollPosition') // //// Change the current row based on the moving direction of the scroll box //if Integer(ls_new_vertical_scroll_pos) < Integer(DAT*is_prev_vertical_scroll_pos) then // This.ScrollPriorRow() //else // This.ScrollNextRow() //end if // //// Store the current vertical scroll box position into instance variable //is_prev_vertical_scroll_pos = ls_new_vertical_scroll_pos end on 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) DAT*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_column_name, & idwc_dw_child.getitemstring(il_selected_row, is_child_name)) end if end if end if endDAT* 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 end event event dw_1::dwnprocessenter;string ls_col_name if il_selected_row > 0 then ls_col_name = this.getcolumnname() if ls_colDAT*_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_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 tDAT*hen Parent.PostEvent("highlight_dddw") end if end if end on event dw_1::itemfocuschanged;call super::itemfocuschanged;string ls_col_name ls_col_name = This.GetColumnName() if ls_col_name = "group_type" then f_retrieve_group_types(parent, this, "MAT") end if if 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 =DAT* "Column - Group Type" is_msg_text = "Sorry! Not a valid group type" is_old_value = dw_1.GetItemString(dw_1.GetRow(), ls_col_name) end if end event on dw_1::rowfocuschanged;call w_master_detail`dw_1::rowfocuschanged;long ll_clicked_row, ll_selected_row, ll_material_rid, ll_cur_row // This datawindow inherit u_dw_freeform, but it should actually inherit // u_dw_list because it is a tabular style. The following code is for // it to perform highlighting the row in tabular style dw lDAT*l_clicked_row = GetRow(This) if ll_clicked_row > 0 then ll_selected_row = GetSelectedRow(this, 0) // Un-highlighted the previous selected row and highlight the new // selected row if ll_selected_row > 0 and ll_selected_row <> ll_clicked_row then SelectRow(This, ll_selected_row, FALSE) end if SelectRow(This, ll_clicked_row, TRUE) end if if dw_1.RowCount() > 0 then ll_cur_row = This.GetRow() ll_material_rid = This.GetItemNumber(ll_cur_row, "rid") if This.GetItemDAT*String(ll_cur_row, 'group_flag') = 'Y' then cb_group.Enabled = TRUE else cb_group.Enabled = FALSE end if end if if is_state = "group" then uo_group.uf_check_pending() uo_group.uf_retrieve_group_member(ll_material_rid) uo_group.uf_retrieve_select_list(ll_material_rid) end if end on on dw_1::delete_row;call w_master_detail`dw_1::delete_row; long ll_rid // Get rid from the datawindow ll_rid = This.GetItemNumber(This.GetRow(), "rid") // Call function if f_check_matDAT*rl_group(ll_rid) = 1 then ib_delete = TRUE else ib_delete = FALSE end if end on on dw_1::scrollvertical;call w_master_detail`dw_1::scrollvertical;//// If this datawindow has been shrunk into one row //if is_enlarge_state = 'detail' then // This.PostEvent('ue_vertical_scroll') //end if end on on dw_1::add_row;// This script override ancestor script for not checking unsaved record // when inserting if wf_insert_ok() then st_no_record_grey.Hide() This.InsertRow(This.GetRoDAT*w()) This.ScrollPriorRow() This.TriggerEvent(Rowfocuschanged!) ib_obj_modified = TRUE end if end on on dw_1::updateend;call w_master_detail`dw_1::updateend; if dw_1.RowCount() > 0 then if This.GetItemString(This.GetRow(), 'group_flag') = 'Y' then cb_group.Enabled = TRUE else cb_group.Enabled = FALSE end if end if end on event dw_1::itemerror;call super::itemerror;return 2 end event type cb_group from commandbutton within w_material int X=1256 int Y=1325 int WidtDAT*h=242 int Height=84 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!) // Change the attributes of menu items is_state = 'group' // Change the size of dw_1, move buttons and display group user object wf_detail_view() uo_group.uf_retrieve_group_member(dw_1.DAT*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 r_buttons from rectangle within w_material int X=1153 int Y=1297 int Width=161 int Height=145 boolean Visible=false boolean Enabled=false int LineThickness=4 long LineColor=12632256 long FillColor=32768 end type type uo_group from u_dw_group_mat within w_materDAT*zial int X=54 int Y=445 boolean Visible=false end type on uo_group.destroy call u_dw_group_mat::destroy end on DAT*'rap_scc_ams_relationships' adw_obj.DataObject = 'd_scc_ams_relationships_ref' CASE "source codes" ls_rtn = 'rap_source_codes' adw_obj.DataObject = 'd_source_codes_ref' CASE "stream codes" ls_rtn = 'rap_stream_codes' adw_obj.DataObject = 'd_stream_codes_ref' CASE "tier codes" ls_rtn = 'rap_tier_codes' adw_obj.DataObject = 'd_tier_codes_ref' CASE "units" ls_rtn = 'rap_units' adw_obj.DataObject = 'd_units_ref' DAT* CASE 'use types' ls_rtn = 'rap_use_types' adw_obj.DataObject = 'd_use_types' CASE "value types" ls_rtn = 'rap_value_types' adw_obj.DataObject = 'd_value_types_ref' CASE "form types" ls_rtn = 'rap_form_types' adw_obj.DataObject = 'd_form_types_ref' // aircraft CASE "aircraft categories" ls_rtn = 'rap_aircraft_categories' adw_obj.DataObject = 'd_aircraft_cat' CASE "aircraft default time-in-mode" ls_rtn = 'rap_aircraft_time_DAT*in_modes' adw_obj.DataObject = 'd_aircraft_def_tim' CASE "aircraft engines" ls_rtn = 'rap_aircraft_engines' adw_obj.DataObject = 'd_aircraft_engines' CASE "aircraft emission factors" ls_rtn = 'rap_aircraft_ef' adw_obj.DataObject = 'd_aircraft_emission_factors' // MOBILE SOURCES CASE "season codes" ls_rtn = 'rap_vv_season' adw_obj.DataObject = 'd_season_codes' CASE "vehicle types" ls_rtn = 'rap_vehicle_types' adw_obDAT*j.DataObject = 'd_vehicle_type' CASE "area facility types" ls_rtn = 'rap_area_facility_types' adw_obj.DataObject = 'd_area_facility_types' CASE "vehicle categories" ls_rtn = 'rap_vehicle_categories' adw_obj.DataObject = 'd_vehicle_cats' CASE "surrogate codes" ls_rtn = 'rap_surrogate_codes' adw_obj.DataObject = 'd_surrogate_codes' CASE "scc/ams surrogate codes" ls_rtn = 'rap_scc_ams_surrogate_codes' adw_obj.DataObject = 'd_scc_DAT*ams_surrogate_codes' CASE "scc/ams default factors" ls_rtn = 'rap_scc_ams_default_factors' adw_obj.DataObject = 'd_scc_ams_default_factors' CASE "geographic equipment counts" ls_rtn = 'rap_geographic_equipment_counts' adw_obj.DataObject = 'd_geo_equipment_counts' CASE "geographic surrogates" ls_rtn = 'rap_geographic_surrogates' adw_obj.DataObject = 'd_geo_surrogates' CASE "emission types" ls_rtn = 'rap_emission_types' adw_DAT*obj.DataObject = 'd_emission_types' CASE "roadway types" ls_rtn = 'rap_roadway_types' adw_obj.DataObject = 'd_roadway_types' CASE "area facility roadway types" ls_rtn = 'rap_area_facility_roadway_types' adw_obj.DataObject = 'd_area_facility_roadway_types' CASE ELSE MessageBox(as_table, 'Sorry! Not a valid reference table name') ddlb_1.Text = '' ls_rtn = '' END CHOOSE return ls_rtn end function public function boolean wf_check_rid ();sDAT*tring ls_code, ls_src_code, ls_src_type, ls_dev_code, ls_pro_code, & ls_mode_type, ls_str_code, ls_mat_code, ls_value_type, ls_use_type,ls_make,ls_model,ls_type long ll_rid, ll_row long ll_row_num, ll_rid_num, ll_aft_rid DataWindowChild ldwc_child choose case is_current_table case "Metric Maps" ll_row_num = dw_1.RowCount() for ll_row = 1 to ll_row_num if gs_database <> 'ORACLE' then // Only for watcom ls_code = dw_1.GetItemString(ll_row, 'code') ls_srcDAT*_code = dw_1.GetItemString(ll_row, "source_code") ls_src_type = dw_1.GetItemString(ll_row, "source_type") ls_dev_code = dw_1.GetItemString(ll_row, "device_code") ls_pro_code = dw_1.GetItemString(ll_row, "process_code") ls_mode_type = dw_1.GetItemString(ll_row, "mode_type") ls_str_code = dw_1.GetItemString(ll_row, "stream_code") ls_mat_code = dw_1.GetItemString(ll_row, "material_code") ls_value_type = dw_1.GetItemString(ll_row, "value_type") ls_use_type = dw_DAT*1.GetItemString(ll_row, "use_type") // Plug the values into the get function ll_rid = f_get_metric_map_rid(ls_code, ls_src_code, ls_src_type, & ls_dev_code, ls_pro_code, ls_mode_type, ls_str_code, ls_mat_code, & ls_value_type, ls_use_type) if ll_rid < 0 then return FALSE end if end if if IsNull(dw_1.GetItemNumber(ll_row, "rid")) then // Select the next available rid from the rid_storage in database ll_rid_num = f_get_sequence() DAT* if ll_rid_num = -1 then return FALSE end if dw_1.SetItem(ll_row, "rid", ll_rid_num) if gs_database <> 'ORACLE' then // Only for watcom if ll_rid > 0 then MessageBox('Metric Maps', 'Code, Source Code, Source Type, ' + & 'Device Code, Process Code, Mode Type, Stream Code, ' + & 'Material Code, Value Type and Use Type must be ' + & 'unique in the table.~nNo changes made to the database.') return FALSE end if DAT* end if else if gs_database <> 'ORACLE' then // Only for watcom if ll_rid > 0 and ll_rid <> dw_1.GetItemNumber(ll_row, 'rid') then MessageBox('Metric Maps', 'Code, Source Code, Source Type, ' + & 'Device Code, Process Code, Mode Type, Stream Code, ' + & 'Material Code, Value Type and Use Type must be ' + & 'unique in the table.~nNo changes made to the database.') return FALSE end if end if end if next case "AircraftDAT* Engines" ll_row_num = dw_1.RowCount() for ll_row = 1 to ll_row_num if IsNull(dw_1.GetItemNumber(ll_row, "rid")) then ls_make = dw_1.GetItemString(ll_row, 'aircraft_make') ls_model = dw_1.GetItemString(ll_row, "aircraft_model") ls_type = dw_1.GetItemString(ll_row, "engine_type") select rid into :ll_rid from rap_aircraft_engines where aircraft_make = :ls_make and aircraft_model = :ls_model and engine_type = :ls_type; if sDAT*qlca.sqlcode = 0 then Messagebox('Error','Make, Model, and Type must be unique in the table.& ~nNo changes made to the database.') return FALSE elseif sqlca.sqlcode = 100 then ll_rid = f_get_sequence() if ll_rid = -1 then MessageBox('Error','Unable to get RID for record') return FALSE else dw_1.SetItem(ll_row,"rid",ll_rid) end if end if end if next case "Area Facility Types" ll_row_num = dw_1.RowCount() DAT* for ll_row = 1 to ll_row_num if IsNull(dw_1.GetItemNumber(ll_row, "area_facility_type_rid")) then ls_make = dw_1.GetItemString(ll_row, 'Area_type') ls_model = dw_1.GetItemString(ll_row, "Facility_type") select area_facility_type_rid into :ll_rid from rap_area_facility_types where area_type = :ls_make and facility_type = :ls_model; if sqlca.sqlcode = 0 then Messagebox('Error','Area type, and Facility Type must be unique in the table.DAT* ' +& '~nNo changes made to the database.') return FALSE elseif sqlca.sqlcode = 100 then ll_rid = f_get_sequence() if ll_rid = -1 then MessageBox('Error','Unable to get RID for record') return FALSE else dw_1.SetItem(ll_row,"area_facility_type_rid",ll_rid) end if end if end if next case "Vehicle Categories" ll_row_num = dw_1.RowCount() for ll_row = 1 to ll_row_num if IsNull(dw_1.GetItemNumber(ll_row,DAT* "rid")) then ls_make = dw_1.GetItemString(ll_row, 'vehicle_type') ll_aft_rid = dw_1.GetItemNumber(ll_row, "area_facility_type_rid") select rid into :ll_rid from rap_vehicle_categories where vehicle_type = :ls_make and area_facility_type_rid = :ll_aft_rid; if sqlca.sqlcode = 0 then Messagebox('Error','Area type, and Facility Type must be unique in the table.& ~nNo changes made to the database.') return FALSE elseif sqlca.sqDAT*lcode = 100 then ll_rid = f_get_sequence() if ll_rid = -1 then MessageBox('Error','Unable to get RID for record') return FALSE else dw_1.SetItem(ll_row,"rid",ll_rid) end if end if end if next case "Geographic Surrogates" ll_row_num = dw_1.RowCount() for ll_row = 1 to ll_row_num // get location type for any changes to ref_rid if dw_1.GetItemStatus(ll_row, "ref_rid", Primary!) <> NotModified! then ll_rid = dw_1.DAT*object.ref_rid[ll_row] select type into :ls_type from rap_geographic_locations where rid = :ll_rid; if sqlca.sqlcode <> 0 then Messagebox('Error','Could not retrieve location type') return FALSE else dw_1.object.type[ll_row] = ls_type end if end if next end choose return TRUE end function event open;call super::open;// Set up variable for handling menu behavior is_state = 'single' is_current_table = "" r_1.HDAT*ide() dw_1.SetFocus() end event on ue_open_filter_win;call w_single_table::ue_open_filter_win;string ls_table ls_table = Lower(ddlb_1.Text) SetPointer(HourGlass!) //SetRedraw(FALSE) if is_rap_table <> '' then // Open the filter window with parameter - table name OpenWithParm(w_filter, is_rap_table) end if //SetRedraw(TRUE) end on on w_reference.create int iCurrent call super::create this.ddlb_1=create ddlb_1 this.st_1=create st_1 iCurrent=UpperBound(this.ConDAT*trol) this.Control[iCurrent+1]=this.ddlb_1 this.Control[iCurrent+2]=this.st_1 end on on w_reference.destroy call super::destroy destroy(this.ddlb_1) destroy(this.st_1) end on type st_no_record_grey from w_single_table`st_no_record_grey within w_reference end type type st_no_record_white from w_single_table`st_no_record_white within w_reference end type type dw_2 from w_single_table`dw_2 within w_reference integer taborder = 30 end type type dw_1 from w_single_table`dw_1 wDAT*ithin w_reference integer y = 156 integer width = 2697 integer height = 1228 integer taborder = 20 end type event dw_1::itemfocuschanged;string ls_col_name, ls_table DataWindowChild dwc long ll_device_rid string ls_device_id string ls_process_id string ls_source_id string ls_meas_code ls_table = Lower(ddlb_1.Text) ls_col_name = This.GetColumnName() SetPointer(HourGlass!) CHOOSE CASE ls_table CASE "accuracy methods" CASE "calculation methods" CASE "coordiDAT*nate calculation types" CASE "data codes" CASE "device codes" if ls_col_name = "metric_map_code" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") end if if ls_col_name = "metric_map_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_device_codes" is_msg_name = "Metric Map Code" DAT* is_msg_text = "Sorry! Not a valid Metric Map Code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "group types" if ls_col_name = "metric_level" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "type") end if if ls_col_name = "metric_level" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name DAT* is_child_name = "type" is_validation_table = "rap_metric_levels" is_msg_name = "Metric Level" is_msg_text = "Sorry! Not a valid Metric Level" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "legal entity types" CASE "legal relationship codes" CASE "measurement codes" CASE "methods" CASE "metric lookups" if ls_col_name = "metric_code" then DAT* f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") end if if 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 = "Metric Code" is_msg_text = "Sorry! Not a valid metric code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else DAT* is_column_name = "" end if CASE "metric maps" if ls_col_name = "code" or & ls_col_name = "unit_code" or & ls_col_name = "source_code" or & ls_col_name = "device_code" or & ls_col_name = "process_code" or & ls_col_name = "stream_code" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") elseif ls_col_name = "value_type" or & ls_col_name = "mode_type" then f_retrieve_codes(Parent.DAT*Title, dw_1, ls_col_name, "type") end if if 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_metrics" is_msg_name = "Code" is_msg_text = "Sorry! Not a valid Code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "value_type" then il_selected_DAT*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 = "Value Type" is_msg_text = "Sorry! Not a valid value type" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "source_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_naDAT*me is_child_name = "code" is_validation_table = "rap_source_codes" is_msg_name = "Source Code" is_msg_text = "Sorry! Not a valid source code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "device_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_device_codes" DAT* is_msg_name = "Device 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 = "process_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 = "Process Code" is_msg_text = "Sorry! Not a valid procDAT*ess code" is_old_value = dw_1.getitemstring(dw_1.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 = "Mode Type" is_msg_text = "Sorry! Not a valid mode type" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_coDAT*l_name = "stream_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_stream_codes" is_msg_name = "Stream Code" is_msg_text = "Sorry! Not a valid stream code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "unit_code" then il_selected_row = 0 Getchild(ls_col_name, DAT*idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_units" is_msg_name = "Unit Code" is_msg_text = "Sorry! Not a valid unit code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif 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" DAT*is_validation_table = "rap_materials" is_msg_name = "Material Code" is_msg_text = "Sorry! Not a valid material code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "metrics" if ls_col_name = "unit_code" then // f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") if dw_1.GetChild(ls_col_name, dwc) <> -1 then // if dwc.rowcount() <> 0 then // DAT* if dwc.GetItemString(1, "code") = '0' then dwc.SetTransObject(SQLCA) ls_meas_code = GetItemString( dw_1.GetRow(), "meas_code" ) dwc.Retrieve( ls_meas_code ) // end if // end if end if end if if ls_col_name = "level_type" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "type") end if if ls_col_name = "unit_code" then il_selected_row = 0 DAT*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 = "Unit Code" is_msg_text = "Sorry! Not a valid unit code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "meas_code" then il_selected_row = 0 Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name =DAT* "code" is_validation_table = "rap_measurements" is_msg_name = "Measurement Code" is_msg_text = "Sorry! Not a valid Measurement Code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "level_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_metric_levels" is_msg_naDAT*me = "Level Type" is_msg_text = "Sorry! Not a valid Level Type" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "modes" CASE "operating daily schedules" CASE "operating days" if ls_col_name = "weekly_schedule_code" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") end if if ls_col_name = "weekly_schedule_code" then il_selected_row DAT*= 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 = "Weekly Schedule Code" is_msg_text = "Sorry! Not a valid weekly schedule code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "operating hours" if ls_col_name = "daily_schedule_codDAT*e" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") end if if 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 = "Daily Schedule Code" is_msg_text = "Sorry! Not a valid daily schedule code" is_old_value = dw_1.getiteDAT* mstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "operating months" if ls_col_name = "yearly_schedule_code" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") end if if ls_col_name = "yearly_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_operatDAT* ing_yearly_schedules" is_msg_name = "Yearly Schedule Code" is_msg_text = "Sorry! Not a valid yearly schedule code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "operating weekly schedules" CASE "operating yearly schedules" CASE "process codes" if ls_col_name = "metric_map_code" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") end if DAT* if ls_col_name = "metric_map_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 = "Metric Map Code" is_msg_text = "Sorry! Not a valid Metric Map Code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "reasons" DAT* CASE "reference types" CASE "scc ams relationships" if ls_col_name = "scc_code" or & ls_col_name = "ams_code" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") end if if ls_col_name = "scc_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_scc_ams_codes" is_msg_name = "SCC Code" DAT* is_msg_text = "Sorry! Not a valid SCC Code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "ams_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_scc_ams_codes" is_msg_name = "AMS Code" is_msg_text = "Sorry! Not a valid AMS Code" is_old_value = dw_1.getitemstringDAT*(dw_1.getrow(), ls_col_name) end if CASE "source codes" if ls_col_name = "metric_map_code" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") end if if ls_col_name = "metric_map_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_source_codes" is_msg_name = "Metric Map Code" is_mDAT*sg_text = "Sorry! Not a valid Metric Map Code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "stream codes" if ls_col_name = "metric_map_code" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") end if if ls_col_name = "metric_map_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_stream_codes" is_msg_name = "Metric Map Code" is_msg_text = "Sorry! Not a valid Metric Map Code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "tier codes" CASE "units" if ls_col_name = "meas_code" or & ls_col_name = "standard_code" then f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "coDAT*de") end if if ls_col_name = "meas_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_measurements" is_msg_name = "Meas Code" is_msg_text = "Sorry! Not a valid measurement code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "standard_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 = "Standard Code" is_msg_text = "Sorry! Not a valid Standard Code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if CASE "value types" END CHOOSE end event event dw_1::itemchanged;call super::itemchangDAT*ed;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 event dw_1::itemerror;call super::itemerror;return 2 end event event dw_1::rbuttondown;call super::rbuttondown;long ll_cur_row string ls_scc_ams_code ll_cur_row = This.GetRow() if ll_cur_row > 0 then This.AcceptText()DAT*  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 event type r_1 from w_single_tableDAT*"`r_1 within w_reference integer x = 64 integer y = 132 end type type ddlb_1 from dropdownlistbox within w_reference integer x = 869 integer y = 36 integer width = 1065 integer height = 508 integer taborder = 10 boolean bringtotop = true integer textsize = -8 integer weight = 700 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 boolean allowedit = true boolean vscrollbar = true string item[] = {"Accuracy DAT*$Methods","Calculation Methods","Coordinate Calculation Types","Data Codes","Device Codes","Form Types","Group Types","Legal Entity Types","Legal Relationship Codes","Measurement Codes","Methods","Metric Lookups","Metric Maps","Metrics","Modes","Operating Daily Schedules","Operating Days","Operating Hours","Operating Months","Operating Weekly Schedules","Operating Yearly Schedules","Process Codes","Reasons","Reference Types","SCC AMS Relationships","Source Codes","Stream Codes","Tier Codes","Units"DAT*&,"Use Types","Value Types","Aircraft Categories","Aircraft Default Time-in-Mode","Aircraft Engines","Aircraft Emission Factors","Season codes","Vehicle Types","Area Facility Types","Vehicle Categories","Surrogate Codes","SCC/AMS Surrogate Codes","SCC/AMS Default Factors","Geographic Equipment Counts","Geographic Surrogates","Conversion Lookup Codes","Emission Types","Roadway Types","Area Facility Roadway Types"} borderstyle borderstyle = stylelowered! end type event modified;string ls_table DAT* if wf_check_pending() = TRUE then ls_table = Lower(ddlb_1.Text) is_current_table = ddlb_1.Text SetPointer(HourGlass!) is_rap_table = wf_assign_table(ls_table, dw_1) dw_1.SetTransObject( SQLCA ) dw_1.Retrieve() dw_1.SetFocus() else ddlb_1.Text = is_current_table end if ddlb_1.Text = is_current_table end event type st_1 from statictext within w_reference integer x = 631 integer y = 44 integer width = 224 integer height = 56 boolean bringtotop = truDAT**8T(X$@8,&1,&`$ B\ xdH +wparam+lparamancestorreturnvaluels_tablew_filter::messagex , 5(@.>&@-h( ue_open_filter_winddlb_1$4text,is_rap_table0<>H<>$ 4 L X ` DAT*,8* 0*8H$}P1<RX$`1<Rh$(>Zd icurrentpH createddlb_14st_1(5)()control@c@@c@4@c@(5)  0 8H P X ` h 48$($DAT*. d 0 destroyddlb_14st_1 5) ( &z{FGOwPxQyRz&.2 wf_freeform_viewwf_check_requiredwf_check_pendingwf_assign_tablewf_check_ridf_get_metric_map_ridf_get_sequence+open+ue_open_filter_win+create+destroy+<LY DAT*0n!n!n!n!}2 widthheighttitleiconddlb_1st_1is_current_tableil_selected_rowidwc_dw_childis_column_nameis_child_nameis_validation_tableis_msg_nameis_msg_textis_rap_tableis_factor_typeis_old_valueis_column_statusil_source_ridil_device_rid HDAT*2 ' ),=M$[jxP] o H  XDAT*41 @@@      )$P{ + xDAT*6M$ ] j3& P8z R  2  2  ] wpH    DAT*8  @2  2  ] wH @      @ OQRSTc-&/29.A2  2 DAT*: taborder] ` @   @ :&<$ $)88:F@@8 68@ |&8Q &8e &8 &8DAT* h8.$6$68088J1) 8$6<80X8`08080$$)8)8d8$0&8%  81@$6H$68P0DAT*>Permit windowforward global type w_permit from w_master_detail end type type cb_conditions from commandbutton within w_permit end type type cb_rpt_req from commandbutton within w_permit end type type uo_1 from u_dw_permit_condition within w_permit end type type dw_4 from datawindow within w_permit end type type dw_5 from datawindow within w_permit end type type dw_6 from datawindow within w_permit end type type r_buttons from rectangle within w_permit end type end forward globaDAT*@l type w_permit from w_master_detail int Width=2984 int Height=1537 boolean TitleBar=true string Title="Permit" string Icon="PROCESS.ICO" cb_conditions cb_conditions cb_rpt_req cb_rpt_req uo_1 uo_1 dw_4 dw_4 dw_5 dw_5 dw_6 dw_6 r_buttons r_buttons end type global w_permit w_permit type variables //string is_member_dw; //string is_member_dw_freeform; string is_activity_dw; string is_activity_dw_freeform; string is_level; string is_current_btn; //string selectedChildType; inDAT*Bteger ii_dw1_height; integer ii_dw1_y; integer ii_cb_y; long il_permit_rid; end variables forward prototypes public subroutine wf_retrieve_data () public function boolean wf_check_required () public subroutine wf_draw_dw2 () public subroutine wf_select_one (datawindow dwname) public subroutine wf_set_var () public subroutine wf_general_view () public subroutine wf_detail_view () public function boolean wf_check_rid (datawindow dwname) end prototypes public subroutine wf_retrieveDAT*D_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 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"DAT*F + & // "Please select another source name.", Information!) else if gl_device_rid > 0 then if dw_5.Retrieve(gl_device_rid) > 0 then if dw_6.GetChild("id", dwc) = -1 then MessageBox(This.Title, "Application Error:~nProcess Id - " + & "Not a DataWindowChild in process context.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) if dwc.Retrieve(gl_device_rid) > 0 then if gd_process_rid > 0 then ifDAT*H dw_6.Retrieve(gd_process_rid) > 0 then // Retrieve stream records only if there is any dw_1.Retrieve(gd_process_rid) end if else dw_6.InsertRow(0) end if else dw_6.InsertRow(0) end if else dw_5.InsertRow(0) 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 function boolDAT*Jean wf_check_required ();long ll_cur_row, ll_total_row dw_1.AcceptText() dw_2.AcceptText() if Not f_validate_dev_pro(dw_1, dw_1.GetRow()) then return FALSE ll_total_row = dw_2.RowCount() for ll_cur_row = 1 to ll_total_row if is_current_btn = "Activity" then // NOT COMPLETE YET // if Not f_validate_act(dw_2, ll_cur_row, is_level, is_process_code) then // return FALSE // end if end if next return TRUE end function public subroutine wf_draw_dw2 ();long ll_master_rDAT*Lid dw_2.SetRedraw(FALSE) dw_3.SetRedraw(FALSE) if dw_1.RowCount() > 0 then // Get the rid for process ll_master_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") if is_current_btn = "Activity" then // Only replace the datawindow object when the radiobutton 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) end if dw_2.Retrieve(ll_master_rid) dw_3.TrigDAT*NgerEvent(RowFocusChanged!) // Share data between dw_2 and dw_3 dw_2.ShareData(dw_3) end if end if dw_2.SetRedraw(TRUE) dw_3.SetRedraw(TRUE) wf_detail_view() end subroutine public subroutine wf_select_one (datawindow dwname);SetPointer(HourGlass!) // Open the filter window with parameter - table name if idw_active.ClassName() = "dw_2" or idw_active.ClassName() = "dw_3" then if is_current_btn = 'Activity' then OpenWithParm(w_filter, 'pro_activities') end if DAT*Pelse OpenWithParm(w_filter, 'rap_processes') 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_set_var ();// Process has no member for now // memberDw = "d_pro_member" is_activity_dw = "d_activity" is_activity_dw_freeform = "d_activity_freeform" is_level = "PMT" end subroutine public subroutine wf_general_view ();// DAT*RResize dw_1 to its original size and move it back to the original position dw_1.Resize(dw_1.Width, ii_dw1_height) dw_1.VScrollBar = FALSE dw_1.Move(dw_1.X, ii_dw1_y) // Move all command buttons up //cb_group.Move(cb_group.X, ii_cb_y) //cb_activity.Move(cb_activity.X, ii_cb_y) //cb_scheduled.Move(cb_scheduled.X, ii_cb_y) //cb_permit.Move(cb_permit.X, ii_cb_y) // Make dw_2 invisible dw_2.Hide() // Resize and move focus indicators r_1.Resize(dw_1.Width + 45, dw_1.Height + 35) r_2.RDAT*Tesize(dw_2.Width + 45, dw_2.Height + 35) r_2.X = dw_2.X - 15 r_2.Y = dw_2.Y - 15 end subroutine public subroutine wf_detail_view (); is_enlarge_state = 'detail' f_menu_behave(is_state, is_style_state, is_enlarge_state) // Shrink the dw_1 and DO NOT put a vertical scrollbar on it dw_1.Resize(dw_1.Width, 120) dw_1.VScrollBar = FALSE // Move all command buttons up cb_conditions.Move(cb_conditions.X, dw_1.Y + 150) cb_rpt_req.Move(cb_rpt_req.X, dw_1.Y + 150) // Make dw_2 visible uDAT*Vo_1.Show() // Resize the green focus r_1.Resize(dw_1.Width + 45, dw_1.Height + 35) 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 end subroutine public function boolean wf_check_rid (datawindow dwname);long ll_row_num, ll_cur_row, ll_rid_num, ll_rid ll_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") ll_row_num = dwName.RowCount() for ll_cur_row = 1 to ll_row_num if IsNull(dwName.GetItemNumber(ll_cur_row, "rid")) then // Select the nexDAT*Xt available rid from the rid_storage in database ll_rid_num = f_get_sequence() if ll_rid_num = -1 then return FALSE end if dwName.SetItem(ll_cur_row, "rid", ll_rid_num) if dwname.classname() = "dw_2" then if is_current_btn = "Activity" then dwName.SetItem(ll_cur_row, "ref_rid", ll_rid) dwName.SetItem(ll_cur_row, "metric_level_type", is_level) dwName.SetItem(ll_cur_row, "creation_date_time", today()) dwName.SetItem(ll_cur_row, "user_id", 'test') if DAT*ZNot f_check_dup_act(dwName, ll_rid, is_level) then return FALSE elseif Right(is_current_btn, 6) = "Member" then // for group member use end if end if end if next return TRUE end function on open;call w_master_detail::open; //bProcessOpen = TRUE //// 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_group.Y //wf_set_var() uo_1.hide() //dw_1.SetTransObject(SQLCA) //dw_4.SeDAT*\tTransObject(SQLCA) // //dw_4.Retrieve(gd_process_rid) //dw_1.Retrieve(gd_process_rid) dw_1.SetTransObject(SQLCA) // The following codes handle the context area for source, device and process dw_4.SetTransObject(SQLCA) dw_5.SetTransObject(SQLCA) dw_6.SetTransObject(SQLCA) wf_retrieve_data() end on on activate;call w_master_detail::activate;//f_menu_behave(TRUE, TRUE, TRUE) //f_view_menu_behave(TRUE, TRUE, FALSE, TRUE) // //m_main_menu.m_view.m_expand.Checked = FALSE //DAT*^m_main_menu.m_view.m_original.Checked = TRUE end on on close;call w_master_detail::close; //if Not (bGeoOpen or bSourceOpen or bDeviceOpen) then // lGeoRid = 0 // lSourceRid = 0 // lDeviceRid = 0 //elseif bGeoOpen and (Not (bSourceOpen or bDeviceOpen)) then // lSourceRid = 0 // lDeviceRid = 0 //elseif bGeoOpen and bSourceOpen and (Not bDeviceOpen) then // lDeviceRid = 0 //end if // //gd_process_rid = 0 //bProcessOpen = FALSE end on on w_permit.create int iCurrent call DAT*`w_master_detail::create this.cb_conditions=create cb_conditions this.cb_rpt_req=create cb_rpt_req this.uo_1=create uo_1 this.dw_4=create dw_4 this.dw_5=create dw_5 this.dw_6=create dw_6 this.r_buttons=create r_buttons iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=cb_conditions this.Control[iCurrent+2]=cb_rpt_req this.Control[iCurrent+3]=uo_1 this.Control[iCurrent+4]=dw_4 this.Control[iCurrent+5]=dw_5 this.Control[iCurrent+6]=dw_6 this.Control[iCurrent+7]=r_buttons end DAT*bon on w_permit.destroy call w_master_detail::destroy destroy(this.cb_conditions) destroy(this.cb_rpt_req) destroy(this.uo_1) destroy(this.dw_4) destroy(this.dw_5) destroy(this.dw_6) destroy(this.r_buttons) end on type dw_3 from w_master_detail`dw_3 within w_permit int X=36 int Y=532 int Width=2785 int Height=877 int TabOrder=60 string Tag="Member information (freeform view)" end type on dw_3::itemfocuschanged;call w_master_detail`dw_3::itemfocuschanged;//string ls_col_nameDAT*d //DataWindowChild dwc // //ls_col_name = This.GetColumnName() // //choose case ls_col_name // case "material_code", "value_unit_code" // f_retrieve_codes(Parent.Title, dw_3, ls_col_name, "code") // case "metric_code" // f_retrieve_metric_codes(Parent, dw_3, is_level, 'PRO') // case "method_type", "value_type" // f_retrieve_codes(Parent.Title, dw_3, ls_col_name, "type") // case "device_rid" // if dw_3.dwGetChild("device_rid", dwc) = -1 then // MessageBox(Parent.TitleDAT*f, "Application Error:~nDevice Rid - " + & // "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(lSourceRid) // end if //end choose end on on dw_3::add_row;call w_master_detail`dw_3::add_row;//if is_current_btn = "Activity" theDAT*hn // This.SetItem(This.GetRow(), "user_id", gs_user_id) // This.SetItem(This.GetRow(), "creation_date_time", today()) //end if end on type dw_2 from w_master_detail`dw_2 within w_permit int X=40 int Y=532 int Width=2785 int Height=877 int TabOrder=50 boolean Visible=false string Tag="Member information (tabular view)" end type on dw_2::itemfocuschanged;call w_master_detail`dw_2::itemfocuschanged;//string ls_col_name //DataWindowChild dwc // //ls_col_name = This.GetColumnNameDAT*j() // //choose case ls_col_name // case "material_code", "value_unit_code" // f_retrieve_codes(Parent.Title, dw_2, ls_col_name, "code") // case "metric_code" // f_retrieve_metric_codes(Parent, dw_2, is_level, 'PRO') // case "method_type", "value_type" // f_retrieve_codes(Parent.Title, dw_2, ls_col_name, "type") // case "device_rid" // if dw_2.dwGetChild("device_rid", dwc) = -1 then // MessageBox(Parent.Title, "Application Error:~nDevice Rid - " + & // "Not a DataWindDAT*lowChild.~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(lSourceRid) // end if //end choose end on on dw_2::add_row;call w_master_detail`dw_2::add_row;//if is_current_btn = "Activity" then // This.SetItem(This.GetRow(), "user_id", gs_user_id) // DAT*nThis.SetItem(This.GetRow(), "creation_date_time", today()) // dw_2.bObjModified = TRUE // Not sure if this is right //end if end on type dw_1 from w_master_detail`dw_1 within w_permit int X=36 int Y=308 int Width=2802 int Height=317 int TabOrder=40 string Tag="General information" string DataObject="d_permit_info" end type on dw_1::itemfocuschanged;call w_master_detail`dw_1::itemfocuschanged;//string ls_col_name // //ls_col_name = This.GetColumnName() // //if ls_col_name = "DAT*pmode_type" then // f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "type") //elseif ls_col_name = "code" or ls_col_name = "primary_material_code" then // f_retrieve_codes(Parent.Title, dw_1, ls_col_name, "code") //end if end on on dw_1::rowfocuschanged;call w_master_detail`dw_1::rowfocuschanged;// Only draw dw_2 when one of those command button is clicked if is_current_btn <> '' then wf_draw_dw2() end if if dw_1.RowCount() > 0 then il_permit_rid = dw_1.GetItemNumber(dw_1.GetDAT*rRow(), "permit_rid") // if rid is null, this means the current row is the new inserted row // then reset the dw_2 if IsNull(dw_1.GetItemNumber(dw_1.GetRow(), "permit_rid")) then dw_2.Reset() end if else il_permit_rid = 0 // Clean the activity datawindow buffer dw_2.Reset() end if end on on dw_1::rbuttondown;call w_master_detail`dw_1::rbuttondown;//if f_look_up(This, "scc_ams_code", "SCC AMS Code Lookup", & // "select code, desc_1, desc_2, desc_3, desc_4, controDAT*tl_1_device_code, " + & // "control_2_device_code, device_code, material_code, process_code, " + & // "source_code, valid_flag from rap_scc_ams_codes order by code") then // This.bObjModified = TRUE //end if end on on dw_1::clicked;call w_master_detail`dw_1::clicked;//if f_look_up(This, "scc_ams_code_t", "SCC AMS Code Lookup", & // "select code, desc_1, desc_2, desc_3, desc_4, control_1_device_code, " + & // "control_2_device_code, device_code, material_code, process_code, " + & // "souDAT*vrce_code, valid_flag from rap_scc_ams_codes order by code") then // This.ib_obj_modified = TRUE //end if end on type r_1 from w_master_detail`r_1 within w_permit int X=33 int Y=196 end type type r_2 from w_master_detail`r_2 within w_permit int X=33 int Y=900 end type type cb_conditions from commandbutton within w_permit int X=555 int Y=676 int Width=676 int Height=81 int TabOrder=70 boolean BringToTop=true string Text="Conditions" int TextSize=-8 int Weight=700 string DAT*xFaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;SetPointer(HourGlass!) This.Default = TRUE //f_view_menu_behave(TRUE, TRUE, FALSE, FALSE) uo_1.uf_retrieve_dw_permit_master(il_permit_rid) wf_detail_view() f_highlight_button(r_buttons, this, "on") end on type cb_rpt_req from commandbutton within w_permit int X=1654 int Y=676 int Width=676 int Height=81 int TabOrder=80 boolean BringToTop=true string Text="Reporting ReDAT*zquirements" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type on clicked;MessageBox("Reporting Requirements", "Sorry! This function is not ready") //f_highlight_button(r_buttons, this, "on") end on type uo_1 from u_dw_permit_condition within w_permit int X=104 int Y=545 boolean Border=false BorderStyle BorderStyle=StyleBox! end type on uo_1.destroy call u_dw_permit_condition::destroy end on DAT*|type dw_4 from datawindow within w_permit event mousemove pbm_mousemove int X=50 int Y=20 int Width=2838 int Height=84 int TabOrder=10 string Tag="Filter on source" boolean BringToTop=true string DataObject="d_source_ids_dddw" boolean Border=false end type on mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on event itemfocuschanged;DataWindowChild dwc string ls_col_name if This.GetChild("id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nSource 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.RowCount() > 0 then if dwc.GetItemString(1, "id") = '0' then dwc.SetTransObject(SQLCA) dwc.Retrieve() end if end if end event event itemchanged;DataWindowChild dwc if dw_4.GetChild("id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nSource Id - DAT*" + & "Not a DataWindowChild in source context.~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(Parent.Title, "Application Error:~nDevice Id - " + & "Not a DataWindoDAT*wChild in device context.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) if dwc.Retrieve(gl_source_rid) = 0 then dwc.Reset() dw_5.Reset() dw_6.Reset() dw_1.Reset() dw_2.Reset() gl_device_rid = 0 // Beep(1) MessageBox(Parent.Title, "No devices available for this source name." + & "~nPlease select another source name.", Information!) else // Device name list has been changed based on the source name, // so let user pick tDAT*he device name dw_5.Retrieve(0) dw_5.InsertRow(0) dw_6.Reset() dw_1.Reset() dw_2.Reset() end if end if end event type dw_5 from datawindow within w_permit event mousemove pbm_mousemove int X=36 int Y=109 int Width=2866 int Height=84 int TabOrder=20 string Tag="Filter on device" boolean BringToTop=true string DataObject="d_device_ids_dddw" boolean Border=false end type on mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on event itemfocuschanged;DataWindowChDAT*ild dwc if This.GetChild("id", 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.RowCount() > 0 then if dwc.GetItemString(1, "id") = '0' then dwc.SetTransObject(SQLCA) dwc.Retrieve(gl_source_rid) end if end if end event event itemchDAT*anged;DataWindowChild dwc if dw_5.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 dw_5.SetItem(1, "code", dwc.GetItemString(dwc.GetRow(), "code")) dw_5.SetItem(1, "name", dwc.GetItemString(dwc.GetRow(), "name")) gl_device_rid = dwc.GetItemNumber(dwc.GetRow(), "rid") if gl_device_rid > 0 then DAT* if dw_6.GetChild("id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nProcess Id - " + & "Not a DataWindowChild in process context.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) if dwc.Retrieve(gl_device_rid) = 0 then dwc.Reset() dw_6.Reset() dw_1.Reset() dw_2.Reset() gd_process_rid = 0 // Beep(1) MessageBox(Parent.Title, "No processes available for this device name." + & "~nPlease select another device namDAT*e.", Information!) else // Process name list has been changed based on the device name, // so let user pick the process name dw_6.Retrieve(0) dw_6.InsertRow(0) dw_1.Reset() dw_2.Reset() end if end if end event type dw_6 from datawindow within w_permit event mousemove pbm_mousemove int X=33 int Y=193 int Width=2838 int Height=84 int TabOrder=30 string Tag="Filter on process" boolean BringToTop=true string DataObject="d_process_ids_dddw" boolean Border=false eDAT*nd type on mousemove;SetMicroHelp(w_mdi_main, This.Tag) end on event itemfocuschanged;DataWindowChild dwc if This.GetChild("id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nProcess 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.RowCount() > 0 then if dwc.GetItemString(1, "id") = '0' then DAT* dwc.SetTransObject(SQLCA) dwc.Retrieve(gl_device_rid) end if end if end event event itemchanged;DataWindowChild dwc if This.GetChild("id", dwc) = -1 then MessageBox(Parent.Title, "Application Error:~nProcess Id - " + & "Not a DataWindowChild in process context.~nContact your technical support.") return end if // Put process code and name in the context area This.SetItem(1, "code", dwc.GetItemString(dwc.GetRow(), "code")) This.SetItem(1, "name", dwc.GetItemString(dwDAT*c.GetRow(), "name")) gd_process_rid = dwc.GetItemNumber(dwc.GetRow(), "rid") if dw_1.Retrieve(gd_process_rid) = 0 then dw_2.Reset() dw_2.TriggerEvent(Rowfocuschanged!) end if dw_1.TriggerEvent(Rowfocuschanged!) if gd_process_rid = 0 then dw_2.Reset() dw_2.TriggerEvent(Rowfocuschanged!) end if dw_1.SetFocus() end event type r_buttons from rectangle within w_permit int X=2738 int Y=724 int Width=161 int Height=145 boolean Visible=false boolean Enabled=false int DAT*LLineThickness=4 long LineColor=12632256 long FillColor=32768 end type DAT*881X1`)h8p6x8P0808080$$)8)88$0&8  $&8 <&88 T&8J l&8R 8ap$6x$DAT*68088a1)8680808080$$)8)8  8$0&8( Z884"8>"8J"8V"8c"p$6xDAT*$6808@88"@$6$68P088\1)8680808080$$) 8)(8V8x 018)@DAT*8H6P8P0X8`0p8x080$$)8)8V8> 1)8680808 0,840T\$d$)l8)t8VDAT*8J |1)86808`08080$$)8)8V8V 1) 8(608088@0T8\0l8t0DAT*$$)8)8V8 1)868P08080 804<$D$)L8)T8V8c\1d)l8t6|8080DAT*8080$$)8)8V84  1 ) 8 6$ 80, 84 0@ 8H 0T 8\ 0|  $ $) 8) 8V8 < 1 ) 8 DAT*6 80 8 0 8 0 8 08 @ $H $)P 8)X 8V` 8$0&8h  84$p $)x 81<$,#) 8  $) 88 ) 8 6) 88 z $6 $68P0DAT*884 1 ) 8 6 80 84 0 8H 0$ 8\ 0, 4 $< $)D 8)L 88 T 1\ )d 8l 6t 80| 8 0 8 0 8 0DAT*  $ $) 8) 88  1 ) 8 6( 8P00 808 8@ 0L 8T 0t | $ $) 8) 8 8$0&8  &8  &8  8  $6DAT* $68088  1 ) 8 6 80 8( 0H 8P 0h 8p 0  $ $) 8) 8 8$0&8  d8 * $6 $68088 F 1DAT*) 8680$8,0L8T0h8p0$$)8)8`8$0&8 8$6$680 881)86 8DAT*0(800P8X0p8x0$$)8)88$0&8  &8 8&8 8$6$680 88$1,)48<6D80L8@0DAT*T80\80dl$t$)|8)88$0&8 &8  &8 88"$6$680 881)8680 80(DAT*800<8D0`h$p$)x8)881)8680808080$$)8)8&8 d!8* ($60$680 8DAT*8F!81@)H8P6X80`80h80p80x$$)8)8`!8$0&8 #8!$6$680 88"1)8DAT*680808080$$) 8)(8#08$0&88  #&8C %8 8I"#X$6`$68088 $h1p)x868DAT*08 08080$$)8)8%8I%1)86 80(84 00880H8P0t|$$)8)8%8$0&8 &,DAT*& &1.&,&$ " :Tdx.B X!~"#$%&'F(J+d,|-0123"4:5T6n789:=? A8CPEhFGJKLM&N>OXPrQRSTW X$_`be@fTgjhijklmnXoppqrstu v, wt x y z { | } ~. H  0 J d  2 L f  4 N h DAT* 8Pj.Tl4Jp8<Vn$8z0J2Lf4Nh0D"<V*>Tz     BF`x6Pj !$&(4)L*`-./01 2$3>4X5r67DAT*:<>? AFDEFGHI J$K>LXMNOPQ R&S@TZUtXYZ]* ^> _T `z a b c d e fB!gF!j`!kx!l!o!p!q!r"s6"tP"uj"v"w"x"y"|#~#4#Z#####$$8$R$l$$$$% %:%T%n%%%%%&d rowdwols_col_namels_tabledwcll_device_ridls_device_idls_process_idls_source_idls_meas_codecase15sqlca::message DAT*  % $)7 D R _ l t#@+z&@- ddlb_14textgetcolumnname(accuracy methodscalculation methodscoordinate calculation typesdata codesdevice codesmetric_map_codetitle dw_1-codeil_selected_row7idwc_dw_child8$getchildoisDAT*_column_name9is_child_name,:is_validation_tableD;rap_device_codesis_msg_nameq<Metric Map Codeis_msg_text=Sorry! Not a valid Metric Map Codeis_old_value@--getrowgetitemstring9group typesmetric_level -type)78$o9,:D;rap_metric_levelsouq<Metric Level=Sorry! Not a valid Metric Level@--9DAT*legal entity typeslegal relationship codesmeasurement codesmethodsmetric lookupsmetric_code -78$o9,:D;rap_metricsq<Metric Code=Sorry! Not a valid metric codet@--9metric mapsunit_codesource_codedevice_codeprocess_codestream_code -value_typemode_type -78$o9,:D;q<Code=Sorry! Not a validDAT* Code@--78$o9,:D;rap_value_typesq<Value Type=Sorry! Not a valid value type8@--78$o9,:D;rap_source_codes)q<Source Code=Sorry! Not a valid source code@--78$o9,:D;q<Device Code=Sorry! Not a valid device code@-DAT*-78$o9,:D;rap_process_codes$q<Process Code=Sorry! Not a valid process code@--78$o9,:D;rap_modesonq<Mode Type=Sorry! Not a valid mode type@--78$o9,:D;rap_stream_codesq<Stream Code=Sorry! Not a valid stream code@-DAT*-78$o9,:D;rap_unitsq<Unit Codep=Sorry! Not a valid unit code@--material_code78$o9,:D;rap_materialsq<Material Code=Sorry! Not a valid material code@--9metrics-osettransobject -meas_coderetrieve} level_type DAT*-78$o9,:D;q<=@--78$o9,:D;rap_measurementsq<Measurement Code=Sorry! Not a valid Measurement Code@--78$o9,:D;q<Level Type=Sorry! Not a valid Level Type@--9modesoperating daily schedulesoperating daysweekly_DAT*schedule_code -78$o9,:D;rap_operating_weekly_schedulesq<Weekly Schedule Code=Sorry! Not a valid weekly schedule code@--9operating hoursdaily_schedule_code -78$o9,:D;rap_operating_daily_schedulesq<Daily Schedule Code=Sorry! Not a valid daily schedule code@--9operatinDAT*g monthsyearly_schedule_code -78$o9,:D;rap_operating_yearly_schedulesq<Yearly Schedule Code=Sorry! Not a valid yearly schedule code@--9operating weekly schedulesoperating yearly schedulesprocess codes -78$o9,:D;q<=@--9reasonsreference typesscc ams relationshipsscc_DAT*codeams_code -78$o9,:D;rap_scc_ams_codesq<SCC Code=Sorry! Not a valid SCC Code@--78$o9,:D;q<AMS Code=Sorry! Not a valid AMS Code@--source codes -78$o9,:D;q<=@--9stream codes DAT* -78$o9,:D;q<=@--9tier codesunitsstandard_code -78$o9,:D;q<Meas Code=Sorry! Not a valid measurement code@--78$o9,:D;q<Standard Code=Sorry! Not a valid Standard Code@--9value typesDAT*  8       $ < X         @ H X ` h p x          p x                p x          DAT*      ( 0 8 @ H P X p              , T \ d l t |                 ( 0 8 T l           DAT*    4 < D L T \ d l t |             $ , @ T |             8 @ H P X ` p x              DAT*Ee integer textsize = -8 integer weight = 700 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 8388608 long backcolor = 12632256 boolean enabled = false string text = "Table:" alignment alignment = center! boolean focusrectangle = false end type DAT*  $ , 4 < D L T \ d l t |            ( 0 8 L t |             H h               $ L h   DAT*            ( P p         $ , 4 < D L T \ d l t |            ( < ` h p x              DAT* ( 0 8 @ H P X ` h p x                     ( 0 X ` h p x                 ( 0 H t |      DAT*6/8)$8<$)L8d$6$68#$6$6@81,&1 ,&$(@Z d? rowdwodataancestorreturnvaluels_col_name::messagex  ) 5DAT*&@-@ itemchangedgetcolumnnameis_column_name,9gettextDis_child_nameT:is_validation_tablel;is_msg_name<is_msg_text=$ < L d     :6081d) rowdwodataancestorreturnvalueP   itemerror.DAT*78)81)0888)T88808\08p8z%8z&8z&8(z&68`9},&1",&h$(@Pb dS xposyposrowdwoancestorreturnvaluell_cur_rowls_scc_ams_code::message DAT* .9 I&@-p( rbuttondowngetrowaccepttext$scc_ams_codegetitemstringESCC/AMS Code Lookupselect 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 codeib_obj_modifiedM 0 T ` hDAT* /017OPQRSTc-&/102$79<.A2 j +itemfocuschangedf_retrieve_codes+itemchangedf_validate_code+itemerror+rbuttondownf_look_up{)))) )))))))j)& DAT*))+R8*HS`+ 2 ywidthheighttaborderP ] oW  @  @  lDAT*T1|/x072  2 xy(@ ] o@ )89,$<$X`$h$6:FDAT*@@86$)8$,#)8$)8$)8:$$6 $(0$6,&~1,&8$<f  :dd! ls_tablesqlca::message< #@+&@-@ wf_check_pendingDAT*ddlb_1$4text4is_current_table)D6$44is_rap_tablep>dw_18-wf_assign_table-settransobject^-retrieve1-setfocus$44D6$44D6 , < X ` h               ( 0 8 -3-2  +modifiedDAT*2  xywidthheighttaborderbringtotoptextsizeweightfontpitchfontfamilyfacenametextcoloralloweditvscrollbaritem borderstyle@e $ ) "-6= G R[eozh1DAT*] oe$)  E@    @@ @@13-32  2 xywidthheightbringtotoptextsizeweightfontpitchfontfamilyfacenametextcolorbackcolorDAT*enabledtextalignmentfocusrectangle@w , 8$-4 > IR\fn @s }] ow,8 @   DAT*r   @DAT*    68V80,8408M8]0t8|0680@8$80806$6 R j | d' as_tableadw_objls_rtncase3P     legal entitDAT*iesrap_legal_entitiesd_legal_entity_types_legreference codesrap_reference_codesd_ref_codes_refSorry! Not a valid data table nameddlb_14texth@, t   ^ $688?z%:)@:@1@81<^:F@@8,8M0)x8)81<X1)81<4,)8,80)8DAT*:NW@)8X,,80)8X ^ x 04:d! pdw_objw_mdi_mainsqlca< @#@$@ title You are about to delete this record. Are you sure?Checking related records ...setmicrohelpZjwf_cascade_deldeleterowresetupdate{Row deleted successfully. Zjtriggerevent Row nDAT*ot deleted.Zj x        $L808)0@81@$)P8}1<X$<8`Jt81|$$680 : H L rd sznamenridnrow< DAT*8 idw_active/#wf_GetCurRidNo active datawindow/#getrowH/#RIDgetitemnumber d/#None @ P X t |  R$8$@$H$)X88`)t8698<168|1Y(@(8z'8z&:)@:@1@8}F1DAT*41}F1}1<698<1<11>)8698168|1Y(@(8z'8z&:)@:@1@8}11}1}1< 69 8>DAT* 1<01>1 ^ 04FZ"%')*"-./034567,80=>d3 sznamesztypels_codenridncntnindsqlca   #(-@$0 is_current_table6Reference Codesidw_active4/#4/#getrowDAT* PcodegetitemstringeDeleting this record will also delete activity records. Do you want to continue?wf_getcurrid s child records. Do you want to continue? @ H X t   $8$8$)L81ZT$8\Jp8 $19x$8\)8P9DAT*> h d) ll_row_numll_cur_rowll_rid_num<8 is_current_table6Legal Entitiesdw_13-rowcount4@3-ridgetitemnumber `3-setitemO 8 L T p x  8d  create8d DAT* destroyFGOwPxQyRz&.2 wf_check_requiredwf_assign_tablewf_deletewf_getcurridwf_cascade_delwf_check_ridf_del_ref_codef_del_recsf_get_sequence+create+destroy*4AP]]llwDAT*2  titlebartitle(V] o HV  d1H @@@    DAT*  !P+$ C@4xT\Pa`p}b bDAT* 2  2  ] wpH      @2  2  ] wH @ DAT*     @ OQRSTc-&/29.A2  2  ] ` @   @ OPQRSDAT*Tc-&/102$79<.A2  2  ] oW  @  @  2  2  ] o@DAT*3-2  2 $ bringtotopitem ( 1] oe$)   E@    @@ @@12  2  bringtotopDAT*] ow,8 @     @DAT* 2  2  ] wH @      @ $),8)<8)P8)`8)t89},1,$DAT*"DZp d- +wparam+lparamll_cur_row::messageP #@@ st_no_record_grey*hide$getrow4insertrow(DsetrowQXscrolltorow?hib_obj_modified| , < P ` t   OQRSTc-&/10279.A2  DAT*$+add_row2  dataobject] % [  @   /$ O$),8)<8)P8)`8)t8DAT*&9},1,$DZp d- +wparam+lparamll_cur_row::messageP #@@ st_no_record_white+hide$getrow4insertrow(DsetrowQXscrolltorow?hib_obj_modified| , < P ` t   OPQRSTc-&DAT*(/102$79<.A2  +add_row2  dataobject] o% [   @ @  /$(O2  2  ] DAT*ZoDAT*,$) "1 ,7 .E 0J 1Oc,t(] oWhR   41DAT*. @@@       " , . 0 1,( o&$7$xDAT*0C&(&(F$ $ 2  2  ] `@ @    DAT*2 @2  2  ] @ @     @OPQRSTcdef-&/28.2  2  taborderDAT*4F]  hF @    OPQRSTcdef-&/289<.A2  2  ytabordervisible<a <] na DAT*6h< @  @    "$1)08H$)X8`$x$6)8$**$6880)8,!1DAT*8,!$0J d ls_col_name::message( !@3` il_selected_rowAgetcolumnname is_column_name8CgetrowP8Cis_old_valuehDsetitemPidwc_dw_child3 B(is_child_namengEAhighlight_dddwpostevent 0 H X ` x       : *@DAT*:l@l8$1)08H$)X8`$x$$$)8)8,!1,!$4Lf d- +key+keyflagsls_col_name::messageP2   #!@3X il_selected_rowAgetcolumnname is_column_name8CgetrowDAT*<P8Cidwc_dw_childhB(Ais_child_namew_Egetitemstringld[setitemP 0 H X ` x       (8) 81r,!^1l,!($8$)P818X08g8z%@8,!1,!$$$)88DAT*>J8%$18$$) 88)48)D8L$18T\$d$)l88t)8)8$18$$)88)8)8$)8$,%)8,!1,!$(r :F ldDAT*DX +xpos+ypos+row+dwoancestorreturnvaluell_device_rid::messagegl_device_rid 2@!@3J%@  doubleclickedrowcount4dw_10. modifiedcount*@Double-ClickedData have been modified. Save the changes before proceeding0. 0. getrow=ridgetitemnumber dw_DAT*BProcess windowforward global type w_process from w_master_detail end type type cb_group from commandbutton within w_process end type type cb_activity from commandbutton within w_process end type type cb_permit from commandbutton within w_process end type type cb_stream from commandbutton within w_process end type type uo_act from u_dw_act_pro within w_process end type type cb_factor from commandbutton within w_process end type type uo_group from u_dw_group_pro within w_process end DAT*Dtype type r_buttons from rectangle within w_process end type type cb_schedule from commandbutton within w_process end type type dw_6 from u_dddw within w_process end type type dw_7 from u_dddw within w_process end type end forward global type w_process from w_master_detail int Width=2953 int Height=1564 boolean TitleBar=true string Title="Process" string Icon="PROCESS.ICO" event current_view pbm_custom31 event history_view pbm_custom32 event highlight_dddw pbm_custom33 cb_grouDAT*Fp cb_group cb_activity cb_activity cb_permit cb_permit cb_stream cb_stream uo_act uo_act cb_factor cb_factor uo_group uo_group r_buttons r_buttons cb_schedule cb_schedule dw_6 dw_6 dw_7 dw_7 end type global w_process w_process type variables string is_unit_sql = "null" string is_validation_table string is_column_status = "valid" string is_msg_name string is_msg_text string is_filt long il_selected_row datawindowchild idwc_dw_child string is_column_name string is_child_nameDAT*H string is_old_value //string is_member_dw; //string is_member_dw_freeform; string is_activity_dw; string is_activity_dw_freeform; string is_schedule_dw; string is_schedule_dw_freeform; string is_level; integer ii_dw1_height; integer ii_dw1_y; integer ii_cb_y; str_stream_context istr_stream_context; string is_process_code; end variables forward prototypes public subroutine wf_retrieve_data () public function boolean wf_check_required () public subroutine wf_draw_dw2 () public DAT*Jsubroutine 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_enable_btn (boolean pb_enable) public function boolean wf_check_rid (datawindow dw_obj) 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 tDAT*Lhe dw_1 and move dw_4 // Change the attributes of expand and original toolbaritems string ls_source_code, ls_device_code if Not wf_check_pending() then return SetPointer(HourGlass!) 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 dwDAT*N_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 // Move all command buttons up cb_group.Move(cb_group.X, dw_1.Y + 225) cb_activity.Move(cb_activity.X, dw_1.Y + 225) cb_schedule.Move(cb_schedule.X, dw_1.Y + 225) cb_stream.Move(cb_stream.X, dw_1.Y + 225) cb_permit.Move(cb_permit.X, dw_1.Y + 225) cb_factor.move(cb_factor.x, dw_1.y + 225) f_highlight_DAT*Pbutton(r_buttons, cb_activity, "on") // Get source code and device code ls_source_code = dw_6.GetItemString(1, "code") ls_device_code = dw_7.GetItemString(1, "code") // Show uo_1 uo_act.uf_prepare_dw(gd_process_rid, is_level, is_style_state, & ls_source_code, ls_device_code, is_process_code, '') uo_act.Show() uo_act.BringToTop = TRUE uo_act.dw_act_detail.SetFocus() w_mdi_main.is_act_style = is_style_state end on on history_view;call w_master_detail::history_view;// User Event DAT*R // 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, ls_device_code if Not wf_check_pending() then return SetPointer(HourGlass!) 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 = FALSEDAT*T 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) r_1.X = dw_1.X - 15 r_1.Y = dw_1.Y - 15 // Move all command buttons up cb_group.Move(cb_group.X, dw_1.Y + 225) cb_activity.Move(cb_activity.X, dw_1.Y + 225) //cb_schedule.Move(cb_schedule.X, dw_1.Y + 225) cb_stream.Move(cb_stream.X, dw_1.Y + 225) cb_permit.Move(cb_permit.X, dw_1.Y + 225) cb_factor.move(cb_factor.x, dw_1.yDAT*V + 225) f_highlight_button(r_buttons, cb_activity, "on") // Get source code and device code ls_source_code = dw_6.GetItemString(1, "code") ls_device_code = dw_7.GetItemString(1, "code") // Show uo_1 uo_act.uf_prepare_dw(gd_process_rid, is_level, is_style_state, & ls_source_code, ls_device_code, is_process_code, '') uo_act.Show() uo_act.BringToTop = 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 > 0DAT*X then idwc_dw_child.SelectRow(il_selected_row, TRUE) end if end on public subroutine wf_retrieve_data ();DataWindowChild dwc long ll_row_num if gl_source_rid > 0 then if dw_6.Retrieve(gl_source_rid) > 0 then if dw_7.GetChild("id", dwc) = -1 then Beep(1) MessageBox(This.Title, "Application Error:~nDevice Id - " + & "Not a DataWindowChild in device context.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) if dwc.Retrieve(glDAT*Z_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_7.Retrieve(gl_device_rid) > 0 then dw_1.Retrieve(gl_device_rid) // dw_1.ScrollToRow(gl_cur_row) if gl_cur_row > 0 then ll_row_num = dw_1.Find('rid = ' + String(gl_cur_row), & 1, dDAT*\w_1.RowCount()) dw_1.ScrollToRow(ll_row_num) end if end if else dw_7.InsertRow(0) end if end if else dw_6.InsertRow(0) end if else dw_6.InsertRow(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, ls_device_code if dw_1.AcceptText() < 0 then return false if dw_2.AcceptText() < 0 then return false if dw_3.accepttext() < 0 thDAT*^en return false // Move to f_validate_act for checking recursively //if is_state = 'activity' then // if not f_check_dates(dw_2, "start_date_time", "end_date_time", "Start Date Time", "End Date Time") then // return false // end if //end if if Not f_validate_dev_pro(dw_1, dw_1.GetRow()) then return FALSE ll_total_row = dw_2.RowCount() for ll_cur_row = 1 to ll_total_row if is_state = "activity" then // Get source code and device code ls_source_codDAT*`e = dw_6.GetItemString(1, "code") ls_device_code = dw_7.GetItemString(1, "code") if Not f_validate_act(dw_2, ll_cur_row, is_level, ls_source_code, & ls_device_code, is_process_code, '') then return FALSE end if elseif is_state = 'schedule' then if Not f_validate_pro_schedule(dw_2, ll_cur_row) then return FALSE end if end if next return TRUE end function public subroutine wf_draw_dw2 ();long ll_master_rid //dw_2.DAT*bSetRedraw(FALSE) //dw_3.SetRedraw(FALSE) if dw_1.RowCount() > 0 then // Get the rid for process ll_master_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") if is_state = "activity" then // Only replace the datawindow object when the radiobutton 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_pro") dw_3.MDAT*dodify("metric_code.DDDW.Name=d_metrics_pro") end if f_highlight_button(r_buttons, cb_activity, "on") dw_2.Retrieve(ll_master_rid, is_level) dw_3.TriggerEvent(RowFocusChanged!) // Share data between dw_2 and dw_3 dw_2.ShareData(dw_3) elseif is_state = "schedule" then // if dw_2.DataObject <> is_schedule_dw then dw_2.DataObject = is_schedule_dw // dw_3.DataObject = is_schedule_dw_freeform SetTransObject(dw_2, SQLCA) // end if f_highlight_button(rDAT*f_buttons, cb_schedule, "on") if is_style_state = 'form' then // dw_3.Show() else dw_2.Show() // dw_2.SetFocus() end if dw_2.Retrieve(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) // Share data between dw_2 and dw_3 // dw_2.dwShareData(dw_3) end if end if //dw_2.SetRedraw(TRUE) //dw_3.SetRedraw(TRUE) //dw_2.Show() end subroutine public subroutine wf_set_var ();// Process has no member for now // memberDw = "d_pro_member" is_schedule_dw = "d_processDAT*h_schedules" is_schedule_dw_freeform = "d_process_schedules_freeform" is_activity_dw = "d_activity" is_activity_dw_freeform = "d_activity_freeform" is_level = "PRO" end subroutine public subroutine wf_general_view ();if is_state = 'activity' then uo_act.uf_check_pending() elseif is_state = 'group' then uo_group.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 dwDAT*j_1.Resize(dw_1.Width, ii_dw1_height) dw_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_group.Move(cb_group.X, ii_cb_y) cb_activity.Move(cb_activity.X, ii_cb_y) //cb_schedule.Move(cb_schedule.X, ii_cb_y) cb_stream.Move(cb_stream.X, ii_cb_y) DAT*l cb_permit.Move(cb_permit.X, ii_cb_y) cb_factor.Move(cb_factor.X, ii_cb_y) cb_schedule.Move(cb_schedule.X, ii_cb_y) // Enable all command buttons wf_enable_btn(TRUE) f_highlight_button(r_buttons, cb_activity, "off") // Make dw_2 and other user objects invisible dw_2.Hide() dw_3.Hide() uo_act.Hide() uo_group.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 publDAT*nic 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 is_enlarge_state = 'detail' f_menu_behave(is_state, is_style_state, is_enlarge_state) // Shrink the dw_1 and put a vertical scrollbar on it 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 tDAT*phe 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_group.Move(cb_group.X, dw_1.Y + 225) cb_activity.Move(cb_activity.X, dw_1.Y + 225) cb_stream.Move(cb_stream.X, dw_1.Y + 225) cb_permit.Move(cb_permit.X, dw_1.Y + 225) cb_factor.Move(cb_factor.X, dw_1.Y + 225) cb_schedule.Move(cb_schedule.X, dw_1.Y + 225) // Make dw_2 and all other user objects off dw_2.Hide() dw_3.Hide() r_2.Hide() uo_act.Hide() DAT*r uo_group.Hide() 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 if is_state = 'activity' then OpenWithParm(w_filter, 'rap_activities') end if else OpenWithParm(w_filter, 'rap_processes') end if // If filter flag is set to true, then trigger the filter event to perform // filter if gb_filter then gb_filter = FALDAT*tSE This.TriggerEvent("filter") end if end subroutine public subroutine wf_undo_uo ();string ls_source_code, ls_device_code // This function retrieve data for the user object based on the reselected // information on the general info area if uo_group.Visible then uo_group.uf_retrieve_select_list(dw_1.GetItemNumber(dw_1.GetRow(), "rid"), gl_source_rid) uo_group.uf_retrieve_group_member(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) end if if uo_act.Visible then // Get sourceDAT*v code and device code ls_source_code = dw_6.GetItemString(1, "code") ls_device_code = dw_7.GetItemString(1, "code") uo_act.uf_prepare_dw(gd_process_rid, is_level, is_style_state, & ls_source_code, ls_device_code, is_process_code, '') 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 // Source ls_Rid = dw_6.GetText() if ls_Rid = "" thenDAT*x lb_Check = FALSE // Device ls_Rid = dw_7.GetText() if ls_Rid = "" then lb_Check = FALSE return lb_Check end function public subroutine wf_enable_btn (boolean pb_enable);cb_group.Enabled = pb_enable cb_activity.Enabled = pb_enable cb_stream.Enabled = pb_enable cb_permit.Enabled = pb_enable cb_schedule.Enabled = pb_enable cb_factor.Enabled = pb_enable end subroutine public function boolean wf_check_rid (datawindow dw_obj);long ll_row_num, ll_cur_row, ll_rid_num, ll_rid, ll_scheDAT*zd_rid string ls_year, ls_beg_mon_no, ls_end_mon_no, ls_beg_date_code, & ls_end_date_code, ls_beg_hour_no, ls_end_hour_no ll_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") 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 // 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 values for not null fields DAT*| if dw_obj.ClassName() = "dw_1" then dw_obj.SetItem(ll_cur_row, "device_rid", gl_device_rid) dw_obj.SetItem(ll_cur_row, "rid", ll_rid_num ) elseif dw_obj.classname() = "dw_2" then if is_state = "activity" then dw_obj.SetItem(ll_cur_row, "ref_rid", ll_rid) dw_obj.SetItem(ll_cur_row, "metric_level_type", is_level) dw_obj.SetItem(ll_cur_row, "creation_date_time", today()) dw_obj.SetItem(ll_cur_row, "user_id", gs_user_id) if Left(sqlca.dbms, 2) <> 'OR' then DAT*~ if Not f_check_dup_act(dw_obj, ll_rid, is_level) then return FALSE end if dw_obj.SetItem(ll_cur_row, "rid", ll_rid_num ) elseif is_state = "schedule" then if Left(sqlca.dbms, 2) <> 'OR' then ls_year = dw_2.GetItemString(ll_cur_row, 'year') ls_beg_mon_no = dw_2.GetItemString(ll_cur_row, 'begin_month_no') ls_end_mon_no = dw_2.GetItemString(ll_cur_row, 'end_month_no') ls_beg_date_code = dw_2.GetItemString(ll_cur_row, 'begin_day_date_code') ls_end_date_code = DAT*dw_2.GetItemString(ll_cur_row, 'end_day_date_code') ls_beg_hour_no = dw_2.GetItemString(ll_cur_row, 'begin_hour_no') ls_end_hour_no = dw_2.GetItemString(ll_cur_row, 'end_hour_no') ll_sched_rid = f_get_pro_schedule_rid(ll_rid, ls_year, ls_beg_mon_no, ls_end_mon_no, & ls_beg_date_code, ls_end_date_code, ls_beg_hour_no, ls_end_hour_no) if ll_sched_rid > 0 then MessageBox('Process Schedule', 'Year, Begin Month No, End Month No, ' + & 'Begin Day Date Code, End DayDAT* Date Code, Begin Hour No and ' + & 'End Hour No must be unique in the table.~nNo changes made to the database') return FALSE elseif ll_sched_rid < 0 then return FALSE end if end if dw_obj.SetItem(ll_cur_row, "rid", ll_rid_num ) dw_obj.SetItem(ll_cur_row, "process_rid", ll_rid) end if end if else // If the activity record is updated. if dw_obj.GetItemStatus(ll_cur_row, 0, Primary!) <> NotModified! then if dw_obj.DataObject = 'd_actiDAT*vity' then dw_obj.SetItem(ll_cur_row, "creation_date_time", today()) dw_obj.SetItem(ll_cur_row, "user_id", gs_user_id) if Left(sqlca.dbms, 2) <> 'OR' then if Not f_check_dup_act(dw_obj, ll_rid, is_level) then return FALSE end if elseif dw_obj.ClassName() = 'dw_2' and is_state = 'schedule' then if Left(sqlca.dbms, 2) <> 'OR' then ls_year = dw_2.GetItemString(ll_cur_row, 'year') ls_beg_mon_no = dw_2.GetItemString(ll_cur_row, 'begin_month_no') ls_end_moDAT*n_no = dw_2.GetItemString(ll_cur_row, 'end_month_no') ls_beg_date_code = dw_2.GetItemString(ll_cur_row, 'begin_day_date_code') ls_end_date_code = dw_2.GetItemString(ll_cur_row, 'end_day_date_code') ls_beg_hour_no = dw_2.GetItemString(ll_cur_row, 'begin_hour_no') ls_end_hour_no = dw_2.GetItemString(ll_cur_row, 'end_hour_no') ll_sched_rid = f_get_pro_schedule_rid(ll_rid, ls_year, ls_beg_mon_no, ls_end_mon_no, & ls_beg_date_code, ls_end_date_code, ls_beg_hour_no, ls_endDAT*_hour_no) if ll_sched_rid > 0 and ll_sched_rid <> dw_2.GetItemNumber(ll_cur_row, 'rid') then MessageBox('Process Schedule', 'Year, Begin Month No, End Month No, ' + & 'Begin Day Date Code, End Day Date Code, Begin Hour No and ' + & 'End Hour No must be unique in the table.~nNo changes made to the database') return FALSE elseif ll_sched_rid < 0 then return FALSE end if end if end if end if end if next return TRUE end function pDAT*ublic 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 event activate;call super::activate; // If this window is activated by double-clicked from the device window // then, refresh the data if gb_double_click then gb_double_click = FALSE wf_retrieve_data() end if //if dw_1.RowCount(DAT*) > 0 then // gd_process_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") //end if end event on open;call w_master_detail::open; // Set up variable for handling menu behavior is_state = 'master' //gb_process_open = TRUE f_window_count("process") // 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_group.Y wf_set_var() dw_1.SetTransObject(SQLCA) // The following codes handle the context area foDAT*r selecting specific // geographic, source and device dw_6.SetTransObject(SQLCA) dw_7.SetTransObject(SQLCA) wf_retrieve_data() dw_1.PostEvent(GetFocus!) end on on close;call w_master_detail::close;if wf_check_pending() then if is_state = 'activity' then uo_act.uf_check_pending() elseif is_state = 'group' then uo_group.uf_check_pending() end if f_window_close("process") //if Not (gb_geo_open or gb_source_open or gb_device_open) then // gl_gDAT*eo_rid = 0 // gl_source_rid = 0 // gl_device_rid = 0 //elseif gb_geo_open and (Not (gb_source_open or gb_device_open)) then // gl_source_rid = 0 // gl_device_rid = 0 //elseif gb_geo_open and gb_source_open and (Not gb_device_open) then // gl_device_rid = 0 //end if // //gd_process_rid = 0 //gb_process_open = FALSE setnull(gs_scc_ams_code) end if end on on clicked;call w_master_detail::clicked;//if not (isnull(is_old_value) or is_old_value = "") then //if is_state DAT*= 'activity' then //if idw_active = dw_1 then // if is_column_name = "code" or is_column_name = "mode_type" or is_column_name = "primary_material_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 //elseif idw_active = dw_2 then // if is_column_name = "material_code" or is_column_name = "metric_code" or & // is_column_name = "value_unit_code" or is_column_name = "metDAT*hod_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 idw_active = dw_3 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_columnDAT*_name, is_old_value) // f_dddw_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_process.create int iCurrent call super::create this.cb_group=create cb_group this.cb_activity=create cb_activity this.cb_permit=create cb_permit this.cb_stream=create cb_stream this.uo_act=create uo_act this.cb_factor=create cb_factor this.uo_group=create uo_group this.r_buttons=create r_buttons this.cb_schedule=create cb_scDAT*hedule this.dw_6=create dw_6 this.dw_7=create dw_7 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_group this.Control[iCurrent+2]=this.cb_activity this.Control[iCurrent+3]=this.cb_permit this.Control[iCurrent+4]=this.cb_stream this.Control[iCurrent+5]=this.uo_act this.Control[iCurrent+6]=this.cb_factor this.Control[iCurrent+7]=this.uo_group this.Control[iCurrent+8]=this.r_buttons this.Control[iCurrent+9]=this.cb_schedule this.Control[iCurrent+10]=this.dw_6 this.ConDAT*trol[iCurrent+11]=this.dw_7 end on on w_process.destroy call super::destroy destroy(this.cb_group) destroy(this.cb_activity) destroy(this.cb_permit) destroy(this.cb_stream) destroy(this.uo_act) destroy(this.cb_factor) destroy(this.uo_group) destroy(this.r_buttons) destroy(this.cb_schedule) destroy(this.dw_6) destroy(this.dw_7) end on type dw_3 from w_master_detail`dw_3 within w_process event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=37 int Y=532 int Width=2784 iDAT*nt Height=876 int TabOrder=0 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 //if is_state = 'activity' then //if is_colDAT*umn_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 //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_selecDAT*ted_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 if end on 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) il_selected_row = f_dddw_search(this, idwc_dw_child, is_child_nDAT*ame, 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 long ll_cur_row ls_col_name = This.GetColumnName() // Call the function to retrieve code values //f_act_dddw_retrieve(This, Parent, is_level, 'PRO') //string code_value //code_value = dw_1.getitemstring(dw_1.getrow(), "code") //f_act_dddw_retrieve(This, Parent, is_level, code_value) DAT* string ls_source, ls_device, ls_process, ls_stream ll_cur_row = dw_6.GetRow() if ll_cur_row > 0 then ls_source = dw_6.getitemstring(ll_cur_row, "code") end if ll_cur_row = dw_7.GetRow() if ll_cur_row > 0 then ls_device = dw_7.getitemstring(ll_cur_row, "code") end if ll_cur_row = dw_1.GetRow() if ll_cur_row > 0 then ls_process = dw_1.getitemstring(ll_cur_row, "code") end if ls_stream = "" if ls_col_name = "metric_code" then //dw_3.dwModify("metric_code.DDDW.Name=d_meDAT*trics_pro") f_retrieve_metric_codes(parent, this, is_level, ls_source, ls_device, ls_process, ls_stream) elseif ls_col_name = "group_type" then f_retrieve_group_types(parent, this, "PRO") 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 DAT*f_act_dddw_retrieve(This, Parent, is_level, ls_device) end if //DataWindowChild dwc // // //choose case ls_col_name // case "material_code", "value_unit_code" // f_retrieve_codes(Parent.Title, This, ls_col_name, "code") // case "metric_code" // f_retrieve_metric_codes(Parent, This, is_level, 'PRO') // case "method_type", "value_type" // f_retrieve_codes(Parent.Title, This, ls_col_name, "type") //end choose //if is_state = 'activity' then if ls_col_name = "material_cDAT*ode" 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_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_valDAT*idation_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_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 DAT*= 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 valid 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_cDAT*hild) 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 = "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 - RefDAT*erence Type" is_msg_text = "Sorry! Not a valid reference type" is_old_value = dw_3.getitemstring(dw_3.getrow(), ls_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 coDAT*de" is_old_value = dw_3.getitemstring(dw_3.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" is_msg_text = "Sorry! Not a valid data code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) else is_column_name = "" end if //end if end event event dw_3::iteDAT*mchanged;call super::itemchanged; string ls_col_name DataWindowChild dwc ls_col_name = This.GetColumnName() choose case ls_col_name 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 // DAT*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' then This.GetChild(ls_col_name, dwc) This.SetItem(This.GetRow(), 'value_unit_code', & dwc.GetItemString(dwc.GetRow(), 'unit_code')) end if end event 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, & DAT*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_3.setitem(dw_3.getrow(), is_column_name, & // idwc_dw_child.getitemstrDAT*ing(il_selected_row, is_child_name)) //// dw_3.triggerevent(editchanged!) //end if //end if //end if // dw_3.triggerevent(editchanged!) 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;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_3::itemerror;call super::itemerror;return 2 end event type dw_2 fDAT*rom w_master_detail`dw_2 within w_process event dwescape pbm_dwescape event dwnkey pbm_dwnkey int X=37 int Y=532 int Width=2784 int Height=896 int TabOrder=40 boolean Visible=false string Tag="Member information (tabular view)" string DataObject="d_process_schedules" 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(), isDAT*_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_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_nameDAT*, 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 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::editchanged;call super::editchanged;sDAT*tring ls_col_name ls_col_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::itemfocuschanged;call super::itemfocuschanged;string ls_col_name, ls_source, ls_device, ls_process, ls_stream long ll_cur_row string ls_begin_mo, ls_end_mo lDAT*s_col_name = This.GetColumnName() // Call the function to retrieve code values //f_act_dddw_retrieve(This, Parent, is_level, 'PRO') //string code_value //code_value = dw_1.getitemstring(dw_1.getrow(), "code") // //dw_obj.dwModify("metric_code.DDDW.Name=d_metrics_pro") //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(ll_cur_row, "code") end if ll_cur_row = dw_7.GetRow() if ll_cur_row > DAT*0 then ls_device = dw_7.getitemstring(ll_cur_row, "code") end if ll_cur_row = dw_1.GetRow() if ll_cur_row > 0 then ls_process = dw_1.getitemstring(ll_cur_row, "code") end if ls_stream = "" if ls_col_name = "metric_code" then //dw_2.Modify("metric_code.DDDW.Name=d_metrics_pro") f_retrieve_metric_codes(parent, this, is_level, ls_source, ls_device, ls_process, ls_stream) elseif ls_col_name = "group_type" then f_retrieve_group_types(parent, this, "PRO") elseif ls_col_name = DAT*"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 //DataWindowChild dwc // // //choose case ls_col_name // case "material_code", "value_unit_code" // f_retrieve_codes(Parent.Title, This, ls_DAT*col_name, "code") // case "metric_code" // f_retrieve_metric_codes(Parent, This, is_level, 'PRO') // case "method_type", "value_type" // f_retrieve_codes(Parent.Title, This, ls_col_name, "type") //end choose if is_state = 'schedule' then // // if ls_col_name = "year" then // il_selected_row = 0 // dwgetchild(ls_col_name, idwc_dw_child) // is_column_name = ls_col_name // is_child_name = "year" // is_validation_table = "" // is_msg_name = "Year" //DAT* is_msg_text = "Sorry! Not a valid Year" // is_old_value = dw_2.getitemnumber(dw_2.getrow(), ls_col_name) // elseif ls_col_name = "code" then // il_selected_row = 0 // // is_filt = "" // dwgetchild(ls_col_name, idwc_dw_child) // is_column_name = ls_col_name // is_child_name = "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 = dDAT*w_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_materials" 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 = "metric_code" then DAT* 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_selected_row = 0 getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_tablDAT*e = "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 = "type" 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.getitemstDAT*ring(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! Not a valid value type" is_old_value = dw_2.getitemstring(dw_2.getrow(), ls_col_name) elseif ls_col_name = "reference_type" then il_selected_row = 0 getchild(ls_col_name, idwc_dw_child) isDAT*_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 is_child_name = "code" is_validation_table = "rap_reference_codes" is_msg_name = "Column - ReDAT*ference 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" is_msg_text = "Sorry! Not a valid data code" is_old_value = This.getitemstring(This.getrow(), ls_col_name) else is_columDAT*n_name = "" end if end if end event event dw_2::itemchanged;call super::itemchanged; string ls_col_name DataWindowChild dwc ls_col_name = This.GetColumnName() choose case ls_col_name 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_selecDAT*ted_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' then This.GetChild(ls_col_name, dwc) This.SetItem(This.GetRow(), 'value_unit_code', & dwc.GetItemString(dwc.GetRow(), 'unit_code')) end if end event event dw_2::itemerror;call super::itemerror;if is_state = 'schedule' then return 0 else return 2 end if end event on dw_2::add_row;call w_maDAT*ster_detail`dw_2::add_row;if is_state = "activity" then This.SetItem(This.GetRow(), "user_id", gs_user_id) This.SetItem(This.GetRow(), "creation_date_time", today()) This.ib_obj_modified = TRUE // Not sure if this is right 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.setitem(this.getrow(), is_column_name, & idwc_dw_child.getitemstring(il_selectedDAT*_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(), is_column_name, & // idwc_dw_child.getitemstring(il_selected_row, is_child_name)) ///DAT*/ dw_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 type dw_1 from w_master_detail`dw_1 within w_process event dwescape pbm_dwescape event closedropdown pbm_dwclosedropdown event dwnkey pbm_dwnkey int X=37 int Y=212 int Width=2784 int Height=816 int TabOrder=30 string Tag="General information" string DataObject="d_process" end type on dw_1::dwescape;call w_master_detail`DAT*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 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() DAT*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::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_DAT*row = idwc_dw_child.GetRow() end if end if if ls_col_name = "scc_ams_code" then 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 end if end if if ls_col_name = "scc_ams_code" then gs_scc_ams_code = dw_1.getitemstring(dw_1.getrow(), "scc_ams_code") end if if ls_col_name = "primary_material_code" then gs_material = dw_1.getitemstring(dw_1.getrow(), "primary_mateDAT*rial_code") end if end event event dw_1::rbuttondown;call super::rbuttondown;string ls_process_code, ls_sql, ls_scc_ams_code string ls_obj_name_str, ls_obj_name long ll_cur_row //gb_process_clicked = true 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, " + & "device_code, material_code, process_code, " + & "source_coDAT*de, type, epa_invalid_flag, inventory_invalid_flag, " + & "mode_type, tier_code, unit_code " + & "from rap_scc_ams_codes" if this.rowcount() > 0 then this.accepttext() ll_cur_row = This.GetRow() 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 = lDAT*s_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 //gb_process_clicked = false //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 " + & // "from rap_scc_ams_codes order by code") then // DAT* This.ib_obj_modified = TRUE //end if end event event dw_1::clicked;call super::clicked;string ls_process_code, ls_sql, ls_scc_ams_code string ls_obj_name_str, ls_obj_name long ll_cur_row //gb_process_clicked = true 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, " + & DAT* "source_code, type, epa_invalid_flag, inventory_invalid_flag, " + & "mode_type, tier_code, unit_code, nei_material_id, material_io_code " + & "from rap_scc_ams_codes" ll_cur_row = row 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.GetItemString(ll_cur_row, 'scc_DAT*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 //gb_process_clicked = false //gb_process_clicked = true //if f_look_up(This, "scc_ams_code_t", "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_fDAT*lag " + & // "from rap_scc_ams_codes order by code") then // This.ib_obj_modified = TRUE //end if //gb_process_clicked = false end event on dw_1::rowfocuschanged;call w_master_detail`dw_1::rowfocuschanged;long ll_cur_row string ls_source_code, ls_device_code //// Only draw dw_2 when the activity button is clicked //if is_current_btn = 'Activity' then // wf_draw_dw2() //end if if ( dw_1.RowCount() > 0 ) and ( dw_1.GetRow() > 0 )then wf_enable_btn(TRUE) gs_scc_ams_code = DAT*dw_1.getitemstring(dw_1.getrow(), "scc_ams_code") gs_material = dw_1.getitemstring(dw_1.getrow(), "primary_material_code") gd_process_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") is_process_code = dw_1.GetItemString(dw_1.GetRow(), "code") // if rid is null, this means the current row is the new inserted row // then reset the dw_2 if IsNull(dw_1.GetItemNumber(dw_1.GetRow(), "rid")) then dw_2.Reset() end if else gd_process_rid = 0 // Clean the activity datawindow DAT*buffer dw_2.Reset() wf_enable_btn(FALSE) end if if is_state = "group" then uo_group.uf_check_pending() uo_group.uf_retrieve_select_list(gd_process_rid, gl_source_rid) uo_group.uf_retrieve_group_member(gd_process_rid) // Only draw dw_2 when the activity button is clicked elseif (is_state = 'activity' and Not uo_act.Visible) then wf_draw_dw2() elseif is_state = 'schedule' then wf_draw_dw2() end if // If uo_act is visible, then check if there is any modification in uo_DAT*act. // When checking is done, retrieve the dw_act_master data based on the // new values. if uo_act.Visible then if uo_act.uf_check_pending() then SetPointer(HourGlass!) // Get source code and device code ls_source_code = dw_6.GetItemString(1, "code") ls_device_code = dw_7.GetItemString(1, "code") uo_act.uf_prepare_dw(gd_process_rid, is_level, is_style_state, & ls_source_code, ls_device_code, is_process_code, '') end if end if end on event dw_1::itemfocuschanged;caDAT*ll 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 = "group_type" then f_retrieve_group_types(parent, this, "PRO") elseif ls_col_name = "code" or ls_col_name = "primary_material_code" or & ls_col_name = "weekly_schedule_code" or ls_col_name = "daily_schedule_code" or & ls_col_name = "yearly_schedule_code" then f_retrieve_codesDAT*(Parent.Title, dw_1, ls_col_name, "code") end if if ls_col_name = "code" then il_selected_row = 0 is_filt = "" 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_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "mode_type" then il_selected_row = 0 is_filt = "" GetchildDAT*(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_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "primary_material_code" then il_selected_row = 0 is_filt = "" Getchild(ls_col_name, idwc_dw_child) is_column_name = ls_col_name is_child_name = "code" is_validation_table = "rap_materials" DAT*is_msg_name = "Column - Code" is_msg_text = "Sorry! Not a valid material code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "weekly_schedule_code" then il_selected_row = 0 is_filt = "" 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" DAT* is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "daily_schedule_code" then il_selected_row = 0 is_filt = "" 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 Operating Schedule" is_msg_text = "Sorry! Not a valid daily schedule code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name DAT* = "group_type" then il_selected_row = 0 is_filt = "" 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_1.getitemstring(dw_1.getrow(), ls_col_name) elseif ls_col_name = "yearly_schedule_codes" then il_selected_row = 0 is_filt = "" Getchild(ls_col_name, idwc_dw_child) is_column_name =DAT*  ls_col_name is_child_name = "code" is_validation_table = "rap_operating_yearly_schedules" is_msg_name = "Column - Yearly Schedule Code" is_msg_text = "Sorry! Not a valid yearly schedule code" is_old_value = dw_1.getitemstring(dw_1.getrow(), ls_col_name) else is_column_name = "" end if end event on dw_1::save;call w_master_detail`dw_1::save; string ls_source_code, ls_device_code // If save failed, get out of the function if Not ib_save_ok then return // If uo_acDAT*t is visible, retrieve the dw_act_master data based on the // new values. if uo_act.Visible then SetPointer(HourGlass!) // Get source code, device code and process code ls_source_code = dw_6.GetItemString(1, "code") ls_device_code = dw_7.GetItemString(1, "code") uo_act.uf_prepare_dw(gd_process_rid, is_level, is_style_state, & ls_source_code, ls_device_code, is_process_code, '') end if end on on dw_1::updateend;call w_master_detail`dw_1::updateend;if This.RowCount() > 0 thenDAT* gd_process_rid = This.GetItemNumber(This.GetRow(), "rid") is_process_code = This.GetItemString(This.GetRow(), "code") else gd_process_rid = 0 SetNull(is_process_code) 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("highlightDAT*_dddw") end if end if //string ls_col_name // // if is_column_name = "code" or is_column_name = "mode_type" or is_column_name = "primary_material_code" or & // is_column_name = "weekly_schedule_code" or is_column_name = "daily_schedule_code" or & // is_column_name = "group_type" then // il_selected_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 dDAT*ddw, 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 = "code" or ls_col_name = "mode_type" or & // ls_col_name = "weekly_schedule_code" or ls_col_name = "daily_schedule_code" or & // ls_col_name = "group_type" then // if Not f_validate_code(This.GetText(), is_child_name, is_validation_table) then // iDAT*s_column_status = ls_col_name // else // is_column_status = "valid" // end if //else // is_column_status = "valid" //end if end on 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 event evDAT*ent 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 type r_1 from w_master_detail`r_1 within w_process int X=32 int Y=196 end type type r_2 from w_master_detail`r_2 within w_process int X=32 int Y=900 end type type cb_group from commandbutton within w_process int X=41 int Y=1072 int Width=357 int Height=80 string Tag="Show group informatiDAT*on" 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 the size of dw_1, move buttons and display group user DAT*object wf_detail_view() uo_group.uf_retrieve_select_list(dw_1.GetItemNumber(dw_1.GetRow(), "rid"), gl_source_rid) uo_group.uf_retrieve_group_member(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_process int X=658 int Y=1072 int Width=357 int Height=80 string Tag="Show activity current view" boolean BringToTop=true string Text="Activity" int TDAT*extSize=-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 SetPointer(HourGlass!) wf_enable_btn(TRUE) // Change the attributes of menu items is_state = 'activity' //is_style_state = 'list' //f_menu_behave(is_state, is_style_state, is_eDAT* nlarge_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("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!) eDAT*"nd choose f_highlight_button(r_buttons, this, "on") end on type cb_permit from commandbutton within w_process int X=1266 int Y=1180 int Width=357 int Height=80 int TabOrder=50 boolean Visible=false string Tag="Open permit window" boolean BringToTop=true string Text="Permit" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type event clicked;SetPointer(HourGlass!) if Not wf_check_pending() then reDAT*$turn SetPointer(HourGlass!) wf_enable_btn(TRUE) // Open permit window OpenSheet(w_permit, w_mdi_main, 0, Layered!) end event type cb_stream from commandbutton within w_process int X=1280 int Y=1072 int Width=357 int Height=80 string Tag="Open stream window" boolean BringToTop=true string Text="Stream" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type event clicked;//DataWindowChild dwc SDAT*&etPointer(HourGlass!) if Not wf_check_pending() then return SetPointer(HourGlass!) wf_enable_btn(TRUE) // Open the steam window gd_process_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") OpenSheet(w_stream, w_mdi_main, 0, Layered!) end event type uo_act from u_dw_act_pro within w_process int X=0 int Y=340 boolean Visible=false boolean Border=false BorderStyle BorderStyle=StyleBox! end type on highlight_dddw;if uil_selected_row > 0 then uidwc_dw_child.SelectRow(uil_selecDAT*(ted_row, TRUE) end if end on on uo_act.destroy call u_dw_act_pro::destroy end on type cb_factor from commandbutton within w_process int X=1897 int Y=1072 int Width=338 int Height=80 boolean BringToTop=true string Text="Factor" int TextSize=-8 int Weight=700 string FaceName="MS Sans Serif" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type event clicked;SetPointer(HourGlass!) if Not wf_check_pending() then return SetPointer(HourGlass!) wf_enable_btn(DAT**TRUE) // Open the source specific factor window gd_process_rid = dw_1.GetItemNumber(dw_1.GetRow(), "rid") gs_scc_ams_code = dw_1.getitemstring(dw_1.getrow(), "scc_ams_code") gs_material = dw_1.getitemstring(dw_1.getrow(), "primary_material_code") //OpenSheetwithparm(w_emission_factor_s, "S", w_mdi_main, 0, Layered!) m_main_menu.m_data.m_emissionestimation.TriggerEvent(Clicked!) end event type uo_group from u_dw_group_pro within w_process int X=46 int Y=548 boolean Visible=false eDAT*,nd type on uo_group.destroy call u_dw_group_pro::destroy end on type r_buttons from rectangle within w_process int X=448 int Y=1052 int Width=160 int Height=144 boolean Visible=false boolean Enabled=false int LineThickness=4 long LineColor=12632256 long FillColor=32768 end type type cb_schedule from commandbutton within w_process int X=2478 int Y=1072 int Width=338 int Height=80 boolean BringToTop=true string Text="Schedule" int TextSize=-8 int Weight=700 string FaceNDAT*.ame="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) is_state = 'schedule' is_style_state = 'list' is_enlarge_state = 'detail' // Change the size of dw_1, move buttons and draw dw_2 wf_detail_view() wf_draw_dw2() f_menu_behave(is_state, is_style_state, is_enlarge_state) f_highlight_button(r_buttons, this, "on") dw_2.DAT*0SetFocus() end on type dw_6 from u_dddw within w_process int X=18 int Y=16 int Width=2853 int Height=80 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 integer i ls_data = This.GetText() // Do not retrieve data if the value does not change if ls_data = is_old_value then return // Blank out value and hit enter wilDAT*2l 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_6.GetChild("id", dwc) = -1 then MessageBox("Source Context", "Application Error:~nSource Name - " + & "Not a DataWindowChild.~nContact your technicalDAT*4 support.") return end if // Put source code and name in the context area dw_6.SetItem(1, "code", dwc.GetItemString(dwc.GetRow(), "code")) dw_6.SetItem(1, "name", dwc.GetItemString(dwc.GetRow(), "name")) gl_source_rid = dwc.GetItemNumber(dwc.GetRow(), "rid") if gl_source_rid > 0 then if dw_7.GetChild("id", dwc) = -1 then MessageBox("Device Context", "Application Error:~nDevice ID - " + & "Not a DataWindowChild.~nContact your technical support.") return end if dDAT*6wc.SetTransObject(SQLCA) if dwc.Retrieve(gl_source_rid) = 0 then dwc.Reset() dw_7.Reset() dw_1.Reset() dw_2.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 if ls_data = is_old_value then return // Device name list has been changed based on the source name, // so let user pick the device name dw_7.Retrieve(0) dw_7.InDAT*8sertRow(0) dw_1.Reset() dw_2.Reset() end if // Only perform the following fix when ENTER or TAB is used. 11/22/94, swj if ib_enter_or_tab then // JNS - 11/18/94 the following code was necessary to force PowerBuilder to // generate a GetFocus event for the Device Context when pressing TAB or ENTER i = w_process.SetFocus() i = dw_7.SetFocus() ib_enter_or_tab = FALSE end if end if end event on getfocus;call u_dddw::getfocus;is_child_name = 'id' is_vaDAT*:lidation_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 if is_state = 'activity' then uo_act.uf_check_pending() elseif is_state = 'group' then uo_group.uf_check_pending() end if return 0 end if end event type dw_7 from u_dddw within w_process int X=18 int Y=96 int Width=2853 int Height=80 int TabOrder=20 string DDAT*<ataObject="d_device_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 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_datDAT*>a = '' or IsNull(ls_data) then MessageBox('Context Error', 'Device Id is required') ib_check_required = TRUE This.SetFocus() return end if if dw_7.GetChild("id", dwc) = -1 then MessageBox("Device Context", "Application Error:~nDevice Name - " + & "Not a DataWindowChild.~nContact your technical support.") return end if // Put device code and name in the context area dw_7.SetItem(1, "code", dwc.GetItemString(dwc.GetRow(), "code")) dw_7.SetItem(1, "name", dwc.GetItemString(dDAT*@wc.GetRow(), "name")) gl_device_rid = dwc.GetItemNumber(dwc.GetRow(), "rid") if dw_1.Retrieve(gl_device_rid) = 0 then dw_2.Reset() dw_2.TriggerEvent(Rowfocuschanged!) end if dw_1.TriggerEvent(Rowfocuschanged!) if gl_device_rid = 0 then dw_2.Reset() dw_2.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 DAT*Id' end on event clicked;call super::clicked;if not wf_check_pending() then return 1 else if is_state = 'activity' then uo_act.uf_check_pending() elseif is_state = 'group' then uo_group.uf_check_pending() end if return 0 end if end event FRE*DAT*F5<1id0. 0. rap_devices_idgetitemstring#setitemP<<1code0. 0. rap_devices_code0#P<<1name0. 0. rap_devices_name#P<0. reset/0. retrieve2 ( 8 P           4 D L \ d l      DAT*H        26/8)$8<$)L8d$6$68#$6$6@81$)888)81<$68 8Gz%@8,!1,!$DAT*J$$)88)88)8)8$$)88)88$),8)48<$P$8XTh$p$)x88)88J8;)8$$)88,%)8$$)88)88J 8DAT*L;)8$$$),884,%)T8,!1&,!\$(@Z $R$%'*P+T-0dQ rowdwodataancestorreturnvaluels_col_namedwc::messagegl_device_rid  ) 5 (9!@3C%@d itemchDAT*Nangedgetcolumnname8is_column_name,CgettextDis_child_name!TEis_validation_tablel=is_msg_name?is_msg_text@il_selected_rowAidwc_dw_childenB(getrowbrap_devices_idgetchildotitle Application Error: Agency Device Id - Not a DataWindowChild. Contact your technical support.dw_1. . rap_devices_namebnamegetitemstring[setitemP. . DAT*Prap_devices_code bcode[P. dataobjectDd_connect_from. . ridbgetitemnumberWO. . rap_connections_to_device_ridO. . bWO. . rap_connections_from_device_ridO$ < L d                DAT*R    , 4 < P h p x                $ , T \ )84$)D8)T8)h8)8:NW@)89}$)8,!1,!$0Rd | dDAT*T" +wparam+lparam::message< !@3X wf_insert_oketcst_no_record_greyum +hide<getrowLinsertrow(\scrollpriorrow>ptriggerevent ib_obj_modifiedst_no_record_whitee*< 4 D T h       D)810$<$L$DAT*VT$\$<<Y5hIk@Vt$$$$<<Y5Ik@V)8$)8$)8,!*18,!$ d +rowcount::message(!@3 rowcount_ok4st_no_record_whitee*x8widthD*D@ypheightDAT*X|*|)@move,*show*hide 0 < L T \ ht          18)(880>80)H81<X$68`8z%@8,!1,!$18)DAT*Z88>,$)8,",%) 880Z$1<)D8\6t80808080 $$$)48)<8tD8L0,!1,!P$ 8Lz  ">RhDAT*\VZ td` rowdwoancestorreturnvaluels_col_namedwc::messagesqlcagl_source_ridgl_device_rid $ 0 (4!@3>$@4D"@R%@X itemfocuschangedgetcolumnnamedrap_devices_idgetchildo?titleP Application Error: Agency Device Id - Not a DataWindowChild. Contact your technical sDAT*^upport.idgetitemstring[0settransobjectretrieve}il_selected_rowAidwc_dw_child,B(o?is_column_nameLCis_child_namedEis_validation_table|=rap_devicesis_msg_name?Column - Device Idis_msg_text@Sorry! Not a valid device idis_old_valueDdw_1. . getrow,LC( H X      $ < D \DAT*` t       $ 4 < D P 6-8)$8<$Tl$**$6 8$180)8,!1,!$(@Z dB +row+dwo+dataancestorreturnvaluels_col_name::messagexDAT*b  , 8!@3H editchangedgetcolumnnameis_column_name,Cil_selected_rowDAidwc_dw_child\B(is_child_nametEDADAhighlight_dddwpostevent!$ < T l      :6081d) rowdwodataancestorretDAT*durnvalueP   itemerror8($1)@8X$)h8p$$$$)8)8,!1,!$0Hb d2 ancestorreturnvaluels_col_name::message< DAT*f(!@3X dwnprocessenteril_selected_rowAgetcolumnname0is_column_nameHCgetrow`HCidwc_dw_childxB(Ais_child_nameEgetitemstring[setitemP( @ X h p       (-/019 OPQRSTcdef-&/102(89<.ADAT*h2 +dwescape+dwnkeyf_dddw_search+doubleclicked+itemchangedf_validate_code+add_row+retrieveend+itemfocuschanged+editchanged+itemerror+dwnprocessenter*(7D+T]j|* 2 - xywidthheighttaborderdataobjectxDAT*j6  Q"d] o6 Q @ d  P(gD,Px(DAT*l/ O9 1#- 080 ;( 2  2  ] `p 2  DAT*n 2  ] WD  :F@@8)8`)$8`4$D9}L9}d$8l08t$9)8$80$,$)8$,%)8$9)8$)8,!DAT*pz1,!$$. B `t$D`d& sqlcagl_device_rid::message<$@4%@!@3, wf_check_pendingl_s}}cb_totc,9,enabled<<r_connectionsT:.ondw_1o. setredraw!|o. dataobjectd_connect_fromo. settransobject^o. retrieve2o. !|o. setfocuDAT*rs $ 4 D L d t            $ """2 $ +clickedf_highlight_button((2 h xywidthheighttaborderenabledbringtotoptexttextsizeweightfacenamefontfamilyfontpitch T 6Q(DAT*t"*5s:CJS ^ ] oT6Q( @    sL(" :F@@8)8`)$8`4$D9}DAT*vL9}d$8l08t$9)8$80$,$)8$,%)8$9)8$)8,!z1,!$$. B `t$D`d& sqlcagl_device_rid::message<$@4%@!@3, wf_check_pendDAT*xing}}cb_from,8"enabled<<r_connectionsT:.ondw_1o. setredraw8!|o. dataobjectd_connect_too. settransobject^o. retrieve2o. !|o. setfocus $ 4 D L d t            $ ","2 $ +clickedf_highlight_button(DAT*z(2 ` xywidthheighttaborderbringtotoptexttextsizeweightfacenamefontfamilyfontpitch T 6Q2"-2;BK V ] oT6Q2 @  DAT*|  @L("2  2 K xywidthheightvisibleenabledlinethicknesslinecolorfillcolor2  1 !)7A] 2 1DAT*~#/8) 88$,!l1z,!@$\$d9})x8,!1,!$8"|8080@89})8,!h1v,!$$8)81<8088z%DAT*@8,!1 ,!T$\$18d)p88d)8)8$18)88)8)8")88J8,"1$8)81<8088z%@8,!z1,!8$,$)P8,")d81DAT*t)t8|$)8$)8%1$688z%:)@@89} $1)8$1)088$)@8,!1,!H$ 8 (<N|b!#$%2'`)*+,-./"1\2p5t67<db wparamlparamanDAT*cestorreturnvaluels_datadwc::messagegl_source_ridsqlcagl_device_rid * 2 (6!@3@"@N$@4T%@PP retrieve_datagettextis_old_value(#ib_check_required9H%H%setfocuslContext ErrorSource Id is requiredlonH%ldw_4llC;0idgetchildoSoDAT*urce ContextApplication Error: Source Name - Not a DataWindowChild. Contact your technical support.;0codegetrowbigetitemstring[xsetitemP;0namebi[xPbiridgetitemnumberWdw_5<1oDevice ContextApplication Error: Device Name - settransobject@retrieve}Xresetzl<1/ldw_1. /ltitle8 No devices available for this source name. PleaDAT*se select another source name.H%<12X<1insertrow($. /l 8 @ \ d x       T \ p           8 P d t |          0 8 @ H ./8 8(0DAT*@8H0`8h080,!1,!$2Lfd& ancestorreturnvalue::message(!@3( getfocusis_child_nameidis_validation_table+"rap_sourcesis_msg_nameT Column - Source Idis_msg_text{!Sorry! Not a valid Source Idlon @ `   DAT*$/8)$8#N1Z1,!t1,!,$>JNZd8 xposyposrowdwoancestorreturnvalue::messagex  .!@34 clickedwf_check_pending}$ , $0.00OPQ-/0$.2 * +retriDAT*eve_data+getfocus+clicked<!2 B xywidthheightdataobjectborderborderstylelivescroll = ]$+7] o= ] @ DAT*  (U \Qd(.Ltx$^/8)(8*)<81~,!j1x,!D$`$h9})|8,!1DAT*,!$)88"8080@89})8,!~1,!$8)81<"$688 z%@8,!1,!l$18t)88t)8)818)88)8)8%DAT*)88J8$,%)8$:NW@)08,!D1R,!8$ 4 ~ >Rd" j"$%(*dN wparamlparamancestorreturnvaluedwcls_data::messagegl_device_rid * (. 6!@3@%@@ DAT*retrieve_datawf_check_pending}rowcount40ib_check_requiredL%L%setfocuspgettextContext ErrorDevice Id is requiredL%pidgetchildotitle Application Error: Device Id - Not a DataWindowChild in device context. Contact your technical support. codegetrowbygetitemstring0[setitemPnameby[PbyridgetitemnumberWdw_1DAT*. retrieve2. triggerevent1 ( < D ` h |        l            0 8 ./8 8(0@8H0`8h080,!1,!$2Lfd&DAT* ancestorreturnvalue::message(!@3( getfocusis_child_nameidis_validation_table+"rap_devicesis_msg_nameT Column - Device Idis_msg_text{!Sorry! Not a valid Device Idvic @ `   $/8)$8#N1Z1,!t1,!,$>JNZd8 DAT*xposyposrowdwoancestorreturnvalue::messagex  .!@34 clickedwf_check_pending}$ , $1.11OPQ-/0$.2 * +retrieve_data+getfocus+clicked<!2 K xywidthheighttaborderdataobjectborderborderDAT*stylelivescroll  ]"-4@] o ] @   (DAT*U Qd(.Lx$DAT*@$8H)X8`$8h)|8$8J888!8!1"!,,88z%81<`9$8)8$8J 81"8(0890@8X$)l8t$)DAT*8$8h)8$)899,X   V` 6!X"x%dF pl_cur_rowll_process_ridls_src_idls_dev_idls_pro_idsqlcax" , 6 @@ dw_1-rap_sources_idgetitemstring'-rap_devices_id'DAT*-rap_processes_id'-process_ridgetitemnumberh@ Error selecting rid from rap_processes table. Contact your technical support.-setitemO- DataWindow ErrorSorry! Process Id is required@-setfocus `-setrowQ|-setcolumnH-scrolltorow? 8 @ X ` |        X l t    DAT*  " &88$08,P,lQt$|1$$6$)8$)8,1,$2FZ r dQ ancestorreturnvaluegl_source_ridgl_device_ridgd_process_rid::messaged@*@DAT*8~G@h openis_factor_type 4Fil_g_source_rid&@il_g_device_rid@Ail_g_process_ridXBXBXBdw_1- 4XBretrieve2-setfocus 8 P l t |        8d  create8dDAT*  destroy&FGOwPxQyRzX&.2 G wf_dwmodifywf_check_specialf_db_error+open+create+destroyx%06>2 M titlebartitleiconil_g_source_ridil_g_device_ridil_g_process_ridx,DAT*<] o.@   1 @@@    }DAT* 0x&6>2  2  ] wpH    DAT*  @2  2  ] wH @      @ 8)84$1DAT*x8<H$)X8p$1x$,`86)8$$1$,86)8$$1$,8 6)488<6)L8,1,T$ 8P xDAT* $Hd |"#&-d +wparam+lparamancestorreturnvaluell_cur_rowls_source_idls_device_idls_process_idls_scc_ams_codesqlca::message ,7 D Q _ o@u@\ add_rowgetrowil_g_process_rid Bprocess_rid BsetitemOPil_g_source_rid`DAT*@`@rap_sources_id+PPil_source_ridct>`@il_g_device_ridAArap_devices_idiPPil_device_rid?A B Brap_processes_idPPscc_ams_codePP 4 H X p x           4 L T  <8)$81)488<JX8DAT*1"#p,11,1,$8j dG +currentrowancestorreturnvaluell_process_ridsqlca::messaged(7@=@@ rowfocuschangedrowcount4getrow,process_ridgetitemnumber Hil_souDAT*rce_rid`>il_device_ridx?`>x?$ 4 X p     <OQRSTc-&/10279<.A2 " +add_row+rowfocuschanged(2  dataobject] % [  @ DAT*  W8 OlH<<8)84$1x8<H$)X8p$1x$,D86)8$$1$,DAT*86)8$$1$,48 6)488<6)L8,1,T$ 8 P x $Hd!|#$'.d +wparam+lparamancestorreturnvaluell_cur_rowls_source_idls_device_idls_process_idls_scc_ams_codesqlca::message DAT*,7 D Q _ o@u@\ add_rowgetrowil_g_process_rid Bprocess_rid BsetitemOPil_g_source_rid`@`@rap_sources_id@PPil_source_ridh@>`@il_g_device_ridAArap_devices_idPPil_device_rid?A B Brap_processes_idPPscc_ams_DAT*codect.PP 4 H X p x           4 L T  <8) 818(JD81"#\t,|11,1,$4D j DAT*dR +currentrowancestorreturnvaluell_process_ridll_cur_rowsqlca::messagex(7B@H@8 rowfocuschangedgetrowprocess_ridgetitemnumber 4il_source_rid8L>il_device_ridd?L>d? D \ t |   <OPQRSTc-&/102DAT*$79<.A2 " +add_row+rowfocuschanged(2  dataobject!] o% [   @ !@  W8LOlHd<DAT*2  2  ] oDAT*. accepttextdw_2,-dw_3D,. getrowd. method_codegetitemstringDataWindow ErrorSorry! Method Code is required. setfocus. setrowQ. setcolumnH. scrolltorow?,. priority_nogetitemnumber TSorry! Priority Number is required. . Q. H. ?,. sub_typeSorry! Sub Type is requDAT*ired. . Q. H. ?,,-rowcount4P,-record_group_no TSorry! Record Group Number is required,-,-Q,-H,-?,,-sequence_no TSorry! Sequence Number is required,-,-Q,-H,-?,,-item_type$Sorry! Item Type is required,-,-Q,-H,-?,,-numer_matDAT*erial_codeSorry! Numer Material Code is required,-,-Q,-H,-?, $ 4 < L T \ l t        $ 8 @ d                ( 0 8 @ H \ d |      DAT*     , 4 < D L T \ d l            4 < D L T \ d l J$9)$84$9)<8L$)`81t|$$)88J8$$)8$DAT*$)8$9)8$9)8 @f  $d  dw_2-setredraw!dw_3,,!dw_1D. rowcount4Tmasterridh8D. D. getrowridgetitemnumber) -h8retrievebuf2-,,sharedata-!,,! $ 4 < L ` t DAT*|              :F@@8$)(8808$)@88H"8M@88`@8,9}8z0)8l d w_filtergb_filter(@%@( idw_active1DAT*%classnamedw_21%dw_3rap_method_metricsrap_calculation_protocolsfiltertriggerevent  ( 8 @  $$6$$)48<$8DJX88`981068o1Y(@(8z'8z&:)@:@1@8}h1V1DAT*}h1}1<981<11$8J8}$8J8}, ,$1,883z%811 " Dt,@RVh |!"#$(*+.B/F0J1Z2t456;DAT*dV ls_dw_namell_cntll_ridll_cur_rowli_indli_record_group_noli_seq_nosqlca !,3FP@&SX idw_active1%1%getrow,1%ridgetitemnumber8 Hd_cal_protocolDeleting this record will also delete child records. Do you want to continue?1%record_group_no H1%DAT*sequence_no HError deleting record from rap_method_metrics. Contact your technical support  $ 4 < X      . )8168J08)D88L,8QX$8`)|8 $8J8}$8)8DAT*$8)8$8)8 $8) 8 $8),8 4$8<)T8 \$8d)86 666 6 6 6 6  8 18088z%8z&86z&@8919 $1DAT*69)l88L~8)|88$$)88J8;)81:@)8:@)88L,8Q!$8`)8 $8J8}$8)8$8) 8$8)DAT*8 $$8),8 4$8)<8 D$8<)L8 T$8d)\86 666 6 6 6 6  8 1d$8Jl8I!8088z%8z&86z&@8919,9 D f DAT*$P|,!"#)*+,.6/X0z1~468D9p:;<=$>P?|@BE2FrJKLRTd dw_objll_row_numll_cur_rowll_rid_numll_ridls_method_codels_sub_typels_scc_ams_codels_src_codels_dev_codels_pro_codels_throughput_mat_codels_emittant_mat_codeli_priority_nogs_database, %07 DAT*F R b n z   @t rowcount4ridgetitemnumber$  classname8dw_1ORACLEL. method_codegetitemstringlL. priority_no  L. sub_typelilL. scc_ams_codelL. source_codelL. device_codelL. process_codelL. emittaDAT*nt_material_codelL. throughput_material_codelCalculation ProtocolMethod 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. No changes made to the database.8setitemOtL. L. getrow  Otgetitemstatusp8L. lL.  L. lL. lL. lL. lLDAT*. lL. lL. lL.   0 D X |             , 4 T \  l |                   $ , 4 < D L T \ d l " &8DAT*8 04$,)L8\$,)d8,#8l,#",#8t"x$80)8$,#6)8,1,$2Rr d< ancestorreturnvaluesqlcags_scc_ams_code::messageP@&"#@2@#P openis_state 2master/detaildwDAT*_1.. settransobject^<dw_2T-^<@STREAM.. noneretrieveat2.. 2 4 L \ d x     8d  create8d  destroy&~FGOwPxQyS{T|o$&.2 +highliDAT*ght_dddwwf_check_requiredwf_draw_dw2wf_select_onewf_cascade_delwf_check_ridf_del_cal_protocolf_db_errorf_get_cal_protocol_ridf_get_sequence+open+create+destroy,*6DS``s~ !~ 2 xywiDAT*dthheighttitlebartitleminboxmaxboxiconmasterridis_child_nameis_validation_tableis_column_statusis_msg_nameis_msg_textil_selected_rowidwc_dw_childis_column_nameis_old_value|D  "T(/6i;ESgxDAT*!] oD T  1i @@@      DAT* ! o&$~8&xD&R(h8,(& & &DAT*2  2  ] `@ @     @2  2  ] @ @  DAT*   @OPQRSTcdef-&/28.2  2 $ xywidthheightdataobjectd6 a $] 6a $ @ DAT*  "$1)08H$)X8`$x$6)8$**$6880)8,1,$0J d ls_col_nameDAT* ::message( @#` il_selected_row>getcolumnname is_column_name8@getrowP8@is_old_valuehAsetitemPidwc_dw_childht?!is_child_namet=9