Sie sind auf Seite 1von 39

INTRODUCTION

1.1 ORGANIZATION PROFILE


Sri Ramakrishna Engineering College was established in the year 1994 by SNR Sons charitable trust. It had grown into an eminent institution in TamilNadu. The institution is accredited by national board of accreditation [NBA]. The college has been awarded autonomous status for all UG and PG programmes by UGC and the sprawling 42.24 acres has an admirable infrastructure with all facilities and well equipped laboratories with latest technology. The Objective of the management of the Sri Ramakrishna Engineering College is that a student passing out of the college should be well trained and equipped to meet the challenges and requirements of the present as well as the future. Therefore industrial training is given to all students as part of the education scheme in well-established industries. Engineers from industries are invited to deliver lecturers on the practices adopted in their establishments. The college has signed MOU with South Dakota School of Mines and Technology, Rapid City USA and Rutgers, The college has also signed MOU with Infosys, Wipro and CODISSIA to enrich the students with exposure on industry scenario.

1.2 PROBLEM DEFINITION


The Mini Project will help us to manage the leave details. This Mini Project maintains a centralized database through which the leave details are being maintained. The Leave details of each and every person are also is updated in to the database. Authenticated person can able to view the report of individual scheme in detail concurrently. The Authenticated person will provide with both on overall and stage wise details report from all the users. The entire Authenticated person under college will be provided with separate logins to avoid stolen of data from unauthorized users. The Authorized person can only update the details. This system provides all the facilities to maintain correct and confident data of the Mini Project in time to time. The each individual in the institution also can view their leave details using their register number. This package provides efficient and low maintenance effort to have total control over Mini Project. This Mini Project contains the following modules: 1. Department Details, 2. Leave Details, 3. Login Details, 4. Staff Details, 5. Student Details.

CHAPTER II SYSTEM ANALYSIS


2.1 EXISTING SYSTEM
The existing system for Online Leave Management system is a manual process. With respect to the existing system, the incharge has to maintain the manual records and it is complicated to identify the particular record at a time and it is not easy to maintain the manual records and manual errors are committed. All this requires more time and labor work. Moreover, the data collected may be inconsistent, redundant, and servicing a remote person will become impossible.
DRAWBACKS OF THE EXISTING 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.

CHAPTER III SYSTEM SPECIFICATION


Providing Online Leave Management System the project is faculties and the students leave details. My project has been developed in order to replace the manual system, where it is a difficult process to implement with it. The manual system will result in some kinds of human mistakes and error which will alter the correct working conditions of the project. If there may be a small mistake it will collapse all the factors of the projects. So in order to avoid those mistakes and errors we found an alternative way of generating automatically.

3.1 SCOPE
Create different users and maintain the details and manage all the details related to student and the facultys leave details.

3.2 HARDWARE REQUIREMENTS


Processor RAM Capacity Hard disk drive Mouse : Intel Pentium Dual CPU T2370 @1.73GHz : 1014MB : 260MB : Optical mouse

3.3 SOFTWARE REQUIREMENTS


Operating System Language Front End Tool Back End Tool : Windows 7 : Visual Studio.NET 2008 : ASP.NET with C# : SQL Server 2005
5

Frame Work

: Visual Studio.NET Frame Work

CHAPTER IV SOFTWARE DESCRIPTION 4.1 FRONT END: ASP.NET:


Introduction: Visual Basic has become the most popular programming language mainly due to its simplicity and powerful pack of features. It has managed to emerge as such a powerful and popular language that C# programmers are always in demand in the job market. ASP.NET, the latest version of c#, it actually a new language. It is fully object-oriented and it is compatible with all the other languages using the .NET Framework, such as VC#.NET, VJ#.NET, and VC+ +.NET. Like C#, ASP.NET allows programmers to easily develop Windows-based applications. It enables the programmers to develop applications that run in a web browser without the complexity generally associated with web-programming. Visual Studio IDE is a special development tool that provides an environment to create and test out windows-based and web based programs. The .NET Framework: The programming language ASP.NET, VASP.NET, VJ#.NET and VC++.NET extensively make use of the .NET Framework. The rich features in this framework ensure easier development of Windows-based applications, allow components from different .NET languages to interact with each other and standardize how the.NET languages refer to objects and data sources. The source code written in all the .NET languages are all initially compiled to an common intermediate language, called Microsofts Intermediate Language (MSIL). The MSIL code, called managed code, is executed by the Common Language Runtime (CLR) which is part of the .NET framework.

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

4.2 BACK-END: MS-SQL SERVER 2005


MS SQL Server is a powerful database management system and the user can create applications that require little or no programming. It supports GUI features and an entire programming language, Visual Studio Application which can be used to develop richer and more developed application. There are quite a few reasons, the first being that SQL is a feature rich program that can handle any database related task you have. You can create places to store your data build tools that make it easy to read and modify your database contents, and ask questions of your data. SQL is a relational database, a database that stores information about related objects. In MS SQL that database means a collection of tables that hold data. It collectively stores all the other related objects such as queries, forms and reports that are used to implement function effectively.
7

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.

CHAPTER V SYSTEM DESIGN AND DEVELOPMENT 5.1MODULE DESCRIPTION


5.1.1 Department Details This Department details is used to get the department details. This module gets the complete details which are used to store in the database and also retrieve it for future use. 5.1.2 Leave Details This Leave Details is used to get the details of applying, cancelling, approved, and rejected leave details. This module gets the complete details which are used to store in the database and also retrieve it for future use. 5.1.3 Login Details This Login Details is used to navigate to the particular page based on Login ID. The authorized person only can add, delete, and view the entire records. 5.1.4 Staff Details This Staff Details is used to add the details of the student of the particular department. The details are stored in the database for the reference and to monitor. 5.1.5 Student Details This Student Details is used to add the details of the student of the particular department. The details are stored in the database for the reference and to monitor.

5.2 ENTITY RELATIONSHIP DIAGRAM


9

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.

ENTITY RELATONSHIP DIAGRAM


10

11

5.3 DATA FLOW DAIGRAM


A data flow diagram (DFD) is a graphical representation of the flow of data through an information system; it differs from the system flowchart as it shows the flow of data through processes instead of hardware. The DFD is designed to show how a system is divided into smaller portions and to highlight the flow of data between those parts. This Context-level Data flow diagram is then exploded to show more detail of the system being modeled. There are different notations to draw data flow diagrams, defining different visual representations for processes, data stores, data flow, and external entities. 5.3.1 LEVEL 0 DFD

Student and faculty

Student and Faculty Details

Leave Manage ment System

Report Report

5.3.2 LEVEL 1 DFD

12

5.4 INPUT DESIGN


The most common source for data processing errors is erroneous input data. Since the computer works as directed by the user/programmer it does not make any mistakes of its own. The goal of input design is to make the data entry easy and free form errors. Input design is aimed at reducing errors. However, there is a chance for error occurrence. They must be detected during input and general term given to the method detecting during input and the general term given to the method detecting errors during input validation. Validity checks used to eradicate confusion.

5.5 OUTPUT DESIGN


Computers output design is a process that involves designing necessary for presenting the output and which can be shared among various users according to their requirements. In this Mini Project a variety of windows has been provided to help the user to know the current status of the organization and other frequent transactions such as distributing energy to feeders, and transformers etc.

5.6 TABLE DESIGN


13

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

FIELD LOGINID PASSWORD DESIGNATION LASTLOGIN nvarchar(10) nvarchar(20) nvarchar(20) nvarchar(50)

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)

0,1,2,3.9 Pending leave, Applied leave, Rejectedleave.

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)

It displays when the particular staff lastly logged in.

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

CHAPTER VI SYSTEM TESTING


Testing is a series of different tests that whose primary purpose is to fully exercise the computer based system. Although each test has a different purpose, all work should verify that all system element have been properly integrated and performed allocated function. Testing is the process of checking whether the developed system works according to the actual requirement and objectives of the system. The philosophy behind testing is to find the errors. A good test is one that has a high probability of finding an undiscovered error. A successful test is one that uncovers the undiscovered error. Test cases are devised with this purpose in mind. A test case is a set of data that the system will process as an input. However the data are created with the intent of determining whether the system will process them correctly without any errors to produce the required output. Types of Testing: Unit testing Integration testing Validation testing Output testing Acceptance testing

6.1 Unit Testing


18

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

CHAPTER VII SYSTEM IMPLEMENTATION


Implementation is the stage of the project when the theoretical design is turned into a working system. This is the final and important phases in the system life cycle it is actually the process of conserting the new system into operational one. The primary objective of Implementation is to write source code and internal documentation so that conformance of the code to its specification can easily be verified. The objectives can be achieved by making source code as clear and straight forward as possible source code clarity is enhanced by structural coding techniques, by good coding style. To achieve the objectives and the benefits expected from development system is to achieve the confidence of the people who will work in that system. In system manuals, details about the system which were used to develop the system are specified. In user manuals, data flow diagrams, menu and screen formats are given. The most creative and challenging phase of the system life cycle is system design. The design focuses on the detailed implementation of the system. System design is the process of planning a new system. The objectives of the proposed system are the driving forces behind the design process. Based on the input values and output requirements, the system is designed System design goes through two phases of the development and they are logical and physical design. When analyst prepares logical system design, they specify then user needs of detail virtually determines information flow and out of the system required data sources. First step is design phase is to determine how the output is produced and in what format.Secondly, input data and the master files have to be design to meet the requirements of the proposed output. Finally at the end of the design phase the system design description will be ready which is used
20

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.

CHAPTER VIII CONCLUSION AND FUTURE ENHANCEMENTS


8.1 CONCLUSION
The aim of this Mini Project is to create Online Leave Management System through which Mini Project developed for the individual leave status of our college is monitored. This Mini Project is used to monitor the leave details in our college used to generate reports for their undergoing processes in online. Each details of the leave is stored and updated by the Authenticated person. All the persons can view the individual details and the reports for details in online. The main intension is to gather the leave information. They are submitting their details and maintenance details manually to their department before we have done this Mini Project.

8.2 FUTURE ENHANCEMENTS


This project maintains the details about the details of the individuals in the institution and provides reports. Thus the future enhancement is going to implement this software to the entire SNR trust colleges.

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

} protected void ImgLogOut_Click(object sender, ImageClickEventArgs e) { Session.Abandon(); Response.Redirect("../Login/Login.aspx"); } }

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

{ if (con.State == ConnectionState.Open) { con.Close(); } if (dr != null) { dr.Close(); } query = null; } } }

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"); }}

9.2 SCREEN SHOTS


31

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

Das könnte Ihnen auch gefallen