HTML Help Forum Index HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

simple database mangement and asp idea
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum Index -> ASP
View previous topic :: View next topic  
Author Message
cloudy



Joined: 21 May 2007
Posts: 7

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

%>
 
 
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum Index -> ASP
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group