Batch data entry, auxiliary input data, and related detection (ASP server side)

Source: Internet
Author: User
Tags empty trim
Server | Data <!--#include file= ". /__inc/goperation.asp "-->
<%

Dim intbilltotal, Intbilltype, Intbillvalue, Dtatoday, I, Strbillcode
Rem Single record number (reserve amount)
Intbilltotal = Request. Form ("bn")
Intbilltotal = Tonum (intbilltotal, 10)

Intbilltype = Getopertype ()
Intbillvalue = Getopervalue ()
Dtatoday = Date ()

Rem ###############################################################################################
REM # Operation Single Item

Dim dtabilldate, Strbilluser, Strbillcheckuser, strbillcontent
Dim Curbillcost, curbillcostasp, Intcustid, Strcustname, Strpaytype, Inttotalnum
Dim dtabillyear, Intbillid, Intbillplanid, Strbillplannum

Rem # dtabilldate Single date, strbilluser filling person, strbillcheckuser, intbillid single ID
Rem # strbillcontent single note, strbillcode serial number, Curbillcost single Total Price (JS), curbillcostasp single Total Price (ASP)
Rem # Intcustid Customer ID, strcustname customer name, Strpaytype payment method, Inttotalnum line number
Rem # Intbilltype single type, intbillvalue single type description, Intbillplanid plan ID, strbillplannum plan single

Rem # Action Single Date
Dtabilldate = RePlace (Trim (Request). Form ("Billdate"), ".", "-")
If not IsDate (dtabilldate) Then
Ouser.gs_addmessage "Action Order date is empty"
Else
Dtabilldate = CDate (dtabilldate)
Dtabillyear = year (dtabilldate)
If (Osys.checkyearout (dtabillyear)) Then
Ouser.gs_addmessage "Action Order Date (" & Dtabillyear & ") Out of range"
End If
End If

Rem # to fill out a person
Strbilluser = Trim (Request. Form ("Billuser") & "")
If Strbilluser = "" Then
Ouser.gs_addmessage "Fill out the form for empty"
End If

Rem # Delivery Person
Strbillcheckuser = Trim (Request. Form ("Billcheckuser") & "")
If Strbillcheckuser = "" Then
Ouser.gs_addmessage "Delivery person is empty"
End If

Rem # Error Turning
Ouser.gs_showmessage 1

Rem # Other Items

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")
Intbillplanid = Tonum (Request. Form ("Brefer") & "", 0)
Strbillplannum = Getbillnuber (Intbillplanid)
Rem ###############################################################################################


Rem ###############################################################################################
Rem # Get data entered by user
Dim Arrrecordinfo ()

Dim inttempid, Curtempprice, Curtemptotal, Curtempcost, CURTEMPASPC
Dim Inttempcode, Inttempname, Inttempspec, Inttempunit, Inttempout

Rem # Inttempid Temporary Product ID, curtempprice unit price, curtemptotal quantity, curtempcost Total Price (JS)
Rem # CURTEMPASPC Product Total Price (ASP), Inttempcode encoding, inttempname name, INTTEMPSPEC specification
Rem # Inttempunit Units

ReDim Arrrecordinfo (9, 0)

Rem # Initialize the number of single lines is 0, filtered out of the number of rows is 0
Inttotalnum = 0
Inttempout = 0
Response. Write (UBound (Arrrecordinfo, 2))

Rem # Initializes 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 = curbillcostasp + curtempaspc

Inttempcode = Trim (Request. Form ("Fpmodel" & i))
Inttempname = Trim (Request. Form ("Fpvalue" & i))
Inttempspec = Trim (Request. Form ("Fpspec" & i))
Inttempunit = Trim (Request. Form ("Fpunit" & i))

ReDim Preserve Arrrecordinfo (9, Inttotalnum)

Arrrecordinfo (0, inttotalnum) = Inttempid
Arrrecordinfo (1, inttotalnum) = Inttempname
Arrrecordinfo (2, inttotalnum) = Inttempcode
Arrrecordinfo (3, inttotalnum) = Inttempspec
Arrrecordinfo (4, inttotalnum) = Inttempunit
Arrrecordinfo (5, inttotalnum) = C



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.