Leave Management System
Leave Management System
Data entry is time consuming and tedious through paper works. No provision for data validation in the manual system. Accessing the records for information takes long time. The process of updating is more time consuming. Consume more time. Expensive. Gives redundant and inconsistent data. Inefficient communication process. Not flexible. Data updating is tedious
2.2 PROPOSED SYSTEM The proposed system is a fully Leave Management System to maintaining the leave details The system automates all the details of the faculty and student leave details. In the proposed system the user can view their details. Online updating is possible for the authenticated person in the proposed system. As the proposed system is centralized one, redundancy can be avoided; moreover the coordination of different departments becomes much easier. All the system provides high security for all this data. ADVANTAGES OF THE PROPOSED SYSTEM Managing multiple events efficiently. Redundancy can be reduced. Leave details status can be checked anytime. Erroneous data can be avoided. Easy to get the vehicle details in case of hacking the data. Latest technological implementation. Accessing of data and report generation becomes easier and faster. This GUI system will make the user flexible to maintain the Leave details.
3.1 SCOPE
Create different users and maintain the details and manage all the details related to student and the facultys leave details.
Frame Work
The CLR is the heart of the .NET framework-the engine that drives the key functionality .IT provides memory management features such as garbage collection and data type checking. IT includes a Common Type System (CTS) that defines data types that are common go all .NET language inheritance possible among the .NET languages. The CLR effectively functions as a middle layer between a .NET programming the Operating System. The Common Language Runtime: One of the major components of the .NET framework is the common Runtime(CLR). The CLR can host a variety of languages ,and can offer a common set of tools across those languages. Microsoft has made C#, C++ languages for the CLR, which means that these three languages fully supported the CLR. Microsoft Intermediate Language (MSIL) The compilation process translates the code into an language called Microsoft Intermediate Language (MSIL) or just IL. The compiler also creates the necessary metadata and compiles it into the component. This IL is CPU independent. Language
The MS SQL database can act as a back end database for .NET as a front end, MS SQL supports the user with its powerful database management functions. A beginner can create his/her own database very simply by some mouse clicks. Another good reason to use SQL as backend tool is that it is a component of the overwhelmingly popular Microsoft office software suite. MS SQL however is a relational database, which means that you can define relationships among the data it contains. Relational database, are superior to flat file databases because you can store discrete information. Primary key and other indexed fields: Access use key fields and indexing to help speed many database operations. We can tell access, which should be key fields, or access can assign them automatically. Controls and objects: Queries are access objects us display, print and use our data. They can be things like field labels that we drag around when designing reports. Or they can be pictures, or titles for reports, or boxes containing the results of calculations. Queries and dynasts: Queries are request to information. When access responds with its list of data, that response constitutes a dynaset. A dynamic set of data meeting our query criteria. Because of the way access is designed, dynasts are updated even after we have made our query. Forms: Forms are on screen arrangement that make it easy to enter and read data. we can also print the forms if we want to. We can design form our self, or let the access auto form feature. Reports: Reports are paper copies of dynasets. We can also print reports to disk, if we like. Access helps us to create the reports. There are even wizards for complex printouts.
An entity -relationship(ER) diagram is a specialized graphic that illustrates the interrelationships between entities in a database. ER diagrams often use symbols to represent three different types of information; boxes are commonly used to represent entities. Diamonds are normally used to represent relationships and ovals are used to represent attributes Entity Relationships diagram are tools are used in analysis to describe the data requirements and assumptions in the system from a top down perspective: There are three basic elements in ER module: Entities are the things about which we seek information. Attributes are the data we collect about the entities. Relationships provide the structure needed to draw information from multiple entities.
11
Report Report
12
The database approach to system design emphasis on the integration and independence of data. Database management system allows the data to be protected and organized separately from other sources.
5.6.1 DEPARTMENT DETAILS To manipulate and view the department details. Primary Key: DeptId
FIELD DEPTID DEPTNAME HOD ACACO TUTOR1 TUTOR2 TUTOR3 Integer Varchar(50) nvarchar(25) nvarchar(50) nvarchar(25) nvarchar(25) nvarchar(25) TYPE DESCRIPTION Unique ID for the department Name of the department Head of the Department Academic Co-ordinator Tutor for students Tutor for students Tutor for students
5.6.2 LOGIN DETAILS To manipulate and view the login details. Primary Key: LoginId
14
TYPE
DESCRIPTION Admin userId Admin Password Admin It displays the date when particular user gets login
5.6.3 LEAVE DETAILS To manipulate and view the leave details. Primary Key: LeaveId
FIELD LEAVEID USERID NAME DATE UPDATEDATE STADATE ENDDATE REASON NOOFDAYS APPROVEDDATE CANCELLEDBY TUTOR ACACO HOD Int nvarchar(15) nvarchar(30) nvarchar(50) nvarchar(50) nvarchar(50) nvarchar(50) nvarchar(50) Int nvarchar(25) nvarchar(50) nvarchar(15) nvarchar(15) nvarchar(15) 15 TYPE DESCRIPTION Autogenerated StudentId for who applying the leave Name of the student Date of applying leave Date of updating leave Starting Date of the leave Ending Date Of the leave Reason for leave Number of days It gives Approved Date It gives the details about who cancelled the leave Concerned tutor Concerned Academic Co-ordinator Particular Department HOD
STA STATUS
Int narchar(50)
5.6.4 STAFF DETAILS To manipulate and view the staff details. Primary Key:StaffId
FIELD STAFFID STAFFNAME PROFESSION QUALIFICATION DPT PHONENO EMAILID BLOODGROUP GENDER DOB ADDRESS EXPYEAR EXPMON FULLSTAFFID RESPONSIBILITY PASSWORD Int nvarchar(25) nvarchar(25) nvarchar(50) Bigint nvarchar(15) nvarchar(25) nvarchar(6) nvarchar(6) nvarchar(15) nvarchar(50) nvarchar(6) nvarchar(6) nvarchar(9) nvarchar(25) nvarchar(15) 16 TYPE DESCRIPTION Unique Id of the staff Name of the staff Tutor,Academic Co-Ordinator,HOD Degree of the staff Belongs to particular department Phone number of the staff Mail id of the staff Staff Blood Group FEMALE/MALE Date Of Birth Address of the staff It displays no of experienced years It displays no of experirnced months Staff Id used for login TUTOR,HOD,Academic Co-ordinator Password for login
LASTLOGIN
nvarchar(25)
5.6.5 STUDENT DETAILS To manipulate and view the student details. Primary Key: StuId
FIELD STUID STUNAME FNAME ADDR EMAIL PHONO DOB GENDER BGROUP PARENTOCCUPATION DPT TUTOR ACACO HOD YEAR STUPERID Int nvarchar(50) nvarchar(50) nvarchar(50) Text Bigint nvarchar(50) Text Text Text Int nvarchar(25) nvarchar(25) nvarchar(25) nvarchar(2) nvarchar(50) 17 TYPE DESCRIPTION Autogenerated Name of the student Father name of the student Address of the student Mail id of the student Phone number of the student Date Of Birth MALE/FEMALE Blood Group of the student Parent occupation It displays to which department the student belongs to. Name of the particular student tutor Name of the particular student Academic Co-ordinator Head Of The Department Year that the student join Id that used for login purpose
LEAVESAPPLIEDALREADY PASSWORD
Int nvarchar(20)
It displays the details of how many leaves already taken Password for login
All modules were tested individually as soon as they were completed and were checked for their correct functionality. The Department module, Login module, and Leave module are tested individually for their functionality.
6.2 Integration Testing Integrated testing is a systematic technique for constructing tests to uncover errors associated with interface. Objective is to take unit tested modules and build a program structure that has been dictated by design 6.3 Validation Testing Interfacing errors have been uncovered and corrected and a final series of test i.e., Validation succeeds when the software function in a manner that can be reasonably accepted by the customer. The project is tested whether the requirements such as burn rate, velocity are generated as required. 6.4 Output Testing After performing the validation testing the next step is output testing of the proposed system. Since the system cannot be useful if it does not produce the required output. Asking the user about the format in which the system is required tests the output displayed or generated by the system under consideration. Here the output format is considered in two ways. One is on screen and another one is printed format. The output format on the screen is found to be corrected as the format was designed in the system phase according to the user needs. And for the hardcopy the output comes according to the specifications requested by the user. 6.5 Acceptance Testing Finally the software is assessed against the requirements defined in the system requirements document. The client (user) conducts the testing in the production environment; successful acceptance testing is required before submitting to the client for approval.
19
as the base for the coding design. It gives a detailed concentration on the technical and the other specifications that will make the new system operational are Input design, which are the input that is to be fed into the systems. Database design, are the tables used for the system.
21
CHAPTER IX APPENDIX
9.1 SOURCE CODE Login.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration; public partial class Login_Login : System.Web.UI.Page { DataSet ds; SqlDataAdapter da; SqlConnection con; SqlDataReader dr; SqlCommand cmd; string query,greetingMsg = null; protected void Page_Load(object sender, EventArgs e) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["LeaveMgmtSysConStr"].ConnectionString); } public string greetings() { string currTime = DateTime.Now.ToString("HH"); int time = Convert.ToInt32(currTime); 22
if (time >= 0 && time < 12) { greetingMsg = "Good Morning, "; } else if (time >= 12 && time < 16) { greetingMsg = "Good Afternoon, "; } else if (time >= 16 && time <= 22) { greetingMsg = "Good Evening, "; } else { greetingMsg = "Greetings, "; } return greetingMsg; } protected void btnSignIn_Click(object sender, EventArgs e) { if (txtLogID.Text.Contains("Sta")) { //Assigning Sql Command in to String Object query = "SELECT [Staffname],[FullStaffID],[Password],[LastLogin],dpt,Responsibility FROM [LeaveManagementSystem].[dbo].[tb_StaffDetails] Where FullStaffID ='" + txtLogID.Text + "' and Password='" + txtPwd.Text + "'"; cmd = new SqlCommand(query, con); //Openning the Connection con.Open(); //Executing the Command And Assigning the Values to Data Reader(dr) dr = cmd.ExecuteReader(); if (dr.HasRows) { if (dr.Read()) { string usrName = dr[0].ToString(); Session["UserName"] = greetings() + dr[0].ToString() + " !"; Session["UsrName"] = dr[0].ToString(); Session["UserID"] = dr[1].ToString(); Session["Designation"] = "Staff"; Session["LastLogin"] = dr[3].ToString(); Session["Dept"] = dr[4].ToString(); Session["Respon"] = dr[5].ToString(); dr.Close(); query = "update tb_StaffDetails set LastLogin ='" + DateTime.Now.ToString() + "' where FullStaffID='" + txtLogID.Text + "'"; cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); 23
userPermission(); } } else { lblstatus.Visible = true; lblstatus.Text = "Login Id Or Password Is Incorrect"; } } else if (txtLogID.Text.Contains("Adm")) { //Assigning Sql Command in to String Object query = "SELECT [LoginID],[Designation],[LastLogin] FROM [LeaveManagementSystem]. [dbo].[tb_Login] Where LoginID ='" + txtLogID.Text + "' and Password='" + txtPwd.Text + "'"; cmd = new SqlCommand(query, con); //Openning the Connection con.Open(); //Executing the Command And Assigning the Values to Data Reader(dr) dr = cmd.ExecuteReader(); if (dr.HasRows) { if (dr.Read()) { Session["UserName"] = greetings() + "Admin" + " !"; Session["UserID"] = dr[0].ToString(); Session["Designation"] = dr[1].ToString(); Session["LastLogin"] = dr[2].ToString(); dr.Close(); query = "update tb_Login set LastLogin ='" + DateTime.Now.ToString() + "' where LoginID='" + txtLogID.Text + "'"; cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); userPermission(); } } else { lblstatus.Visible = true; lblstatus.Text = "Login Id Or Password Is Incorrect"; } } else { //Assigning Sql Command in to String Object query = "SELECT [StuName],[stuperid],[Designation],[LastLogin] FROM [LeaveManagementSystem].[dbo].[tb_StudentDetails] Where StuPerID ='" + txtLogID.Text + "' and Password='" + txtPwd.Text + "'"; cmd = new SqlCommand(query, con); //Openning the Connection con.Open(); 24
//Executing the Command And Assigning the Values to Data Reader(dr) dr = cmd.ExecuteReader(); if (dr.HasRows) { if (dr.Read()) { string usrName = dr[0].ToString(); Session["UserName"] = greetings() + dr[0].ToString() + " !"; Session["UserID"] = dr[1].ToString(); Session["Designation"] = dr[2].ToString(); Session["LastLogin"] = dr[3].ToString(); dr.Close(); query = "update tb_StudentDetails set LastLogin ='" + DateTime.Now.ToString() + "' where StuPerID='" + txtLogID.Text + "'"; cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); userPermission(); } } else { lblstatus.Visible = true; lblstatus.Text = "Login Id Or Password Is Incorrect"; } } } public void userPermission() { string designation = Session["Designation"].ToString(); if (designation == "Admin") { Response.Redirect("../StudentDetails/addNewStudentDetails.aspx"); } else if (designation == "Student") { Response.Redirect("../Student/StudentHome.aspx"); } else if (designation == "Staff") { lblstatus.Text = "Staff Logged In"; lblstatus.Visible = true; Response.Redirect("../Staff/StaffHome.aspx"); } } }
LeaveDetails.aspx
using System; 25
using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration; public partial class applyLeave : System.Web.UI.Page { SqlConnection con; SqlCommand cmd; SqlDataReader dr; string query = null; protected void txtEndDate_TextChanged(object sender, EventArgs e) { int noOfDays = DaysIgnoreWeekends(Convert.ToDateTime(txtStaDate.Text), Convert.ToDateTime(txtEndDate.Text)); lblNoDays.Text = noOfDays.ToString(); if (Session.Count > 0) { if (Session["Designation"].Equals("Student")) { lblUser.Text = Session["UserName"].ToString(); lblLastLogin.Text = "Last Logged In " + Session["LastLogin"].ToString(); } else { Response.Redirect("../login/Login.aspx"); } } else { Response.Redirect("../login/Login.aspx"); } } private int DaysIgnoreWeekends(DateTime dtst, DateTime dtend) { TimeSpan days = dtend.Subtract(dtst); int count = 0; for (int a = 0; a < days.Days + 1; a++) { if (dtst.DayOfWeek != DayOfWeek.Saturday && dtst.DayOfWeek != DayOfWeek.Sunday) { count++; } dtst = dtst.AddDays(1.0); } return count; } 26
protected void Page_Load(object sender, EventArgs e) { lblUserID.Text = Session["UserID"].ToString(); con = new SqlConnection(ConfigurationManager.ConnectionStrings["LeaveMgmtSysConStr"].ConnectionString); if (!Page.IsPostBack) { loaduserdata(); } } public void loaduserdata() { try { query = "SELECT [StuName],[hod],[tutor],[acaco],[LeavesAppliedAlready] FROM [LeaveManagementSystem].[dbo].[tb_StudentDetails] where stuperid='" + Session["UserID"].ToString() + "'"; cmd = new SqlCommand(query, con); //Openning the Connection con.Open(); //Executing the Command And Assigning the Values to Data Reader(dr) dr = cmd.ExecuteReader(); if (dr.HasRows) { if (dr.Read()) { lblName.Text = dr[0].ToString(); lblHOD.Text = dr[1].ToString(); lbltutor.Text = dr[2].ToString(); lblAcaCo.Text = dr[3].ToString(); lblLeaAppAl.Text = dr[4].ToString(); } } } catch (SqlException sqlex) { lblstatus.Text = sqlex.Message; lblstatus.Visible = true; } finally { if (con.State == ConnectionState.Open) { con.Close(); } if (dr != null) { dr.Close(); } query = null; 27
} } protected void btnSave_Click(object sender, EventArgs e) { try { //Assigning Sql Command in to String Object query = "INSERT INTO [LeaveManagementSystem].[dbo].[tb_LeaveDetails] VALUES ('" + Session["UserID"].ToString() + "','" + lblName.Text + "','" + DateTime.Today.ToShortDateString() + "','','" + txtStaDate.Text + "','" + txtEndDate.Text + "','" + txtReason.Text + "'," + lblNoDays.Text + ",'','','','" + lbltutor.Text + "','" + lblAcaCo.Text + "','" + lblHOD.Text + "',0,'Pending')"; cmd = new SqlCommand(query, con); //Openning the Connection con.Open(); //Executing the Command And Assigning the Values to Data Reader(dr) if (cmd.ExecuteNonQuery() > -1) { lblstatus.Text = "The Leave Request Sent to Tutor. Check Your Home Page for further Details."; lblstatus.Visible = true; query = "update tb_StudentDetails set LeavesAppliedAlready ='" + lblLeaAppAl.Text + "' where StuPerID='" + Session["UserID"].ToString() + "'"; cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); disControl(); } else { lblstatus.Text = "The Leave Request Not Submitted"; lblstatus.Visible = true; btnSave.Enabled = false; } } catch (SqlException ex) { lblstatus.Text = ex.ToString(); lblstatus.Visible = true; } finally { if (con.State == ConnectionState.Open) { con.Close(); } }} public void disControl() { txtStaDate.Enabled = false; txtEndDate.Enabled = false; btnSave.Enabled = false; txtReason.Enabled = false; 28
ChangePwd.aspx.cs:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration; public partial class Login_Login : System.Web.UI.Page { DataSet ds; SqlDataAdapter da; SqlConnection con; SqlDataReader dr; SqlCommand cmd; string query, greetingMsg = null; protected void Page_Load(object sender, EventArgs e) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["LeaveMgmtSysConStr"].ConnectionString); lblUser.Text = Session["UserName"].ToString(); lblLastLogin.Text = "Last Logged In " + Session["LastLogin"].ToString(); lblPusrID.Text = Session["UserID"].ToString(); } protected void ImgLogOut_Click(object sender, ImageClickEventArgs e) { Session.Abandon(); Response.Redirect("../Login/Login.aspx"); } protected void btnChange_Click(object sender, EventArgs e) { try { string s = lblPusrID.Text; if (s.Contains("Sta")) { query = "Update [LeaveManagementSystem].[dbo].[tb_StaffDetails] Set Password ='" + txtConPWD.Text + "' where FullStaffID='" + Session["UserID"].ToString() + "'"; cmd = new SqlCommand(query, con); //Openning the Connection con.Open(); 29
//Executing the Command ,It Will update the Records if (cmd.ExecuteNonQuery() > -1) { lblstatus.Text = "Password Is Updated"; lblstatus.Visible = true; } else { lblstatus.Text = "Password is Not Updated"; lblstatus.Visible = true; } } else if (s.Contains("Adm")) { string stuid = Session["UserID"].ToString(); query = "Update [LeaveManagementSystem].[dbo].[tb_login] Set Password ='" + txtConPWD.Text + "' where loginid='" + stuid + "'"; cmd = new SqlCommand(query, con); //Openning the Connection con.Open(); //Executing the Command ,It Will update the Records if (cmd.ExecuteNonQuery() > -1) { lblstatus.Text = "Password Is Updated"; lblstatus.Visible = true; } else { lblstatus.Text = "Password is Not Updated"; lblstatus.Visible = true; } } else { string stuid = Session["UserID"].ToString(); query = "Update [LeaveManagementSystem].[dbo].[tb_StudentDetails] Set Password ='" + txtConPWD.Text + "' where StuPerID='" + stuid + "'"; cmd = new SqlCommand(query, con); //Openning the Connection else { lblstatus.Text = "Password is Not Updated"; lblstatus.Visible = true; } } } catch (SqlException ex) finally 30
StaffHome.aspx.cs
using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration; public partial class StaffHome : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Session.Count > 0) { if (Session["Designation"].Equals("Staff")) { lblUser.Text = Session["UserName"].ToString(); lblLastLogin.Text = "Last Logged In " + Session["LastLogin"].ToString(); } else { Response.Redirect("../login/Login.aspx"); }} else { Response.Redirect("../login/Login.aspx"); } } protected void ImgLogOut_Click(object sender, ImageClickEventArgs e) { Session.Abandon(); Response.Redirect("../Login/Login.aspx"); }}
32
33
34
35
36
37
38
CHAPTER X
BIBLIOGRAPHY WEBSITES www.asptutorial.com www.pscode.com www.w3schools.com www.hotscripts.com www.freesoft.in BOOKS: 1) Software engineering ,Roger S.Pressman Fifth Edition,Mc Graw Hill International Edition 2001 2) System Analysis and Design
Elais M.Awad, Second Edition Galgotia Publications(p)Ltd Published by Sunil Galgotia, 2002.
39