|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
写软件都是想的时间比写的时间要长的.如果反过来了就得看看是什么原因了.另外大家可以回去问问公司里的小MM.(一般企业里,跟你们交付软件接触得最多的是她们)Thisisthecomplexpart-youmustmakesureeveryonesbidsarecorrect,updatethosethathaveproxybids,reallocatelotstowinners,notifybuyerswhohavebeenoutbid,andperformsomeupkeep.
Firstletslookatthecodetoaddabid.
FunctionDoBid(ItemID,BidderID,Price,optionalMaxPrice,optionalMaxItems)
Setvariablesandcreateobjects
strConnectionString="DSN=MyAuction;UID=username;PWD=password;Database=MyAuctionDB"
setrst=Server.CreateObject("ADODB.Recordset")
Checktoseeifabidalreadyexistsforthisbuyerandauction
strSQL="SELECTBIDFROMtblAuctionBidsWHEREIID="&ItemID&"AND"&_
"UID="&BidderID
rst.openstrSQL,strConnectionString
ifrst.eofthenAbiddoesnotexist
rst.close
Insertinfointotable
strSQL="INSERTINTOtblAuctionBids(IID,UID,WinPrice,MaxBid,"&_
"BidItems,WinItems,TimeVALUES("&ItemID&","&BidderID&_
","&Price&","&MaxPrice&","&MaxItems&_
",0,"&Now()&")"
DefaultWinItemsto0fornow
elseAbiddoesexist
rst.close
Updateinfointable
strSQL="UPDATEtblAuctionBidsSETWinPrice="&Price&_
"WHEREIID="&ItemID&"ANDUID="&BidderID
endif
rst.openstrSQL,strConnectionString
Fixbiddinginformation
callResolveBids(ItemID)
EndFunction
NOTE:ThiscodeaboveisdevelopedforVisualBasic,andthekeyword"optional"inthefunctionopenerisnotsupportedinVBScript.InanASPthen,simplyleaveoutthekeyword"optional"here,andwhenyoucallthefunction,passinanemptystring,i.e.:
callDoBid(ItemId,BidderID,Price,"","")
Thisfunctionbasicallytakessomeinfo,andeitherinsertsitorupdatesitintheBidstable-fairlysimplestuff.ThefunctionResolveBidshoweveriswhereallthegoodstuffhappens.
</p>ASP最大的缺点在于网络的安全性和可靠性,企业将经营数据放在开放的平台上,最大的担忧就是如何保证这些数据不被其他人破坏。 |
|