• No results found

Library Management System

N/A
N/A
Protected

Academic year: 2021

Share "Library Management System"

Copied!
147
0
0

Loading.... (view fulltext now)

Full text

(1)Library Management System. LIBRARY MANAGEMENT SYSTEM By. KOH YEE KEAT. Supervisor: Ms. Choon Kwai Mui. A project report submitted to the School of Arts and Science in partial fulfilment of the requirement for the Bachelor of Science, Campbell University, U.S.A And Advanced Diploma in Science.. Division of Computer Science School of Arts and Science Tunku Abdul Rahman College Kuala Lumpur 2010/2011. Copyright ©2011 by Tunku Abdul Rahman College. All rights served. No part of this project documentation may be reproduced, stored in retrieval system, or transmitted in any form or by any means without prior permission of Tunku Abdul Rahman College.. I.

(2) Library Management System. Declaration. Declaration The project submitted herewith is a result of my own efforts in totality and in every aspects of the project works. All information that has been obtained from other sources had been fully acknowledged. I understand that any plagiarism, cheating or collusion or any sorts constitutes a breach of College rules and regulations and would be subjected to disciplinary actions.. Student’s Name : Koh Yee Keat Programme : Advance Diploma in Science cum Bachelor in Science (Internet Technology). II.

(3) Library Management System. Abstract. Title. :. Library Management System. Author. :. Koh Yee Keat. Abstract This report is all about the development of Library Management System for the website part. It develop use to convince the member to search the book and also ease of borrowing books from the library.. This website mainly use by member and staff. It allow member to search and reserve book. Member allows search the book and knows what book contain in the library. Other than that, member allows to see the book detail and also comment on the book. Member also allow reserve the book via website so that they can save their time and cost to travel from their destination to library. Member also can view current book they are borrowed and also history of the book they have borrowed. For staff user, they are able to add news and also view report with several criteria. Staff allows to add, edit and delete the news. When new news added, the homepage news tab will be shown the new data.. Because of the college is Microsoft partners, as a student of the college, I am able to use Microsoft product for free. So I choose Microsoft Visual Studio 2008 as my website development and ASP.NET with C# as my programming language. Microsoft SQL Server 2008 as my database.. The methodology used by me is waterfall model. The report’s chapter was included system planning, requirement analysis, system design, programming, system testing, and evaluation of the project.. III.

(4) Library Management System. Acknowledgement. Acknowledgements After completed my Final Year Project, there are many people help when developing this project. I would like to express my sincere gratitude to my supervisor which is Ms. Choon Kwai Mui who has guided me a lot throughout the project development. If Ms. Choon does not keep on recall us to done our Final Year Project, I could not done my project in time. With the recall, I slowly done some module, when reach due date I was just able to finish my project. Other than that, Ms. Choon also will ask us some question to solve the logic problem in the system. When the question could not be answered well which mean the error occur. Secondly, I would also thank to my family that give me mental support. They reduce my pressure of developing of Final Year Project so that I could finish it. My family have gave me a great support so I would very gratefully thank my family for supporting me until my end of Final Year Project. Lastly, I would also like to acknowledge my course-mate and house-mate which given me help when I needed. One of my friends, Chan Cheang Hau helped me the most. When I faced logic and coding problem, he will help me to solve. Other than that, I also have to thank my group-mate, Tan Chaur Chuan which give some idea for me to complete my Final Year Project.. IV.

(5) Library Management System. Table Of Contents. Table of Contents Declaration .......................................................................................................................................... II  Abstract .............................................................................................................................................. III  Acknowledgment ............................................................................................................................... IV  1. System Planning ........................................................................................................................ 1‐18  1.0 System Planning .............................................................................................................................. 2 1.1 Project Aims and Objectives ........................................................................................................... 2 1.2 Background of Project..................................................................................................................... 2 1.3 Project Scope................................................................................................................................... 4 1.4 Project Schedule ............................................................................................................................ 13 1.5 Outline of Approach/ Methodology Used ..................................................................................... 14 1.6 Operation Environment ................................................................................................................. 17 1.7 Summary ....................................................................................................................................... 18. 2. Requirement Analysis .............................................................................................................. 19‐40  2.0 Requirement Analysis ................................................................................................................... 20 2.1 Software Requirement Specification (SRS) ..................................................................................20 2.2 Data Flow Diagram (DFD) ........................................................................................................... 33 2.3 Summary ....................................................................................................................................... 40. 3. System Design .......................................................................................................................... 41‐67  3.0 System Design............................................................................................................................... 42 3.1 External Interface Requirements ................................................................................................... 42 3.2 Entity Relationship Diagram (ERD) ............................................................................................ 57 3.3 Normalization................................................................................................................................ 58 3.4 Data Dictionary ............................................................................................................................. 61 3.5 Summary ....................................................................................................................................... 67. 4. Programming ........................................................................................................................... 68‐84  4.0 Programming ................................................................................................................................. 69 4.1 Coding ........................................................................................................................................... 69 4.2 Summary ...................................................................................................................................... 84. 5. Software Testing ...................................................................................................................... 85‐90  5.0 Software Testing ........................................................................................................................... 86 5.1 Test Plan ........................................................................................................................................ 86 5.2 Summary ...................................................................................................................................... 90. IV.

(6) Library Management System. Table Of Contents. 6. Conclusion ................................................................................................................................ 91‐97  6.1 Introduction ................................................................................................................................... 92 6.2 Linkage to seminar ........................................................................................................................ 92 6.3 Evaluation of Project Objective .................................................................................................... 93 6.4 Project Management Issues ........................................................................................................... 93 6.5 Evaluation of Project Strengths and Weakness ............................................................................. 94 6.6 Suggestion for Future Enhancement ............................................................................................. 95 6.7 Personal Reflection ....................................................................................................................... 96. 7. References ............................................................................................................................... 98‐99  8. Appendices .......................................................................................................................... 100‐141  User Manual ...................................................................................................................................... 101 Project Specification ......................................................................................................................... 123 Project Management Document ........................................................................................................ 135. V.

(7) Library Management System. Chapter 1: System Planning. Chapter 1 System Planning. 1.

(8) Library Management System. Chapter 1: System Planning. 1.0 System Planning The developing website of the Library Management System will be carried out in this chapter as well as the website objectives, scope and schedules.. 1.1 Project Aims and Objectives The project aims and objectives that will be achieved after completion of the website were carried out in this sub chapter. The succession of the system also will be evaluated through this sub chapter. The project objectives are: -. To allow user to reserve book via online. -. To convenience user borrow book by searching online. -. To implement E-mail technologies into the website.. -. To implement SMS technologies into system.. -. To design a user friendly graphical user interface which suit the users. -. To complete the website according to project schedule. 1.2 Background of Project Library Management System is an application refer to other library system and it is suitable to use by small and medium size library. It has divided into online and offline. In this document will only mention about online which is website and a small part of offline system. It use by librarian and also normal user. The website develop to help convince the normal member to allow the library facility. Example, To know this book currently exist in library or not. For admin users they can implement the website. They can update the news for the website and also can see some report.. SMS(Short Message Service) is implement in to the system. The user allow to sms the message by connecting a GSM(Global System For Mobile Communication) phone. The SMS module is created for sending message to the people who has borrow the book over the due date. It convenience the user by clicking one button and it will send to all user.. 2.

(9) Library Management System. Chapter 1: System Planning. Staff and member maintenance module also included in Library Management Website. Users can edit the information of their profile. The staff and member also able to get back lost password. By matching the ID and E-mail, they will get a E-mail with their password written. In additional, comment module also included inside. So each member can comment the books which contain in the library. This module helps to recommend the book for users which is good or bad. The comment can be delete by the member who comment it and also any admin user. Other than that, report module also implement inside Library Management Website. It only can view by admin users. It has two type of report which is book comment report and also member expired report. Book comment report allow librarian to know the popularity of the report. So if the book is popular, the librarian may order more books. Member expired report allow to see who is expired. It may see the member popularity of the library of current year or month is decreasing or increasing. Reserve module also implement in the website. Reserve module is allow user to reserve book online so that they can borrow the book if they are far from the library. But in this reserve, member needed to get the book in 2 week period or else the reservation will be cancel. All these modules are able to help librarian to manage the library more convenience and efficiency compare to those library without computerized system.. 3.

(10) Library Management System. Chapter 1: System Planning. 1.3 Project Scope In this sub chapter, project scope will carried out what modules were contains inside the Library Management System.. For Library Management System, it is divided into online web site and library system. For my part, I was responsible for library website and a part of system while the system was carried out by my friend Tan Chaur Chuan.. At here, I will describe my own part which is library website which used by librarian and member.  Authorization and Authentication Module Authorization and Authentication. ID / Password. Password Recovery. Checking. This module is used by user and also admin user for the website. They need to login to the website using their id and password. In order to distinguish the user’s level, user can access to different module when successfully login. For example, admin can implement News.. 4.

(11) Library Management System. Chapter 1: System Planning.  Member/Staff Maintenance Module Member/Staff Maintenance. Change Password. Edit Staff/Member. View Staff/Member. This module allow user and also admin to view their profile. Not only that, they allow to edit their profile and also change their password.  Search Module. Search module allow user or guess who visit website to search the book. Not only that the user allow to view the detail of the book and also see the comment of the book. There are a few of type allow users to search. They can search via ISBN, book title, author, publisher, and category.  Top 10 new book and recommended book Module. Top 10 new book module allow guess and member to see the top 10 new book has brought by the library and the recommended book module only can see by member after log in to the system. It recommended based on their category example the user like to see action type book then it will recommend some action book for. 5.

(12) Library Management System. Chapter 1: System Planning.  News Maintenance Module. News Maintenance. Add new news. Edit news. Delete news. This module allows user to add, edit and delete the news. So when the user visit the website the website will have shown updated news.  Book Maintenance Module. Book Maintenance Module. View Current Book Borrowed. Add Reservation. Reservation. Delete Reservation. View Book Borrowed. View Reservation. Book maintenance module allows the member to view the book currently they have borrowed and also view the book they have borrowed. Not only that, there got reservation module which allow member to reserve book. Members are allow to reserve book and delete the reservation and also view currently the book they reserve.. 6.

(13) Library Management System. Chapter 1: System Planning.  E-mail Module. E-mail module has implemented in FAQ and also forget password. So when the member forgot their password they can get back their password via matching their ID and E-mail. Other than that, for FAQ if guess or member have more question to ask they can ask via E-mail.  Report Module. Report Module. Book Comment Report. Member Expired Report. Report module is the module for admin user. There is two report which is Book Comment and Member Expired. For Book Comment report is to view the top book that has been commented. It allows the admin to know the popularity of the book so that they can get more new books. It can view via day, month and year. Member Expired report is to view the member is expired via which date, month or year. So they can remind their member to renew the membership and also can know the popularity of the library. So, it can be estimate the popularity of the library currently is increasing or decreasing.. 7.

(14) Library Management System. Chapter 1: System Planning.  Comment Module. Comment Module. Add Comment. Delete Command. Comment Module created is for member to comment a book. So, if the member have opinion about the book they can actually comment on the book. Not only that they can also delete their own comment. Admin users can delete any comment of the book that member has already comment.. Library system At this part I will present about my friend’s part which is the application part.  Authorization and Authentication Module Authorization and Authentication. ID / Password. Password Recovery. Checking. This module is used by user which means librarian in the library. They need to login to the system using their id and password. In order to distinguish the user’s level, user can access to different module when successfully login. For example, only admin level users are able to access the report module.. 8.

(15) Library Management System. Chapter 1: System Planning.  Member Maintenance Module. Member Maintenance. Add new member. Edit member. Print ID card. Search Member. This module can be accessed by either librarian or library admin to maintain member’s profile or record such as search, add, edit and print ID card..  Book Maintenance Module. Book Maintenance. Add new book. Edit book information. Generate barcode. Search book. Book Module can access by any user from all levels. This module can used to maintain the book inventory record such as search, add and edit. In addition, we can generate the barcode for particular book and print it out so that librarian can stick the barcode on the book cover.. 9.

(16) Library Management System. Chapter 1: System Planning.  Publisher Maintenance Module. Publisher Maintenance. Add new publisher. Edit publisher information. Search publisher. This module allows user to add and edit the book’s publisher. Publisher is used when register a new book.  Employee Maintenance Module. Employee Maintenance. Add new employee. Edit employee. Search employee. Employee Maintenance is only can carried out by admin level user. It can use to add the new librarian to the library which means add the new user.. 10.

(17) Library Management System. Chapter 1: System Planning.  Book Transaction Module. Book Transaction. Rental Module. Return Module. Check Reservation. Lost Book Module. Fine Module. Book Transaction module is a main module in Library Management System. When member wants to borrow books, return books or they want to register lost book, it is all under book Transaction module. This module can be accessed by normal user or admin user. When member wants to borrow a book, librarian needs to scan in their member id. After that, librarian will scan their book’s barcode id. If the book is under reservation, the book is not available to rent. For return module, librarian just needs to scan the book’s barcode id, and confirm the rental detail with user. If the rental detail is correct, return module can be complete if no any fine issued.. 11.

(18) Library Management System. Chapter 1: System Planning.  Report Module. Report Module. Transaction Report. Top10 Book Report. Activity Log File. Report module is the main module for admin user. It is because normal user is not allowed to view the report. The report divided into 3 types. First one is transaction report which can let admin views the book transaction happen on particular date such as rental report and return report. Top10 Report is the top rental rate’s book. Admin can filter the information based on book’s category and also filter by date in type of daily, monthly and yearly. Activity Log File is a log which records every process in the Library Management System such as login / logout activity, register new book, new member or edit information or a member. All the activity done by every user will be record so that when system crash, admin or system admin are able to check the activity that may crash the system.. 12.

(19) Library Management System. Chapter 1: System Planning. 1.4 Project Schedule. 13.

(20) Library Management System. Chapter 1: System Planning. 1.5 Outline of approach / Methodology used Software has been used to develop Library Management System is Visual Studio 2008, language ASP.NET with C#, and SQL Server 2008 as the database. For methodology, I have use waterfall method.. Waterfall is a method allow to increase the speed to complete the project but risky. So users need to carefully design. If the current phase is complete, it will proceed to next phase. It is risky because it does not allow to backward to previous phase.. At Royce's original waterfall model, the waterfall model originally consists of 7 phases which is Requirement Specification, Design, Construction, Integration, Testing and Debugging, Installation and Maintenance.. At first, we get the requirement for the library website, and then we analyzed it. After the analyzed phase has completed, we can proceed to next phase which is design phase. For design phase, I have design the website interface. After that, with my group members we designed database. After that is construction phase. Construction phase basically is to start develop the website. With the logic and coding, I use ASP.NET with C# to develop the website. In this phase is the most time consuming phase because there might have many problem occur and could not understanding the function. Sometime the logic is wrong make the errors. After this phase, it comes to integration phase. At this phase, the library management system has been share one database because it needed to link between online and offline part. So we needed them to integrate with each other. Then testing and debugging phase come after integration phase. For testing phase, it is actually not suitable for programmer itself to testing. So we given some of our friend as user to test. It has divided into few part, logic test, validate test, and user interface test. If there are bugs is founded, it will be record down and solve. At last is installation and maintenance phase. In this phase, for member for that library just have needed a web browser at home to open the website. And for library user, they. 14.

(21) Library Management System. Chapter 1: System Planning. needed to buy a address and host the website so that every member can log in to the website.. 1.5.1 Development Environment Software  Operating system: Window 7 Professional Window 7 Professional has been selected as my operating system to develop the website because it has the latest technology and many new functions which only allow window 7 uses other than other windows which bring advantage to develop a website. Website also does not have compatibility problem because we just needed a web browser and we could see the website..  Database: Microsoft SQL Server 2008 Microsoft SQL Server 2008 has been use ask our database because SQL 2008 is more user-friendliness than other database. It may use more process compare to other database software but it solve some problem. Example when a emergency happen which need to change something in database. We can actually easily teach the user to do it on their own. Other than that, SQL may have auto backup so that the data would not be lost easily.This is very useful when we developing the Library Management System.  Development tools and programming language: Microsoft Visual Studio 2008 and VB.NET We would like to use Microsoft Visual Studio 2008 as our developing software. Visual Studio 2008 is powerful and flexible developing software, it allows us to build a good design application with an easy-use drag and drop controls on our form. We can see the user-friendliness of our application once we finished drop the control on form.. 15.

(22) Library Management System. Chapter 1: System Planning. Hardware  Processor: Intel® Core™ 2 Duo CPU T7250 @ 2.00GHz Intel processor is a popular processor which allow comfortable to more technology. With this processor, Intel Core 2 Duo, it help the CPU reduce the temperature and allow us to work more longer and faster. By this technology, we have no worry to developing a system with higher technology. It is suitable for develop Library Management System in more advance way.  Ram: 2.00 Gb With the Visual Studio and SQL server open at the same time. The CPU itself needed have more space to let the software process. So that it cannot make the computer hang. If there are no higher Ram, the process will become slower because the memory in the Ram maybe full. It actually delay the development phase.. 16.

(23) Library Management System. Chapter 1: System Planning. 1.6 Operation Environment The table shown below is the minimum requirement for the Library Management System (Website): Client Side -. A Web browser – IE, Mozilla Firefox, Google Chrome.. Host Side Processor. Intel Pentium IV 3.0 Ghz or better performance. Operating System. Microsoft Window XP, Vista or Window 7. Memory. 512MB RAM. Screen Resolution. Monitor with screen resolution minimum 1024 x 768. Hard disk Space. Minimum 5GB to include database usage for future. Database. Microsoft SQL Server 2008. 17.

(24) Library Management System. Chapter 1: System Planning. 1.7 Summary In this chapter, project schedule, project scope, methodology used, project background and also the developing and operating environment has been presented.. In this chapter, I have faced a few problems. At first, the problem that we met is lack of research and knowledge about library process. We wanted to make the library process become computerize system but before that we does not understand the process. Not only that, many of our friend also lack of knowledge about library process. This made us have to go to find the solution ourselves. The solution of this problem is we have go to research the library. Other than that, our supervisor also gives us some important advice and also the advice from the internet. We can finally sure the process of the library.. The second problem is time management problem. We have planned to start our project during internship start which is July 2010. During internship, because of my laziness, I did not do the project at all. After internship, we still have not done many parts as the schedule. After that we found out we are lack of time to do the project, with the remind of the supervisor time to time, we rush our project daily and finally we could done it on time.. In this chapter, I have learnt that time management skill is very important because when we do not plan our time properly it will cause us disaster when the due date come. If we start early, if we have error we can solve it after we done but when we done it late, we have no time to solve the error.. 18.

(25) Library Management System. Chapter 2: Requirement Analysis. Chapter 2 Requirement Analysis. 19.

(26) Library Management System. Chapter 2: Requirement Analysis. 2.0 Requirement Analysis In this chapter, Software Requirement Specification (SRS), Data Flow Diagram (DFD) and Entity Relationship Diagram (ERD) will be discus for developing process of the Library Management System. SRS used to have overview of the system requirements and it also included functional and non-functional requirements. Other than that, DFD used to provide a view of business flow. It show the efficiency and effectiveness of the system... 2.1 Software Requirement Specification (SRS) 2.1.1 General Description. Product Description For online website, Library Management System is a website which helps the normal users and admin users to convince their daily jobs. It reduces the normal users travel fees and for admin users may reduce paper work. It help both of the users save time and costs.. Problem Statement The problem occurred before having website includes:  Does not have reservation Before having website, the customer which is member of the library does could not reserve book from the library. So when they wanted to borrow a book without knowing there quantity still left or not, so they have to travel from their destination to library. If the book is out of stock, they needed to wait for the people return only they can borrow again.. 20.

(27) Library Management System. Chapter 2: Requirement Analysis.  Members/Staffs Maintenance The website allows the member or staff to maintenance. Without website, they needed to go to library tell the staff to change the information. Example a member has move from Setapak to Serdang, he needed go to the library change his address himself. But website allows them to change themselves. It is convenience to both librarian and member. Example when a letter sends out to the member house, it will directly send to new address.  Difficult to search book Without website, the member of the library could not know what book contain in the library. They will have to go to find out at the library themselves. With website they can search the book in the website to know that currently the book exist in the library or not.  SMS by handwork Without computerizes system, the staff of the library have to send SMS to recall member that the book that they borrow is already reach due date. They have to check themselves and send one by one themselves. With this SMS function, they will just need to click one button and send to all members who are reach the due date.  Difficult to view reports Report need to generate manually by themselves. They have to record and calculate themselves and generate the report. With the website and system actually overcomes the problem. It save times.. 21.

(28) Library Management System. Chapter 2: Requirement Analysis.  Cost and Time consuming Before the website develop, many things for member needed to travel from their destination to library to know the information. It has already wasted their travel fees and time to only get the information from library. With the website help, they allow to check it at homes and it overcomes the problem.. 2.1.2 System objectives  Improvement in control and performance The website develops to overcome the problem exists in the library. It can validate the users, store the record and bug free. It also convenience both staff and members.  Save cost The members save travelling cost which he/she need to travel from his/her destination to library to get the information such as book available, new books and more. The website is overcome the problem.  Save time Member is able to search the book in short time by using the search function. Compare to previous time before implementing the website, member can save a lot time to travel from their destination to library.. 2.1.3 System Requirements 2.1.3.1 Non-functional Requirements  Products Requirements Efficiency requirements With the library management system, the librarian can process in book transaction with faster speed. It is because by reviewing the website they can get the information they want and they does not needed to ask the librarian. In addition, with the SMS function, the librarian can send the SMS by clicking one button instead they send it one by one and send it to wrong number.. 22.

(29) Library Management System. Chapter 2: Requirement Analysis. Reliability requirements The website must immediately update. So when the member visit they could get the latest information and also they can provide latest information to us. Example, when the member changes the profile, the information must be immediately update and the detail get by the librarian must be the latest. Other than that, the pages which needed user key-in will be validate to prevent user key-in wrongly.. Usability requirements The website must be designed user-friendly so that the user is easy to learn when they first get in to the website. It also must have the clear instruction so that the user will be guided when using the website. After that, the error message should be clear and understanding for user.  Organizational Requirements Implementation requirements In implementing of the website, it uses the ASP.NET with C# as the programming language and tools. SQL Server will be use for the database to support with the programming language.. Delivery requirements For the whole system, the progress is estimated done at about six months and the documentation done in two months. Documentation will be delivers in hardcopy and softcopy and for full system will be delivers in softcopy.. 23.

(30) Library Management System. Chapter 2: Requirement Analysis.  External Requirements Legislative requirements The information that use must be acknowledge by the authorized people so that it has no violating the law. This information is copyrighted and protected by the law. When visitors wanted to become the member of the library, he/she must agree with the rules and regulations stated in the of library management system.. Security requirements This system must be highly secure in the login part. It can know the authorization of the id which belongs to member or staff. Member and staff both can perform different.. 24.

(31) Library Management System. Chapter 2: Requirement Analysis. 2.1.3.2 Functional Requirements 1. Member User. 1.1 User Login Description of Feature This feature used by the user (Librarian and Library’s member) to login into the website. They are required to key in the user id and password to log in to the website. The password length must not less than 8 character and user id and password will be verified and invalid id is not allowed to enter the system.. Stimulus / Response Sequences Stimulus. : User visits the website.. Response. : Center left part of the website allow user log in.. Stimulus. : User enters user id and password at the textbox provided and click. the log in button.. Response. : It verifies the user id and password with the data inside database. If. the user id is invalid or password not matches, there will pop up red label with password incorrect to tell user. If valid, the user successfully log in to the website.. Functional Requirements -. User id is provided when they register as member or staff.. -. The website allow guess to visit. But with member there will more function to use and some special function for staff users.. -. The website must be able to perform authorization process which decides what the user’s level can access to.. -. The user must able to logout after they finished using the website.. 25.

(32) Library Management System. Chapter 2: Requirement Analysis. 1.2 Password Recovery Description of Feature This feature used by the user(Librarian and Library’s member) when they forget their password.. Stimulus / Response Sequences Stimulus. : User runs the website and click forget password.. Response. : Link to another page which request for ID and Email.. Stimulus. : Click the submit button.. Response. : It will verify the ID and Email see it is match or not. If match, the. password will be send to the user’s Email. If it does not match, a message box will pop out to tell users it is wrong Email.. Functional Requirements -. The website must be able to send the correct password to the user’s mailbox.. 26.

(33) Library Management System. Chapter 2: Requirement Analysis. 1.3 FAQ ask question Description of Feature This feature allows anyone to the question about the library via email. It requires user’s Email so that the staff can reply.. Stimulus / Response Sequences Stimulus. : User press FAQ below the banner.. Response. : Website bring user to FAQ page.. Stimulus. : User key in own Email, subject and also the question wanted to ask.. After that, click on send to proceed. Response. : System will validate the text box is empty or not. If empty, message. box will pop up to tell the user. If valid, the system will send the email to the staff Email. If the format of the email is incorrect, message box will pop up to tell the user that the format the email is wrong.. Functional Requirements -. Website must be able to verify the information.. -. System must deliver the question to staff Email successfully.. 27.

(34) Library Management System. Chapter 2: Requirement Analysis. 1.4 Search Book Description of Feature This feature is to search the book which contain in the library. It can search in many categories. The categories are ISBN, Title, Author, Publisher, and Category. So user can choose the category base on the category.. Stimulus / Response Sequences Stimulus. : User search below the banner.. Response. : Website bring user to search page. Stimulus. : User selects a search criteria and key in a word as keyword. After. that, press the search button. Response. : It will validate see the textbox is empty or not. If empty, it will pop. up message box said that the textbox is empty or it will search the database with the criteria given and show it on gridview.. Functional Requirements -. Website must be able to search the database based on selected category (ISBN, book title , etc). -. Website must able to filter the book based on the keyword entered.. -. Website must able to show out the filtered book in gridview.. 28.

(35) Library Management System. Chapter 2: Requirement Analysis. 1.5 Change password Description of Feature This feature allows the user(Librarian and Library’s member) to change their password.. Stimulus / Response Sequences Stimulus. : After login click on change password on left side panel.. Response. : Website will bring user to change password page.. Stimulus. : User need to key in the current password, new password and. confirm password. After that click on submit button to proceed. Response. : It will validate see the textbox is empty or not. If empty, it will pop. up message box said that the textbox is empty or it will check the database see the current password is correct or not and also check the new password and confirm password is same or not. If it is correct then the password will be change.. Functional Requirements -. Website must check the empty textbox and correctness of the password.. -. Website able to update new password to database.. -. User can use the new password to log in.. 29.

(36) Library Management System. Chapter 2: Requirement Analysis. 1.6 User Profile Maintenance Description of Feature This feature allows user to edit and view their own profile.. Stimulus / Response Sequences Stimulus. : User press edit profile.. Response. : Website will bring user to profile page. It will shows user’s profile. information. Stimulus. : If users wish to edit their profile, users just need to click on the edit. button. After change, click on update button. Response. : If there are any errors, there will show a list of label with red colour. font show that what are the errors. If there are no errors, the data will update into database.. Functional Requirements -. Website must validate the errors.. -. Website must retrieve the data and show it on the correct field in the page.. -. Button edit will change to update when press.. 30.

(37) Library Management System. Chapter 2: Requirement Analysis. 1.7 Borrowed Book Maintenance Description of Feature This feature allows the user to view current book borrowed and book has been borrowed.. Stimulus / Response Sequences Stimulus. : Click on Current book borrowed to see current book borrowed.. Response. : Page show with the current book borrowed in gridview.. Stimulus. : Click on View borrowed book to see the history of what user have. borrow the book before. Response. : Page show with the history book borrowed in gridview.. Functional Requirements -. System must able to show the data on the gridview.. 31.

(38) Library Management System. Chapter 2: Requirement Analysis. 1.8 Reservation Maintenance Description of Feature This feature allows the user to reserve book, cancel reserve and view reserve.. Stimulus / Response Sequences Stimulus. : Click on Reservation to reserve book. Response. : Website will bring to reservation page.. Stimulus. : Search the book via category and click on reserve button.. Response. : Website will check the book is currently reserve or borrow by. anyone or not. If the book is not available, the message box will pop up to tell the user. It also check see the user available to borrow book or not. If user is not available to borrow book then he/she could not have permission to reserve book. Stimulus. : Click on Current book reserve to view current book that user. reserve. Response. : It will show the reserve book in gridview.. Stimulus. : If user want to cancel reserve, click on delete button in the. gridview. Response. : It will find the database and delete the reserve book that user. reserve.. Functional Requirements -. System must able to show data on gridview after search.. -. System must able to validate that the book can be borrow or not.. -. System must able to validate user have permission to borrow or not.. -. System must able to show the data on the gridview.. -. System able to delete the reserve book that user reserve.. 32.

(39) Library Management System. Chapter 2: Requirement Analysis. 2. Admin User. 2.1 View Report Description of Feature This feature allows the staff to view book comment and member expired report.. Stimulus / Response Sequences Stimulus. : Go to the report page. Choose which type of the report wanted to. show. Choose on Book comment. Response. : The Book comment tab show.. Stimulus. : User chooses on the category wanted to see and click on submit. button.. Response. : Website will bring user to another page show the report with the. criteria given. Stimulus. : Choose member expired.. Response. : The Member expired tab show.. Stimulus. : Choose on the date type wanted to show. Type is date, month and. year. Response. : Website will bring user to another page show the report with the. criteria given.. Functional Requirements -. Website must show the correct information via the criteria given.. 33.

(40) Library Management System. Chapter 2: Requirement Analysis. 2.2 News Maintenance Description of Feature This feature allows the staff to add, edit and delete news.. Stimulus / Response Sequences Stimulus. : Click on add news page.. Response. : Website will bring to news page.. Stimulus. : Key-in information in textbox to add news.. Response. : Website will add in to the database and show it in the gridview.. Stimulus. : Choose edit to edit the news and delete to delete the news in the. gridview. Response. : Website will update or delete into database due to which button is. click.. Functional Requirements -. Website must able to show the news.. -. Website must able to add, update and delete the news into database.. 34.

(41) Library Management System. Chapter 2: Requirement Analysis. 2.2 Data Flow Diagram 2.2.1. Context Diagram. Library Management System. 35. Member Info.

(42) Library Management System. Chapter 2: Requirement Analysis. 2.2.2. Level 0 DFD (Overview Diagram). 36.

(43) Library Management System. Chapter 2: Requirement Analysis. 2.2.3 Level 1DFD (Lower – Level Diagram). 1. Member Registration. 2. Book Rental. 37.

(44) Library Management System. Chapter 2: Requirement Analysis. 3. Return book. 4. Comment. 38.

(45) Library Management System. Chapter 2: Requirement Analysis. 5. Report. 39.

(46) Library Management System. Chapter 2: Requirement Analysis. 2.3 Summary In this chapter present about system objectives, system requirements and also Data Flow Diagram (DFD) for level 0 and level 1.. In this chapter, I have met problem of constructing of DFD diagram. It is because I and my group mate have already forgotten how to construct this diagram. We have no idea how to draw DFD diagram. In the help of the friend and also note that borrowed from our junior student. It reminds me back the construction of the DFD diagram.. After find the DFD diagram, the DFD has split to level 0 and level 1 DFD diagram. I could not understand why it split it to two different diagrams. I could not continue to draw but have to research on the diagram again. After research on internet, I finally can overcome this problem.. In this chapter, I have gain back the knowledge of DFD diagram. It also taught me a lesson about to keep everything that we have learnt. In my opinion, not everything that we can memorize but we need to have a backup so that when we need it we can refer back.. ‘. 40.

(47) Library Management System. Chapter 3: System Design. Chapter 3 System Design. 41.

(48) Library Management System. Chapter 3: System Design. 3.0 System Design At this chapter is about System design phase. GUI design, database design will be discuss in this chapter.. 3.1 External Interface Requirements 3.1.1. User Interfaces. Library Management System website is used by the users and staff. It is very important that the website should designed standard and user friendly so that everyone who visit the website can use easily. An example, a button user to edit thing should use EDIT word but not add or delete or just a picture.. 42.

(49) Library Management System. Chapter 3: System Design. Library Management System (Website) Guess. 1. Home Page. Figure 1.1 Home Page. Figure 1.1 above present the Library Management System website home page. These interface design for all users. Users allow view what is new books arrival at library and also what news happen at the library.. 43.

(50) Library Management System. Chapter 3: System Design. 2. FAQ. Figure 1.2 FAQ Page. Figure 1.2 present questions that may always ask by the users. When the users see this page, they may find out the answers that what they did not understand. If the users have more question and the questions do not shown in FAQ page, they can use FAQ page bottom part which is email to send the question to ask the staff.. 44.

(51) Library Management System. Chapter 3: System Design. 3. Contact Us. Figure 1.3 Contact Us Page. Figure 1.3 present about contact us. It show library operating time and also phone and e-mail. So, when users have problem they may see this page if they want to contact staff.. 4. About Us. Figure 1.4 About Us Page. Figure 1.4 show the about us which about the history of the library. It show the development time, development team, and operate in when.. 45.

(52) Library Management System. Chapter 3: System Design. 5. Search. Figure 1.5 Search Page. Figure 1.5 present about search function. This function allows the users to search the book at the website to see that what book is contains in the library. So they know what book inside before borrow. Click on the Detail button allows user to see the book detail and also the comment of the book.. 6. Book Detail. Figure 1.6. 46.

(53) Library Management System. Chapter 3: System Design. Figure 1.6 shows the book detail after search. These page designs for book detail. At the top has the title of the book and after that is the picture and also the detail of the following book. After that comment design at bottom part so that user allow to see the comment.. Member 1. Login Page. Figure 2.1 Login. Figure 2.1 is the login page for member and also admin level users. They have to key in the user ID and also user password to log in to the system. Different level of users have different function.. Figure 2.1.1 Member Menu. Figure 2.1.2 Staff Menu. Figure 2.1.1 and Figure 2.1.2 are the different of users menu. For member log in they have their own menu and staff log in they also have their own menu.. 47.

(54) Library Management System. Chapter 3: System Design. 2. Forget password. Figure 2.2 Forget Password Page. Figure 2.2 allows users to get back password when the user forgot their password. They have to key-in their user ID and their e-mail. So when the e-mail and the user ID is match then the system will send the password via e-mail to the user’s e-mail.. 3. Edit Profile. Figure 2.3 Edit Profile Page Figure 2.3 show the users profile for staff and member. If users wish to change the profile so will just need to click on edit button to change their profile.. 48.

(55) Library Management System. Chapter 3: System Design. 4. Change Password. Figure 2.4 Change Password Page. Figure 2.4 is the page which allows users to change their password. Users need to keyin the current password and then key-in the new password. After that, users have to retype the new password in the retype password to confirm that the new password and retype password that user type is correct. After submit, the user can use the new password to log in.. 5. Reservation. Figure 2.5 Reservation Page. Figure 2.5 allow member of the library to reserve book from the library. After they search the book they want to reserve, click on the Reserve button link, to reserve the book. After click, message box will pop up and show you the barcode number which needed member record down and go library get the book.. 49.

(56) Library Management System. Chapter 3: System Design. 6. View Borrowed Book. Figure 2.6 View Borrowed Book Page. Figure 2.6 show member that the member borrowed book before. In other word, is history of the member borrow book. Member also allows to see the book detail by clicking the book detail.. 7. Current Book Reserve. Figure 2.7 Current Book Reserve Page Figure 2.7 shows the member current book they have reserve. When the member wish to cancel the reserve, they can choose the delete button to cancel the reserve.. 50.

(57) Library Management System. Chapter 3: System Design. 8. Current Book Borrowed. Figure 2.8 Current Book Borrowed. Figure 2.8 show that the book currently borrow by the member. Date rented stated to show when is the user borrow the book.. Staff 1. News. Figure 3.1 News Page. Figure 3.1 is about news. It only can modify by staff. When staff add a new news at this page, the news will be shown at the main page so that every of the user can see the news. If the staff wish to edit the news, they will just need to click on the edit button to edit the news and if staff wish to delete, they will just need to click on the delete button to delete the news. 2. Member Expired Report. 51.

(58) Library Management System. Chapter 3: System Design. Figure 3.2 Report Page. Figure 3.2 is about member expired report. It show the member that are expired via date, month, and year in this 3 category. User can only choose one category.. Figure 3.2.1 Member Expired Report By Date. If user choose date, a calendar will show up to let the user to choose the date.. 52.

(59) Library Management System. Chapter 3: System Design. Figure 3.2.2 Member Expired Report By Month. If user choose month, Figure 3.2.2 will be show.. Figure 3.2.3 Member Expired Report By Year. If user choose year, Figure 3.2.3 will be show.. Figure 3.2.4 Member Expired Report Page. Figure 3.2.4 show the report generate via year 2012.. 53.

(60) Library Management System. Chapter 3: System Design. 3. Book Comment Report. Figure 3.3 Report Page. Figure 3.3 show the user see the book comment via four category which is category, publisher, language, and all.. Figure 3.3.1 Book Comment Report Page. Figure 3.3.1 Show the user report about book comment and the date via the criteria that the user choose.. 54.

(61) Library Management System. Chapter 3: System Design. 4. Edit Profile. Figure 3.4 Edit Profile Page. Figure 3.4 is edit profile page for staff. It is same with the member but the information is lesser compare to member. If staff wish to edit profile, click edit button to edit the profile.. 55.

(62) Library Management System. 3.1.2. Chapter 3: System Design. Hardware Interfaces. For Library Management System, the additional device for library is GSM modem or GSM phone. This device use to tell member when they borrow the book pass the due date SMS will remind them.. 3.1.3. Software Interfaces. Library Management System requires user to install SQL Server 2008. SQL server 2008 is support for more function and datatype. For operating system, Library System requires Window XP or newer version.. 3.1.4. Communication Interfaces. Library website is a web application. So, it required the internet connection. With a static line and fix ip address, the library only can host their own website at the server. So that everyone also can visit the website. HTTP helps to transferring data between web server and web client. Our library system will serves as web client and send the request to targeted web server. For the application, USB cable is use to connect to a GSM phone or GSM modem to send SMS.. 56.

(63) Library Management System. Chapter 3: System Design. 3.2 Entity Relationship Diagram (ERD). 57.

(64) Library Management System. Chapter 3: System Design. 3.3 Normalization. 3.3.1. 1st Normalization. RentalInfo (UserID, ISBN, BookTitle, Author, PublisherID, PublisherName, Language, Category, Description, BookCover, BarCodeID, Status, PurchasePrice, PurchaseDate,. UserName,. UserAddress,. UserPhone,. UserIC,UserRegDate,. AvailableBook, UserPass, UserPhoto, UserEmail, UserExpiredDate, DateRented, DateReturned, DateDue, TotalFine). Reservation (UserID, BarCodeID, DateRented). LibraryDetail (Libno, libname, libadd1, libadd2,libposcode,libstate, libtown, libphone, libfax, libemail, libweb). News(ID, date, content). ActivityLog (LogID, LogEmp, LogContent). LostBook (ID, BarCodeID*, UserID*, ISBN*, LostDate). Admin (Admin_ID, AdminName, AdminLevel, Password, AdminID, AdminContact, AdminEmail, AdminAddress). 58.

(65) Library Management System. 3.3.2. Chapter 3: System Design. 2nd Normalization. RentalInfo (UserID, ISBN, BookTitle, Author, PublisherID, PublisherName, Language, Category, Description, BookCover, BarCodeID, Status, PurchasePrice, PurchaseDate, DateRented, DateReturned, DateDue, TotalFine). User (UserID, UserName, UserAddress, UserPhone, UserIC,UserRegDate, AvailableBook, UserPass, UserPhoto, UserEmail, UserExpiredDate). Reservation (UserID, BarCodeID, DateRented). LibraryDetail (Libno, libname, libadd1, libadd2,libposcode,libstate, libtown, libphone, libfax, libemail, libweb). News(ID, date, content). ActivityLog (LogID, LogEmp, LogContent). LostBook (ID, BarCodeID*, UserID*, ISBN*, LostDate). Admin (Admin_ID, AdminName, AdminLevel, Password, AdminID, AdminContact, AdminEmail, AdminAddress). 59.

(66) Library Management System. 3.3.3. Chapter 3: System Design. 3rd Normalization. RentalInfo (UserID, ISBN, BarCodeID, DateRented, DateReturned, DateDue, TotalFine). Book (ISBN, BookTitle, Author, PublisherID, Language, Category, Description, BookCover). Publisher (PublisherID, PublisherName). BookCopy (BarCodeID, ISBN, Status, PurchasePrice, PurchaseDate). User (UserID, UserName, UserAddress, UserPhone, UserIC,UserRegDate, AvailableBook, UserPass, UserPhoto, UserEmail, UserExpiredDate). Reservation (UserID, BarCodeID, DateRented). LibraryDetail (Libno, libname, libadd1, libadd2,libposcode,libstate, libtown, libphone, libfax, libemail, libweb). News(ID, date, content). ActivityLog (LogID, LogEmp, LogContent). LostBook (ID, BarCodeID*, UserID*, ISBN*, LostDate). Admin (Admin_ID, AdminName, AdminLevel, Password, AdminID, AdminContact, AdminEmail, AdminAddress). 60.

(67) Library Management System. Chapter 3: System Design. 3.4 Data Dictionary. Table Name: ActivityLog Description : store all the activity done by user in the system Null/Not Default Fields Data Type Null Value LogId int Not null LogEmp nchar(10) Not null LogTime datetime Not null LogActivity varchar(MAX) Not null Field LogId(PK) LogEmp LogTime LogActivity. Rules -. Example Data 113 M0001 2011-02-16 16:35:07.000 Information of PublisherID P0003 has been updated. Table Name: Admin Description : store the information of user who used the library system Null/Not Default Fields Data Type Rules Null Value Admin_ID nvarchar(50) Not null Admin_Name nvarchar(50) Not null Admin_Level nvarchar(50) Not null Format : 1,0 Password nvarchar(50) Not null Admin_ic nvarchar(50) Not null admin_contact nvarchar(50) Not null admin_email nvarchar(50) Not null admin_address nvarchar(MAX) Not null Field Admin_ID Admin_Name Admin_Level Password Admin_ic admin_contact admin_email admin_address. Example Data M0001 Tan Chaur Chuan 1 12341234 880704-35-5263 04-3984851 [email protected] 30, lintang perai 2, taman chai leng, 34567 pahang.. 61.

(68) Library Management System. Chapter 3: System Design. Table Name: Book Description : store the information of the books Null/Not Fields Data Type Null ISBN nvarchar(50) Not null BookTitle nvarchar(50) Not null Author nvarchar(50) Not null PublisherID nvarchar(50) Not null Language nvarchar(50) Not null Category nvarchar(50) Not null Description nvarchar(MAX) Not null BookCover nvarchar(MAX) Not null Field ISBN(PK) BookTitle Author PublisherID Language Category Description BookCover. Default Value -. -. Example Data 9781587132049 Handphone King C.Y P0001 Chinese Technology A book which show the latest information of all brand handphone Handphone.JPG. Table Name: BookComment Description : to store the comment for particular book Null/Not Default Fields Data Type Null Value CID Int Not null ISBN Nvarchar(50) Not null UserID Nvarchar(max) Not null Comment Nvarchar(max) Not null Field CID ISBN UserID Comment. Rules. Example Data 13 1234567891234 M0001 This book is very interesting…thanks. 62. Rules -.

(69) Library Management System. Chapter 3: System Design. Table Name: BookCopy Description : to store the quantities of books and the detail of each book Null/Not Default Fields Data Type Rules Null Value BarcodeID nvarchar(50) Not null ISBN nvarchar(50) Not null Status nvarchar(50) Not null Format : L, A, N PurchasePrice Money Not null purchaseDate Datetime Not null Field barcodeID ISBN Status PurchasePrice PurchaseDate. Example Data 978158713204901 9781587132049 L 200.0000 2011-02-16 00:00:00.000. Table Name: News Description : to post the latest news at web site’s main page Null/Not Default Fields Data Type Null Value ID Int Not null Date Date Not null [content] Nvarchar(50) Not null Field ID Date [content]. -. Example Data 9781587132049 2011-01-13 The popular book ‘The Lord of the Ring’ is now available !!!. Table Name: Book Description Description : to store the description of particular book Null/Not Default Fields Data Type Null Value ISBN Nvarchar(50) Not null Description Nvarchar(max) Not null Field ISBN Description. Rules. Rules -. Example Data 9781587132049 This book is talk about the journey of one kids to find his parents.. 63.

(70) Library Management System. Chapter 3: System Design. Table Name: LibraryDetail Description : to store the information of the library Null/Not Fields Data Type Null libno Char(10) Not null Libname varchar(50) Not null Libadd1 varchar(50) Not null Libadd2 varchar(50) Not null Libposcode Char(5) Not null Libstate varchar(50) Not null Libtown varchar(50) Not null Libphone varchar(50) Not null Libfax varchar(50) Not null Libemail varchar(50) Not null Libweb varchar(50) Not null Field libno Libname Libadd1 Libadd2 Libposcode Libstate Libtown Libphone Libfax Libemail Libweb. Default Value -. Rules Format : [email protected] -. Example Data 001 Chen Library 30, lintang perai 5, Taman putang, 13506 Pulau Pinang Butterworth 04-3859451 04-3225645 [email protected] www.google.com. Table Name: Reservation Description : to record the book reservation for the member Null/Not Default Fields Data Type Null Value UserID Nvarchar(50) Not null BarCodeId Nvarchar(50) Not null DateReserve date Not null Field Example Data UserID M0001 BarCodeId 584961352652401 Table Name: LostBook Description : to keep the information of lost book. 64. Rules -.

(71) Library Management System. Fields. Data Type. ID Userid Barcodeid ISBN LostDate. int varchar(50) varchar(50) varchar(50) Date. Field ID Userid Barcodeid ISBN LostDate. 3 M0002 978158713204901 9781587132049 2011-02-16. Chapter 3: System Design. Null/Not Null Not null Not null Not null Not null Not null. Rules -. Example Data. Table Name: RetalInfo Description : to keep the book transaction detail Null/Not Fields Data Type Null userID nvarchar(50) Not null BarCodeID nvarchar(50) Not null DateReturned Datetime DateRented Datetime Not null DateDue Datetime Not null Total Fine money Field userID BarCodeID DateReturned DateRented DateDue Total Fine. Default Value -. Default Value -. Example Data M0003 123456789123401 2011-03-02 00:00:00.000 2010-09-09 00:00:00.000 2010-10-10 00:00:00.000 200.0000. 65. Rules -.

(72) Library Management System. Chapter 3: System Design. Table Name: Publisher Description : to store the publisher so it is available when register book Null/Not Default Fields Data Type Null Value PublisherId Nvarchar(50) Not null PublisherName nvarchar(50) Not null Field PublisherId PublisherName. Example Data P0001 Tan Khen Khen. Table Name: User Description : to store the information of the member Null/Not Fields Data Type Null UserID Char(10) Not null Username varchar(50) Not null Useraddress varchar(50) Not null UserPhone varchar(50) Not null UserIC Char(5) Not null UserRegDate varchar(50) Not null AvailableBook varchar(50) Not null Userpass varchar(50) Not null Userphoto varchar(50) Not null Useremail varchar(50) Not null UserExpiredDate varchar(50) Not null Field UserID Username Useraddress UserPhone UserIC UserRegDate AvailableBook Userpass Userphoto Useremail UserExpiredDate. Rules. Default Value -. Rules Format : [email protected] -. Example Data M001 Ooi Yee Neng 30 lintang talang 2, taman perai. 13600 Perai, Penang. 04-3568956 880407-35-5266 2011-02-16 00:00:00.000 4 12345678 Tan_chen_khen.JPG [email protected] 2012-03-05 0:00:00.000. 66.

(73) Library Management System. Chapter 3: System Design. 3.5 Summary In this chapter discuss about normalization, Entity Relationship Diagram (ERD), interface design and also database design.. For the interface design, because it is website and it for member and librarian, the website must design user friendly so that every user can easily learn how to use the website in a short period of time. When I am designing this website, there are few problems occur. One of the problems is the alignment of the website. When I design at Visual studio 2008 the lay out should be find but when run it, the alignment is not correct. I have to readjust it. Second problem is the browser problem. Different browser may cause different interface when run. I faced internet explorer 7 problem. When run the website, the alignment is not correct compare to Mozilla Firefox and also Google Chrome when run. After research and also friend helps, I used script to control so that when it comes to different browser it will run the particular browser alignment.. Besides that, I met a big problem on normalization. Because of the database design has already designed, we have to normalize from 3rd to 1st normalization form. In this normalization, I found out that some of the table does not naming properly. Example Staff table normally for ID would be StaffID but we name it as ID. In this case, We could not know this ID is for which table but it actually is staff id. After discuss with my group mate, we change the naming of the database to overcome the problem.. In this chapter, a good interface design is important because it can convince the user to use the website. A complicated website will cause the user does not want to serve the website. Other than that, database design also important such as primary key and foreign key in the database. If these keys do not exist, then duplicate data will happen.. 67.

(74) Library Management System. Chapter 4: Programming. Chapter 4 Programming. 68.

(75) Library Management System. Chapter 4: Programming. 4.0 Programming This chapter will discuss about coding for the system. In the development, logic and coding skill is required. A good coding can enhance the efficiency of the system so that when other people wanted to implement the coding they can easily understand the code. Following would discuss the sample programming and description of the book.. 4.1 Coding 1. Database Class using System.Data.OleDb; public class DBConnector { OleDbConnection con; public OleDbDataReader dtr; public DataSet DS = new DataSet(); public DBConnector(string strProvider, string strDBPath) { con = new OleDbConnection("Provider = SQLNCLI10; server = 127.0.0.1 ;Database=LibrarySystem; user id = keat; Password = 1234;"); } public bool con_Open() { con.Open(); try { return true; } catch { return false; } } public void con_Close() { if (con.State == ConnectionState.Open) { con.Close(); } } public bool DB_Reader(string strQuery) { OleDbCommand cmd;. 69.

(76) Library Management System. Chapter 4: Programming. cmd = new OleDbCommand(strQuery, con); dtr = cmd.ExecuteReader(); if (dtr.HasRows) { return true; } else { return false; } } public bool DB_Command(string strQuery) { OleDbCommand cmd; cmd = new OleDbCommand(strQuery, con); cmd.ExecuteNonQuery(); return true; try { } catch { return false; } } public bool DB_DS(string strQuery,string strTableName) { OleDbDataAdapter adp = new OleDbDataAdapter(strQuery, con); adp.Fill(DS, strTableName); try { return true; } catch { return false; } } }. The coding above about is a database class. At first we need to import a OLEDB class. It is to ease to reuse this class to connect the database. In this class, it has created a few functions which link with database and the coding. The first is the connection string that specify where to connect to. Con_open() is open the connection to database, and Con_close() is to close the connection. DB_Reader() is data reader use to read the data. 70.

(77) Library Management System. Chapter 4: Programming. from the database. DB_Reader() required to insert a SQL query to get the data . DB_DS() is a dataset. It use to store the data that has been retrieve from the database. It required to insert a SQL query and a data table name. DB_Command() is database command allow it read the execute insert, update and delete in the database. Below is the example of the query used. DBConnector DBase = new DBConnector(); DBase.con_Open(); Dbase.con_Close();. This code use when we want to open a connection to database. Dbase.con_Open() is to open the connection. Dbase.con_Close(), is to close the database connection. DBase.DB_Reader("SELECT * FROM BOOK") DBase.DB_DS("SELECT * FROM BOOK",”BookTable”);. This code use when we want to get data from database to data reader and data set. Data set need one more parameter because data set needed table name. DBase.DB_Command("INSERT INTO [Admin] VALUES [admin_address]='" + address + "'); DBase.DB_Command("UPDATE [Admin] SET [admin_address]='" + address + "'); DBase.DB_Command("DELETE FROM [Admin] WHERE [admin_id]=’123’ );. This code use when we want to execute a insert or update, or delete into database. It require a insert or update or delete command at this function.. 71.

(78) Library Management System. Chapter 4: Programming. 2. Search Function DBConnector DBase = new DBConnector(); DBase.con_Open(); DBase.DB_DS("SELECT dbo.Book.ISBN, dbo.Book.BookTitle, dbo.Book.Author, dbo.Book.Language, dbo.Book.Category, dbo.Publisher.PublisherName FROM dbo.Book INNER JOIN dbo.Publisher ON dbo.Book.PublisherID = dbo.Publisher.PublisherID WHERE [" + type + "] LIKE '%" + search + "%'", "Book"); gvSearch.DataSource = DBase.DS; gvSearch.DataBind(); DBase.con_Close();. This is the search function of the website. It will first put the data into the data set and after that bind the data to gvSearch gridview. When the button search click, this query will be execute. <asp:GridView ID="gvSearch" runat="server" AutoGenerateColumns="False" onrowcommand="gvSearch_RowCommand" OnPageIndexChanging="gvSearch_PageIndexChanging" AllowPaging="True" onselectedindexchanged="gvSearch_SelectedIndexChanged"> <Columns> <asp:BoundField DataField="ISBN" HeaderText="ISBN" /> <asp:BoundField DataField="BookTitle" HeaderText="BookTitle" /> <asp:BoundField DataField="Author" HeaderText="Author" /> <asp:BoundField DataField="PublisherName" HeaderText="PublisherName" /> <asp:BoundField DataField="Category" HeaderText="Category" /> <asp:ButtonField CommandName="Detail" HeaderText="Detail" Text="Detail" /> </Columns> </asp:GridView>. This is a gridview called gvSearch. By putting in onselectedindexchanged= gvSearch_ SelectedIndexChanged”, it enable the gridview to put in the button. In there I have put the detail button so that when the user search the book they can click the detail button to see the book detail. protected void gvSearch_RowCommand(object sender, GridViewCommandEventArgs e) { string command = e.CommandName.ToString(); if ((command).ToUpper() == ("detail").ToUpper()) { string ISBN = gvSearch.Rows[int.Parse(e.CommandArgument.ToString())].Cells[0].Text; Session["ISBN"] = ISBN; Server.Transfer("../Home/BookDescription.aspx");. 72.

(79) Library Management System. Chapter 4: Programming. } }. This is the detail button which allows the user to click and transfer to another page. So when the button is click, the id of the row will be store and transfer to other page. So that when the book description page show they will know which the book that has to be show is.. 3. Email using System.Net.Mail;. MailMessage message = new MailMessage(); message.To.Add("[email protected]"); message.Subject = txtsubject.Text; message.From = new System.Net.Mail.MailAddress(txtfrom.Text); message.Body = TextArea1.Value; SmtpClient sc = new SmtpClient(); sc.Credentials = new System.Net.NetworkCredential("[email protected]", "XXXXXXXXX"); sc.Port = 587; sc.Host = "smtp.live.com"; sc.EnableSsl = true; sc.Send(message);. The coding above is about Email. At first we have to import Mail class in order to use Email. This function allows us to send an email. The thing we need to prepare is a email and find a smtp server. At here I used hotmail as my smtp server and [email protected] as my hotmail. The port to hotmail server is 587 and the host address for hotmail is smtp.live.com. After prepare, we will just have a subject, a sender mail, a receiver mail and content. This part I have implement in the FAQ part and also Forget Password part.. 73.

(80) Library Management System. Chapter 4: Programming. 4. Log in / Log out private bool Login(string ID, string password, string Type) { DBConnector DBase = new DBConnector(); string msg; bool valid; if (DBase.con_Open()) { if (Type == "Admin") { if (DBase.DB_Reader("SELECT * FROM [Admin] WHERE Admin_ID='" + ID + "'")) { DBase.dtr.Read(); if (DBase.dtr["password"].ToString() == password) { msg = "Successful Login"; Session["ID"] = DBase.dtr["Admin_ID"].ToString(); Session["level"] = Type.ToString(); valid = true; } else { msg = "Incorrect Password."; valid = false; } } else { msg = "Unregistered ID."; valid = false; } } else { if (DBase.DB_Reader("SELECT * FROM [User] WHERE UserID='" + ID + "'")) { DBase.dtr.Read(); if (DBase.dtr["userpass"].ToString() == password) { msg = "Successful Login"; Session["ID"] = DBase.dtr["UserID"].ToString(); Session["level"] = Type.ToString(); valid = true; } else { msg = "Incorrect Password."; valid = false; } } else. 74.

(81) Library Management System. Chapter 4: Programming. { msg = "Unregistered ID."; valid = false; } } DBase.con_Close(); } else { msg = "Failed to connect to server"; valid = false; } if (valid) { lblError.Text = msg; } else { lblError.Text = msg; } return valid; }. This coding is about log in and log out. Because it have two type of user which are admin and member, the code has separate two parts. If users choose admin, it will go to admin table to validate but if users choose member, it will go member table to validate. After log in the type and ID will be store in the session value which is Session[“level”] and Session[“ID”]. protected void btnLogOut_Click(object sender, EventArgs e) { Session["level"] = "guest"; Session["id"] = ""; mvSecurity.ActiveViewIndex = 0; tbllogout.Visible = false; mvMenu.ActiveViewIndex = 0; Server.Transfer("../home/home.aspx"); }. This is the log out coding. So when the users log out the level will set become a guest.. 75.

References

Related documents

Favor you leave and sample policy employees use their job application for absence may take family and produce emails waste company it discusses email etiquette Deviation from

CD (%) PTW (%) Number of speed tickets/10 000 habitants Poland Hungary Sweden Estonia Finland Czech Republic Ireland Germany Netherlands Slovenia Greece Belgium Serbia

By investigating the underlying demotivating factors associated with foreign language learning, this study will offer support in terms of comprehending theories of motivation, and

Previous Ge-on-Si SPADs have used a mesa etch to define the device area; here, we present pseudo-planar devices which led to a three order of magnitude improvement in dark count

production of cellulose regenerate fibers and films, as well as for the synthesis of a large number of cellulose esters and ethers.. Such cellulose derivatives produced on an

Suspension only permitted in top position Inclusion of suspended folding platform or suspended platform (scaffold cat.2) possible Planking bridging only with extra bracket.

Retrieval for the Selection and Sensitivity Review of Digital Public Records”; Gollins, “The National Archive, Big Data and Security.”.. 64 Salton and Buckley,

Thèse include : (a) such socio- demographic characteristics of white-collar workers as their sex, social origins, âge, and status in the community ; (b) such aspects of their