Batch Data Input, auxiliary data input, and Related detection (ASP server) (original)

Source: Internet
Author: User

Batch Data Input, auxiliary data input, and Related detection (ASP Server)

Author: Xiao Yue mark

Related Links: batch data input, auxiliary data input, and Related detection (jscript client) (original)

<! -- # Include file = ".. /_ INC/goperation. ASP "--> <% dim intbilltotal, intbilltype, intbillvalue, dtatoday, I, strbillcode REM single record count (reserve) intbilltotal = request. form ("bn") intbilltotal = tonum (intbilltotal, 10) intbilltype = getopertype () intbillvalue = getopervalue () dtatoday = Date () rem ####################################### ######################################## ################ REM # operate a single project dim dtab Illdate, strbilluser, strbillcheckuser, strbillcontent dim curbillcost, clerk, clerk, strcustname, strpaytype, dim numeric, intbillid, intbillplanid, strbillplannum REM # dtabilldate, strbilluser, strbillcheckuser pick-up person, intbillid single id rem # strbillcontent single remarks, strbillcode serial number, curbillcost single price (JS), curbillcostasp single price (ASP) REM # intcustid customer ID, strcustname customer name, Strpaytype payment method, inttotalnum single-row quantity REM # intbilltype single-type, intbillvalue single-type description, intbillplanid plan single ID, strbillplannum scheduler ticket number REM # Operation Ticket date dtabilldate = Replace (TRIM (request. form ("billdate ")),". ","-") if not isdate (dtabilldate) Then ouser. gs_addmessage "the operation order date is blank" else dtabilldate = cdate (dtabilldate) dtabillyear = year (dtabilldate) if (osys. checkyearout (dtabillyear) Then ouser. gs_addmessage "ticket date (" & Dtabillyear &") out of range "end if REM ################################## ######################################## ################## REM # data storage restriction REM ############## ######################################## ####################################### end if REM # contact strbilluser = trim (request. form ("billuser") & ") if strbilluser =" "Then ouser. gs_addmessage "blank" end if REM # Pick-up person strbillcheckuser = T Rim (request. form ("billcheckuser") & ") if strbillcheckuser =" "Then ouser. gs_addmessage "Empty pick-up person" end if REM # Turning Error to ouser. gs_showmessage 1 rem # other projects curbillcost = tocur (request. form ("totalprice") & "", 0) curbillcostasp = 0 intcustid = tonum (request. form ("custid") & ", 0) strcustname = request. form ("custname") strpaytype = request. form ("paytype") strbillcontent = request. form ("billcontent") in Tbillplanid = tonum (request. form ("billplan") & "", 0) strbillplannum = getbillnuber (intbillplanid) rem ####################################### ######################################## ################ REM ####################### ######################################## ################################ REM ## obtain user input data dim arrrecordinfo () dim inttempid, curtempprice, curtemptotal, curtempcost, curtempa SPC dim strtempcode, strtempname, strtempspec, strtempunit, inttempout, strtempcontent REM # inttempid temporary product ID, curtempprice unit price, curtemptotal quantity, curtempcost total price (JS) rem # curtempaspc product total price (ASP), strtempcode code, strtempname name, strtempspec specifications REM # strtempunit, strtempcontent remarks redim arrrecordinfo (10, 0) rem # initialize the number of single rows to 0, and the number of filtered rows to 0 inttotalnum = 0 inttempout = 0 REM # initialize useful data submitted by the client for I = 1 To intbilltotal inttempid = tonum (request. form ("fpid" & I), 0) curtempprice = tocur (request. form ("fpprice" & I), 0) curtemptotal = tocur (request. form ("fptotal" & I), 0) curtempcost = tocur (request. form ("fpcost" & I), 0) curtempaspc = curtempprice * curtemptotal if (curtempprice> 0) and (curtemptotal <> 0) and (inttempid> 0 )) then REM # available data inttotalnum = inttotalnum + 1 curbillcostasp = cur Billcostasp + curtempaspc strtempcode = trim (request. form ("fpmodel" & I) strtempname = trim (request. form ("fpvalue" & I) strtempspec = trim (request. form ("fpspec" & I) strtempunit = trim (request. form ("fpunit" & I) strtempcontent = trim (request. form ("fpcontent" & I) redim preserve arrrecordinfo (10, inttotalnum) arrrecordinfo (0, inttotalnum) = inttempid arrrecordinfo (1, inttotalnum) = strtempname Counter (2, inttotalnum) = strtempcode counter (3, inttotalnum) = strtempspec counter (4, inttotalnum) = strtempunit counter (5, inttotalnum) = curtempprice arrrecordinfo (6, inttotalnum) = curtemptotal partition (7, inttotalnum) = curtempcost arrrecordinfo (8, inttotalnum) = curtempaspc partition (9, inttotalnum) = strtempcontent elseif (inttempid> 0) Then inttempout = I Nttempout + 1 end if next if inttotalnum <1 then ouser. gs_addmessage "no product data in the Operation Ticket" ouser. gs_addmessage "Total" & inttempout & "items (product unit price is 0, empty or negative, quantity is 0 or empty) are filtered" ouser. gs_showmessage 1 end if REM ################################### ######################################## ################### REM ## open the connection F _ openconn REM ########## ######################################## ##################################### ######## REM # Check whether the table exists dim tbltablename = ouser. getbilltable (dtabillyear) rem ####################################### ######################################## ################ REM ####################### ######################################## ################################ REM ## construct a single project SQL statement and save strbillcode = getopebill () SQL = "select * from [" & gbl1_str_tab_inf_bill & "]" set rs = Server. createobject ("ADODB. recordset ") rs. open SQL, Conn, 1, 3 RS. addnew RS ("customerid") = intcustid RS ("customername") = strcustname RS ("bitplanid") = intbillplanid RS ("bitplannum") = strbillplannum ("bittype ") = intbilltype RS ("bitname") = intbillvalue RS ("bitcode") = strbillcode RS ("bitnum") = inttotalnum RS ("bitprice") = curbillcost RS ("bitpriceasp ") = curbillcostasp RS ("bitdate") = dtabi Lldate RS ("bitpay") = strpaytype RS ("bitcontent") = strbillcontent RS ("filluser") = strbilluser RS ("sureuser") = strbillcheckuser RS ("userid ") = ouser. uid rs ("username") = ouser. username Rs. update intbillid = RS ("ID") strbillcode = getbillnuber (intbillid) RS ("bitcode") = strbillcode Rs. update Rs. close REM ###################################### ######################################## ############### # REM ##################################### ######################################## ################# REM ## construct a data row SQL statement and save for I = 1 to inttotalnum SQL = "insert ["& tbltablename &"] "& _" (bittype, bitvalue, bitid, bitcode, productid, productname, productcode, productspec "& _", productunit, productprice, productnum, pricecount, priceaspc, billdate, content) "& _" values ("&_"" & Intbilltype & "& _", '"& tosqlr (intbillvalue) &"' "& _", "& intbillid &""&_", '"& tosqlr (strbillcode) &"' "& _", "& arrrecordinfo (0, I) &" & _ ", '" & tosqlr (arrrecordinfo (1, i) & "'" & _ ",'" & tosqlr (arrrecordinfo (2, I) & "'" & _ ",'" & tosqlr (arrrecordinfo (3, i) & "'" & _ ",'" & tosqlr (arrrecordinfo (4, I) & "'" & _ "," & arrrecordinfo (5, I) & "" & _ "," & arrrecordin Fo (6, I) & "" & _ "," & arrrecordinfo (7, I) & "& _", "& arrrecordinfo (8, I) & "" & _ ", #" & dtabilldate & "#" & _ ", '" & tosqlr (arrrecordinfo (9, I ))&"'"&_") "conn.exe cute (SQL) next REM ###################################### ######################################## ################ REM ## close the connection to F _ closeconn REM ############# ######################################## ######################### ################# REM ## output prompt information ouser. gs_addmessage "Total" & inttempout & "items (product unit price is 0, empty or negative, quantity is 0 or empty) are filtered" ouser. gs_addmessage "Total" & inttotalnum & "item data storage and warehouse receiving, total price:" & formatnumber (curbillcost, 2, true) & "(" & formatnumber (curbillcostasp, 2, true) & ")" ouser. gs_addmessage "<a href = "".. /ERP/bill_view.asp? Bt = "& intbilltype &" & id = "& intbillid &" "> view the information of this ticket (" & strbillcode & ") </a>" ouser. gs_addmessage "<a href = "".. /ERP/bill_view.asp? Bt = "& intbilltype &" & id = "& intbillid &" & Pt = 1 ""> Print this ticket </a> "ouser. gs_showmessage 0 REM ##################################### ######################################## ##################%>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.