Project
Project
net-project
This web application is used to handle typical operations in a library system. This application is developed for librarians. Issuing book, returning book, adding member, and searching for books are some of the major operations of this application.
ASP.NET 2.0 C# language Visual Web Developer 2005 Express Edition SQL Server 2005 Express Edition
File Structure
The following is the directory structure of this application.
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 |- chanepassword.aspx |- deletemember.aspx |- issue.aspx |- returnbook.aspx |- memberslist.aspx |- searchbooks.aspx |- web.config |- web.sitemap |- updatemembers.aspx |- logout.aspx
Operation Login Logout Delete Member Master page of all Home Page Change password Add Title Add Member Iseue of book Return of book Search books Update Members
Files login.aspx logout.aspx deletemember.aspx Masterpage.master Default.aspx changepassword.aspx addtitle.aspx addmember.aspx issue.aspx returnbook.aspx searchbooks.aspx updatemembers.aspx
Structure of Tables
USERS Table
uname - varchar(10) pwd - varchar(10) fullname - varchar(30)
SUBJECTS Table
subcode - varchar(10) subname - varchar(30) di - datetime
MEMBERS Table
mid - int mname - varchar(30) depositamt - int djoin - datetime email - varchar(40) occupation - varchar(50)
TITLES Table
tid - int title - varchar(30) subcode - varchar(10) authors - varchar(50) price - int dp - datetime publishers - varchar(30) status - char(1)
ISSUES Table
tid - int mid - int di - datetime issuedby - varchar(10)
RETURNS Table
tid - int mid - int di - datetime dr - datetime issuedby - varchar(10) returnedto - varchar(10) fineamt - int
if not exists( select * from titles where tid = @tid and status 'a') 18. begin
19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53.
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 54. else 0 55. end 56. from issues where tid = @tid; 57. 58. select @mid = mid, @di = di, @issuedby=issuedby 59. from issues where tid = @tid; 60. 61. /* insert a row into returns */ 62. 63. begin tran 64. insert into returns 65. values(@tid,@mid,@di,@dr,@issuedby,@user,@fine); 66. 67. delete from issues where tid = @tid; 68. 69. update titles set status ='a' 70. where tid = @tid 71. 72. commit tran 73.
74. Goto Solution Explorer and make default.aspx the startup page. 75. Run project from VWD 2005 Express Edition. 76. You should see login.aspx page.