exam |- App_Data | |-Database.mdf |- App_Code | |-Database.cs |- App_Themes | |-style.css |- all | |-LibraryService.asmx |- photos (this directory contains .jpg files of members) |- default.aspx |- login.aspx |- addtitle.aspx |- addmember.aspx |- Masterpage.master |- memberinfo.aspx |- members.aspx |- changepassword.aspx |- deletemember.aspx |- issue.aspx |- returnbook.aspx |- memberslist.aspx |- searchbooks.aspx |- web.config |- web.sitemap |- updatemembers.aspx |- logout.aspx
Operation | Files |
---|---|
Login | login.aspx |
Logout | logout.aspx |
Delete Member | deletemember.aspx |
Master page of all | Masterpage.master |
Home Page | Default.aspx |
Change password | changepassword.aspx |
Add Title | addtitle.aspx |
Add Member | addmember.aspx |
Iseue of book | issue.aspx |
Return of book | returnbook.aspx |
Search books | searchbooks.aspx |
Update Members | updatemembers.aspx |
Member Information | memberinfo.aspx |
List of books | books.aspx |
uname - varchar(10) pwd - varchar(10) fullname - varchar(30)
subcode - varchar(10) subname - varchar(30) di - datetime
mid - int mname - varchar(30) depositamt - int djoin - datetime email - varchar(40) occupation - varchar(50)
tid - int title - varchar(30) subcode - varchar(10) authors - varchar(50) price - int dp - datetime publishers - varchar(30) status - char(1)
tid - int mid - int di - datetime issuedby - varchar(10)
tid - int mid - int di - datetime dr - datetime issuedby - varchar(10) returnedto - varchar(10) fineamt - int
The following are the steps to related to be taken to run the existing part of the application :
ALTER PROCEDURE IssueBook ( @tid int, @mid int, @di datetime, @issuedby varchar(10) ) AS declare @nbooks int /* check titles availablity */ if not exists( select * from titles where tid = @tid and status = 'a') begin raiserror('Title is not present or not available',15,1) return end /* check members availablity */ if not exists (select * from members where mid = @mid ) begin raiserror('Invalid member id!',15,1) return end
ALTER PROCEDURE ReturnBook ( @tid int, @dr datetime, @user varchar(10) ) AS declare @fine int declare @mid int declare @issuedby varchar(10) declare @di datetime /* check tid is valid */ if not exists (select * from issues where tid = @tid) begin raiserror('Title is not in the issued titles!',15,1) return end /* calculate fine */ select @fine=case when datediff(dd,di,getdate()) > 15 then datediff(dd,di,getdate())-15 else 0 end from issues where tid = @tid; select @mid = mid, @di = di, @issuedby=issuedby from issues where tid = @tid; /* insert a row into returns */ begin tran insert into returns values(@tid,@mid,@di,@dr,@issuedby,@user,@fine); delete from issues where tid = @tid; update titles set status ='a' where tid = @tid commit tran