Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

ABSTRACT

With the advancement of technology, it is imperative to exalt all the systems into a user-
friendly manner. The Library Management system (LMS) acts as a tool to transform traditional
libraries into digital libraries. In traditional libraries, the students/user has to search for books which
are hassle process and there is no proper maintenance of database about issues/fines. The overall
progress of work is slow and it is impossible to generate a fast report. The librarians have to work
allotted for arranging, sorting books in the book sells. At the same time, they have to check and
monitor the lend/borrow book details with its fine. It is a tedious process to work simultaneously in
different sectors. LMS will assist the librarians to work easily. The LMS supports the librarians to
encounter all the issues concurrently. The users need not stand in a queue for a long period to
return/borrow a book from the library. The single PC contains all the data’s in it. The librarians have
to assess the system and provide an entry in it. Through LMS the librarian can find the book in the
bookshelves. The LMS is designed with the basic features such as librarian can
add/view/update/delete books and students' details in it. Once he/she ingress into the system they
can modify any data’s in the database. The complete model is developed in Dot net technology, the
C# language is used to build the front end application whereas the SQL server is exploiting as
database. The authorized person can only access the LMS system, they have to log in with their user
id and password. As aforementioned that the LMS is designed in a user-friendly manner, so the
admin can smoothly activate the system without expert advice. Every data is storing and retrieving
from the SQL database so it is highly secure. Thus our system contributes its new approach towards
the digital library setup.

Keywords: Management System, .Net, SQL Server, LAN, DBMS.

1
E-R MODEL

Fig 1. Block Diagram of Proposed System


1. Rules for Mapping Conceptual Model to Relational Model.

Step 1: Mapping of Regular Entity Types:

For each regular strong entity type E in the ER schema create a relation R that includes
all the simple attributes of E. include only the simple component attributes of a composite
attribute. Choose one of the key Attribute of E as primary key for R. If the chosen key of E
is composite, the set of simple attributes that form it will together form the primary key of
R.
If multiple keys were identified of E during the conceptual design, the information
describing the attributes that form each additional key is kept in order to specify secondary
(unique) keys of relation R. knowledge about keys is also kept for indexing purpose and
other type of analyses.

Step 2: Mapping of Weak Entity Types:

For each weak entity type W in the ER schema with owner of type E, create a
relation R and include all simple attributes (or simple components of composite attributes
of Was attribute of R. In addition, include as foreign key attributes of R in the primary key
attributes of the relation of type W. The primary key R is the combination of the primary
key of the owner and the partial key of weak entity type W.

Step 3: Mapping of Binary 1:1 Relationship Types:

For each binary 1:1 relationship type R in the ER schema, identify the relation S and
T that corresponds to the entity type participating in R. there are three possible approaches
which are as follows

l) foreign key approach:


Choose one of the relations-s, say-and include as a foreign key in s the primary key
of T.it is better to choose any entity type with total participation in R in the role of S. include
all the simple attributes (or simple components of composite attributes) of the l: l relationship
type R as attribute S.

3
2) Relation option:

An alternative mapping of a 1:1 relation Ip type 1s possible by merging two entity


types and the relationship in a single relation. This may be appropriate when both
participations are total.

3) cross-reference or relationship relation option:


The third alternative is to set up a third relation R for the purpose of cross-
referencing the primary keys of the two relations S and T representing the entity types. As
we shall see, this approach is required for binary M: N relationship. The relation R is called
relationship relation, because each tuple in R represents a relationship instance that relates
one tuple from S with one tuple of T.

Step 4: Mapping of Binary 1: N Relationship Types:


For each regular binary 1: N relationship type identify the relation s that represents
the participating entity type at the N-side of the relationship type include as foreign key in
S the primary key of the relation T and represents the other entity type participation in R.
this is done because each entity instance on the N-side is related to at most one entity
instance on the one side of the relationship type. Include any simple attributes of the 1: N
relationship type as attributes of S.

Step 5: Mapping of Binary M: N Relationship Types:


for each multivalued attributes A, create a new relation R. This relation R will
include an attribute corresponding to A, plus the primary key attribute K as a foreign
key in R of the relation that represents the entity type or the relation type that has A
as an attribute, The primary key of R is the combination of A and K. If the multivalued
attribute is composite, we include its simple components.
Step 6: Mapping of N-ary Relationship Types:

For each n-ary relationship type R, where n>2, create a new relation S to represent
R. Include as foreign key attributes in S the primary keys any simple attributes of the n-ary relationship
type as attributes of S. The primary key of S is usually the combination of all the foreign key that
reference the relations representing the participating entity types. However, if the cardinality
constraints on any of the entity types E participating in R in 1, then the primary key of S should not
include the foreign key attribute that references the relation E corresponding to E.

• Mapping Conceptual Model To Relation Moldel :

PATIENT(ID,NAME,ADDRESS,AGE,GENDER,PH.NO.)
BILL(ID,CHARGE,MED,LAB,TOTAL)
ROOM(ID,CHARGE)
PAYS(PATIENT ID,BILL)
ACCOMODATES(PATIENT ID,ROOM ID)

5
SQL-I : Basics (DDL)
7
NORMALIZATION OF ORDER FORM
9
11
13
7. PROJECT
CODE FOR LIBRARY MANAGEMENT

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;

namespace LibraryM
{
public partial class Form1 : Form
{
string cs, q;
MySqlConnection c1;
MySqlCommand cmd;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)


{
cs = "server = localhost; database = library; uid=root; pwd=root";
c1 = new MySqlConnection(cs);
MessageBox.Show("Welcome To Library");
}

private void button3_Click(object sender, EventArgs e)


{
Form2 f2 = new Form2();
f2.iss.Visible = true;
f2.ret.Visible = true;
f2.search.Visible = true;
f2.label1.Text = "Issue/Return Books";
f2.sid.ReadOnly = false;
f2.sname.ReadOnly = true;
f2.rn.ReadOnly = true;
f2.Show();
}

private void pictureBox1_Click(object sender, EventArgs e)


{

private void addStudentsToolStripMenuItem_Click(object sender, EventArgs


e)
{
Form2 f2 = new Form2();
f2.sub.Visible = true;
f2.sr.Visible = false;
f2.label1.Text = "Add Student";

15
c1.Open();
try
{
q = "select count(sid) from students";
cmd = new MySqlCommand(q, c1);
int ids = Convert.ToInt32(cmd.ExecuteScalar());
ids++;
f2.sid.Text = ids.ToString();
}
catch (Exception ex)
{
MessageBox.Show("Please Enter Valid Text.", "",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (c1.State == ConnectionState.Open)
c1.Close();
}

f2.Show();
}

private void updateStudentProfileToolStripMenuItem_Click(object sender,


EventArgs e)
{
Form2 f2 = new Form2();
f2.upd.Visible = true;
f2.search.Visible = true;
f2.label1.Text = "Update Student Profile";
f2.sid.ReadOnly = false;
f2.sname.ReadOnly = true;
f2.rn.ReadOnly = true;
f2.Show();
}

private void removeStudentToolStripMenuItem_Click(object sender,


EventArgs e)
{
Form2 f2 = new Form2();
f2.search.Visible = true;
f2.rem.Visible = true;
f2.label1.Text = "Remove Student Profile";
f2.sid.ReadOnly = false;
f2.sname.ReadOnly = true;
f2.rn.ReadOnly = true;
f2.Show();
}

private void menuStrip1_ItemClicked(object sender,


ToolStripItemClickedEventArgs e)
{

private void button1_Click(object sender, EventArgs e)


{
Form4 f4 = new Form4();
f4.Show();
}

private void addBooksToolStripMenuItem_Click(object sender, EventArgs e)


{
Form3 f3 = new Form3();
f3.sub.Visible = true;
f3.label1.Text = "Add Books";

c1.Open();
try
{
q = "select count(bid) from books";
cmd = new MySqlCommand(q, c1);
int idb = Convert.ToInt32(cmd.ExecuteScalar());
idb++;
f3.bid.Text = idb.ToString();
}
catch (Exception ex)
{
MessageBox.Show("Please Enter Valid Text.", "",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (c1.State == ConnectionState.Open)
c1.Close();
}

f3.Show();
}

private void modifyBooksToolStripMenuItem_Click(object sender, EventArgs


e)
{
Form3 f3 = new Form3();
f3.upd.Visible = true;
f3.search.Visible = true;
f3.label1.Text = "Update Books";
f3.bid.ReadOnly = false;
f3.bname.ReadOnly = true;
f3.aut.ReadOnly = true;
f3.qua.ReadOnly = true;
f3.Show();
}

private void removeBooksToolStripMenuItem_Click(object sender, EventArgs


e)
{
Form3 f3 = new Form3();
f3.search.Visible = true;
f3.rem.Visible = true;
f3.label1.Text = "Remove Books";
f3.bid.ReadOnly = false;
f3.bname.ReadOnly = true;
f3.aut.ReadOnly = true;
f3.qua.ReadOnly = true;
f3.Show();
}

private void button2_Click(object sender, EventArgs e)


{
Form5 f5= new Form5();
f5.label5.Visible = false;
f5.sid.Visible = false;

c1.Open();

17
try
{
q = "select * from books";
MySqlDataAdapter da = new MySqlDataAdapter(q, c1);
DataTable t = new DataTable();
da.Fill(t);

f5.dataGridView1.DataSource = t;
}
catch (Exception ex)
{
MessageBox.Show("Something went wrong.", "",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (c1.State == ConnectionState.Open)
c1.Close();
}
f5.Show();
}

private void aboutToolStripMenuItem_Click(object sender, EventArgs e)


{
MessageBox.Show("Welcome to Library Management System...\n\nthis
project is created by our team under the guidance of,\nMr. Ajay N. Kate sir\n\n
Our Team:\n1. Dhananjay D. Gitte\n2. Vipul Kaitke\n3. Vaibhav Chavan\n\nThank you
for visiting our management system, for more information contact us at\nAjay
Infotech, Ambajogai.", "About", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}

private void button4_Click_1(object sender, EventArgs e)


{
DialogResult dialog = MessageBox.Show("Are you sure want to log out
and exit ? ", "Logging Out", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dialog == DialogResult.Yes)
{
this.Close();
}
}
}
}

You might also like