Posted: Thu May 31, 2007 9:06 pm simple database mangement and asp idea
hi there, i have a very simple problem but i cant think the good way to solve it.
i have one table is store the leavetype(typeid, description).it can add,edit or delete the leave type by the user from the frontend.so every time the typeid will be change.
from a form, after the user submit and then the app will send to the approval. when approval APPROVE the app,it will run if the leave type is medical leave then will get the balance of the medical leave else if the leave type is annual leave then it will get the balance annual leave from the table. the code below i hard code it with
if leavetypeid="1" then
...
elseif leavetypeid="2" then
...
end if
how can i make it to be dynamic the but not hardcoded since the leavetypeid in the table leave type will change dynamically?
can u all give me some idea?
hope to hear from u all soon.
thanx.
<%
leavetypeid=request.form("leavetypeid")set
set rsupdate=Server.CreateObject("ADODB.Recordset")
if leavetypeid="1" then
Balance=rsleave("BAnnualleave")
NewBalance=Balance-totalday
strupdate="UPDATE leaverecord Set BAnnualleave='"&NewBalance&"' WHERE empid=" &empid
conn.execute strupdate
'medical leave
elseif leavetypeid="2" then
Medical=rsleave("BMedicalLeave")
NewBalanceMec=Medical-totalday
strupdate="UPDATE leaverecord Set BMedicalleave='"&NewBalanceMec&"' WHERE empid=" &empid
conn.execute strupdate
end if
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum