report on library mangement

Embed Size (px)

Citation preview

  • 8/7/2019 report on library mangement

    1/521

    Certificate

    This is to certify that Mr. PRATEEK GAURAVof

    Department InformationTechnology (B) , Semester

    FIFTH , Session 2008-2012 , Registration number

    14090058 , SOE , CUSAThas successfully completed his

    project on LIBRARYMANAGEMENT SYSTEMunderthesupervision and guidance of Mr. PHILIP SAMUEL .

    ___________________

    Dated :____________ Project Incharge

    Place : kochi

  • 8/7/2019 report on library mangement

    2/522

    Acknowledgement

    At the outset, we thank God almighty for making our endeavor

    a success. We also express our gratitude to Dr. Philip

    Samuel, Head of the Department for providing us with

    adequate facilities, ways and means by which we were able to

    complete this project.

    We express our sincere gratitude to our Project Guide Mr.

    Rohit J Markus,Orionis Academy for his constant support and

    valuable suggestions without which the successful completion

    of this project would not have been possible.

    We express our immense pleasure and thankfulness to all the

    teachers and staff of the Department of Information

    Technology, CUSAT for their cooperation and support.

    Last but not the least, we thank all others, and especially our

    classmates and our family members who in one way or another

    helped us in the successful completion of this work.

  • 8/7/2019 report on library mangement

    3/523

    Contents

    1.Introduction4 - 5

    2.Software Requirement Specification

    Purpose of document 6

    Scope7

    Objective7 - 8

    Budget8

    Technology used8 - 9

    Overview of solution9

    Milestones9 -10

    Business objective10

    Constraints10

    Features and services11

    Assumption /Risk assessment11-12

    Functional specification12 Infrastructure 12

    Server / solution 12

    Client platform 13

    Non functional requirement 13

    Software quality attributes 13 -14

    Technical challenges 14

    3.Data flow diagram 15 -164.Forms 17 -28

    5.Asp codes 29 -50

    6.Conclusion 51

    7.Bibiliography 52

  • 8/7/2019 report on library mangement

    4/524

    Introduction

    As the name suggests Library Management System will deal

    in all the requirements needed for managing libraries. It will

    deal with the process of maintaining data about the books and

    many other things as well as transactions, which are taking

    place in the library with respect to the issue and return of the

    books.

    This solution helps the administrator to accomplish his tasks

    at ease. This solution is an online library management system,

    which lets users sign-up to the library initially and then sign-

    in every time they want to find some item in the library. The

    user can also maintain and edit his profile details.

    It also lets administrators manage the library from their

    desktop. They can monitor any item, its stock and other

  • 8/7/2019 report on library mangement

    5/525

    related information. A user can sign-in and search for items,

    borrow items if they are present in the library. All details of

    the user are stored in the database, which eases pressure on

    the administrator about defaulters. The administrator can

    block or remove the defaulters from the library. The user need

    not visit the library every time to find an item; instead, he/she

    can search items from his/her own PC/laptop. Reports can also

    be generated for individual items or for number of defaulters

    and the number of transactions for an item or by a user.

  • 8/7/2019 report on library mangement

    6/526

    SoftwareRequirement

    Specification

    Purpose of this Document :

    This is the Software Requirements Specification for the

    Library Management System. The purpose of this document is

    to convey the functional and performance requirements of the

    product as specified by the feasibility study and requirement

    analysis conducted by the developer. Primarily, this document

    ensures that the software requirements of the product are

    properly understood by the programmer/developer as specified

    by the clients. To create software for managing the products

    inside the company and publishing the product details to the

    world using a web application.

  • 8/7/2019 report on library mangement

    7/527

    Scope :

    The objective of the Library Management is to create a central,

    functional website which contains the details of all the books

    available in the library, so that it can be searched by the users

    who visit the site .Mainly there are two classes of users

    administration and Library Members(students).Admin can use

    all the links to perform the operation for the receiving and

    lending of the books and keep all the details of the books andthe respective students who has taken the book. User can go

    through all the links available to him/her. The system shall

    require a user to login , in order to see the details of his own

    and the issued books . It will ask the user for the following

    information username and password. Website keeps the

    details of registered users and books on their database.

    Objective :

    Objective of the project is to create a library management

    system which sorts the administrators and studentsseparately. It empowers each with different levels of privileges.

    Users and administrators are allowed to search and lend/take

    books from the library. It also sorts the items in the library

    and lets administrator to monitor items/members and also

  • 8/7/2019 report on library mangement

    8/528

    generate graphical reports for them. Administrator can even

    deny membership to them if the rules are not followed strictly.

    BUDGET :

    Budget would include initial setup of the server that would

    include a system as a server and one system for

    browsing/searching the library. Using many more systems for

    browsing may affect the budget of the solution implementer.

    TECHNOLOGY USE :

    ASP.NET 2.0

    ASP.NET is a server side scripting technology that

    enables scripts (embedded in web pages) to be executed

    by an Internet server. ASP.NET is a part of the

    Microsoft .NET framework, and a powerful tool for

    creating dynamic and interactive web pages.

    ASP.NET is a Microsoft Technology

    ASP stands for Active Server Pages

    ASP.NET is a program that runs inside IIS

    IIS (Internet Information Services) is Microsoft's Internet

    server

    IIS comes as a free component with Windows serversIIS is also a part of Windows 2000 and XP Professional

    SQL Server 2005 Express edition

    SQL is a standard language for accessing and manipulating databases.

  • 8/7/2019 report on library mangement

    9/529

    SQL stands for Structured Query Language

    SQL lets you access and manipulate databases

    SQL is an ANSI (American National Standards Institute)

    standard

    Windows XP Professional Edition

    All the above listed softwares are either freeware or trial version

    software. Certain features which these lacks may be successfully

    executed using a licensed version of the same set of softwares. Hence

    this affects the budget of a solution developer.

    OVERVIEW OF SOLUTION :

    The users and administrators can create their accounts based

    on different privileges. They can lend borrow books in library

    based on their privileges. Administrator sorts, edits the items

    in the library. By using this solution, managing/maintaining

    the server becomes easy. The interface provides more

    information and saves time. This is much more accurate than

    a librarian updating the fields manually. The database is

    updated after every transaction and leaves no user fooled

    about the status of availability of an item.

    Milestones :

    Analyzing solutions and finding possible entities.

    Designing the user interface.

    Prototyping the project.

  • 8/7/2019 report on library mangement

    10/5210

    Creating data base tables and establishing relationships

    with the user interface.

    Code the user authentications, search algorithms and other

    special features.Testing the solution and bettering it.

    Implementing the solution and also documenting it.

    Business Objectives :

    To provide a reliable solution.

    Better interfaces to make transactions easier.

    To help users get accurate search results in no-time.

    To make the solution available to every library present.

    To improve solution based on feedback from the solution

    audience.

    Constraints :

    Constraint Known impact Issues :-

    1. Non-availability of licensed softwares. Lesser number of

    features generated from limited trial wares.

    Developer may find difficulties in creating the solution.

    2. User must have basic knowledge of computers. User finds it

    difficult to use the computer. Solution cannot be exploited

    properly.

  • 8/7/2019 report on library mangement

    11/5211

    Features and Services :

    Features of the library management are as follows:-Registration - Allows users to sign up for accessing the library.

    Managing the library - Allows administrators to update,

    view/edit book details and also categorize them into different

    categories based on type.

    Search facility - Users including the administrators can check

    for books if it is available or not . Administrator can also check

    the members if any one has taken the book or not.

    Monitor members- Administrator can monitor members too

    and also view details or can even deny membership to

    defaulters.

    Assumption / Risk assessment :

    Assumptions support the base of the solution. Assumptions

    include :-

    Library houses a certain minimum number of copies of the

    same book for sake of many borrowers.

    Library uses original books.

    Library server is not overloaded and is maintained

    throughout the year.

    Library restricts the maximum number of borrowable items

    for different users.

    Library server runs a version of Windows operating system.

  • 8/7/2019 report on library mangement

    12/5212

    Client systems support .NET Framework.

    User has basic computer knowledge and knows how to

    search/find information in the internet.

    User has a decent internet speed to run the online solution.

    Functional specification:

    Initially when the solution is host in the server, administratoraccounts are setup. These administrators manage the server.

    First time users can carry on with simple search but those who

    want to borrow books need to sign-up for this facility. They can

    then sign-in anytime for searching, borrowing or returning

    books. They can also view their profile pages.

    Infrastructure :

    Infrastructure plays an important role in this type of server-

    client computing. Both server and client require a minimum

    amount of configuration to run the implementation.

    Server/Solution:

    Platform Server must run a WINDOWS OS which supports IIS so that

    the website can be deployed. The server must also be capable of running

    Visual studio and SQL Server for database management.

  • 8/7/2019 report on library mangement

    13/5213

    Client Platform :

    Client system must run a windows operating system. It must

    run browsers which support .NET framework like Internet

    Explorer or Mozilla Firefox.

    Non functional requirement:

    Performance Requirements :-

    The user must have a system which is capable of running a

    Windows operating system released after Windows 98/XP, i.e.

    it requires a minimum of 256 MB RAM.

    Software requirements :-

    Front end: ASP.NET

    Back end: SQL Server

    Security Requirements :-

    The users are authenticated with their register numbers and

    passwords. The password can be changed anytime by the user to

    improve security.

    Software Quality Attributes :

    The interface is such that the user can learn from looking at

    the menus. Help files will also be provided with the solution.

    Use of .NET 2.0 has improved reliability and major

  • 8/7/2019 report on library mangement

    14/5214

    improvement in functionality which makes it more adaptable

    and flexible.

    Technical Challenges :

    Real-time searching algorithms.

    Gridview is available for the user used to check book details

    online and retrieve it for the user.

    Using AJAX Controls for various features.

    Intricacies in databases are not known.

  • 8/7/2019 report on library mangement

    15/5215

    Date flow diagram

    Level - I

    User

    Library Management

    System

    User

    Admin LoginBook

    registrationTable book

    LendingLending

    table

    ReturningLending

    table

    Student

    registration

    Student

    record

  • 8/7/2019 report on library mangement

    16/5216

    Level - II

    Student Login Available

    book

    Lending

    table

    Student

    profile

    Student

    record

  • 8/7/2019 report on library mangement

    17/5217

    FORMS:

    Loginpage:

    This is the home page of OnlineLibrary.com There are two

    parts of login interface. One is Administrator Login and the

    other is users Login. The login id and password is fixed for

    Administrator. Administrators have full access on the system

    like insertion, modification, deletion etc. The homepage

    restricts the entry of unauthorizedmembers andon entering

  • 8/7/2019 report on library mangement

    18/5218

    correct username and password, valid members are navigated

    to homepage.

    Home page :

    This is the home page viewed when admin logins. It consists of

    several links like homepage, Book registration, Member

    registration, Book availability, Lending process, Returning

  • 8/7/2019 report on library mangement

    19/5219

    process, Lended books. The Homepage also contain a list of

    rules regarding decorum of library. Admin can navigate to

    corresponding page just by clicking on the specified links.

    This is the home page viewed when valid members logins. It

    consists of several links like homepage, Book availability,

    Member profile. The Homepage also contain a list of rules

  • 8/7/2019 report on library mangement

    20/5220

    regarding decorum of library. Members can navigate to

    corresponding page just by clicking on the specified links.

    Book registration :

    In this page all details i.e. (Book Name, Book Code, Author

    Name, Publisher, Category and Price) regarding the books can

    be inserted and saved through

    Submit button. Clear button is used to clear all the textboxes

    and dropdown lists. If the admin want to update any details of

  • 8/7/2019 report on library mangement

    21/5221

    any book that is already available in database then he just

    need to click Edit button. On clicking Editbutton a grid view

    will appear with select option through which he can select the

    required book and all the details regarding that book is itselffilled in the respective text boxes. Then the field he wants to

    change he can update through Update button.

    Member registration :

    In this page all details i.e. (Student Name, User Name,

    Password, Retype Password, Registration Number, Course,

    Batch, Address and Contact Number) regarding the Students

  • 8/7/2019 report on library mangement

    22/5222

    can be inserted and saved through Submit button. Clear

    button is used to clear all the textboxes and dropdown lists. If

    the admin want to update any details of any Student that is

    already available in database then he just need to click Editbutton. On clicking Edit button a grid view will appear with

    select option through which he can select the required Student

    and all the details regarding that Student is itself filled in the

    respective text boxes. Then the field he wants to change he can

    update through Update button.

    Book availability :

  • 8/7/2019 report on library mangement

    23/5223

    This page consists of a grid view which lists all the books

    available in the library along with their respective book code.

    Lending process :

  • 8/7/2019 report on library mangement

    24/5224

    This page is used to save details regarding the student, the

    book and the date of issue, in the database with the help of

    Save button. During page load the date of issue is considered

    to be todays date but the admin is also provided the calendar

    through which he can select any date. As soon as admin select

    any student then side by side a grid view is also shown which

    lists all the books that have been current issued against that

    student. Clear button is used to clear all the text boxes. Admin

    can also update any lending record just by clicking on the

    student in the grid view.

  • 8/7/2019 report on library mangement

    25/5225

    Returning process :

    This page is used to save details regarding the student, the

    book the date of issue and the fine, in the database with the

    help of Save button.During page load the date of return is

    considered to be todays date but the admin is also provided

    the calendar through which he can select any date. Fine is also

    calculated and is displayed in the fine text box. . As soon as

  • 8/7/2019 report on library mangement

    26/5226

    admin select any student then side by side a grid view is also

    shown which lists all the books that have been current issued

    against that student. Clear button is used to clear all the text

    boxes. Admin can also update any returning record just byclicking on the student in the grid view. Actual date of

    returning is after fourteen days of date of issue.

    Lended books:

    This page consists of grid view which shows all the books that

    have been lended along with other details like Book code,

    Author, Student name, Registration number, course, Batch,

    Date of issue.

  • 8/7/2019 report on library mangement

    27/5227

    Student profile :

    This page is loaded when any valid member logins and then in

    homepage clicks the link of student profile. In this page all the

    details about him is given in the corresponding text boxes. Thispage consist a grid view also which lists all the books that have

    been issued on his name. This page is provided so that the

    valid members can also keep records about their membership

    and can also see which all books have been issued on their

  • 8/7/2019 report on library mangement

    28/5228

    name. But the members are not given the provision to change

    any record as all the text boxes are in the read only mode.

    Asp Codes

    Login page :

  • 8/7/2019 report on library mangement

    29/5229

    using System;

    using System.Text;

    using System.Collections;

    using System.Configuration;

    using System.Data;

    using System.Linq;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.HtmlControls;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Xml.Linq;

    publicpartialclasslibs_Pages_LoginPage : System.Web.UI.Page

    {

    protectedvoid Page_Load(object sender, EventArgs e)

    {

    }

    protectedvoid Login_Authenticate(object sender, AuthenticateEventArgs e)

    {

    StringBuilder stbSQL = newStringBuilder();

    stbSQL.AppendFormat("SELECT Id,Type FROM LoginRecord WHERE

    UserName='{0}' AND Password='{1}'", Login1.UserName, Login1.Password);

    DataTableReader dr = CGeneral.Read(Convert.ToString(stbSQL));

    if(dr.Read())

    {

    if(!dr.IsDBNull(0))

    {

    Int32 int32Id = dr.GetInt32(0);

    Int32 int32Type = dr.GetInt32(1);

    Session["UserId"] = int32Id;

    Session["UserType"] = int32Type;Response.Redirect("~/libs/Pages/Home/HomePage.aspx");

    }

    else

    {

    e.Authenticated = false;

    }

  • 8/7/2019 report on library mangement

    30/5230

    }

    }

    }

    Member registration :using System;

    using System.Text;

    using System.Collections;

    using System.Configuration;

    using System.Data;

    using System.Linq;using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.HtmlControls;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Xml.Linq;

    publicpartialclasslibs_Pages_Member_Registration : System.Web.UI.Page

    {

    protectedvoid Page_Load(object sender, EventArgs e){

    }

    protectedvoid CustomValidatorCourse_ServerValidate(object source,

    ServerValidateEventArgs args)

    {

    if(DropDownListCourse.SelectedValue == "-1")

    args.IsValid = false;

    }

    protectedvoid Submit_Click(object sender, EventArgs e)

    {

    String strStudentName,strRegistrationNumber,

    strAddress,strContactNumber,strUserName,strPassword ;

    StringBuilder stbSQL = newStringBuilder();

    strStudentName = TextBoxStudentName.Text;

    strRegistrationNumber=TextBoxRegistrationNumber.Text;

  • 8/7/2019 report on library mangement

    31/5231

    Int32 int32Course = Convert.ToInt32(DropDownListCourse.SelectedValue);

    int int32Batch = Convert.ToInt32( DropDownListBatch.SelectedValue);

    strAddress = TextBoxAddress.Text;

    strContactNumber = TextBoxContactNumber.Text;

    strUserName = TextBoxUserName.Text;

    strPassword = TextBoxPassword.Text;Int32 int32Id = CGeneral.GetNextId("LoginRecord", "Id");

    stbSQL.Append("INSERT INTO

    LibraryStudentRecord(Id,StudentName,RegistrationNumber,Course,Batch,Address

    ,ContactNumber)");

    stbSQL.AppendFormat("Values({0},'{1}','{2}',{3},{4},'{5}','{6}')" , int32Id,

    strStudentName, strRegistrationNumber, int32Course, int32Batch, strAddress,

    strContactNumber);

    CGeneral.Execute(stbSQL.ToString());

    StringBuilder stbSQL1 = newStringBuilder();

    stbSQL1.Append("INSERT INTO

    LoginRecord(Id,UserName,Password,Type) ");

    stbSQL1.AppendFormat("Values('{0}','{1}','{2}',2)", int32Id, strUserName,

    strPassword);

    CGeneral.Execute(stbSQL1.ToString());

    clear();

    }

    protectedvoid clear()

    {

    TextBoxStudentName.Text = " ";TextBoxAddress.Text = " ";

    TextBoxContactNumber.Text = " ";

    TextBoxRegistrationNumber.Text = " ";

    DropDownListCourse.SelectedIndex = 0;

    TextBoxUserName.Text = " ";

    TextBoxPassword.Text = " ";

    TextBoxRetypePassword.Text = " ";

    DropDownListBatch.SelectedIndex = 0;

    ButtonEdit.Visible = true;

    ButtonSubmit.Visible = true;

    GridViewLibraryStudentRecord.Visible = false;ButtonUpdate.Visible = false;

    }

    protectedvoid Clear_Click(object sender, EventArgs e)

    {

    clear();

    }

  • 8/7/2019 report on library mangement

    32/5232

    protectedvoid CustomValidatorBatch_ServerValidate(object source,

    ServerValidateEventArgs args)

    {

    if(Convert.ToInt32(DropDownListBatch.SelectedValue) == -1)

    args.IsValid = false;

    }protectedvoid ButtonEdit_Click(object sender, EventArgs e)

    {

    GridViewLibraryStudentRecord.Visible = true;

    }

    protectedvoid ButtonUpdate_Click(object sender, EventArgs e)

    {

    int Id = (int)Session["Id"];

    String strStudentName, strRegistrationNumber, strAddress, strContactNumber,

    strUserName, strPassword, strCourse;

    StringBuilder stbSQL = newStringBuilder();

    StringBuilder stbSQL2 = newStringBuilder();

    strStudentName = TextBoxStudentName.Text;

    strRegistrationNumber = TextBoxRegistrationNumber.Text;

    stbSQL2.AppendFormat("SELECT Id FROM LibraryStudentRecord WHERE

    RegistrationNumber='{0}' AND Id!={1}",strRegistrationNumber,Id);

    CGeneral.Read(stbSQL2.ToString());

    if(CGeneral.RecordExists==false)

    {

    strCourse = DropDownListCourse.SelectedValue;

    int int32Batch = Convert.ToInt32(DropDownListBatch.SelectedValue);

    strAddress = TextBoxAddress.Text;strContactNumber = TextBoxContactNumber.Text;

    strUserName = TextBoxUserName.Text;

    strPassword = TextBoxPassword.Text;

    stbSQL.AppendFormat("UPDATE LibraryStudentRecord SET

    StudentName='{0}',RegistrationNumber='{1}',Course='{2}',", strStudentName,

    strRegistrationNumber, strCourse);

    stbSQL.AppendFormat("Batch={0},Address='{1}',ContactNumber='{2}'",

    int32Batch, strAddress, strContactNumber);

    stbSQL.AppendFormat(" WHERE Id={0}", Id);

    CGeneral.Execute(stbSQL.ToString());

    StringBuilder stbSQL1 = newStringBuilder();stbSQL1.AppendFormat("UPDATE LOginRecord SET

    UserName='{0}',Password='{1}'", strUserName, strPassword);

    stbSQL1.AppendFormat(" WHERE Id={0}", Id);

    CGeneral.Execute(stbSQL1.ToString());

    GridViewLibraryStudentRecord.Visible = false;

    ButtonSubmit.Visible = true;

  • 8/7/2019 report on library mangement

    33/5233

    ButtonEdit.Visible = true;

    GridViewLibraryStudentRecord.DataBind();

    clear();

    }

    else

    {

    Label1.Visible = true;

    }

    }

    protectedvoid GridViewLibraryStudentRecord_SelectedIndexChanged(object

    sender, EventArgs e)

    {

    string strid = GridViewLibraryStudentRecord.SelectedDataKey.Value.ToString();

    Session["Id"] =Convert.ToInt32(strid);

    DataTableReader dr = CGeneral.Read("SELECT

    Id,StudentName,RegistrationNumber,Course,Batch,Address,ContactNumber

    FROM LibraryStudentrecord WHERE Id="+strid );

    if(dr.Read())

    {

    TextBoxStudentName.Text = dr.GetString(1);TextBoxRegistrationNumber.Text = dr.GetString(2);

    DropDownListCourse.SelectedValue = dr.GetInt32(3).ToString();

    DropDownListBatch.SelectedValue = dr.GetInt32(4).ToString();

    TextBoxAddress.Text = dr.GetString(5);

    TextBoxContactNumber.Text = dr.GetString(6);

    DataTableReader dr1 = CGeneral.Read("SELECT UserName,Password FROM

    LoginRecord WHERE Id=" + strid);

    if(dr1.Read())

    {

    TextBoxUserName.Text = dr1.GetString(0);

    TextBoxPassword.Text = dr1.GetString(1);TextBoxRetypePassword.Text = dr1.GetString(1);

    }

    }

    ButtonSubmit.Visible = false;

    ButtonEdit.Visible = false;

  • 8/7/2019 report on library mangement

    34/5234

    ButtonUpdate.Visible = true;

    }

    }

    Book registration :

    using System;

    using System.Collections;

    using System.Configuration;

    using System.Data;using System.Linq;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.HtmlControls;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Xml.Linq;

    using System.Collections.Generic;

    using System.Text;

    using System.Data.SqlClient;

    publicpartialclassLibs_Pages_Member_registration : System.Web.UI.Page

    {

    privatevoid Clear()

    {

    TxtBookName.Text = " ";

    TxtBookCode.Text = " ";

    TxtPublisher.Text = " ";

    TxtAuthor.Text = " ";DropDownListCategory.SelectedIndex = 0;

    TxtPrice.Text = " ";

    Label7.Visible = false;

    GridViewBook.DataBind();

    }

    protectedvoid Page_Load(object sender, EventArgs e)

    {

  • 8/7/2019 report on library mangement

    35/5235

    }

    protectedvoid butSave_Click(object sender, EventArgs e)

    {

    string strBookName, strBookCode, strAuthor, strPublisher, strPrice, strCategory;strBookName = TxtBookName.Text;

    strBookCode = TxtBookCode.Text;

    strAuthor = TxtAuthor.Text;

    strPublisher = TxtPublisher.Text;

    strCategory=DropDownListCategory.SelectedValue;

    strPrice = TxtPrice.Text;

    String strSQL=String.Format("Select * from Tablebook where [Book

    Code]='{0}'",TxtBookCode.Text);

    CGeneral.Read(strSQL);

    if(CGeneral.RecordExists==false)

    {

    Int32 int32Id = CGeneral.GetNextId("Tablebook", "Id");

    StringBuilder stbSQL = newStringBuilder();

    stbSQL.Append("INSERT into Tablebook(Id,[Book Name] ,[Book

    Code],Author,Publisher,Category,Price)");

    stbSQL.AppendFormat("VALUES({0},'{1}','{2}','{3}','{4}',{5},{6})",int32Id,strBookNam

    e, strBookCode, strAuthor, strPublisher,strCategory, strPrice);

    CGeneral.Execute(stbSQL.ToString());

    GridViewBook.DataBind();GridViewBook.Visible = true;

    Clear();

    }

    else

    {

    Label7.Visible=true;

    TxtBookName.Text = " ";

    TxtBookCode.Text = " ";

    TxtAuthor.Text = " ";

    TxtPublisher.Text = " ";DropDownListCategory.SelectedIndex = 0;

    TxtPrice.Text = " ";

    }

  • 8/7/2019 report on library mangement

    36/5236

    }

    protectedvoid Button5_Click(object sender, EventArgs e)

    {

    TxtBookName.Text = " ";

    TxtBookCode.Text = " ";TxtAuthor.Text = " ";

    TxtPublisher.Text = " ";

    DropDownListCategory.SelectedIndex = 0;

    TxtPrice.Text = " ";

    }

    protectedvoid ButEdit_Click(object sender, EventArgs e)

    {

    GridViewBook.DataBind();

    GridViewBook.Visible = true;

    }

    protectedvoid ButtonClear_Click(object sender, EventArgs e)

    {

    TxtBookName.Text = " ";

    TxtBookCode.Text = " ";

    TxtAuthor.Text = " ";

    TxtPublisher.Text = " ";

    DropDownListCategory.SelectedIndex = 0;

    TxtPrice.Text = " ";ButSubmit.Visible = true;

    ButEdit.Visible = true;

    ButUpdate.Visible = false;

    }

    protectedvoid GridViewBook_SelectedIndexChanged(object sender, EventArgs e)

    {

    string strid = GridViewBook.SelectedDataKey.Value.ToString();

    Session["Id"] = Convert.ToInt32(strid);

    DataTableReader dr = CGeneral.Read("SELECT Id,[Book Name],[Book

    Code],Author,Publisher,Category,price FROM Tablebook WHERE Id=" + strid);if(dr.Read())

    {

    TxtBookName.Text = dr.GetString(1);

    TxtBookCode.Text = dr.GetString(2);

    TxtAuthor.Text = dr.GetString(3);

    TxtPublisher.Text = dr.GetString(4);

  • 8/7/2019 report on library mangement

    37/5237

    DropDownListCategory.SelectedValue = dr.GetInt32(5).ToString();

    TxtPrice.Text = dr.GetDecimal(6).ToString();

    }

    ButSubmit.Visible = false;ButEdit.Visible = false;

    GridViewBook.Visible = false;

    ButUpdate.Visible = true;

    }

    protectedvoid ButUpdate_Click(object sender, EventArgs e)

    {

    String strBookName, strBookCode, strAuthor, strPublisher, strCategory, strPrice;

    StringBuilder stbSQL = newStringBuilder();

    strBookName = TxtBookName.Text;

    strBookCode = TxtBookCode.Text;

    strAuthor = TxtAuthor.Text;

    strPublisher = TxtPublisher.Text;

    strCategory = DropDownListCategory.SelectedValue;

    int int32Batch = Convert.ToInt32(DropDownListCategory.SelectedValue);

    strPrice = TxtPrice.Text;

    String strSQL = String.Format("Select * from Tablebook where [Book Code]='{0}'",

    TxtBookCode.Text);

    CGeneral.Read(strSQL);if(CGeneral.RecordExists == false)

    {

    stbSQL.AppendFormat("UPDATE Tablebook SET [Book Name]='{0}',[Book

    Code]='{1}',Author='{2}',Publisher='{3}',Category='{4}',Price='{5}' ", strBookName,

    strBookCode, strAuthor, strPublisher, strCategory, strPrice);

    Int32 Id = (int)Session["Id"];

    stbSQL.AppendFormat("WHERE Id={0}", Id);

    CGeneral.Execute(stbSQL.ToString());GridViewBook.Visible = false;

    ButSubmit.Visible = true;

    ButEdit.Visible = true;

    Clear();

    ButUpdate.Visible = false;

    }

  • 8/7/2019 report on library mangement

    38/5238

    else

    {

    Label7.Visible = true;

    }

    }

    protectedvoid ButtonDelete_Click(object sender, EventArgs e)

    {

    StringBuilder stbsql = newStringBuilder();

    string strBookId=GridViewBook.SelectedDataKey.Value.ToString();

    stbsql.AppendFormat("DELETE FROM Tablebook WHERE Id={0}",

    strBookId);

    CGeneral.Execute(stbsql.ToString());

    Clear();

    ButSubmit.Visible = true;

    ButEdit.Visible = true;

    ButUpdate.Visible = false;

    }

    }

    Lending page :

    using System;

    using System.Text;

    using System.Collections;

    using System.Configuration;

    using System.Data;

    using System.Linq;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.HtmlControls;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Xml.Linq;

    publicpartialclasslibs_Pages_LendingPage : System.Web.UI.Page

  • 8/7/2019 report on library mangement

    39/5239

    {

    privatevoid ShowLendingsOfStudent(Int32 prm_int32StudentId)

    {

    StringBuilder stbSQL = newStringBuilder();

    stbSQL.Append("SELECT

    LendingTable.Id,LibraryStudentRecord.StudentName,[Book Name],[Book Code] ,");

    stbSQL.Append(" convert(varchar,LendingTable.DateOfIssue,105) as 'Date of

    Issue' ");

    stbSQL.Append(" FROM Tablebook INNER JOIN LendingTable ON

    Tablebook.Id=LendingTable.BookId ");

    stbSQL.Append(" INNER JOIN LibraryStudentRecord ON

    LibraryStudentRecord.Id=LendingTable.StudentId ");

    stbSQL.AppendFormat(" WHERE LendingTable.Type=1 AND

    LendingTable.StudentId={0}", prm_int32StudentId);

    SqlDsLendings.SelectCommand = stbSQL.ToString();

    GridViewStudent.DataBind();

    }

    protectedvoid Page_Load(object sender, EventArgs e)

    {

    if(!IsPostBack)

    {TextBoxDateOfIssue.Text = DateTime.Now.ToShortDateString();

    Calendar1.SelectedDate = DateTime.Now;

    }

    }

    protectedvoid DropDownListRegistrationNumber_SelectedIndexChanged(object

    sender, EventArgs e)

    {

    DropDownListStudentName.SelectedValue

    =DropDownListRegistrationNumber.SelectedValue ;

    ShowLendingsOfStudent(Convert.ToInt32(DropDownListRegistrationNumber.SelectedValue));

    GridViewStudent.Visible = true;

    }

    protectedvoid DropDownListStudentName_SelectedIndexChanged(object sender,

    EventArgs e)

    {

  • 8/7/2019 report on library mangement

    40/5240

    DropDownListRegistrationNumber.SelectedValue =

    DropDownListStudentName.SelectedValue;

    ShowLendingsOfStudent(Convert.ToInt32(DropDownListStudentName.SelectedVal

    ue));

    GridViewStudent.Visible = true;}

    protectedvoid DropDownListBookCode_SelectedIndexChanged(object sender,

    EventArgs e)

    {

    DropDownListBookName.SelectedValue =

    DropDownListBookCode.SelectedValue;

    }

    protectedvoid DropDownListBookName_SelectedIndexChanged(object sender,

    EventArgs e)

    {

    DropDownListBookCode.SelectedValue =

    DropDownListBookName.SelectedValue;

    }

    protectedvoid ChooseDate_click(object sender, EventArgs e)

    {

    Calendar1.Visible = true;

    }

    protectedvoid Calendar1_SelectionChanged(object sender, EventArgs e)

    {

    TextBoxDateOfIssue.Text = Calendar1.SelectedDate.ToShortDateString();

    Calendar1.Visible = false;}

    protectedvoid ButtonSave_Click(object sender, EventArgs e)

    {

    if(GridViewStudent.Rows.Count < 3)

    {

    String strStudentId, strBookId;

    Int32 int32Id = CGeneral.GetNextId("LendingTable", "Id");

    DateTime DateOfIssue = Calendar1.SelectedDate;

    strStudentId = DropDownListRegistrationNumber.SelectedValue;

    strBookId = DropDownListBookCode.SelectedValue;StringBuilder stbsql1=newStringBuilder();

    stbsql1.AppendFormat("SELECT Id FROM LendingTable WHERE

    BookId={0} AND Type=1",strBookId);

    CGeneral.Read(stbsql1.ToString());

    if(CGeneral.RecordExists == false)

    {

  • 8/7/2019 report on library mangement

    41/5241

    StringBuilder stbsql = newStringBuilder();

    stbsql.Append("INSERT INTO

    LendingTable(Id,StudentId,BookId,DateOfIssue,Type)");

    stbsql.AppendFormat("Values({0},{1},{2},'{3}',{4})", int32Id,

    Convert.ToInt32(strStudentId), Convert.ToInt32(strBookId), DateOfIssue, 1);CGeneral.Execute(stbsql.ToString());

    GridViewStudent.Visible = false;

    DropDownListStudentName.SelectedIndex = 0;

    DropDownListBookName.SelectedIndex = 0;

    DropDownListBookCode.SelectedIndex = 0;

    DropDownListRegistrationNumber.SelectedIndex = 0;

    GridViewStudent.Visible = false;

    TextBoxDateOfIssue.Text = " ";

    ButtonSave.Visible = true;

    ButtonClear.Visible = true;

    ButtonUpdate.Visible = true;

    LabelExtraBook.Visible = false;

    DropDownListBookCode.DataBind();

    DropDownListBookName.DataBind();

    }

    else

    {

    LabelExtraBook.Text = "SOORY! somebody has just taken the book";

    LabelExtraBook.Visible = true;

    }

    }

    else

    {

    LabelExtraBook.Visible = true;

    }

    }

    protectedvoid GridViewStudent_SelectedIndexChanged(object sender, EventArgs e)

    {

    string strLendingId = GridViewStudent.SelectedDataKey.Value.ToString();

    StringBuilder stbsql = newStringBuilder();stbsql.Append("SELECT BookId,DateOfIssue FROM LendingTable ");

    stbsql.AppendFormat("WHERE Id={0} ",Convert.ToInt32(strLendingId));

    DataTableReader dr = CGeneral.Read(stbsql.ToString());

    if(dr.Read())

    {

    DropDownListBookCode.SelectedValue = Convert.ToString(dr.GetInt32(0));

  • 8/7/2019 report on library mangement

    42/5242

    DropDownListBookName.SelectedValue = Convert.ToString(dr.GetInt32(0));

    TextBoxDateOfIssue.Text = dr.GetDateTime(1).ToString("dd/MM/yyyy");

    }

    GridViewStudent.Visible = false;

    ButtonSave.Visible = false;

    ButtonDelete.Visible = true;ButtonUpdate.Visible = true;

    }

    protectedvoid ButtonUpdate_Click(object sender, EventArgs e)

    {

    String strStudentId, strBookId;

    Int32

    int32Id=Convert.ToInt32(GridViewStudent.SelectedDataKey.Value.ToString());

    DateTime DateOfIssue =Convert.ToDateTime(TextBoxDateOfIssue.Text);

    strStudentId = DropDownListRegistrationNumber.SelectedValue;

    strBookId = DropDownListBookCode.SelectedValue;

    StringBuilder stbsql1=newStringBuilder();

    stbsql1.AppendFormat("SELECT Id FROM LendingTable WHERE

    BookId={0} AND Type=1",strBookId);

    CGeneral.Read(stbsql1.ToString());

    if(CGeneral.RecordExists == false)

    {

    StringBuilder stbSQL = newStringBuilder();

    stbSQL.AppendFormat("UPDATE LendingTable SETBookId={0},StudentId={1},DateOfIssue='{2}' ", strBookId.ToString(),

    strStudentId.ToString(), DateOfIssue);

    stbSQL.AppendFormat(" WHERE Id={0}", int32Id);

    CGeneral.Execute(stbSQL.ToString());

    GridViewStudent.Visible = false;

    DropDownListStudentName.SelectedIndex = 0;

    DropDownListBookName.SelectedIndex = 0;

    GridViewStudent.Visible = false;

    TextBoxDateOfIssue.Text = " ";

    ButtonSave.Visible = true;

    ButtonClear.Visible = true;ButtonUpdate.Visible = true;

    DropDownListBookCode.SelectedIndex = 0;

    DropDownListRegistrationNumber.SelectedIndex = 0;

    LabelExtraBook.Visible = false;

    DropDownListBookCode.DataBind();

    DropDownListBookName.DataBind();

  • 8/7/2019 report on library mangement

    43/5243

    }

    else

    {

    LabelExtraBook.Text = "SOORY! this book has been taken";

    LabelExtraBook.Visible = true;

    }

    }

    protectedvoid CustomValidatorRegistrationNumber_ServerValidate(object source,

    ServerValidateEventArgs args)

    {

    if(Convert.ToInt32(DropDownListRegistrationNumber.SelectedValue) == -1)

    args.IsValid = false;

    }

    protectedvoid CustomValidatorBookCode_ServerValidate(object source,

    ServerValidateEventArgs args)

    {

    if(Convert.ToInt32(DropDownListBookCode.SelectedValue) == -1)

    args.IsValid = false;

    }

    protectedvoid CustomValidatorStudentName_ServerValidate(object source,

    ServerValidateEventArgs args)

    {

    if(Convert.ToInt32(DropDownListStudentName.SelectedValue) == -1)

    args.IsValid = false;

    }

    protectedvoid CustomValidatorBookName_ServerValidate(object source,ServerValidateEventArgs args)

    {

    if(Convert.ToInt32(DropDownListBookName.SelectedValue) == -1)

    args.IsValid = false;

    }

    protectedvoid ButtonClear_Click(object sender, EventArgs e)

    {

    DropDownListStudentName.SelectedIndex = 0;

    DropDownListBookName.SelectedIndex = 0;

    GridViewStudent.Visible = false;

    TextBoxDateOfIssue.Text = " ";ButtonSave.Visible = true;

    ButtonClear.Visible = true;

    ButtonUpdate.Visible = true;

    DropDownListBookCode.SelectedIndex = 0;

    DropDownListRegistrationNumber.SelectedIndex = 0;

    LabelExtraBook.Visible = false;

  • 8/7/2019 report on library mangement

    44/5244

    DropDownListBookCode.DataBind();

    DropDownListBookName.DataBind();

    }

    protectedvoid ButtonDelete_Click(object sender, EventArgs e)

    {

    StringBuilder stbsql = newStringBuilder();stbsql.AppendFormat("DELETE FROM LendingTable WHERE

    Id={0}",GridViewStudent.SelectedDataKey.Value.ToString());

    CGeneral.Execute(stbsql.ToString());

    }

    }

    Returning page :

    using System;

    using System.Text;

    using System.Collections;

    using System.Configuration;

    using System.Data;

    using System.Linq;

    using System.Web;using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.HtmlControls;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Xml.Linq;

    publicpartialclasslibs_Pages_ReturningPage : System.Web.UI.Page

    {

    privatevoid FineCalculation()

    {

    DateTime dtmLendingDate = Convert.ToDateTime(TextBoxDateOfIssue1.Text);

    DateTime dtmReturningDate = Convert.ToDateTime(TextBoxDateOfReturn.Text);

    DateTime dtmActualReturningDate = dtmLendingDate.AddDays(14);

    TextBoxActualDateOfReturning.Text =

    dtmActualReturningDate.ToShortDateString();

    if(dtmActualReturningDate < dtmReturningDate)

  • 8/7/2019 report on library mangement

    45/5245

    {

    TimeSpan tsDateDifference = dtmReturningDate - dtmActualReturningDate;

    TextBoxFine.Text = (tsDateDifference.Days * 0.25).ToString();

    }

    else{

    TextBoxFine.Text = "0";

    }

    }

    privatevoid ShowLendingsOfStudent(Int32 prm_int32StudentId)

    {

    StringBuilder stbSQL = newStringBuilder();

    stbSQL.Append("SELECT

    LendingTable.Id,LibraryStudentRecord.StudentName,[Book Name],[Book Code] ,");

    stbSQL.Append(" convert(varchar,LendingTable.DateOfIssue,105) as 'Date of

    Issue' ");

    stbSQL.Append(" FROM Tablebook INNER JOIN LendingTable ON

    Tablebook.Id=LendingTable.BookId ");

    stbSQL.Append(" INNER JOIN LibraryStudentRecord ON

    LibraryStudentRecord.Id=LendingTable.StudentId ");

    stbSQL.AppendFormat(" WHERE LendingTable.Type=1 AND

    LendingTable.StudentId={0}", prm_int32StudentId);

    SqlDsLendings.SelectCommand = stbSQL.ToString();

    GridViewStudent.DataBind();

    }

    protectedvoid Page_Load(object sender, EventArgs e)

    {

    if(!IsPostBack)

    {

    TextBoxDateOfReturn.Text = DateTime.Now.ToShortDateString();

    }

    }

    protectedvoid DropDownListRegistrationNumber_SelectedIndexChanged(objectsender, EventArgs e)

    {

    DropDownListStudentName.SelectedValue

    =DropDownListRegistrationNumber.SelectedValue ;

  • 8/7/2019 report on library mangement

    46/5246

    ShowLendingsOfStudent(Convert.ToInt32(DropDownListRegistrationNumber.Selec

    tedValue));

    GridViewStudent.Visible = true;

    }

    protectedvoid DropDownListStudentName_SelectedIndexChanged(object sender,EventArgs e)

    {

    DropDownListRegistrationNumber.SelectedValue =

    DropDownListStudentName.SelectedValue;

    ShowLendingsOfStudent(Convert.ToInt32(DropDownListStudentName.SelectedVal

    ue));

    GridViewStudent.Visible = true;

    }

    protectedvoid DropDownListBookCode_SelectedIndexChanged(object sender,

    EventArgs e)

    {

    DropDownListBookName.SelectedValue =

    DropDownListBookCode.SelectedValue;

    }

    protectedvoid DropDownListBookName_SelectedIndexChanged(object sender,

    EventArgs e)

    {

    DropDownListBookCode.SelectedValue =

    DropDownListBookName.SelectedValue;

    }protectedvoid ChooseDate_click(object sender, EventArgs e)

    {

    Calendar1.Visible = true;

    }

    protectedvoid Calendar1_SelectionChanged(object sender, EventArgs e)

    {

    TextBoxDateOfReturn.Text = Calendar1.SelectedDate.ToShortDateString();

    Calendar1.Visible = false;

    FineCalculation();

    }

    protectedvoid GridViewStudent_SelectedIndexChanged(object sender, EventArgs e){

    string strLendingId = GridViewStudent.SelectedDataKey.Value.ToString();

    StringBuilder stbsql = newStringBuilder();

    stbsql.Append("SELECT BookId,DateOfIssue FROM LendingTable ");

    stbsql.AppendFormat("WHERE Id={0} ",Convert.ToInt32(strLendingId));

    DataTableReader dr = CGeneral.Read(stbsql.ToString());

  • 8/7/2019 report on library mangement

    47/5247

    if(dr.Read())

    {

    DropDownListBookCode.SelectedValue = Convert.ToString(dr.GetInt32(0));

    DropDownListBookName.SelectedValue = Convert.ToString(dr.GetInt32(0));

    TextBoxDateOfIssue1.Text = dr.GetDateTime(1).ToString("dd/MM/yyyy");

    }

    FineCalculation();

    }

    protectedvoid ButtonUpdate_Click(object sender, EventArgs e)

    {

    String strStudentId, strBookId;

    Int32

    int32Id=Convert.ToInt32(GridViewStudent.SelectedDataKey.Value.ToString());

    DateTime DateOfIssue =Convert.ToDateTime(TextBoxDateOfIssue1.Text);

    strStudentId = DropDownListRegistrationNumber.SelectedValue;

    strBookId = DropDownListBookCode.SelectedValue;

    StringBuilder stbSQL = newStringBuilder();

    stbSQL.AppendFormat("UPDATE LendingTable SET

    BookId={0},StudentId={1},DateOfIssue='{2}' ", strBookId.ToString(),

    strStudentId.ToString(), DateOfIssue);

    stbSQL.AppendFormat(" WHERE Id={0}", int32Id);

    CGeneral.Execute(stbSQL.ToString());

    GridViewStudent.Visible = false;

    DropDownListStudentName.SelectedIndex = 0;

    DropDownListBookName.SelectedIndex = 0;

    GridViewStudent.Visible = false;TextBoxDateOfIssue1.Text = " ";

    ButtonClear.Visible = true;

    ButtonSave.Visible = true;

    DropDownListBookCode.SelectedIndex = 0;

    DropDownListRegistrationNumber.SelectedIndex = 0;

    }

    protectedvoid CustomValidatorRegistrationNumber_ServerValidate(object source,

    ServerValidateEventArgs args)

    {

    if(Convert.ToInt32(DropDownListRegistrationNumber.SelectedValue) == -1)args.IsValid = false;

    }

    protectedvoid CustomValidatorBookCode_ServerValidate(object source,

    ServerValidateEventArgs args)

    {

    if(Convert.ToInt32(DropDownListBookCode.SelectedValue) == -1)

  • 8/7/2019 report on library mangement

    48/5248

    args.IsValid = false;

    }

    protectedvoid CustomValidatorStudentName_ServerValidate(object source,

    ServerValidateEventArgs args)

    {

    if(Convert.ToInt32(DropDownListStudentName.SelectedValue) == -1)args.IsValid = false;

    }

    protectedvoid CustomValidatorBookName_ServerValidate(object source,

    ServerValidateEventArgs args)

    {

    if(Convert.ToInt32(DropDownListBookName.SelectedValue) == -1)

    args.IsValid = false;

    }

    protectedvoid ButtonClear_Click(object sender, EventArgs e)

    {

    DropDownListStudentName.SelectedIndex = 0;

    DropDownListBookName.SelectedIndex = 0;

    GridViewStudent.Visible = false;

    TextBoxDateOfIssue1.Text = " ";

    TextBoxFine.Text = " ";

    TextBoxActualDateOfReturning.Text = " ";

    TextBoxDateOfReturn.Text = " ";

    ButtonClear.Visible = true;

    ButtonSave.Visible = true;

    DropDownListBookCode.SelectedIndex = 0;

    DropDownListRegistrationNumber.SelectedIndex = 0;}

    protectedvoid ButtonSave_Click1(object sender, EventArgs e)

    {

    String strStudentId, strBookId;

    DateTime DateOfIssue = Calendar1.SelectedDate;

    strStudentId = DropDownListRegistrationNumber.SelectedValue;

    strBookId = DropDownListBookCode.SelectedValue;

    StringBuilder stbsql = newStringBuilder();

    stbsql.AppendFormat("UPDATE LendingTable SET Type=2 WHERE Id={0} ",

    GridViewStudent.SelectedDataKey.Value.ToString());

    CGeneral.Execute(stbsql.ToString());GridViewStudent.Visible = false;

    DropDownListStudentName.SelectedIndex = 0;

    DropDownListBookName.SelectedIndex = 0;

    DropDownListBookCode.SelectedIndex = 0;

    DropDownListRegistrationNumber.SelectedIndex = 0;

    GridViewStudent.Visible = false;

  • 8/7/2019 report on library mangement

    49/5249

    TextBoxDateOfIssue1.Text = " ";

    ButtonClear.Visible = true;

    ButtonSave.Visible = true;

    TextBoxFine.Text = " ";

    TextBoxActualDateOfReturning.Text = " ";

    TextBoxDateOfReturn.Text = " ";GridViewStudent.DataBind();

    }

    }

    Member profile :

    using System;

    using System.Text;

    using System.Collections;

    using System.Configuration;

    using System.Data;

    using System.Linq;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.HtmlControls;

    using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;

    using System.Xml.Linq;

    publicpartialclasslibs_Pages_StudentProfile : System.Web.UI.Page

    {

    privatevoid ShowLendingsOfStudent(Int32 prm_int32StudentId)

    {

    StringBuilder stbSQL = newStringBuilder();

    stbSQL.Append("SELECT

    LendingTable.Id,LibraryStudentRecord.StudentName,[Book Name],[Book Code] ,");

    stbSQL.Append(" convert(varchar,LendingTable.DateOfIssue,105) as 'Date of

    Issue' ");stbSQL.Append(" FROM Tablebook INNER JOIN LendingTable ON

    Tablebook.Id=LendingTable.BookId ");

    stbSQL.Append(" INNER JOIN LibraryStudentRecord ON

    LibraryStudentRecord.Id=LendingTable.StudentId ");

    stbSQL.AppendFormat(" WHERE LendingTable.Type=1 AND

    LendingTable.StudentId={0}", prm_int32StudentId);

  • 8/7/2019 report on library mangement

    50/5250

    SqlDsLendings.SelectCommand = stbSQL.ToString();

    GridViewStudent.DataBind();

    }

    protectedvoid Page_Load(object sender, EventArgs e)

    {

    Int32 int32UserId = (Int32)Session["UserId"];ShowLendingsOfStudent(int32UserId);

    StringBuilder stbsql = newStringBuilder();

    stbsql.AppendFormat("SELECT

    StudentName,RegistrationNumber,Course.Name,Batch,Address,ContactNumber

    FROM LibraryStudentRecord ");

    stbsql.AppendFormat(" INNER JOIN Course ON

    Course.Id=LibraryStudentRecord.Course ");

    stbsql.AppendFormat(" WHERE LibraryStudentRecord.Id={0}", int32UserId);

    DataTableReader dr = CGeneral.Read(stbsql.ToString());

    if(dr.Read())

    {

    TextBoxStudentName.Text = dr.GetString(0);

    TextBoxRegistrationNumber.Text = dr.GetString(1);

    TextBoxCourse.Text = dr.GetString(2);

    TextBoxBatch.Text = dr.GetInt32(3).ToString();

    TextBoxAddress.Text = dr.GetString(4);

    TextBoxContactNumber.Text = dr.GetString(5);

    }

    }

    }

    Conclusion

    After we have completed the project we are sure the problems in the

    existing system would overcome. The LIBRARY MANAGEMENT

    SYSTEM process made computerized to reduce human errors and to

    increase the efficiency. The main focus of this project is to lessen

    human efforts. The maintenance of the records is made efficient, as

    all the records are stored in the SQL Server database, through which

    data can be retrieved easily. The navigation control is provided in all

    the forms to navigate through the large amount of records. If the

  • 8/7/2019 report on library mangement

    51/5251

    numbers of records are very large then user has to just type in the

    search string and user gets the results immediately. The editing is

    also made simpler. The user has to just type in the required field and

    press the update button to update the desired field.

    The Books and Students are given a particular unique id no. So that

    they can be accessed correctly and without errors. Our main aim of

    the project is to get the correct information about a particular

    student and books available in the library.

    The problems, which existed in the earlier system, have been

    removed to a large extent. And it is expected that this project will go

    a long way in satisfying users requirements. The computerization of

    the Library Management will not only improves the efficiency but

    will also reduce human stress thereby indirectly improving human

    recourses.

    Bibiliography

    The complete reference ASP.NET

    BY: Herbert Schildt

    Mastering Visual Basic 6.0

  • 8/7/2019 report on library mangement

    52/52

    MSDN Help