<% ' ' Customer Entry and Maintenance ' 'Initialize Standard Information Index = request("Index") ' The last selected Index number RowId = request("RowId") ' If a record Id was passed RunReport = (request("RunReport")<>"") ' If run report was selected %> <% ' redirects must occur before any html output! If RunReport then Response.redirect ("CustomerList.asp?RunReport=1&Index=" & Index) end if %> Customer2 <% ' LoginRights: If 1 user has full rights, if 0 or -1, browse only rights %> <% LoginRights = request.cookies("Rights") %> " TYPE="text/css"> <% CheckFieldChange=oCustomer.call("get_peFieldMultiUser") %> <% ' DebugMode =1 ' uncomment this for page get/post debug help %> <% If LoginRights = "1" then %>

Customer Entry and Maintenance

<% else %>

Customer Query

<% end if %> <% oCustomer.call "set_pbReportErrors", 1 'normally show any errors that occur 'We either find a record, or clear the WBO If RowId <> "" Then Err = oCustomer.RequestFindbyRowId( "Customer", RowId) else Err = oCustomer.RequestClear("Customer",1) End if ' process various buttons that might have been pressed. ' only support Post submissions If request("Request_method")="POST" Then if Request("clear")<>"" then Err = oCustomer.RequestClear("Customer",1) end if if Request("save")<>"" then oCustomer.call "set_pbReportErrors", 0 err = oCustomer.RequestSave("Customer") if err = 0 then Response.Write("

Customer record saved

") else Response.Write("") Response.Write("

Could not save changes. Errors Occurred

") oCustomer.call "msg_ReportAllErrors" Response.Write("
") end if end if if Request("delete")<>"" then oCustomer.call "set_pbReportErrors", 0 Err = oCustomer.RequestDelete("Customer") if err = 0 then Response.Write("

The record has been deleted.

") else Response.Write("") Response.Write("

The record could not be deleted.

") oCustomer.call "msg_ReportAllErrors" Response.Write("
") end if end if ' note we use the Index variable we created above if Request("findprev") <>"" then Err = oCustomer.RequestFind("Customer", Index, LT) if Request("find") <>"" then Err = oCustomer.RequestFind("Customer", Index, GE) if Request("findnext") <>"" then Err = oCustomer.RequestFind("Customer", Index, GT) if Request("findfirst")<>"" then Err = oCustomer.RequestFind("Customer", Index, FIRST_RECORD) if Request("findlast") <>"" then Err = oCustomer.RequestFind("Customer", Index, LAST_RECORD) end if Sub ShowDataLine (Obj, FileField ) FErr = Obj.DDValue(FileField,DDFIELDERROR) Response.write("") Response.write( "") If FErr<>"" then Response.Write("") Response.write( Obj.ddValue(FileField, DDLONGLABEL)) If FErr<>"" then Response.Write("") Response.Write("") Response.write( "" & Obj.DDValue(FileField,DDAUTO) & "") If FErr <> "" then Response.write("" & FErr & "") end if Response.write("") End Sub Sub BuildData () Response.Write("") ShowDataLine oCustomer, "customer.Customer_Number" ShowDataLine oCustomer, "customer.Name" ShowDataLine oCustomer, "customer.status" ShowDataLine oCustomer, "customer.address" ShowDataLine oCustomer, "customer.city" ShowDataLine oCustomer, "customer.state" ShowDataLine oCustomer, "customer.zip" ShowDataLine oCustomer, "customer.phone_number" ShowDataLine oCustomer, "customer.fax_number" ShowDataLine oCustomer, "customer.email_address" ShowDataLine oCustomer, "customer.credit_limit" ShowDataLine oCustomer, "customer.purchases" ShowDataLine oCustomer, "customer.balance" ShowDataLine oCustomer, "customer.comments" Response.Write("
") End sub %>
">

Find by <% oCustomer.call "get_CreateFindIndexCombo", "Index", "Customer", Index %> <% If LoginRights = "1" then %>    <% end if %>

<% BuildData %>