若相依 发表于 2015-1-16 22:28:00

ASP网页设计制造我们本人的Ebay(拍卖体系)(6)

当然了,现在国内CRM厂商的产品与其说是CRM,但从至少从我的角度分析上来看,充其量只是一个大型的进销存而已了,了解尚浅,不够胆详评,这里只提技术问题ResolvingBids-Page6

ChrisPayne

September11,2000



FunctionResolveBids(ItemID)


Setvariablesandcreateobjects
dimmonIncrement,monHighPrice,intAvailable,intTotItems,flgQuit
dimblnResolved


Assumebidsareresolved
blnResolved=True
strConnectionString="DSN=MyAuction;UID=username;PWD=password;Database=MyAuctionDB"
setrst=Server.CreateObject("ADODB.Recordset")


Getinformationfromitemstable
strSQL="SELECTIncrement,AvailableFROMtblAuctionItemsWHERE"&_
"IID="&ItemID
rst.openstrSQL,strConnectionString
monIncrement=rst(0)
intAvailable=rst(1)
rst.close


Findthehighestbidandtotalnumberitemsbidfor
strSQL="SELECTmax(WinPrice)ASWinPrice,sum(WinItems)as"&_
"WinItemsFROMtblAuctionBidsWHERE"&_
"ItemID="&ItemID
rst.openstrSQL,strConnectionString
monHighPrice=rst(0)
intTotItems=rst(1)
rst.close


Ifauserwithahighermaxbidexists,then
updatetheirbidifandonlyifavailableitemsisexceeded
strSQL="SELECTMaxBid,UID,BidItems,WinPriceFROM"&_
"tblAuctionBidsWHEREItemID="&ItemID
rst.openstrSQL,strConnectionString
ifnotrst.eofthen
dountilrst.eof
if(rst(0)>monHighPrice+monIncrement)AND(intTotItems>intAvailable)&_
AND(rst(3)monHighPrice)then
monHighPrice=monHighPrice+monIncrement
callDoBids(ItemID,rst(1),monHighPrice)
blnResolved=False
endif
rst.MoveNext
Ifwereattheendoftherecordset
andthebidsarenotyetresolved,gobacktothebeginning
ifnotblnResolvedANDrst.eofthen
rst.MoveFirst
blnResolved=True
endif
loop
endif
rst.close

EndFunction


Themainpartoftheabovecodeisthelastdo...loopsection.Theprocessisasfollows:


Enterausersbid(usingtheDoBids()function)
Findthehighestbidfortheitem,andtotalnumberofitemsbidfor
Loopthroughdatabaseand:
IFthecurrentbiddersmaximumbidishigherthanthehighestwinningbid,
ANDthetotalnumberofitemsbidforisgreaterthanthenumberofitemsavailable,
ANDthecurrentbiddersbidisnotthehighestbid,
THENincrementthecurrentbiddersbidbytheincrementvalue.
Ifwereachtheendoftherecordset,andthebidsarestillnotresolved,thestartover.
Thisprocesswillautomaticallyupdateallbidsappropriately,andweedoutthosewhosemaxbidsarenot
highenough.Thereasonwechecktomakesurethetotalnumberofitemsbidforisgreaterthanthenumber
oftotalitemsavailableinstep4isbecauseifallbidsareplacedanditemsclaimed,andthereare
stilllotsavailable,theneveryonewinsandbidsdonotneedtobeincremented.

Forexample,imaginethereare10lotsavailable,andthereare3bidders.IfbidderAwants3lotsat$3,
bidderBwants3lotsat$2,andbidderCwants3lotsat$1,everyonewillwinbecausethereisenough
lotstogoaround,andthensome.Thedoloopabovewillonlyhavetogothroughonce.

However,supposebidderCnowwants5items.Sincetherearenotenoughitemstogoaround,someonewill
havetoloseout.Theloopinthecodeaboveweedsthispersonoutbycheckingmaxbidsandupdatingthe
winningbids.Ifeveryonesmaxbidsinthisscenariowas$20,andtheincrementwas$2,thenbidderCand
whicheverofbidderAandBplacedthefirstbidwouldwin(rememberthatbidpriorityisplacedonmost
lotsbidfor,followedbybidtime).

缺点:正版成本价格贵(盗版就不说了)、不够安全,大多数服务器用windows系统,没有linux安全

深爱那片海 发表于 2015-1-19 13:34:00

用户端的浏览器不需要提供任何别的支持,这样大提高了用户与服务器之间的交互的速度。

飘飘悠悠 发表于 2015-1-27 18:50:32

接下来就不能纸上谈兵了,最好的方法其实是实践。实践,只能算是让你掌握语言特性用的。而提倡做实际的Project也不是太好,因为你还没有熟练的能力去综合各种技术,这样只能使你自己越来越迷糊。

蒙在股里 发表于 2015-2-5 11:17:02

不能只是将它停留在纸上谈兵的程度上。

admin 发表于 2015-2-11 12:31:11

ASP的语言不仅仅只是命令格式差不多,而是包含在<%%>之内的命令完全就是VB语法。虽然ASP也是做为单独的一个技术来提出的,但他就是完全继承了VB所有的功能。

乐观 发表于 2015-3-11 03:42:26

学习是为了用的,是为了让你的程序产生价值,把握住这个原则会比较轻松点。除此之外,课外时间一定要多参加一些社会实践活动,来锻炼自己的能力。

柔情似水 发表于 2015-3-17 20:09:40

学习ASP其实应该上升到如何学习程序设计这种境界,其实学习程序设计又是接受一种编程思想。比如ASP如何学习,你也许在以前的学习中碰到过。以下我仔细给你说几点:

精灵巫婆 发表于 2015-3-24 23:40:13

ASP.Net摆脱了以前ASP使用脚本语言来编程的缺点,理论上可以使用任何编程语言包括C++,VB,JS等等,当然,最合适的编程语言还是MS为.NetFrmaework专门推出的C(读csharp),它可以看作是VC和Java的混合体吧。
页: [1]
查看完整版本: ASP网页设计制造我们本人的Ebay(拍卖体系)(6)