Analysis Report Review Report Title: REPORT DRAFT 4 Report ...
Report
-
Upload
piyush-kumar -
Category
Documents
-
view
212 -
download
0
description
Transcript of Report
A
PROJECT REPORT
ON
FILE MOVEMENT SYSTEM
SUBMITTED IN PARTIAL FULFILLMENT FOR THE AWARD OF THE DEGREE OF
BACHELOR OF TECHNOLOGYIN
COMPUTER SCIENCE AND ENGINEERING
UNDER THE GUIDANCE OF SUBMITTED BY
Mr. Sukhveer Singh Piyush Kumar(03710402711)
Department Of Computer Science & EngineeringAmity School Of Engineering & Technology
(Affiliated To G.G.S.I.P. University)Dwarka Sector-16 New Delhi
1
ACKNOWLEGEMENT
This project report on “FILE MOVEMENT SYSTEM” is an outcome of sincere and positive
contribution of various individuals. Although it is very difficult to name all source of inspiration
and guidance from time to time. However, we shall be failing in my duty I do not express my
thanks to a few people in particular and I wish to single out for special of few individuals who
contributed directly to our knowledge and for completing this project.
We are thankful to the almighty who guides me at each and every step ad because of whom only
I could represent this endeavor.
I also express my gratitude to my parents whose support and love made us able to do this work I
have bee doing.
I feel ardently impelled to express my heartfelt gratitude to my project guide Mr. Sukhveer Sir
without whose precious guidance, encouragement and support this project would not have been
possible. He has a constant source of motivation and inspiration in this work.
Thanking You,
Piyush Kumar(03710402711/B.tech/CSE)
2
DECLARATION
I, Mr. Piyush Kumar hereby declare that this project report is the record of authentic work carried out by me during the period from 22 th June 2015 to 31th July 2015 and has not been submitted to any other University or Institute for the award of any degree / diploma etc.
Signature
Name of the student: Piyush Kumar
Date: 18.09.2015
3
ABSTRACT
Inspite of great computerization in the country, the offices have not become paper less and are
still continuing with the conventional documentation procedures in the form of files and
registers. Most of the Government machinery is using computers more or less as an electronic
typing machine and are still using the traditional methods for record keeping or documentation
processes.
In order to monitor the movement of files and registers within an organization where all the
communication between the sections and directorates is still done on hard paper instead of
electronic files, it is mandatory to have a system of monitoring the movement of files and
registers being maintained by various sections and directorates by the employees deployed
therein.
The project File Monitoring system has been designed exclusively for a scenario where all the
correspondences are done in the form of physical files and registers which will enable all the
users/ employees to locate the current position of their respective files and folders.
This system will not only eliminate the file movement registers being maintained at all levels in
the organization but will also be helpful in tracing the physical files which tend to get lost during
movements from one desk to another within an organization. The File Monitoring system is a
web based application which will be operative in the organization’s LAN environment. The
system has three types of users viz: Super Admin, Admin and Users. Administrator controls the
user accounts and takes user feedback to make the system work more efficiently.
4
TABLE OF CONTENTSAcknowledgement……………………………………………………………………………..…..i
Certificate………………………………………………………………………………………....ii
Declaration………………………………………………………………………………………..iii
Abstract………………………………….………………………………………………………..iv
List of Screenshot…………………………………………………………………………………v
Chapter 1.Introduction…………………………………………………………………...…...…..7
1.1 What is file movement?
1.2 Existing system
Chapter 2. Software Requirement Specification……………………………………..…………11
2.1 SRS Document
2.2 Database design
2.3 E-R diagram
2.4 Data Flow Diagram
2.4.1 0-level DFD
2.4.2 1-level DFD
Chapter 3.Theoretical background…………………...……………………..……….....…….....24
3.1 Hardware Requirement
3.2 Software Requirement
Chapter 4.Module description…..………….……………………..………………………...…..27
Chapter 5.SoftwareAnalysis…………………………………………..………………………...30
Chapter 6.SoftwareTesting……………………………………..……………………………….35
Chapter 7.Screenshots...…………………….…………………..………………………...…….45
Chapter 8.Conclusion and future scope…………………………...……………………….........54
References………………………………………………………….…………………………….55
Appendix…………………………………………………………..……………………….…….56
5
LIST OF SCREENSHOTS
Screenshots No. Page No.
1. Login 45
2. Change Password 46
3. User Home Page 47
4. Admin Home Page 48
5. View/Mark File 49
6. File Ranking 50
7. File Weed out 51
8. Directorate Detail 52
9. File Hand Over 53
10. Add New Section 53
6
INTRODUCTION
WHAT IS FILE MOVEMENT SYSTEM?
Inspite of great computerization in the country, the offices have not become paperless and are
still continuing with the conventional documentation procedures in the form of files and
registers. Most of the Government machinery is using computers more or less as an electronic
typing machine and are still using the traditional methods for record keeping or documentation
processes.
In order to monitor the movement of files and registers within an organization where all the
communication between the sections and directorates is still done on hard paper instead of
electronic files, it is mandatory to have a system of monitoring the movement of files and
registers being maintained by various sections and directorates by the employees deployed
therein.
The project File Monitoring system has been designed exclusively for a scenario where all the
correspondences are done in the form of physical files and registers which will enable all the
users/ employees to locate the current position of their respective files and folders.
This system will not only eliminate the file movement registers being maintained at all levels in
the organization but will also be helpful in tracing the physical files which tend to get lost during
movements from one desk to another within an organization. The File Monitoring system is a
web based application which will be operative in the organization’s LAN environment. The
system has three types of users viz: Super Admin, Admin and Users. Administrator controls the
user accounts and takes user feedback to make the system work more efficiently.
8
EXISTING SYSTEM
Presently registers are being maintained by all the employees wherein they make endorsements
about the files and registers sent to other desks by them and further make corresponding entries
on their return and taking back in to the custody.
.
9
SOFTWARE REQUIREMENT SPECIFICATION
If a document that completely describes what the proposed software should do without
describing how the software will do it, The basic goal of requirements specific to produce the
requirements, which describes the complete external behavior of the proposed software.
However, producing the report is said to be done.
The basic limitation is that the user’s need keep on changing as the environment in which system
was to function changes with time. This happens more in complex application where all the
needs may not be known to any set of people during the requirement phase. Types of error in this
specifications can clearly be avoided or at least considerably, by properly performing the
requirement phase.
As many times a developer or administrator does not know what a user and the supplier on what
the software product will do. This is the only document which tells the time agreement and
procedure of complete project as well as what a user wants.
There are some steps which are considered in the SOFTWARE REQUIREMENT
SPECIFICATION such as:
Introduction Description
Information Description
Function Description
Behavioral Description
11
Introduction Description
The introduction states the goals and objectives of the software describing it in the context of the
computer -based system. Actually the introduction may be nothing more than the software
people of the planning document.
Information
The Information description provides a detailed description of the project.
File Monitoring System is a custom based web application developed exclusively for an
organization which is capable of handling all the movements of physical files and registers which
are sent amongst the employees of the same organization from one desk to another. The
application has been developed in a modular fashion wherein all the employees will be accessing
various modules based on their assigned roles.
Functional Description
The project also provides the facility to contact the registered user easily without any admin
interaction. If you find an existing entry meeting your requirement, then you can contact the
concerned party directly. If there is no entry, which meets your requirement, you can register
your details on the site, so that others can find you. The project improves the efficiency and
effectiveness of the whole system.
Behavioral Description
IT Examines the operations of the software as a consequence of external events and internally
generated control characteristics. Here the Admin checks the classified entered by the registered
users. Admin is the only person who can activate or deactivate the classified entered by the
registered users.
12
DATABASE DESIGN
List of Tables:
1. File_Directorate_Table
2. File_Section_Table
3. File_Rank_Table
4. File_Custodian_Table
5. File_master_Table
6. File_Weeded_table
7. File_History_Table
1. File_Directorate Table
Field Name Datatype
Directorate_Id Int
Directorate_Name Varchar
2. File_Section Table
Field Name Data Type
Section_Id Int
Section_Name Varchar
Directorate_Id Int
3. File_Rank Table
Field Name Data Type
Rank_Id Int
Rank_Name Varchar
4. File_Custodian Table
13
Field Name Data Type
Custodian_Id Int
Custodian_Name Varchar
Custodian_Rank_Id Int
Custodian_Section_Id Int
Custodian_Password Char
Custodian_Type Char
Custodian_Active Bit
5. File_Master Table
Field Name Data Type
File_Id Int
File_Number Varchar
File_Subject Varchar
File_Opened_on Date
File_Closed_on Date
File_Retention_Period Int
File_Section_Id Int
File_Marked_on DateTime
File_Received_On DateTime
Permanent_Cutodian_Id Int
Current_Custodian_Id Int
Remark Varchar
6. File_Weeded Table
Field Name Data Type
File_Id Int
File_Number Int
File_Subject Varchar
14
File_Opened_on Date
File_Closed_On Date
File_Retention_Period Int
File_Section_Name Varchar
Custodian_Name Varchar
File_Weededout_Date Date
7. File_History_Table
Field_Name Data Type
File_Id Int
Custodian_Id int
File_Marked_on Date
File_Received_On Date
Permanent_Custodian_Id Int
Remark Varchar
15
DFD (Data Flow Diagram)
User Detail
File Deatils
Files Details
Subject
Section Details
View Details
1 ST level DFD (File Movement System)
17
User Send Files
Add new section
File Movement SystemUser recives
View Files
User reg.
subject
The level 1 of DFD shows the main functionality areas of the system. Each of this process can be
broken in to further process until you reach.
Non registered User
Correct Login DetailsForgot Password
18
File Movement System
Has
Registered User
Login
Create New User
Incorrect Login
Details
Forgot Password
User Home
Compose File
Mark File
SendFile
Database Requirements:
Identify The Various Tables Required.
Fields For These Tables.
The Various Key Fields (for example Primary key and Foreign key).
Identify The Various Constraints like Not Null, Unique etc.
The Database here used is Ms-SQL. The database tables are shown in DATABASE DESIGN.
Software/Compilers Required To Develop This System:
Operating System : Windows XP / 2000
Front-End Tool : ASP.NET 2008
Back-End : SQL Server
Hardware Required To Develop This System:
Processor: Any Pentium IV or Equivalent Machine
RAM: 256 MB
HDD: 40 GB
CD-ROM: 52X
15 inches Color Monitor
104 Keys Keyboards
20
The project is modular and has various modules depending on the requirements of the
organization.
Login
The login page will deal with the authentication of the users/ employees who would be using this
application. The login page is having the feature to change the password in case the users wish to
do the same thereby authenticating the user and redirecting to the home page in both the cases.
Admin Role
Although there would be only one administrator for this application, his basic role is to create
new Directorates, Sections, Ranks and new users for which the only page which uses the Multi-
view function caters all the functionalities. Additionally, he has the access to all the pages of the
application where users have a limited or no right.
Administrator can also be able to activate or deactivate a user and reset user’s passwords.
Marking of files to other desks
The users will be able to mark their files to other custodians/ desks i.e., the current location of
the file will keep on changing with respect to the physical location of the file from one desk to
another. Since the handle of marking the files to others will keep on changing as the file moves.
Receiving marked files from other desks
Similarly the files received physically on one desk will also be electronically received and an
endorsement in the system has to be made by the receiving employee. This will enable each
employee to monitor the flow of file movement from one desk to another. The difference in the
date and time stamp for each file will actually show the transit stage from one desk to another.
Handing/Taking over of files and registers
The procedures of handing/ taking over of files and registers being maintained by one desk
officer to another desk officer is mere cumbersome and in order to overcome this tedious
procedure, this application will also take care of the handing/taking over issues and will
22
accordingly change the permanent custodian of that particular file/ register (refer to the database
diagram of table “File_master_table”).
Weeding out of Files
Since every document and records maintained in an organization has a retention life period after
which they are supposed to be physically destroyed. This application will also be able to cater to
the need of weeding out procedures wherein the files which are closed and the retention period is
over (the calculation will be done by the application and the list of files to be weeded out will be
generated.) will be subjected to weed out procedures laid down by the organization.
23
System Analysis
The analysis model must achieve three primary objectives:-
To describe the requirements of the customer.
To establish a basis for the creation of a software design.
To define a set of requirements that can be validated once software is built.
An Overview to system analysis:
The system analysis phase is considered to be one of the most important phases in the system
development life cycle. It is immensely important that the software developer make through
study of the existing system. Thorough study of the system is made and need i.e. features that
are critical to system success and users wants (i.e. features that would be good but not essential)
are brought out. The study will enable the developer to know the intricacies of the existing
system.
Requirement analysis is done in order to understand the problem which the S/W system is to
solve e.g., the problem could be automating the existing manual system or developing a
completely new automated system or a combination of the two. For large systems having a large
number of features and the need to perform many different tasks, understanding the requirement
of the system is a major task. The emphasis in requirement analysis is on identifying what is
needed from the system, and not how the system achieves its goal.
The main objective behind any business organization is to maximize its profit besides
maintaining quality and strategic norms. This can be achieved by improving the efficiency of
the system by providing more facilities using automation, by adopting faster data access, proper
communication.
Since Computer Craft is an educational institute, whereas its main objective behind automation
is not only to maximize profit but also to take care of students’ interest by providing coaching
of latest courses benefiting students, in turn the country.
25
The most important objective behind automation is to minimize Paper Work. Paper
Work/Registers are replaced by a Centralized Data Bank, which is well equipped to store /
provide information as and when required. Data Bank also helps speed up the communication
between various depts. / outside agencies, as there is no need of making request against
different departments for a specific data and to wait for it for a long period. This also
improves the efficiency as it saves time and human resources.
By making the manual system computerized, we can ensure complete utilization of our
existing resources. Automation helps in generating the reports / information in a consistent
way, which saves time and labour if done manually.
NEED OF COMPUTERIZATION:
In the area of information technology, it is need of hour to have a fast information processing
system capable of providing processed data at right time and to right person which
appropriately justified by the following limitation of manual system:
Delay in information search and retrieval
Problem in updation of current information and maintaining proper backup of
information
Possible damage of paper carrying the information thereby chance of loosing valuable
information.
Much time required in giving correct information
Less reliability and maintainability of data
Secrecy of information may not be maintained due to visible facts on paper.
26
SOFTWARE TESTING
It should be clear in mind that the philosophy behind testing is to find errors. Test cases are
devised with this purpose in mind. A test case is a set of data that the system will process as
normal input. However, the data are created with the express intent of determining whether the
system will process them correctly. For example, test cases for inventory handling should
include situations in which the quantities to be withdrawn from inventory exceed, equal and are
less than the actual quantities on hand. Each test case is designed with the intent of finding errors
in the way the system will process it. There are two general strategies for testing software: Code
testing and Specification testing. In code testing, the analyst develops that cases to execute every
instructions and path in a program. Under specification testing, the analyst examines the program
specifications and then writes test data to determine how the program operates under specific
conditions. Regardless of which strategy the analyst follows, there are preferred practices to
ensure that the testing is useful. The levels of tests and types of test data, combined with testing
libraries, are important aspects of the actual test process.
Levels of Testing :
Systems are not designed as entire systems nor are they tested as single systems. The analyst
must perform both unit and system testing.
Unit Testing:
In unit testing the analyst tests the programs making up a system. For this reason, unit testing is
sometimes called program testing. Unit testing gives stress on the modules independently of one
another, to find errors. This helps the tester in detecting errors in coding and logic that are
contained within that module alone. The errors resulting from the interaction between modules
are initially avoided. For example, a hotel information system consists of modules to handle
reservations; guest checking and checkout; restaurant, room service and miscellaneous charges;
convention activities; and accounts receivable billing. For each, it provides the ability to enter,
modify or retrieve data and respond to different types of inquiries or print reports. The test cases
needed for unit testing should exercise each condition and option.
28
System Testing:
The important and essential part of the system development phase, after designing and
developing the software is system testing. We cannot say that every program or system design is
perfect and because of lack of communication between the user and the designer, some error is
there in the software development. The number and nature of errors in a newly designed system
depend on some usual factors like communication between the user and the designer; the
programmer's ability to generate a code that reflects exactly the systems specifications and the
time frame for the design.
Theoretically, a newly designed system should have all the parts or sub-systems are in working
order, but in reality, each sub-system works independently. This is the time to gather all the
subsystem into one pool and test the whole system to determine whether it meets the user
requirements. This is the last change to detect and correct errors before the system is installed for
user acceptance testing. The purpose of system testing is to consider all the likely variations to
which it will be subjected and then push the system to its limits.
Testing is an important function to the success of the system. System testing makes a logical
assumption that if all the parts of the system are correct, the goal will be successfully activated.
Another reason for system testing is its utility as a user-oriented vehicle before implementation.
29
CONCLUSION AND FUTURE SCOPE
Conclusion
We propose file movement system in order to eliminate the file movement registers being
maintained at all levels in the organization but will also be helpful in tracing the physical files
which tend to get lost during movements from one desk to another within an organization. The
File Monitoring system is a web based application which will be operative in the organization’s
LAN environment.
Advantages of this process:
It is simple to implement.
Reduces the number of employee in an organization.
Reduces the use of paper.
Help in detecting the location of current and lost files.
Future scope
The future of the Project looks more promising. The proposed system will eliminate the
manual work of maintenance of registers by all the employees within the organization
thereby not only enhancing the working efficiency but also providing immediate information
about the physical location of the file/ register with the movement history.
43
REFRENCES
ASP.NET UNLEASHED……………………………….Stephen Walther.
Mastering in Sql Server.………..………………………….Brad Mc Gehee
Web References:
[1]. http://opensmpp.logica.com/introhtml/menu.htm
[2]. www.devshock.com
[3]. www.msdn.com
[4]. http://www.asp.net/
[5]. http://msdn.microsoft.com/netframework/windowsforms/
[6]. www.sas.com
[7]. www.bonrix.net
44
PROGRAMMING CODE:
HOME:
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;
public partial class home : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) {
}}
LOGIN:
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;
public partial class login : System.Web.UI.Page{ connct c = new connct(); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Label4.Visible = false; }
46
if (Request.QueryString["log"] != null) { Label4.Visible = true; Label4.Text = "Please Login into your account"; } } protected void Button1_Click(object sender, EventArgs e) { if (txt_uname.Text == "admin" && txt_pass.Text == "a") { Session["uid"] = "Admin"; Response.Redirect("adminlog.aspx"); } else { c.con.Open(); string abc = "select * from user_det where u_id='" + txt_uname.Text + "' and u_pass='" + txt_pass.Text + "'"; SqlCommand cmd = new SqlCommand(abc, c.con); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { if (dr["u_block"].ToString() == "y") { ViewState["per"] = "No Permission...Please Contact to administrator"; goto done; } if (dr["u_block"].ToString() == "n") { Session["uid"] = txt_uname.Text; Session["uname"] = dr["u_fname"].ToString(); Response.Redirect("ulogmain.aspx"); } done: Label4.Visible = true; Label4.Text = ViewState["per"].ToString(); } else { Label4.Visible = true; Label4.Text = "Please enter correct ID & Password"; } dr.Close(); c.con.Close(); } }}
47
LOGOUT:
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class logout : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { Session["uname"] = null; Session["uid"] = null; Response.Redirect("about.aspx"); }}
ADMIN LOGIN:
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;using System.Text;
public partial class adminlog : System.Web.UI.Page{ connct c = new connct(); protected void Page_Load(object sender, EventArgs e) { if (Session["uid"] == null) { Response.Redirect("login.aspx?log=n"); }
48
if (Session["uid"].ToString() != "Admin") { Response.Redirect("login.aspx?log=n"); } if (Request.QueryString["ud"] == "n") { Button1.Enabled = false; GridView1.Visible = false; Button1.Visible = false; Label3.Visible = true; Label3.Text = "Please Select the user to Block/Unblock"; } if (!Page.IsPostBack) { Button1.Enabled = false; GridView1.Visible = false; Button1.Visible = false; Label3.Visible = false; } } public void gd() { } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[1].Text = e.Row.Cells[1].Text + "@secure.com"; } } protected void Button1_Click(object sender, EventArgs e) { ck(); } public void ck() { StringBuilder str = new StringBuilder(); int a = 0; string quid = ""; int s = 0; for (int i = 0; i < GridView1.Rows.Count; i++) { GridViewRow row = GridView1.Rows[i]; bool isChecked = ((CheckBox)row.FindControl("chk")).Checked; Response.Write(isChecked); if (isChecked) {
49
s = Convert.ToInt32(((TextBox)row.FindControl("txt")).Text); if (a == 0) quid += s; else quid += "," + s; a = a + 1; } } if (Button1.Text == "Block") { if (quid == "") { string ab = "n"; Response.Redirect("adminlog.aspx?ud=" + ab); } else Response.Redirect("logchng.aspx?ubid=" + quid); } if (Button1.Text == "Unblock") { if (quid == "") { string ab = "n"; Response.Redirect("adminlog.aspx?ud=" + ab); } else { string a12 = "logchng.aspx?unbid=" + quid.ToString(); Response.Redirect(a12.ToString()); } } } protected void Button2_Click(object sender, EventArgs e) { Label3.Visible = false; Button1.Visible = true; Button1.Text = "Unblock"; Button1.Enabled = true; Button3.Enabled = false; c.con.Open(); GridView1.Visible = true; string str = "select * from user_det where u_block='y' order by u_dttm desc"; SqlDataAdapter ad = new SqlDataAdapter(str, c.con); DataSet ds = new DataSet(); ad.Fill(ds); GridView1.DataSource = ds;
50
GridView1.DataBind(); c.con.Close(); } protected void Button3_Click(object sender, EventArgs e) { Label3.Visible = false; Button1.Visible = true; Button1.Text = "Block"; Button1.Enabled = true; Button2.Enabled = false; GridView1.Visible = true; c.con.Open(); string str = "select * from user_det where u_block='n' order by u_dttm desc"; SqlDataAdapter ad = new SqlDataAdapter(str, c.con); DataSet ds = new DataSet(); ad.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); c.con.Close(); }}
CHANGE PASSWORD:
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;
public partial class uchgpwd : System.Web.UI.Page{ connct c = new connct(); protected void Page_Load(object sender, EventArgs e) { if (Session["uid"] != null) { ViewState["uname"] = Session["uname"].ToString(); fill(); }
51
else { Response.Redirect("login.aspx?log=n"); } } protected void Button1_Click(object sender, EventArgs e) { string str = "update user_det set u_pass='" + txt_npass.Text + "' where u_id='" + Session ["uid"] + "'"; c.con.Open(); SqlCommand cmd = new SqlCommand(str, c.con); cmd.ExecuteNonQuery(); c.con.Close(); Label3.Visible = true; Label3.Text = "Updated Successfully"; Button1.Enabled = false; } public void fill() { string abc = "select * from user_det where u_id='" + Session["uid"] + "'"; c.con.Open(); SqlCommand cmd = new SqlCommand(abc, c.con); SqlDataReader dr = cmd.ExecuteReader(); dr.Read(); { txt_aname.Text = dr["u_id"].ToString(); txt_opass.Text = dr["u_pass"].ToString(); } c.con.Close(); }}
COMPOSE _FILE:
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;using System.Collections.Generic;
52
using System.Text;using System.Security.Cryptography;using System.IO;
public partial class ucomp : System.Web.UI.Page{ connct c = new connct(); protected void Page_Load(object sender, EventArgs e) { if (Session["uid"] == null) { Response.Redirect("login.aspx?log=n"); } if (Session["uname"] == null) { Response.Redirect("login.aspx?log=n"); } if (!Page.IsPostBack) { Button2.Enabled = true; Button5.Enabled = true; Button3.Enabled = false; Label3.Visible = false; Label3.Text = ""; attachFile1.Visible = true; Label6.Visible = false; } } protected void Button5_Click(object sender, EventArgs e) { avli(); } public void avli() { if ((TextBox1.Text == "2" || TextBox1.Text == "3" || TextBox1.Text == "5" || TextBox1.Text == "7" || TextBox1.Text == "11" || TextBox1.Text == "13" || TextBox1.Text == "17" || TextBox1.Text == "19") && (TextBox2.Text == "2" || TextBox2.Text == "3" || TextBox2.Text == "5" || TextBox2.Text == "7" || TextBox2.Text == "11" || TextBox2.Text == "13" || TextBox2.Text == "17" || TextBox2.Text == "19")) { if (TextBox1.Text != TextBox2.Text) { chkatt(); ViewState["pass"] = TextBox3.Text; attachFile1.Visible = false; Label6.Visible = true;
53
Label3.Text = ""; int txt1 = Convert.ToInt32(TextBox1.Text); int txt2 = Convert.ToInt32(TextBox2.Text); int txt3 = txt1 * txt2; RSACryptoServiceProvider myrsa = new RSACryptoServiceProvider(); System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); string data = txt_mailmsg.Text; Byte[] newdata = encoding.GetBytes(data); Byte[] encrypted = myrsa.Encrypt(newdata, false); for (int i = 0; i < encrypted.Length; i++) { string s = encrypted[i].ToString(); Label3.Text = Label3.Text + s.ToString(); } txt_mailenmsg.Text = Label3.Text; Label3.Text = ""; Button3.Enabled = true; Button2.Enabled = false; Button5.Enabled = false; Label3.Visible = false; } else { Label3.Visible = true; Label3.Text = "Both prime no should not same"; } } else { Label3.Visible = true; Label3.Text = "Please enter valid Prime no"; } } public void insert() { Label11.Visible = true; Label11.Text = ""; string myData = txt_mailmsg.Text; string myDataEncoded = EncodeTo64(myData); Label11.Text = myDataEncoded.ToString(); Label11.Visible = false; } protected void Button3_Click(object sender, EventArgs e) { chk(); if (ViewState["chk"].ToString() == "y")
54
{ insert(); string type = "i"; nwmal(); c.con.Open(); string fuldt = System.DateTime.Now.Day.ToString() + "-" + System.DateTime.Now.Month.ToString() + "-" + System.DateTime.Now.Year.ToString(); string abc123 = "insert into usr_mail(m_type,m_rec,m_sen,m_att,m_mail,m_rsamail,m_dttm,m_sub,m_pass,m_fuldt) values('" + type + "','" + txt_mailto.Text + "','" + Session["uid"].ToString() + "','" + Label6.Text + "','" + Label11.Text + "','" + txt_mailenmsg.Text + "','" + System.DateTime.Now + "','" + txt_mailsub.Text + "','" + ViewState["pass"].ToString() + "','" + fuldt + "')"; SqlCommand cmd1 = new SqlCommand(abc123, c.con); cmd1.ExecuteNonQuery(); c.con.Close(); sendoutbox(); Response.Redirect("ulogmain.aspx"); } if (ViewState["chk"].ToString() == "n") { Label3.Visible = true; Label3.Text = "There is no such ID in Secure Database..!!"; } }
public void nwmal() { String Filename1 = System.DateTime.Now.Day.ToString(); Filename1 = Filename1 + "-" + System.DateTime.Now.Month.ToString(); Filename1 = Filename1 + "-" + System.DateTime.Now.Year.ToString(); c.con.Open(); string str = "select * from usr_mail where m_rec='" + txt_mailto.Text + "' and m_fuldt='" + Filename1.ToString() + "' order by m_id"; SqlCommand cmd = new SqlCommand(str, c.con); SqlDataReader dr = cmd.ExecuteReader(); int i = 1; while (dr.Read()) { i = i + 1; } String Filename = System.DateTime.Now.Day.ToString(); Filename = Filename + "-" + System.DateTime.Now.Month.ToString(); Filename = Filename + "-" + System.DateTime.Now.Year.ToString(); ViewState["fname"] = Filename + " (" + i + ")"; c.con.Close(); string att = ConfigurationSettings.AppSettings["path"].ToString();
55
System.IO.Directory.CreateDirectory(att); string path = att + "" + txt_mailto.Text; System.IO.Directory.CreateDirectory(path); string Filepath = path + "/" + ViewState["fname"].ToString() + ".txt"; if (Label3.Text == "n") ViewState["att1"] = "No"; else ViewState["att1"] = "Yes"; string content = "From: " + Session["uid"].ToString() + "\r\n\r\nSubject: " + txt_mailsub.Text + "\r\n\r\nAttachment: " + ViewState["att1"].ToString() + "\r\n\r\nMessage: " + txt_mailmsg.Text + ""; StreamWriter swcontent = new StreamWriter(Filepath); swcontent.Write(content); File.SetAttributes(Filepath, FileAttributes.ReadOnly); swcontent.Close(); } public void sendoutbox() { string type = "o"; c.con.Open(); string abc123 = "insert into usr_mail(m_type,m_rec,m_sen,m_att,m_mail,m_dttm,m_sub) values('" + type + "','" + txt_mailto.Text + "','" + Session["uid"].ToString() + "','" + Label6.Text + "','" + txt_mailenmsg.Text + "','" + System.DateTime.Now + "','" + txt_mailsub.Text + "')"; SqlCommand cmd1 = new SqlCommand(abc123, c.con); cmd1.ExecuteNonQuery(); c.con.Close(); } public void chk() { c.con.Open(); string abc = "select u_id from user_det where u_id='" + txt_mailto.Text + "'"; SqlCommand cmd = new SqlCommand(abc, c.con); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) ViewState["chk"] = "y"; else ViewState["chk"] = "n"; dr.Close(); c.con.Close(); } public void chkatt() { if (attachFile1.Value.ToString() != "") { // Boolean fileOK = false; string str = attachFile1.PostedFile.FileName;
56
str = System.IO.Path.GetFileName(str); string path = Server.MapPath("~/Attach/") + str; attachFile1.PostedFile.SaveAs(path); Label6.Text = str; } else { string str = "n"; Label6.Text = str; } } protected void Button2_Click(object sender, EventArgs e) { c.con.Open(); chkatt(); string a = "d"; string abc = "insert into usr_mail(m_type,m_rec,m_sen,m_att,m_mail,m_dttm,m_sub) values('" + a + "','" + txt_mailto.Text + "','" + Session["uid"].ToString() + "','" + Label6.Text + "','" + txt_mailmsg.Text + "','" + System.DateTime.Now + "','" + txt_mailsub.Text + "')"; SqlCommand cmd = new SqlCommand(abc, c.con); cmd.ExecuteNonQuery(); c.con.Close(); Response.Redirect("ulogmain.aspx"); } static public string EncodeTo64(string toEncode) { byte[] toEncodeAsBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(toEncode); string returnValue = System.Convert.ToBase64String(toEncodeAsBytes); return returnValue; } static public string DecodeFrom64(string encodedData) { byte[] encodedDataAsBytes = System.Convert.FromBase64String(encodedData); string returnValue = System.Text.ASCIIEncoding.ASCII.GetString(encodedDataAsBytes); return returnValue; }}
VIEW/ACCEPT FILE:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;
57
using System.Data;using System.Data.SqlClient;using System.Web.UI.WebControls;
namespace project.aspx{ public partial class WebForm4 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection("server=CHINKI-PC;database=model;integrated security=True"); con.Open(); SqlCommand cmd = new SqlCommand("select * from tabl", con); SqlDataReader dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind(); }
}}
FILE_RANKING:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Data;using System.Data.SqlClient;using System.Web.UI.WebControls;
namespace project.aspx{ public partial class WebForm8 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection(@"server=CHINKI-PC;database=model;integrated security=True"); con.Open(); SqlCommand cmd = new SqlCommand("select * from table3", con); SqlDataReader dr = cmd.ExecuteReader(); GridView1.DataSource = dr;
58
GridView1.DataBind();
} }}
DIRECTORATE DETAILS:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Data;using System.Data.SqlClient;using System.Web.UI.WebControls;
namespace project.aspx{ public partial class Directorate : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection(@"server=CHINKI-PC;database=model;integrated security=True"); con.Open(); SqlCommand cmd = new SqlCommand("select * from dir", con); SqlDataReader dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind();
} }}
ADD_NEW SECTION:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Data;using System.Data.SqlClient;using System.Web.UI.WebControls;
59
namespace project.aspx{ public partial class add_new_section : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection(@"server=CHINKI-PC;database=model;integrated security=True"); con.Open(); SqlCommand cmd = new SqlCommand("select * from dirc", con); SqlDataReader dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind();
} }}
______
60