日期:2014-05-17  浏览次数:20726 次

高手门过来看了哦!~~~
我网站里有很多的管理员,这些管理员都可以对里面的订单进行操作!~   现在我要的是这些管理员不能同时对同一个订单进行操作!~该怎么办?     我的解决思路是   当第一个进去后,我就在cache里面建立一个文件.当第二个用户进入后就查找这个文件是否存在,   但是现在有个问题!   如果我进入网站后不进行操作的话,那又该怎么判断?

------解决方案--------------------
加个字段[操作中]是/否
------解决方案--------------------
set rs=conn.execute( "select * from table where id=n ")

id=rs( "id ")
now_opera=application( "opera ")
power=0
if len(now_opera& " ")=0 then
power=1
application.lock
application( "opera ") = session( "user ")& ": "&id
application.unlock
else
operas=split(now_opera, "| ")
for i=0 to ubound(operas)
temp=split(operas(i), ": ")
if temp(1)=id then
if temp(0) <> session( "user ") then
power=-1
else
power=1
end if
end if
next
if power=0 then
power=1
application.lock
application( "opera ") = now_opera& "| "&session( "user ")& ": "&id
application.unlock
end if
end if
if power =1 then
response.write "you can modify this object "
else
response.write "other one is already modify this boject "
end if