HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
simple database mangement and asp idea
Post new topic   Reply to topic    HTML Help Forum Index -> ASP
View previous topic :: View next topic  
Author Message
cloudy



Joined: 21 May 2007
Posts: 7

PostPosted: Thu May 31, 2007 9:06 pm     simple database mangement and asp idea Reply with quote

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

%>
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> ASP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial