尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
4 | P a g e
PREFACE
The computer world has undergone a revolution since the invention of C# .NET
language. C# .NET is called High Level Language. Our project word has been
designed in c# .NET .
The project “School Management System” handle tasks at the single instruction of
the user with done so much effort. The approach of project designing is very simple,
lucid and comprehensive, which results in a very sophisticated project. We hope
that our project will work very easily and efficient. We do our best to complete this
project.
Today’s commercial world is built around money. Every commercial transaction
needs to be supported using a financial transaction. Traditional procedure for
maintaining, records using Ledgers, Day Book etc. is very timer consuming and may
lead to error if not performed carefully.
Keeping in mind that today in School world is built around management, and all the
systems going on computerized, so I have made an effort automate the School
System by developing a small package.
“SMS” is developed using C# .NET, ADO.NET, Crystal Report and MS ACCESS
2010. C# .NET is used as front-end for the following reason:
* C#.NET is flexible
* C# .NET supports has Common Language
Report (CLR) feature.
* Structured programming language
The Project has used MS ACCESS 2010 as back-end for database
management. MS ACCESS provides more handy and safe database management
tools.
5 | P a g e
INTRODUCTION
About The Project :
School Management is the important and hence are an integral part of the
every school. Today a Every school management plays a vital role in fee and
management related actions.
The project entitled “School Management System” is and effort towards
designing an information system that would provide most of the requirements of a
managing the school efficiently.
The project has been designed using the MS ACCESS 2010 Database
Management System. MS ACCESS 2010 is an RDBMS, It uses the relational we have
used the concept of the relations to stored and manipulate the data of the
information system.
Physically these relations have been stored in form of the tables.
Corresponding to each entitle and the relationships we have a database table.
These tables contain the columns as the fields of table. Further, each column have
some attributes such as data types, size, default values etc. which defines and
validate the data.
In the design “School Management System” we have exploited the rich
facilities (tools) of c#.NET. C#.NET is Microsoft’s strategic language for Rapid
Application Development (RAD) and its also have feature of Common Language
Runtime(CLR). It is easy to use, efficient, flexible and more powerful for developing
a Database related programming as well as Net programming.
I prefer this language because one can build a Windows program quicker
and with less effort with C#.NET than with any other programming language. It’s is
natural language for building database applications, owing to the level and
sophistication of the tools included with the language.
6 | P a g e
We have used C#.NET for designing the data entry screens
corresponding to each table. These forms have been further customized using the
toolstrip button, option button, datagrid, Datetime picker and functions to provide
the functionality to make them as user friendly and easy to use as possible. We are
providing the data retrieval and the data manipulation task a matter by clicking the
desire buttons and the result of the task mentioned on button would be displayed
on the screen.
We designed reports that would request the users parameter and
provide the result based on the query define the data model of the report and the
parameter passed by the users.
These objectives have been achieved using the form. Various forms have
been used to design the screen and these screens have been used along with the
coded buttons to integrate objects.
7 | P a g e
OBJECTIVES
The main objective of the project entitled “School Management System” is to
facilitate reliable, fast and easy information of students,Fee Details, Employee
Entry,Vehicle Entry with Day book on single keystroke. In this I am trying to
facilitates the School services of the Management System is fully computerized.
The main objective of my project is to reduce complexities to traditional work and
facilitate them through computerized services. The primary goal behind the
development of the “School Mangement System” is to improve the quality of the
work in the school .It increases the Easiness and maintain the records of staffs.
The secondary goals was to achieve better and efficient output in less amount of
time, and finally to increase the profits.
There is also a mechanism of quick detail of every student with their fee receipt
generation and day Book support. Management of School Services is main objective
in this project. Everything has been automatised for this purpose. A paperless office
will be there. The software should be user friendly, easily understandable to the
user, flexible and further modification should be possible in future.
8 | P a g e
SYSTEM STUDY
Analysis:
I had to undertake a logical and proficient analysis to scrutinize the
feasibility of the project.The types of considerations that were taken were
economical, technical and resource wise. The resources like the users who will
operate the computer, were thoroughly studied ensure total compatibility with the
objectives of the project. An effort was made to make the School Management
efficient in all type of day to day Fee Related Transactions.
Existing System with Limitations:
The existing system has a manual work system. The manual works
system takes more time and then it may also be possible that the system has errors.
The manual systems work is very slow, has emotions, tiredness and some other
problems. The existing “Manual School Management” has many limitations. It takes
a reasonable time to search a particular fees in account ledger and takes reasonable
time in checking, updating various activities. Major problem faced during fee
deposition if the user do not entry his receipt.
Proposed System with Objectives:
The approach adopted in “School Management” system is very simple,
lucid, comprehensive, and user friendly. The proposed system can efficiently handle
all the tasks as keeping the record of the student and it’s through different sides.
This task can be efficiently handled at the single instruction of the user without
taking more time, which on the become very hazardous when done manually.
The Menu’s have been so easily defined one within the other so that
there is no difficulty in understanding it. It is very sophisticated software and can be
used by any School to store their information in an efficient manner and we hope
that it will be of great help to them. This project has been designed to reduce the
manual work.
9 | P a g e
Design:
The prototype was iteratively enhanced. Each new enhanced prototype
was sought to be more powerful and robust. The process of constant enhancement
was carried out until the Project Guide and some other concerning persons were
fully satisfied with the system design in hand. After the analysis of the project, the
most creative phase of the project was commenced, that of the designing. The
designing dealt with the conception of system designs that are to be implemented
to execute the project.
Data Flow drawings were doesn’t to define the accurate glow of DATA.
After various rounds of discussion and arguments the design was finalized.
Implementation :
The next stage, that of implementation dealt with the synergizing of
the System design and application of the various technical tools. The final prototype
that was designed was coded in the tools, most convenient, powerful and glexible
for the implementation of the various modules. Various modules were codec very
carefully only after considering every conditions and cases that may affect the
functionality of the module. Online help comprising of MSDN provides a valuable
help in coding.
Debugging:
After successfully coding the individual modules, all the modules were
cross checked. The debugging was performed to ensure that no software bugs
existed. Debugging is recursively performed until the newly designed system
resembles the proposed system. Ite was ensure that all the modules were logically
and syntactically correctly codec. During debugging, the entire module combined
together by systematically checking and correcting the modules one at a time.
10 | P a g e
Deployment & System Testing:
The Phase of deployment and system testing involved the task of the
linking of all the individual modules to establish the actual and complete project.
The system testing involved string testing(to check the compatibility of the modules
with one another to establish integration). Overall testing (validation of system
against failures) and ensurence to the original project guidelines. Any discrepancy
found was immediately removed and all the testing were undertaken once more to
establish System Credibility. The Project – Guide was demonstrated the project and
all his challenging enquiries were fully satisfied.
11 | P a g e
Hardware & Software Requirements:-
Hardware Configuration: (Recommended)
Processor : Dual Core
Main Memory : 1024 MB RAM
Hard Disk Capacity : 80 GB
Compact Disk Drive : 650 MB
Monitor : SVGA
Keyboard : At 104 Keyboard
Software Configuration:
Operating System : Windows 7/8/10
Front-End : C# .NET
Back-End : MS ACCESS 2010
12 | P a g e
C#.Net
The .NET Framework is a new computing platform that simplifies application
development in the highly distributed environment of the Internet. The .NET
Framework is designed to fulfill the following objectives:
To provide a consistent object-oriented programming environment
whether object code is stored and executed locally, executed locally but Internet-
distributed, or executed remotely.
To provide a code-execution environment that minimizes software
deployment and versioning conflicts.
To provide a code-execution environment that guarantees safe
execution of code, including code created by an unknown or semi-trusted third
party.
To provide a code-execution environment that eliminates the
performance problems of scripted or interpreted environments.
To make the developer experience consistent across widely varying
types of applications, such as Windows-based applications and Web-based
applications.
To build all communication on industry standards to ensure that
code based on the .NET Framework can integrate with any other code.
The .NET Framework has two main components: the common
language runtime and the .NET Framework class library. The common language
runtime is the foundation of the .NET Framework. You can think of the runtime as
an agent that manages code at execution time, providing core services such as
memory management, thread management, and remoting, while also enforcing
strict type safety and other forms of code accuracy that ensure security and
robustness. In fact, the concept of code management is a fundamental principle of
13 | P a g e
the runtime. Code that targets the runtime is known as managed code, while code
that does not target the runtime is known as unmanaged code. The class library, the
other main component of the .NET Framework, is a comprehensive, object-oriented
collection of reusable types that you can use to develop applications ranging from
traditional command-line or graphical user interface (GUI) applications to
applications based on the latest innovations provided by the following sections
describe the main components and features of the .NET Framework in greater
detail.
Features of the Common Language Runtime
The common language runtime manages memory, thread execution,
code execution, code safety verification, compilation, and other system services.
These features are intrinsic to the managed code that runs on the common
language runtime.
With regards to security, managed components are awarded varying
degrees of trust, depending on a number of factors that include their origin (such as
the Internet, enterprise network, or local computer). This means that a managed
component might or might not be able to perform file-access operations, registry-
access operations, or other sensitive functions, even if it is being used in the same
active application.
The runtime enforces code access security. For example, users can
trust that an executable embedded in a Web page can play an animation on screen
or sing a song, but cannot access their personal data, file system, or network. The
security features of the runtime thus enable legitimate Internet-deployed software
to be exceptionally feature rich.
14 | P a g e
ADO.NET
ADO.NET provides consistent access to data sources such as Microsoft SQL
Server,MS ACCESS as well as data sources exposed through OLE DB and XML. Data-
sharing consumer applications can use ADO.NET to connect to these data sources
and retrieve, manipulate, and update data.
ADO.NET cleanly factors data access from data manipulation into discrete
components that can be used separately or in tandem. ADO.NET includes .NET
Framework data providers for connecting to a database, executing commands, and
retrieving results. Those results are either processed directly, or placed in an
ADO.NET DataSet object in order to be exposed to the user in an ad-hoc manner,
combined with data from multiple sources, or remoted between tiers. The ADO.NET
DataSet object can also be used independently of a .NET Framework data provider
to manage data local to the application or sourced from XML.
The ADO.NET classes are found in System.Data.dll, and are integrated with
the XML classes found in System.Xml.dll. When compiling code that uses the
System.Data namespace, reference both System.Data.dll and System.Xml.dll. For an
example of compiling an ADO.NET application using a command line compiler.
ADO.NET provides functionality to developers writing managed code
similar to the functionality provided to native COM developers by ADO.
In my software, I have been uses OLEDB data connection object class of
ADO.NET. By the feature of having “Provider” property of OLEDB its is easier to
connect any database plateform to your application. With the OLEDB we can very
easily transit all the the transactions as per our requirement.
15 | P a g e
Crystal report
Crystal Reports is a report design tool that allows you to create reports
capable of retrieving and formatting a result set from a database of other data
source. In addition to simply reading data from a data source, Crystal Reports has its
own formula language `for creating calculations and includes a number of features
that can be used to turn raw data into presentation- quality reports, with graphs,
charts, running totals, and so on.
Crystal Reports .NET includes and integrated Report Designer available
within the Visual Studio IDE that you can use to create report files (. rpt) to integrate
with your application. This Report Designer features a number of experts to help
you get started creating reports. It will guide you thorugh the report development
process, from selecting ad data source dn the field that will appear on your report,
to determining what records should appear.
16 | P a g e
DATA FLOW Diagram
0 Level DFD
1 Level DFD
17 | P a g e
Table Structure
1. Table Name - TbleLogin
Primary Key - UserId1
2. Table Name - StudentInfo
Primary Key - EnrollInfo
Column Name Data Type
UserId1 Number
Username1 Text
Password1 Text
Column Name Data Type
EnrollInfo Number
StudentName Text
FathersName Text
DOB Date/Time
Admission Text
Class Text
Transport Required Text
TransportFee Number
18 | P a g e
3. Table Name - TbleEmployeeDetail
Primary Key - EmpId
4. Table Name - TbleEmployeeSalary
Primary Key - PaySlipRefNo
Column Name Data Type
EmpId Number
EmpName Text
EmpDob Text
EmpDesignation Text
EmpAddress Text
EmpMo Text
EmpStatus Text
EmpQualification Text
RecordDate Text
EmpSalary Number
Column Name Data Type
PayslipRefNo Number
Empid Number
RecordDate Text
EmpSalart Number
MonthOf Text
PayBegDate Text
PayendDate Text
PayType Text
Absent Text
NOWD Number
Description Text
TSAD Number
19 | P a g e
5. Table Name - TbleFeeEntry
Primary Key - ReceiptNo.
Column Name Data Type
ReceiptNo Number
BillNo Number
EnrollmentId Number
StudentName Text
FromDate Text
ToDate Text
TuitionFee Number
NOM Number
RegFee Number
TransportFee Number
ExamFee Number
Fine Number
AmeCharge Number
OtherFee Number
Description Text
TotalAmount Number
PaidAmount Number
DueAmount Number
EntryLoggedBy Text
20 | P a g e
6. Table Name - TbleEmployeeSalary
Primary Key - PaySlipRefNo
7. Table Name - TbleSalesVoucher
Primary Key - ID
Column Name Data Type
PayslipRefNo Number
Empid Number
RecordDate Text
EmpSalart Number
MonthOf Text
PayBegDate Text
PayendDate Text
PayType Text
Absent Text
NOWD Number
Description Text
TSAD Number
Column Name Data Type
ID AutoNumber
SalesVoucherNo Number
SubmissionDate Text
BillNo Number
NameParty Text
Quantity Number
PayabaleAmount Number
DueAmount Number
NetAmount Number
21 | P a g e
8. Table Name - TbleSalesVoucherDetail
Primary Key - ___________________
9. Table Name - TbleTpSetup
Primary Key - VehicleId
10. Table Name - TbleVehDayBook
Primary Key - Entry_Id
Column Name Data Type
ID AutoNumber
SalesVoucherNo Number
BookName Text
Quantity Number
Rate Number
Amount Number
Column Name Data Type
Vehicle ID Number
VehicleName Text
VehicleNo Text
DriverName Text
DriverDLNo Text
DriverAddress Text
DriverMobile Text
Column Name Data Type
Entry_Id Number
Driver_Name Text
Vehicle_No Text
Paid_Amount Number
Date_Issue Date/Time
Description Text
22 | P a g e
11. Table Name - TbleLogData
Primary Key - LogId
12. Table Name - TbleBookMaster
Primary Key - BookId
Column Name Data Type
LogId Number
UserName1 Text
Role Text
Logintime Text
LogOutTime Text
Column Name Data Type
BookName Text
BookCategory Text
Quantity Number
Rate Number
Class Text
23 | P a g e
24 | P a g e
Main Login Form
Main Menu Form
25 | P a g e
Authorization Form
Admission Form
26 | P a g e
Fee Entry Form
DayWise Report Form
27 | P a g e
Employee Detail Form
Certificate Feeding Form
28 | P a g e
Book Stock Entry Form
Book Sales Entry Form
29 | P a g e
Vehicle Master Entry Form
Vehicle Day Book Entry Form
30 | P a g e
31 | P a g e
Authorization Module
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
using Excel = Microsoft.Office.Interop.Excel;
namespace FeeEntrySystem
{
public partial class FrmMaintainLogin : Form
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data
Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha");
OleDbCommand cmd;
OleDbDataAdapter da;
//OleDbDataReader dr;
DataSet ds;
DataTable dt;
string str;
public FrmMaintainLogin()
{
InitializeComponent();
}
private void label5_Click(object sender, EventArgs e)
{
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
if (txtCnfPassword.Text == txtPassword.Text)
{
//label6.Text = "Password Matched";
}
else
{
// label6.Text = "";
}
}
private void txtUserName_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtPassword.Focus();
}
}
private void txtPassword_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtCnfPassword.Focus();
}
}
32 | P a g e
private void AutoIdGenerate()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
// int i=0;
string query = "SELECT max(UserId1)+1 from TbleLogin ";
cmd = new OleDbCommand();
cmd.CommandText = query;
cmd.Connection = con;
textBox1.Text = cmd.ExecuteScalar().ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void Savelogin()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Insert into TbleLogin(UserId1,UserName1,Password1,Role)values(" +
textBox1.Text.Trim() + ",'" + txtUserName.Text.Trim() + "','" + txtPassword.Text.Trim() +
"','"+cmbrole1.Text+"')";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Login Data Saved Successfully......");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
txtUserName.Clear();
txtPassword.Clear();
txtCnfPassword.Clear();
txtUserName.Focus();
}
}
private void updateLogin()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Update TbleLogin set UserName1='" + txtUserName.Text.Trim() +
"',Password1='" + txtPassword.Text.Trim() + "',Role='"+cmbrole1.Text+"' where UserId1=" +
textBox1.Text.Trim() + "";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void gridLogCheckData()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Select * from TblLogData";
da = new OleDbDataAdapter(str, con);
33 | P a g e
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
dataGridView1.Columns[0].HeaderText = "Log Id";
dataGridView1.Columns[1].HeaderText = "User Name";
dataGridView1.Columns[3].HeaderText = "Log In Time";
dataGridView1.Columns[4].HeaderText = "Log Out Time";
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void CheckDuplicateUser()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
cmd=new OleDbCommand("SELECT UserName1 from TbleLogin where
UserName1='"+txtUserName.Text.Trim()+"'",con);
OleDbDataReader dr = cmd.ExecuteReader();
cmd.Dispose();
if (dr.HasRows == true)
{
dr.Read();
MessageBox.Show("User Name Already Exist...", "Try Again");
txtUserName.Clear();
txtUserName.Focus();
return;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void FrmMaintainLogin_Load(object sender, EventArgs e)
{
gridLogCheckData();
gridLoginData();
AutoIdGenerate();
}
private void gridLoginData()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Select * from TbleLogin";
da = new OleDbDataAdapter(str, con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
dgvLoginView.DataSource = dt;
con.Close();
dgvLoginView.Columns[0].HeaderText = "User Sr. No.";
dgvLoginView.Columns[1].HeaderText = "User Name";
dgvLoginView.Columns[2].HeaderText = "Password";
dgvLoginView.Columns[3].HeaderText = "Job Role ";
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
34 | P a g e
}
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
if (txtUserName.Text == "")
{
MessageBox.Show("Username-Required Field...");
txtUserName.Focus();
return;
}
else if (txtPassword.Text == "")
{
MessageBox.Show("Password-Required Field...");
txtPassword.Focus();
return;
}
else if (txtCnfPassword.Text == "")
{
MessageBox.Show("Confirm Password Required");
txtCnfPassword.Focus();
return;
}
else if (txtCnfPassword.Text != txtPassword.Text)
{
MessageBox.Show("Field Must Be Matchable...");
txtPassword.Clear();
txtCnfPassword.Clear();
txtPassword.Focus();
}
else if (cmbrole1.Text == "")
{
MessageBox.Show("Role Initialization Required");
cmbrole1.Focus();
return;
}
else
{
Savelogin();
AutoIdGenerate();
resetControl();
gridLoginData();
}
}
private void resetControl()
{
txtUserName.Clear();
txtPassword.Clear();
txtCnfPassword.Clear();
}
private void txtCnfPassword_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
cmbrole1.Focus();
}
}
private void dgvLoginView_AllowUserToAddRowsChanged(object sender, EventArgs e)
{
}
private void dgvLoginView_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
try
{
if (e.RowIndex >= 0)
35 | P a g e
{
DataGridViewRow row = dgvLoginView.Rows[e.RowIndex];
textBox1.Text = row.Cells[0].Value.ToString();
txtUserName.Text = row.Cells[1].Value.ToString();
txtPassword.Text = row.Cells[2].Value.ToString();
txtCnfPassword.Text = row.Cells[2].Value.ToString();
cmbrole1.Text = row.Cells[3].Value.ToString();
}
tsSaveLogin.Enabled = false;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
if (txtUserName.Text == "")
{
MessageBox.Show("Username-Required Field...");
txtUserName.Focus();
return;
}
else if (txtPassword.Text == "")
{
MessageBox.Show("Password-Required Field...");
txtPassword.Focus();
return;
}
else if (txtCnfPassword.Text == "")
{
MessageBox.Show("Confirm Password Required");
txtCnfPassword.Focus();
return;
}
else if (txtCnfPassword.Text != txtPassword.Text)
{
MessageBox.Show("Field Must Be Matchable...");
txtPassword.Clear();
txtCnfPassword.Clear();
txtPassword.Focus();
}
else if (cmbrole1.Text == "")
{
MessageBox.Show("Role Initialization Required");
cmbrole1.Focus();
return;
}
else
{
updateLogin();
AutoIdGenerate();
resetControl();
gridLoginData();
tsSaveLogin.Enabled = true;
}
}
private void deleteInfo()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
if (MessageBox.Show(" Do you want to Delete?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
36 | P a g e
{
str = "Delete from TbleLogin where UserId1=" + textBox1.Text.Trim() +
"";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Data Deleted Successfully");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void toolStripButton3_Click(object sender, EventArgs e)
{
deleteInfo();
AutoIdGenerate();
txtUserName.Clear();
txtCnfPassword.Clear();
txtPassword.Clear();
txtUserName.Focus();
}
private void cmbrole1_Leave(object sender, EventArgs e)
{
int index = cmbrole1.FindString(cmbrole1.Text);
if (index < 0)
{
MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
cmbrole1.Focus();
cmbrole1.Text = "";
return;
}
}
private void cmbrole1_KeyPress(object sender, KeyPressEventArgs e)
{
if(e.KeyChar==13)
{
tsSaveLogin.PerformClick();
}
}
private void btnlog_Click(object sender, EventArgs e)
{
int rowsTotal = 0;
int colsTotal = 0;
int I = 0;
int j = 0;
int iC = 0;
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
Excel.Application xlApp = new Excel.Application();
try
{
37 | P a g e
Excel.Workbook excelBook = xlApp.Workbooks.Add();
Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelBook.Worksheets[1];
xlApp.Visible = true;
rowsTotal = dataGridView1.RowCount - 1;
colsTotal = dataGridView1.Columns.Count - 1;
var _with1 = excelWorksheet;
_with1.Cells.Select();
_with1.Cells.Delete();
for (iC = 0; iC <= colsTotal; iC++)
{
_with1.Cells[1, iC + 1].Value = dataGridView1.Columns[iC].HeaderText;
}
for (I = 0; I <= rowsTotal; I++)
{
for (j = 0; j <= colsTotal; j++)
{
_with1.Cells[I + 2, j + 1].value =
dataGridView1.Rows[I].Cells[j].Value;
}
}
_with1.Rows["1:1"].Font.FontStyle = "Bold";
_with1.Rows["1:1"].Font.Size = 12;
_with1.Cells.Columns.AutoFit();
_with1.Cells.Select();
_with1.Cells.EntireColumn.AutoFit();
_with1.Cells[1, 1].Select();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
//RELEASE ALLOACTED RESOURCES
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
xlApp = null;
}
}
private void txtUserName_Leave(object sender, EventArgs e)
{
CheckDuplicateUser();
}
}
}
38 | P a g e
Admission Module
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
namespace FeeEntrySystem
{
public partial class FrmAddmission : Form
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data
Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha");
OleDbCommand cmd;
OleDbDataAdapter da;
DataSet ds;
DataTable dt;
string str;
public FrmAddmission()
{
InitializeComponent();
}
public void dgvAddmissionView1()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Select * from StudentInfo where EnrollInfo=" + txtEnroll.Text + "";
da = new OleDbDataAdapter(str, con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
dgvFeeDetailView.DataSource = dt;
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
public void dgvAddmissionView12()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Select * from StudentInfo";
da = new OleDbDataAdapter(str, con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
dgvFeeDetailView.DataSource = dt;
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
39 | P a g e
}
private void resetinfo()
{
txtEnroll.Clear();
txtStudentName.Clear();
txtFathersName.Clear();
txtAddmissiondate.Clear();
cmbClass.Text = "";
txtFee.Clear();
cmbTpRequired.SelectedIndex =1;
txtLastSchoolAttend.Clear();
txtMobileNo.Clear();
txtEnroll.Focus();
}
private void validateEnrollment()
{
}
private void updateInfo()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Update StudentInfo set StudentName='" + txtStudentName.Text.Trim() +
"',FathersName='" + txtFathersName.Text.Trim() + "',DOB='" + dateTimePicker1.Value +
"',AddmissionDate='" + txtAddmissiondate.Text.Trim() + "',Class='" + cmbClass.Text +
"',Fee=" + txtFee.Text + ",TranspRequired='" + cmbTpRequired.Text + "',TransportFee=" +
txtTpAmount.Text + ",MobileNo='" + txtMobileNo.Text + "',LSA='"+txtLastSchoolAttend.Text+"'
where Enrollinfo=" + txtEnroll.Text + "";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Your Data Updated....","Information");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void saveinfo()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Insert into
StudentInfo(EnrollInfo,StudentName,FathersName,DOB,AddmissionDate,Class,Fee,TranspRequired,
TransportFee,MobileNo,LSA)values(" + txtEnroll.Text.Trim() + ",'" +
txtStudentName.Text.Trim() + "','" + txtFathersName.Text.Trim() + "','" +
dateTimePicker1.Value + "','" + txtAddmissiondate.Text.Trim() + "','" + cmbClass.Text +
"'," + txtFee.Text + ",'" + cmbTpRequired.Text.Trim() + "'," + txtTpAmount.Text + ",'" +
txtMobileNo.Text.Trim() + "','" + txtLastSchoolAttend.Text + "')";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Details Saved Successfully......");
resetinfo();
txtEnroll.Focus();
dgvAddmissionView12();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
40 | P a g e
con.Close();
}
}
private void TsEnrollment_Click(object sender, EventArgs e)
{
if (txtEnroll.Text == "")
{
MessageBox.Show("Enrollment Required");
txtEnroll.Focus();
return;
}
if (txtStudentName.Text == "")
{
MessageBox.Show("Student Name Required....");
txtStudentName.Focus();
return;
}
else if (txtFathersName.Text == "")
{
MessageBox.Show("Father Name Required....");
txtFathersName.Focus();
return;
}
else if (txtAddmissiondate.Text == "")
{
MessageBox.Show("Addmission Date Required...");
txtAddmissiondate.Focus();
return;
}
else if (cmbClass.Text == "")
{
MessageBox.Show("Course Required.......");
cmbClass.Focus();
return;
}
else if (txtFee.Text == "")
{
MessageBox.Show("Fee Submission Compulsory...");
txtFee.Focus();
return;
}
else if(cmbTpRequired.Text=="")
{
MessageBox.Show("Transport Status Required.....");
cmbTpRequired.Focus();
return;
}
else if (txtTpAmount.Text == "")
{
MessageBox.Show("Transport Amount Required.....");
txtTpAmount.Focus();
return;
}
else if (txtMobileNo.Text == "")
{
MessageBox.Show("Mobile No Required.....");
txtTpAmount.Focus();
return;
}
else if (txtLastSchoolAttend.Text == "")
{
MessageBox.Show("LSA Record Required.....");
txtTpAmount.Focus();
return;
}
else
{
41 | P a g e
saveinfo();
ROWCOUNT();
}
}
private void deleteinfo()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
if (MessageBox.Show(" Do you want to Delete?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
str = "Delete from StudentInfo where EnrollInfo=" + txtEnroll.Text +
"";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Data Deleted Successfully");
ROWCOUNT();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void ROWCOUNT()
{
int i;
for (i = 0; i < dgvFeeDetailView.Rows.Count; i++)
{
toolStripTextBox1.Text = Convert.ToString(dgvFeeDetailView.Rows.Count);
}
}
private void FrmAddmission_Load(object sender, EventArgs e)
{
cmbTpRequired.SelectedIndex = 1;
dgvAddmissionView12();
ROWCOUNT();
}
private void txtStudentName_Leave(object sender, EventArgs e)
{
}
private void cmbClass_Leave(object sender, EventArgs e)
{
int index = cmbClass.FindString(cmbClass.Text);
if (index < 0)
{
MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
cmbClass.Focus();
cmbClass.Text = "";
return;
}
}
private void txtEnroll_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
42 | P a g e
txtStudentName.Focus();
}
// dgvAddmissionView1();
}
private void txtStudentName_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtFathersName.Focus();
}
}
private void txtFathersName_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
dateTimePicker1.Focus();
}
}
private void dateTimePicker1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
txtAddmissiondate.Focus();
}
}
private void txtAddmissiondate_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
cmbClass.Focus();
}
}
private void cmbCourse_KeyPress(object sender, KeyPressEventArgs e)
{
}
private void txtFee_KeyPress(object sender, KeyPressEventArgs e)
{
if ((!char.IsControl(e.KeyChar)) && (!char.IsDigit(e.KeyChar)))
{
e.Handled = true;
}
base.OnKeyPress(e);
if (e.KeyChar == 13)
{
cmbTpRequired.Focus();
}
}
private void txtAffiliatedto_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
43 | P a g e
{
txtMobileNo.Focus();
}
}
private void dgvAddmissionView_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
if (e.RowIndex >= 0)
{
DataGridViewRow row = dgvFeeDetailView.Rows[e.RowIndex];
txtEnroll.Text = row.Cells[0].Value.ToString();
txtStudentName.Text = row.Cells[1].Value.ToString();
txtFathersName.Text = row.Cells[2].Value.ToString();
dateTimePicker1.Text = row.Cells[3].Value.ToString();
txtAddmissiondate.Text = row.Cells[4].Value.ToString();
cmbClass.Text = row.Cells[5].Value.ToString();
txtFee.Text = row.Cells[6].Value.ToString();
cmbTpRequired.Text = row.Cells[7].Value.ToString();
txtTpAmount.Text = row.Cells[8].Value.ToString();
txtMobileNo.Text = row.Cells[9].Value.ToString();
txtLastSchoolAttend.Text = row.Cells[10].Value.ToString();
txtEnroll.Focus();
}
TsEnrollment.Enabled = false;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void TsEdit_Click(object sender, EventArgs e)
{
if (txtEnroll.Text == "")
{
MessageBox.Show("Enrollment Required");
txtEnroll.Focus();
return;
}
if (txtStudentName.Text == "")
{
MessageBox.Show("Student Name Required....");
txtStudentName.Focus();
return;
}
else if (txtFathersName.Text == "")
{
MessageBox.Show("Father Name Required....");
txtFathersName.Focus();
return;
}
else if (txtAddmissiondate.Text == "")
{
MessageBox.Show("Addmission Date Required...");
txtAddmissiondate.Focus();
return;
}
else if (cmbClass.Text == "")
{
44 | P a g e
MessageBox.Show("Course Required.......");
cmbClass.Focus();
return;
}
else if (txtFee.Text == "")
{
MessageBox.Show("Fee Submission Compulsory...");
txtFee.Focus();
return;
}
else if (cmbTpRequired.Text == "")
{
MessageBox.Show("Transport Status Required.....");
cmbTpRequired.Focus();
return;
}
else if (txtTpAmount.Text == "")
{
MessageBox.Show("Transport Amount Required.....");
txtTpAmount.Focus();
return;
}
else if (txtMobileNo.Text == "")
{
MessageBox.Show("Mobile No Required.....");
txtTpAmount.Focus();
return;
}
else if (txtLastSchoolAttend.Text == "")
{
MessageBox.Show("LSA Record Required.....");
txtTpAmount.Focus();
return;
}
else
{
updateInfo();
dgvAddmissionView12();
ROWCOUNT();
resetinfo();
txtEnroll.Focus();
TsEnrollment.Enabled = true;
}
}
private void TsDelete_Click(object sender, EventArgs e)
{
if (txtEnroll.Text == "")
{
MessageBox.Show("Enrollment Required");
txtEnroll.Focus();
return;
}
if (txtStudentName.Text == "")
{
MessageBox.Show("Student Name Required....");
txtStudentName.Focus();
return;
}
else if (txtFathersName.Text == "")
{
MessageBox.Show("Father Name Required....");
txtFathersName.Focus();
return;
45 | P a g e
}
else if (txtAddmissiondate.Text == "")
{
MessageBox.Show("Addmission Date Required...");
txtAddmissiondate.Focus();
return;
}
else if (cmbClass.Text == "")
{
MessageBox.Show("Course Required.......");
cmbClass.Focus();
return;
}
else if (txtFee.Text == "")
{
MessageBox.Show("Fee Submission Compulsory...");
txtFee.Focus();
return;
}
else if (cmbTpRequired.Text == "")
{
MessageBox.Show("Transport Status Required.....");
cmbTpRequired.Focus();
return;
}
else if (txtTpAmount.Text == "")
{
MessageBox.Show("Transport Amount Required.....");
txtTpAmount.Focus();
return;
}
else if (txtMobileNo.Text == "")
{
MessageBox.Show("Mobile No Required.....");
txtTpAmount.Focus();
return;
}
else if (txtLastSchoolAttend.Text == "")
{
MessageBox.Show("LSA Record Required.....");
txtTpAmount.Focus();
return;
}
else
{
deleteinfo();
dgvAddmissionView1();
ROWCOUNT();
resetinfo();
txtEnroll.Focus();
TsEnrollment.Enabled = true;
}
}
private void txtEnroll_Enter(object sender, EventArgs e)
{
dgvAddmissionView12();
}
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((!char.IsControl(e.KeyChar)) && (!char.IsDigit(e.KeyChar)))
{
e.Handled = true;
46 | P a g e
}
base.OnKeyPress(e);
if (e.KeyChar == 13)
{
txtLastSchoolAttend.Focus();
}
}
private void toolStripTextBox2_TextChanged(object sender, EventArgs e)
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
da = new OleDbDataAdapter("Select * from StudentInfo where StudentName like '"
+ toolStripTextBox2.Text + "%'", con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
dgvFeeDetailView.DataSource = dt;
con.Close();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
//txtAffiliatedto.Text = comboBox1.Text;
}
private void cmbCourse_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
txtFee.Focus();
}
}
private void cmbTpRequired_Leave(object sender, EventArgs e)
{
int index = cmbTpRequired.FindString(cmbTpRequired.Text);
if (index < 0)
{
MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
cmbTpRequired.Focus();
cmbTpRequired.Text = "";
return;
}
}
private void cmbTpRequired_SelectedIndexChanged(object sender, EventArgs e)
{
if (cmbTpRequired.SelectedItem.ToString() == "YES")
{
txtTpAmount.Enabled = true;
txtTpAmount.Focus();
txtTpAmount.SelectAll();
}
else
{
int a = 0;
txtTpAmount.Text = a.ToString();
txtTpAmount.Enabled = false;
}
}
47 | P a g e
private void cmbTpRequired_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (cmbTpRequired.SelectedItem.ToString()=="NO")
{
txtMobileNo.Focus();
}
}
}
private void txtTpAmount_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtMobileNo.Focus();
}
}
private void txtLastSchoolAttend_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
if (TsEnrollment.Enabled == true)
{
TsEnrollment.PerformClick();
}
else
{
TsEdit.PerformClick();
}
}
}
private void TsReset_Click(object sender, EventArgs e)
{
resetinfo();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
var _with1 = openFileDialog1;
_with1.Filter = ("Image Files |*.png; *.bmp; *.jpg;*.jpeg; *.gif;");
_with1.FilterIndex = 4;
//Reset the file name
openFileDialog1.FileName = "";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = Image.FromFile(openFileDialog1.FileName);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
}
48 | P a g e
Fee Entry Module-
Fee Entry Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
namespace FeeEntrySystem
{
public partial class FrmFee : Form
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data
Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha");
OleDbCommand cmd;
OleDbDataAdapter da;
//OleDbDataReader dr;
DataSet ds;
DataTable dt;
string str;
public FrmFee()
{
InitializeComponent();
}
private void ReceiptAutoGenerate()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
// int i=0;
string query = "SELECT max(ReceiptNo)+1 from TbleFeeEntry ";
cmd = new OleDbCommand();
cmd.CommandText = query;
cmd.Connection = con;
txtReceiptNo.Text= cmd.ExecuteScalar().ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void BillAutoGenerate()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
string query = "SELECT max(BillNo)+1 from TbleFeeEntry ";
cmd = new OleDbCommand();
cmd.CommandText = query;
cmd.Connection = con;
txtBillNo.Text = cmd.ExecuteScalar().ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void CmbEnrollmentFill()
{
49 | P a g e
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
string str = "Select * From StudentInfo";
OleDbDataAdapter da = new OleDbDataAdapter(str, con);
ds = new DataSet();
da.Fill(ds);
cmbEnroll.DataSource = ds.Tables[0];
cmbEnroll.DisplayMember = "EnrollInfo";
cmbEnroll.ValueMember = "EnrollInfo";
cmbEnroll.SelectedIndex = -1;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
//This function is used to load the data i.e Transport fee and Tuition fee when
gets updated by the Data grid view
private void fillstudentDgv()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
cmd = new OleDbCommand(" Select Fee,TransportFee from StudentInfo where
EnrollInfo=" + cmbEnroll.Text + "", con);
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtApplicable.Text = dr["Fee"].ToString();
txtTpFee.Text = dr["TransportFee"].ToString();
}
dr.Close();
}
catch (Exception)
{
}
}
//This fills the student detail criteria selected According to the ComboBox.
private void fillstudentdetail()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
cmd = new OleDbCommand(" Select StudentName,Class,Fee,TransportFee from
StudentInfo where EnrollInfo=" + cmbEnroll.Text + "", con);
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtStudentName.Text = dr["StudentName"].ToString();
txtCourse.Text = dr["Class"].ToString();
txtApplicable.Text = dr["Fee"].ToString();
txtTpFee.Text = dr["TransportFee"].ToString();
}
dr.Close();
}
catch (Exception)
{
}
}
private void deletefeeinfo()
{
try
50 | P a g e
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
if (MessageBox.Show(" Do you want to Delete?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
str = "Delete from TbleFeeEntry where ReceiptNo=" + txtReceiptNo.Text +
"";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Data Deleted Successfully");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void FeePrintModule()
{
FrmFeePrint frmprint = new FrmFeePrint();
RptFeeReceipt FEE = new RptFeeReceipt();
frmprint.crystalReportViewer1.ReportSource = FEE;
FEE.Refresh();
frmprint.crystalReportViewer1.SelectionFormula = "{TbleFeeEntry.ReceiptNo} = "
+ txtReceiptNo.Text + " ";
frmprint.Show();
}
private void FeePrintCmbReceipt()
{
FrmFeePrint frmprint = new FrmFeePrint();
RptFeeReceipt FEE = new RptFeeReceipt();
frmprint.crystalReportViewer1.ReportSource = FEE;
FEE.Refresh();
frmprint.crystalReportViewer1.SelectionFormula = "{TbleFeeEntry.ReceiptNo} = "
+ TsTxtReceipt.Text + " ";
frmprint.Show();
}
private void FeeLedgerPrint()
{
FrmFeeLedger frmledger = new FrmFeeLedger();
RptFeeLedger FEE1 = new RptFeeLedger();
frmledger.crystalReportViewer1.ReportSource = FEE1;
FEE1.Refresh();
frmledger.crystalReportViewer1.SelectionFormula = "{TbleFeeEntry.EnrollmentId}
= " + TsTxtReceipt.Text + " ";
frmledger.Show();
}
private void countInstallment()
{
int i;
for (i = 0; i < dgvViewF.Rows.Count; i++)
{
label21.Text = Convert.ToString(dgvViewF.Rows.Count);
}
}
private void TsDelet_Load(object sender, EventArgs e)
{
cmbEnroll.Select();
txtSubmissionDate.Text = monthCalendar1.TodayDate.ToShortDateString();
51 | P a g e
ReceiptAutoGenerate();
BillAutoGenerate();
CmbEnrollmentFill();
}
private void savefeeinfo()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Insert into
TbleFeeEntry(ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate
,TuitionFee,NOM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,Total
Amount,PaidAmount,DueAmount,EntryLoggedBy)values(" + txtReceiptNo.Text.Trim() + "," +
txtBillNo.Text.Trim() + ",'" + cmbEnroll.Text.Trim() + "','" + txtStudentName.Text.Trim() +
"','" + txtCourse.Text.Trim() + "','" + txtSubmissionDate.Text.Trim() + "','" +
dateTimePicker2.Value + "','" + dateTimePicker3.Value + "'," + txtTuition.Text.Trim() + ","
+ txtNOM.Text.Trim() + "," + txtRegFee.Text.Trim() + "," + txtTransportFee.Text.Trim() +
"," + txtExamFee.Text.Trim() + "," + txtFine.Text.Trim() + "," + txtAmenCh.Text.Trim() +
"," + txtOtherFee.Text.Trim() + ",'" + txtDescription.Text.Trim() + "'," +
txtAmount.Text.Trim() + "," + txtPaidAmount.Text.Trim() + "," + txtDueAmount.Text.Trim() +
",'" + txtUser.Text.Trim() + "')";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Fee Data Saved Successfully......");
if (MessageBox.Show(" Do you want to Print Receipt?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
FeePrintModule();
}
Resetcontrol();
cmbEnroll.Focus();
initialvalue();
ReceiptAutoGenerate();
BillAutoGenerate();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
ReceiptAutoGenerate();
}
}
private void dueCalculateFee()
{
try
{
int due1 = 0;
for (int k = 0; k < dgvViewF.Rows.Count; k++)
{
due1 = due1 + Convert.ToInt32(dgvViewF.Rows[k].Cells[19].Value);
}
label23.Text = due1.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void updatefeeinfo()
52 | P a g e
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Update TbleFeeEntry set EnrollmentId=" + cmbEnroll.Text.Trim() +
",StudentName='" + txtStudentName.Text.Trim() + "',Class='" + txtCourse.Text.Trim() +
"',SubmissionDate='" + txtSubmissionDate.Text.Trim() + "',FromDate='" +
dateTimePicker2.Value + "',ToDate='" + dateTimePicker3.Value + "', TuitionFee=" +
txtTuition.Text + ",NOM=" + txtNOM.Text + ",RegFee=" + txtRegFee.Text + ",TransportFee=" +
txtTransportFee.Text.Trim() + ",ExamFee=" + txtExamFee.Text.Trim() + ",Fine=" +
txtFine.Text + ",AmenitiesCharge=" + txtAmenCh.Text.Trim() + ",OtherFee=" +
txtOtherFee.Text + ",Description='" + txtDescription.Text + "',TotalAmount=" +
txtAmount.Text + ",PaidAmount=" + txtPaidAmount.Text + ",DueAmount=" + txtDueAmount.Text +
",EntryLoggedBy='" + txtUser.Text.Trim() + "' where ReceiptNo=" + txtReceiptNo.Text + "";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Your Data Updated....");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void duecalculation()
{
try
{
int due;
due = Convert.ToInt32(txtAmount.Text) -
Convert.ToInt32(txtPaidAmount.Text);
txtDueAmount.Text = Convert.ToString(due);
txtDueAmount.SelectAll();
}
catch (Exception)
{
txtDueAmount.Clear();
}
}
public void dgvFeeView()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Select
ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate,TuitionFee,N
OM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,TotalAmount,PaidAm
ount,DueAmount,EntryLoggedBy from TbleFeeEntry";
da = new OleDbDataAdapter(str, con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
dgvViewF.DataSource = dt;
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
//This function loads the particular enrollement detail with Enrollid
public void dgvFeeView1()
53 | P a g e
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Select
ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate,TuitionFee,N
OM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,TotalAmount,PaidAm
ount,DueAmount,EntryLoggedBy from TbleFeeEntry Where EnrollmentId=" + cmbEnroll.Text + "";
da = new OleDbDataAdapter(str, con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
dgvViewF.DataSource = dt;
con.Close();
}
catch (Exception)
{
MessageBox.Show("Try Again", "Warning");
}
}
//This function calculate the Fee as per NOM is given and is placed at NOM Leave
event
private void FeeCalculate()
{
int FeeAmount;
FeeAmount = Convert.ToInt32(txtApplicable.Text) * Convert.ToInt32(txtNOM.Text);
txtTuition.Text = Convert.ToString(FeeAmount);
}
//This function calculate the TP FEE as per NOM is given and is placed at NOM Leave
event
private void TransportFeeCalculate()
{
int TPAmount;
TPAmount = Convert.ToInt32(txtTpFee.Text) * Convert.ToInt32(txtNOM.Text);
txtTransportFee.Text = Convert.ToString(TPAmount);
}
private void totalamount()
{
int TotalAmount;
TotalAmount = Convert.ToInt32(txtTuition.Text) +
Convert.ToInt32(txtTransportFee.Text) + Convert.ToInt32(txtExamFee.Text) +
Convert.ToInt32(txtFine.Text) + Convert.ToInt32(txtOtherFee.Text) +
Convert.ToInt32(txtAmenCh.Text);
txtAmount.Text = Convert.ToString(TotalAmount);
}
private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
TsTxtReceipt.Focus();
}
private void txtOtherFee_Leave(object sender, EventArgs e)
{
try
{
if (Convert.ToInt32(txtOtherFee.Text) < 0)
{
MessageBox.Show("Negative Value Not Allowed");
txtOtherFee.Focus();
54 | P a g e
txtOtherFee.Text = Convert.ToString(0);
txtOtherFee.Select();
}
FeeCalculate();
TransportFeeCalculate();
}
catch (Exception)
{
txtOtherFee.Text = Convert.ToString(0);
txtOtherFee.Select();
}
}
private void txtAmount_Leave(object sender, EventArgs e)
{
try
{
if (Convert.ToInt32(txtAmount.Text) <= 0)
{
MessageBox.Show("Total Amount is Zero", "Warning");
cmbEnroll.Focus();
return;
}
}
catch (Exception)
{
}
}
private void txtPaidAmount_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtDueAmount.Focus();
}
}
private void txtPaidAmount_Leave(object sender, EventArgs e)
{
try
{
if (Convert.ToInt32(txtPaidAmount.Text) < 0)
{
MessageBox.Show("Paid Cannot Be Negative");
txtPaidAmount.Focus();
txtPaidAmount.Text = Convert.ToString(0);
txtPaidAmount.SelectAll();
}
duecalculation();
}
catch (Exception )
{
MessageBox.Show("Try Again");
}
}
private void txtAmount_TextChanged(object sender, EventArgs e)
{
txtPaidAmount.Text = txtAmount.Text;
}
private void txtPaidAmount_TextChanged(object sender, EventArgs e)
{
55 | P a g e
duecalculation();
try
{
if (Convert.ToInt32(txtPaidAmount.Text) > Convert.ToInt32(txtAmount.Text))
{
MessageBox.Show("Paid Amount is Overflow", "Warning");
txtPaidAmount.Text = txtAmount.Text;
txtPaidAmount.SelectAll();
}
}
catch (Exception)
{
}
}
private void TsAddButton_Click(object sender, EventArgs e)
{
if (txtReceiptNo.Text == "")
{
MessageBox.Show("Receipt No Compulsory");
txtReceiptNo.Focus();
return;
}
else if (txtBillNo.Text == "")
{
MessageBox.Show("Bill NO. Required");
txtBillNo.Focus();
return;
}
else if (cmbEnroll.Text == "")
{
MessageBox.Show("Enroll Id Compulsory");
cmbEnroll.Focus();
return;
}
else if (txtStudentName.Text == "")
{
MessageBox.Show("Student Name Required");
txtStudentName.Focus();
return;
}
else if (txtCourse.Text == "")
{
MessageBox.Show("Class Entry Compulsory");
txtCourse.Focus();
return;
}
else if (txtNOM.Text == "")
{
MessageBox.Show("NOM Field Required");
txtNOM.Focus();
return;
}
else if (txtTuition.Text == "")
{
MessageBox.Show("Tuition Fee Compulsory");
txtTuition.Focus();
return;
}
else if (txtRegFee.Text == "")
{
MessageBox.Show("Tuition Fee Compulsory");
txtRegFee.Focus();
return;
}
else if (txtTransportFee.Text == "")
56 | P a g e
{
MessageBox.Show("Initial Value Required-Transport Fee");
txtTransportFee.Focus();
return;
}
else if (txtExamFee.Text == "")
{
MessageBox.Show("Exam Fee Compulsory");
txtExamFee.Focus();
return;
}
else if (txtFine.Text == "")
{
MessageBox.Show("Fine Value Required");
txtFine.Focus();
return;
}
else if (txtOtherFee.Text == "")
{
MessageBox.Show("Other Fee Required");
txtOtherFee.Focus();
return;
}
else if (txtAmenCh.Text == "")
{
MessageBox.Show("Amenities Charge Required");
txtAmenCh.Focus();
return;
}
else if (txtDescription.Text == "")
{
MessageBox.Show("Description Required");
txtDescription.Focus();
return;
}
else if (txtAmount.Text == "")
{
MessageBox.Show("Total Amount Compulsory");
totalamount();
txtAmount.Focus();
return;
}
else if (txtPaidAmount.Text == "")
{
MessageBox.Show("Paid Amount Must be Compulsory");
txtPaidAmount.Text = txtAmount.Text;
txtPaidAmount.Focus();
txtPaidAmount.SelectAll();
return;
}
else if (txtDueAmount.Text == "")
{
int i = 0;
MessageBox.Show("Due Amount Initial Value Required.");
txtDueAmount.Text = Convert.ToString(i);
txtDueAmount.Focus();
return;
}
else
{
savefeeinfo();
}
}
private void txtReceiptNo_KeyPress(object sender, KeyPressEventArgs e)
57 | P a g e
{
}
private void cmbEnroll_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
fillstudentdetail();
dgvFeeView1();
dueCalculateFee();
txtStudentName.Focus();
}
}
private void txtStudentName_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtCourse.Focus();
}
}
private void txtCourse_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
dateTimePicker2.Focus();
}
}
private void txtAffiliated_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
dateTimePicker2.Focus();
}
}
private void dateTimePicker2_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
dateTimePicker3.Focus();
}
}
private void dateTimePicker3_KeyPress(object sender, KeyPressEventArgs e)
{
}
private void txtTuition_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtRegFee.Focus();
}
}
private void txtNOM_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtTuition.Focus();
58 | P a g e
}
}
private void txtRegFee_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtTransportFee.Focus();
}
}
private void txtFine_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtOtherFee.Focus();
}
}
private void txtOtherFee_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtAmenCh.Focus();
}
}
private void txtDescription_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtAmount.Focus();
}
}
private void Resetcontrol()
{
cmbEnroll.SelectedIndex = -1;
txtStudentName.Clear();
txtCourse.Clear();
txtTuition.Clear();
txtNOM.Clear();
txtRegFee.Clear();
txtTpFee.Clear();
txtTransportFee.Clear();
txtAmenCh.Clear();
txtFine.Clear();
txtApplicable.Clear();
txtOtherFee.Clear();
txtAmount.Clear();
txtPaidAmount.Clear();
txtDueAmount.Clear();
}
private void Resetcontrol1()
{
cmbEnroll.SelectedIndex = -1;
txtStudentName.Clear();
txtCourse.Clear();
txtTpFee.Clear();
txtApplicable.Clear();
txtTuition.Clear();
}
private void initialvalue()
{
int a = 0, b = 1;
txtNOM.Text = Convert.ToString(b);
txtRegFee.Text = Convert.ToString(a);
txtFine.Text = Convert.ToString(a);
59 | P a g e
txtOtherFee.Text = Convert.ToString(a);
txtTransportFee.Text = Convert.ToString(a);
txtAmenCh.Text = Convert.ToString(a);
txtAmount.Text = Convert.ToString(a);
txtTuition.Text = Convert.ToString(a);
txtPaidAmount.Text = Convert.ToString(a);
txtDueAmount.Text = Convert.ToString(a);
txtExamFee.Text = Convert.ToString(a);
label23.Text = Convert.ToString(a);
}
private void txtAmount_KeyPress(object sender, KeyPressEventArgs e)
{
if ((!char.IsControl(e.KeyChar)) && (!char.IsDigit(e.KeyChar)))
{
e.Handled = true;
}
base.OnKeyPress(e);
if (e.KeyChar == 13)
{
txtPaidAmount.Focus();
}
}
private void txtDueAmount_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
if (TsAddButton.Enabled == true)
{
TsAddButton.PerformClick();
}
else
{
TsEdit.PerformClick();
}
}
}
private void cmbEnroll_Leave(object sender, EventArgs e)
{
countInstallment();
int index = cmbEnroll.FindString(cmbEnroll.Text);
if (index < 0)
{
MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
cmbEnroll.Focus();
cmbEnroll.Text = "";
return;
}
}
private void dgvFeeViewEntry_CellContentClick(object sender,
DataGridViewCellEventArgs e)
{
try
{
//ReceiptNo1,BillNo2,EnrollmentId3,StudentName4,Class5,SubmissionDate6,FromDate6,ToDate7,Tu
itionFee8,9NOM,
//10RegFee,11TransportFee,12ExamFee,13Fine,14AmenitiesCharge,15therFee,16Description,17Tota
lAmount,18PaidAmount,19DueAmount,20EntryLoggedBy
if (e.RowIndex >= 0)
{
DataGridViewRow row = dgvViewF.Rows[e.RowIndex];
60 | P a g e
txtReceiptNo.Text = row.Cells[0].Value.ToString();
txtBillNo.Text = row.Cells[1].Value.ToString();
cmbEnroll.Text = row.Cells[2].Value.ToString();
txtStudentName.Text = row.Cells[3].Value.ToString();
txtCourse.Text = row.Cells[4].Value.ToString();
txtSubmissionDate.Text = row.Cells[5].Value.ToString();
dateTimePicker2.Text = row.Cells[6].Value.ToString();
dateTimePicker3.Text = row.Cells[7].Value.ToString();
txtTuition.Text = row.Cells[8].Value.ToString();
txtNOM.Text = row.Cells[9].Value.ToString();
txtRegFee.Text = row.Cells[10].Value.ToString();
txtTransportFee.Text = row.Cells[11].Value.ToString();
txtExamFee.Text = row.Cells[12].Value.ToString();
txtFine.Text = row.Cells[13].Value.ToString();
txtAmenCh.Text = row.Cells[14].Value.ToString();
txtOtherFee.Text = row.Cells[15].Value.ToString();
txtDescription.Text = row.Cells[16].Value.ToString();
txtAmount.Text = row.Cells[17].Value.ToString();
txtPaidAmount.Text = row.Cells[18].Value.ToString();
txtDueAmount.Text = row.Cells[19].Value.ToString();
textBox2.Text = row.Cells[20].Value.ToString();
}
TsAddButton.Enabled = false;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void TsReset_Click(object sender, EventArgs e)
{
Resetcontrol1();
TsAddButton.Enabled = true;
initialvalue();
ReceiptAutoGenerate();
BillAutoGenerate();
cmbEnroll.Focus();
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
if (txtUser.Text != textBox2.Text)
{
MessageBox.Show("You are not a Valid Logger-To Delete");
if (MessageBox.Show("Want to Override Authorization?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
label24.Visible = true;
textBox1.Visible = true;
button1.Visible = true;
cmbTask.Visible = true;
textBox1.Focus();
}
return;
}
if (txtReceiptNo.Text == "")
{
MessageBox.Show("Receipt No Compulsory");
txtReceiptNo.Focus();
return;
}
else if (txtBillNo.Text == "")
{
MessageBox.Show("Bill NO. Required");
61 | P a g e
txtBillNo.Focus();
return;
}
else if (cmbEnroll.Text == "")
{
MessageBox.Show("Enroll Id Compulsory");
cmbEnroll.Focus();
return;
}
else if (txtStudentName.Text == "")
{
MessageBox.Show("Student Name Required");
txtStudentName.Focus();
return;
}
else if (txtCourse.Text == "")
{
MessageBox.Show("Class Entry Compulsory");
txtCourse.Focus();
return;
}
else if (txtTuition.Text == "")
{
MessageBox.Show("Tuition Field Required");
txtTuition.Focus();
return;
}
else if (txtNOM.Text == "")
{
MessageBox.Show("No of Month Entry Compulsory (No Only)");
txtNOM.Focus();
return;
}
else if (txtRegFee.Text == "")
{
MessageBox.Show("Tuition Fee Compulsory");
txtRegFee.Focus();
return;
}
else if (txtTransportFee.Text == "")
{
MessageBox.Show("Initial Value Required-Transport Fee");
txtTransportFee.Focus();
return;
}
else if (txtExamFee.Text == "")
{
MessageBox.Show("Exam Fee Compulsory");
txtExamFee.Focus();
return;
}
else if (txtFine.Text == "")
{
MessageBox.Show("Fine Value Required");
txtFine.Focus();
return;
}
else if (txtOtherFee.Text == "")
{
MessageBox.Show("Other Fee Required");
txtOtherFee.Focus();
return;
}
else if (txtAmenCh.Text == "")
{
MessageBox.Show("Amenities Charge Fee Required");
txtAmenCh.Focus();
62 | P a g e
return;
}
else if (txtDescription.Text == "")
{
MessageBox.Show("Description Required");
txtDescription.Focus();
return;
}
else if (txtAmount.Text == "")
{
MessageBox.Show("Total Amount Compulsory");
totalamount();
txtAmount.Focus();
return;
}
else if (txtPaidAmount.Text == "")
{
MessageBox.Show("Paid Amount Must be Compulsory");
txtPaidAmount.Text = txtAmount.Text;
txtPaidAmount.Focus();
txtPaidAmount.SelectAll();
return;
}
else if (txtDueAmount.Text == "")
{
int i = 0;
MessageBox.Show("Due Amount Initial Value Required.");
txtDueAmount.Text = Convert.ToString(i);
txtDueAmount.Focus();
return;
}
else
{
deletefeeinfo();
dgvFeeView1();
Resetcontrol();
ReceiptAutoGenerate();
BillAutoGenerate();
initialvalue();
cmbEnroll.Focus();
TsAddButton.Enabled = true;
}
}
private void TsEdit_Click(object sender, EventArgs e)
{
if (txtUser.Text != textBox2.Text)
{
MessageBox.Show("You are not a Valid Logger-To Update");
if (MessageBox.Show("Want to Override Authorization?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
label24.Visible = true;
textBox1.Visible = true;
button1.Visible = true;
cmbTask.Visible = true;
textBox1.Focus();
}
return;
}
if (txtReceiptNo.Text == "")
{
MessageBox.Show("Receipt No Compulsory");
txtReceiptNo.Focus();
return;
}
63 | P a g e
else if (txtBillNo.Text == "")
{
MessageBox.Show("Bill NO. Required");
txtBillNo.Focus();
return;
}
else if (cmbEnroll.Text == "")
{
MessageBox.Show("Enroll Id Compulsory");
cmbEnroll.Focus();
return;
}
else if (txtStudentName.Text == "")
{
MessageBox.Show("Student Name Required");
txtStudentName.Focus();
return;
}
else if (txtCourse.Text == "")
{
MessageBox.Show("Class Entry Compulsory");
txtCourse.Focus();
return;
}
else if (txtTuition.Text == "")
{
MessageBox.Show("Tuition Field Required");
txtTuition.Focus();
return;
}
else if (txtNOM.Text == "")
{
MessageBox.Show("No of Month Entry Compulsory (No Only)");
txtNOM.Focus();
return;
}
else if (txtRegFee.Text == "")
{
MessageBox.Show("Tuition Fee Compulsory");
txtRegFee.Focus();
return;
}
else if (txtTransportFee.Text == "")
{
MessageBox.Show("Initial Value Required-Transport Fee");
txtTransportFee.Focus();
return;
}
else if (txtExamFee.Text == "")
{
MessageBox.Show("Exam Fee Compulsory");
txtExamFee.Focus();
return;
}
else if (txtFine.Text == "")
{
MessageBox.Show("Fine Value Required");
txtFine.Focus();
return;
}
else if (txtOtherFee.Text == "")
{
MessageBox.Show("Other Fee Required");
txtOtherFee.Focus();
return;
}
64 | P a g e
else if (txtAmenCh.Text == "")
{
MessageBox.Show("Amenities Charge Required");
txtAmenCh.Focus();
return;
}
else if (txtDescription.Text == "")
{
MessageBox.Show("Description Required");
txtDescription.Focus();
return;
}
else if (txtAmount.Text == "")
{
MessageBox.Show("Total Amount Compulsory");
totalamount();
txtAmount.Focus();
return;
}
else if (txtPaidAmount.Text == "")
{
MessageBox.Show("Paid Amount Must be Compulsory");
txtPaidAmount.Text = txtAmount.Text;
txtPaidAmount.Focus();
txtPaidAmount.SelectAll();
return;
}
else if (txtDueAmount.Text == "")
{
int i = 0;
MessageBox.Show("Due Amount Initial Value Required.");
txtDueAmount.Text = Convert.ToString(i);
txtDueAmount.Focus();
return;
}
else
{
updatefeeinfo();
dgvFeeView1();
Resetcontrol1();
initialvalue();
ReceiptAutoGenerate();
BillAutoGenerate();
cmbEnroll.Focus();
TsAddButton.Enabled = true;
}
}
private void TsTxtReceipt_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
TsPrintBtn.PerformClick();
}
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
if (TsTxtReceipt.Text == "")
{
MessageBox.Show("Enter Value to Print");
TsTxtReceipt.Focus();
}
else if (TsCmbReceiept.Text == "By Receipt No.")
{
65 | P a g e
FeePrintCmbReceipt();
TsTxtReceipt.Clear();
}
else
{
FeeLedgerPrint();
TsTxtReceipt.Clear();
}
}
private void dateTimePicker2_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
dateTimePicker3.Focus();
}
}
private void dateTimePicker2_KeyPress_1(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
dateTimePicker3.Focus();
}
}
private void dateTimePicker3_KeyPress_1(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtNOM.Focus();
}
}
private void toolStripLabel3_Click(object sender, EventArgs e)
{
dgvFeeView();
}
private void groupBox1_Enter(object sender, EventArgs e)
{
label24.Visible = false;
textBox1.Visible = false;
textBox1.Clear();
button1.Visible = false;
cmbTask.Visible = false;
}
private void button1_Click_1(object sender, EventArgs e)
{
if (cmbTask.Text == "Edit")
{
if (textBox1.Text == "07071979")
{
if (txtReceiptNo.Text == "")
{
MessageBox.Show("Receipt No Compulsory");
txtReceiptNo.Focus();
return;
}
66 | P a g e
else if (txtBillNo.Text == "")
{
MessageBox.Show("Bill NO. Required");
txtBillNo.Focus();
return;
}
else if (cmbEnroll.Text == "")
{
MessageBox.Show("Enroll Id Compulsory");
cmbEnroll.Focus();
return;
}
else if (txtStudentName.Text == "")
{
MessageBox.Show("Student Name Required");
txtStudentName.Focus();
return;
}
else if (txtCourse.Text == "")
{
MessageBox.Show("Class Entry Compulsory");
txtCourse.Focus();
return;
}
else if (txtTuition.Text == "")
{
MessageBox.Show("Tuition Field Required");
txtTuition.Focus();
return;
}
else if (txtNOM.Text == "")
{
MessageBox.Show("No of Month Entry Compulsory (No Only)");
txtNOM.Focus();
return;
}
else if (txtRegFee.Text == "")
{
MessageBox.Show("Tuition Fee Compulsory");
txtRegFee.Focus();
return;
}
else if (txtTransportFee.Text == "")
{
MessageBox.Show("Initial Value Required-Transport Fee");
txtTransportFee.Focus();
return;
}
else if (txtExamFee.Text == "")
{
MessageBox.Show("Exam Fee Compulsory");
txtExamFee.Focus();
return;
}
else if (txtFine.Text == "")
{
MessageBox.Show("Fine Value Required");
txtFine.Focus();
return;
}
else if (txtOtherFee.Text == "")
{
MessageBox.Show("Other Fee Required");
txtOtherFee.Focus();
return;
}
else if (txtDescription.Text == "")
67 | P a g e
{
MessageBox.Show("Description Required");
txtDescription.Focus();
return;
}
else if (txtAmount.Text == "")
{
MessageBox.Show("Total Amount Compulsory");
totalamount();
txtAmount.Focus();
return;
}
else if (txtPaidAmount.Text == "")
{
MessageBox.Show("Paid Amount Must be Compulsory");
txtPaidAmount.Text = txtAmount.Text;
txtPaidAmount.Focus();
txtPaidAmount.SelectAll();
return;
}
else if (txtDueAmount.Text == "")
{
int i = 0;
MessageBox.Show("Due Amount Initial Value Required.");
txtDueAmount.Text = Convert.ToString(i);
txtDueAmount.Focus();
return;
}
else
{
updatefeeinfo();
dgvFeeView1();
Resetcontrol1();
initialvalue();
ReceiptAutoGenerate();
BillAutoGenerate();
cmbEnroll.Focus();
TsAddButton.Enabled = true;
textBox1.Clear();
label24.Visible = false;
textBox1.Visible = false;
button1.Visible = false;
cmbTask.Visible = false;
}
}
}
else if (cmbTask.Text == "Delete")
{
if (textBox1.Text == "07071979")
{
if (txtReceiptNo.Text == "")
{
MessageBox.Show("Receipt No Compulsory");
txtReceiptNo.Focus();
return;
}
else if (txtBillNo.Text == "")
{
MessageBox.Show("Bill NO. Required");
txtBillNo.Focus();
return;
}
else if (cmbEnroll.Text == "")
{
MessageBox.Show("Enroll Id Compulsory");
68 | P a g e
cmbEnroll.Focus();
return;
}
else if (txtStudentName.Text == "")
{
MessageBox.Show("Student Name Required");
txtStudentName.Focus();
return;
}
else if (txtCourse.Text == "")
{
MessageBox.Show("Class Entry Compulsory");
txtCourse.Focus();
return;
}
else if (txtTuition.Text == "")
{
MessageBox.Show("Tuition Field Required");
txtTuition.Focus();
return;
}
else if (txtNOM.Text == "")
{
MessageBox.Show("No of Month Entry Compulsory (No Only)");
txtNOM.Focus();
return;
}
else if (txtRegFee.Text == "")
{
MessageBox.Show("Tuition Fee Compulsory");
txtRegFee.Focus();
return;
}
else if (txtTransportFee.Text == "")
{
MessageBox.Show("Initial Value Required-Transport Fee");
txtTransportFee.Focus();
return;
}
else if (txtExamFee.Text == "")
{
MessageBox.Show("Exam Fee Compulsory");
txtExamFee.Focus();
return;
}
else if (txtFine.Text == "")
{
MessageBox.Show("Fine Value Required");
txtFine.Focus();
return;
}
else if (txtOtherFee.Text == "")
{
MessageBox.Show("Other Fee Required");
txtOtherFee.Focus();
return;
}
else if (txtDescription.Text == "")
{
MessageBox.Show("Description Required");
txtDescription.Focus();
return;
}
else if (txtAmount.Text == "")
{
MessageBox.Show("Total Amount Compulsory");
69 | P a g e
totalamount();
txtAmount.Focus();
return;
}
else if (txtPaidAmount.Text == "")
{
MessageBox.Show("Paid Amount Must be Compulsory");
txtPaidAmount.Text = txtAmount.Text;
txtPaidAmount.Focus();
txtPaidAmount.SelectAll();
return;
}
else if (txtDueAmount.Text == "")
{
int i = 0;
MessageBox.Show("Due Amount Initial Value Required.");
txtDueAmount.Text = Convert.ToString(i);
txtDueAmount.Focus();
return;
}
else
{
deletefeeinfo();
dgvFeeView1();
Resetcontrol();
ReceiptAutoGenerate();
BillAutoGenerate();
initialvalue();
cmbEnroll.Focus();
TsAddButton.Enabled = true;
}
}
}
else if (textBox1.Text == "")
{
MessageBox.Show("Null Code Not Permitted", "Warning");
textBox1.Focus();
return;
}
}
private void txtTransportFee_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtExamFee.Focus();
}
}
private void txtExamFee_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtFine.Focus();
}
}
private void txtAmenCh_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtDescription.Focus();
}
}
private void txtNOM_Leave(object sender, EventArgs e)
{
70 | P a g e
int errorassign = 1;
try
{
if (Convert.ToInt32(txtNOM.Text) < 0)
{
MessageBox.Show("Negative Value Not Allowed");
txtNOM.Focus();
txtNOM.Text = Convert.ToString(errorassign);
txtNOM.Select();
}
FeeCalculate();
TransportFeeCalculate();
}
catch (Exception)
{
txtNOM.Text = Convert.ToString(errorassign);
txtNOM.Select();
}
}
private void txtDescription_Leave(object sender, EventArgs e)
{
// int a = 0;
try
{
totalamount();
}
catch (Exception)
{
//txtOtherFee.Text = Convert.ToString(a);
}
}
private void txtRegFee_Leave(object sender, EventArgs e)
{
try
{
if (Convert.ToInt32(txtRegFee.Text) < 0)
{
MessageBox.Show("Negative Value Not Allowed");
txtRegFee.Focus();
txtRegFee.Text = Convert.ToString(0);
txtRegFee.Select();
}
}
catch (Exception)
{
txtRegFee.Focus();
txtRegFee.Text = Convert.ToString(0);
txtRegFee.Select();
}
}
private void txtTransportFee_Leave(object sender, EventArgs e)
{
try
{
if (Convert.ToInt32(txtTransportFee.Text) < 0)
{
MessageBox.Show("Negative Value Not Allowed");
txtTransportFee.Focus();
txtTransportFee.Text = Convert.ToString(0);
71 | P a g e
txtTransportFee.Select();
}
}
catch (Exception)
{
txtTransportFee.Focus();
txtTransportFee.Text = Convert.ToString(0);
txtTransportFee.Select();
}
}
private void txtExamFee_Leave(object sender, EventArgs e)
{
try
{
if (Convert.ToInt32(txtExamFee.Text) < 0)
{
MessageBox.Show("Negative Value Not Allowed");
txtExamFee.Focus();
txtExamFee.Text = Convert.ToString(0);
txtExamFee.Select();
}
}
catch (Exception)
{
txtExamFee.Focus();
txtExamFee.Text = Convert.ToString(0);
txtExamFee.Select();
}
}
private void txtFine_Leave(object sender, EventArgs e)
{
try
{
if (Convert.ToInt32(txtFine.Text) < 0)
{
MessageBox.Show("Negative Value Not Allowed");
txtFine.Focus();
txtFine.Text = Convert.ToString(0);
txtFine.Select();
}
}
catch (Exception)
{
txtFine.Focus();
txtFine.Text = Convert.ToString(0);
txtFine.Select();
}
}
private void txtAmenCh_Leave(object sender, EventArgs e)
{
try
{
if (Convert.ToInt32(txtAmenCh.Text) < 0)
{
MessageBox.Show("Negative Value Not Allowed");
txtAmenCh.Focus();
txtAmenCh.Text = Convert.ToString(0);
txtAmenCh.Select();
}
}
catch (Exception)
{
txtFine.Focus();
72 | P a g e
txtFine.Text = Convert.ToString(0);
txtFine.Select();
}
}
private void txtBillNo_KeyPress(object sender, KeyPressEventArgs e)
{
if ((!char.IsControl(e.KeyChar)) && (!char.IsDigit(e.KeyChar)))
{
e.Handled = true;
}
base.OnKeyPress(e);
}
}
}
Day Book Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
using Excel = Microsoft.Office.Interop.Excel;
namespace FeeEntrySystem
{
public partial class FrmFeeViewByDate : Form
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data
Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha");
// OleDbCommand cmd;
OleDbDataAdapter da;
DataSet ds;
DataTable dt;
string a;
public FrmFeeViewByDate()
{
InitializeComponent();
}
public void dgvFeeViewByDate()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
a = "Select
ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate,TuitionFee,N
OM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,TotalAmount,PaidAm
ount,DueAmount,EntryLoggedBy from TbleFeeEntry Where SubmissionDate='" +
textBox4.Text.Trim() + "'";
da = new OleDbDataAdapter(a, con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
DataGridView1.DataSource = dt;
con.Close();
}
catch (Exception EX)
{
MessageBox.Show(EX.Message); ;
}
73 | P a g e
}
public void dgvIndividualFeeRecord()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
a = "Select
ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate,TuitionFee,N
OM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,TotalAmount,PaidAm
ount,DueAmount,EntryLoggedBy from TbleFeeEntry Where EnrollmentId=" + textBox2.Text + "";
da = new OleDbDataAdapter(a, con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
DataGridView1.DataSource = dt;
DataGridView1.Columns[1].Visible = false;
con.Close();
}
catch (Exception )
{
textBox2.Text = Convert.ToString(0);
textBox2.SelectAll();
}
}
private void dateReport()
{
FrmDaywiseReport frmdaywise1 = new FrmDaywiseReport();
RptDayWisePrint FEE2 = new RptDayWisePrint();
frmdaywise1.crystalReportViewer1.ReportSource = FEE2;
FEE2.Refresh();
frmdaywise1.crystalReportViewer1.SelectionFormula =
"{TbleFeeEntry.SubmissionDate} = #"+dateTimePicker1.Text+"#";
frmdaywise1.Show();
}
private void TotalAmount()
{
try
{
decimal sum = 0.00m;
for (int k = 0; k < DataGridView1.Rows.Count; k++)
{
sum = sum + Convert.ToDecimal(DataGridView1.Rows[k].Cells[18].Value);
}
textBox1.Text= sum.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void dueCalculate()
{
try
{
decimal due = 0.00m;
for (int k = 0; k < DataGridView1.Rows.Count; k++)
{
due = due + Convert.ToDecimal(DataGridView1.Rows[k].Cells[19].Value);
}
textBox3.Text = due.ToString();
}
74 | P a g e
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void daterangeverify()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
a = "Select
ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate,TuitionFee,N
OM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,TotalAmount,PaidAm
ount,DueAmount,EntryLoggedBy from TbleFeeEntry Where SubmissionDate between #" +
textBox4.Text.Trim() + "# and #" + textBox5.Text.Trim() + "# ORDER BY SubmissionDate Asc";
da = new OleDbDataAdapter(a, con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
DataGridView1.DataSource = dt;
con.Close();
}
catch (Exception EX)
{
MessageBox.Show(EX.Message); ;
}
}
private void FrmFeeViewByDate_Load(object sender, EventArgs e)
{
textBox4.Text = monthCalendar1.TodayDate.ToShortDateString();
textBox5.Text = monthCalendar1.TodayDate.ToShortDateString();
TotalAmount();
dueCalculate();
}
private void dateTimePicker1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
button1.PerformClick();
}
}
private void button1_Click(object sender, EventArgs e)
{
dateReport();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.Text == "Individual Fee Record")
{
textBox2.Visible = true;
textBox2.Focus();
textBox4.Visible = false;
textBox5.Visible = false;
}
else
{
daterangeverify();
textBox4.Text = monthCalendar1.TodayDate.ToShortDateString();
textBox4.Visible = true;
textBox5.Visible = true;
textBox2.Clear();
textBox2.Visible = false;
75 | P a g e
TotalAmount();
dueCalculate();
}
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
try
{
dgvIndividualFeeRecord();
TotalAmount();
dueCalculate();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
textBox2.Text = Convert.ToString(0);
textBox2.SelectAll();
}
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if ((!char.IsControl(e.KeyChar)) && (!char.IsDigit(e.KeyChar)))
{
e.Handled = true;
}
base.OnKeyPress(e);
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
}
private void textBox4_TextChanged_1(object sender, EventArgs e)
{
}
private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
textBox5.Focus();
}
}
private void textBox5_TextChanged(object sender, EventArgs e)
{
}
private void textBox5_KeyPress(object sender, KeyPressEventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
int rowsTotal = 0;
int colsTotal = 0;
int I = 0;
int j = 0;
76 | P a g e
int iC = 0;
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
Excel.Application xlApp = new Excel.Application();
try
{
Excel.Workbook excelBook = xlApp.Workbooks.Add();
Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelBook.Worksheets[1];
xlApp.Visible = true;
rowsTotal = DataGridView1.RowCount - 1;
colsTotal = DataGridView1.Columns.Count - 1;
var _with1 = excelWorksheet;
_with1.Cells.Select();
_with1.Cells.Delete();
for (iC = 0; iC <= colsTotal; iC++)
{
_with1.Cells[1, iC + 1].Value = DataGridView1.Columns[iC].HeaderText;
}
for (I = 0; I <= rowsTotal; I++)
{
for (j = 0; j <= colsTotal; j++)
{
_with1.Cells[I + 2, j + 1].value =
DataGridView1.Rows[I].Cells[j].Value;
}
}
_with1.Rows["1:1"].Font.FontStyle = "Bold";
_with1.Rows["1:1"].Font.Size = 12;
_with1.Cells.Columns.AutoFit();
_with1.Cells.Select();
_with1.Cells.EntireColumn.AutoFit();
_with1.Cells[1, 1].Select();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
//RELEASE ALLOACTED RESOURCES
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
xlApp = null;
}
}
private void textBox6_KeyPress(object sender, KeyPressEventArgs e)
{
}
private void textBox5_KeyPress_1(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
daterangeverify();
TotalAmount();
dueCalculate();
}
}
}
}
77 | P a g e
Employee Module-
Employee Detail Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
namespace FeeEntrySystem
{
public partial class FrmAddSalary : Form
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data
Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha");
OleDbCommand cmd;
OleDbDataAdapter da;
DataSet ds;
DataTable dt;
string str;
public FrmAddSalary()
{
InitializeComponent();
}
private void resetControl()
{
txtAddress.Clear();
txtDob.Clear();
txtEmpName.Clear();
txtMoNo.Clear();
CmbEmpDesignation.Text = "";
cmbEmpStatus.SelectedIndex = -1;
cmbQualification.SelectedIndex = -1;
cmbSalary.Clear();
cmbEmpStatus.SelectedIndex = -1;
}
public void DgvShowEmpDetail()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Select * from TbleEmployeeDetail";
da = new OleDbDataAdapter(str, con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
dgvViewFee.DataSource = dt;
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void savefeDetailinfo()
{
try
{
78 | P a g e
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Insert into
TbleEmployeeDetail(EmpId,EmpName,EmpDob,EmpDesignation,EmpAddress,EmpMo,EmpStatus,EmpQualif
ication,RecordDate,EmpSalary)values(" + txtEmpid.Text.Trim() + ",'" +
txtEmpName.Text.Trim() + "','" + txtDob.Text.Trim() + "','" + CmbEmpDesignation.Text.Trim()
+ "','" + txtAddress.Text.Trim() + "','" + txtMoNo.Text.Trim() + "','" +
cmbEmpStatus.Text.Trim() + "','" + cmbQualification.Text.Trim() + "','" +
txtRecordDate.Text.Trim() + "'," + cmbSalary.Text.Trim() + ")";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Employee Data Saved Successfully......");
resetControl();
DgvShowEmpDetail();
}
catch (Exception )
{
MessageBox.Show("Duplicate Id Found...","Warning...!");
}
}
private void updateEmpinfo()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Update TbleEmployeeDetail set EmpName='" + txtEmpName.Text.Trim()
+ "',EmpDob='" + txtDob.Text.Trim() + "',EmpDesignation='" + CmbEmpDesignation.Text.Trim()
+ "',EmpAddress='" + txtAddress.Text.Trim() + "',EmpMo='" + txtMoNo.Text.Trim() +
"',EmpStatus='" + cmbEmpStatus.Text.Trim() + "', EmpQualification='" +
cmbQualification.Text.Trim() + "',RecordDate=" + txtRecordDate.Text + ",EmpSalary=" +
cmbSalary.Text.Trim() + " where EmpId=" + txtEmpid.Text + "";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Your Data Updated....");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void deleteEmpinfo()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
if (MessageBox.Show(" Do you want to Delete?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
str = "Delete from TbleEmployeeDetail where EmpId=" + txtEmpid.Text +
"";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Data Deleted Successfully");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void EmpIdAutoGenerate()
79 | P a g e
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
// int i=0;
string query = "SELECT max(EmpId)+1 from TbleEmployeeDetail ";
cmd = new OleDbCommand();
cmd.CommandText = query;
cmd.Connection = con;
txtEmpid.Text = cmd.ExecuteScalar().ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void TsBtnSave12_Load(object sender, EventArgs e)
{
DgvShowEmpDetail();
txtRecordDate.Text = DateTime.Today.ToShortDateString();
EmpIdAutoGenerate();
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
resetControl();
}
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
if (txtEmpid.Text == "")
{
MessageBox.Show("Id Required....!", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtEmpid.Focus();
return;
}
else if (txtEmpName.Text == "")
{
MessageBox.Show("Please Enter Name", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtEmpName.Focus();
return;
}
else if (txtDob.Text == "")
{
MessageBox.Show("Please Enter DOB", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtDob.Focus();
return;
}
else if(CmbEmpDesignation.Text=="")
{
MessageBox.Show("Select Correct Value");
CmbEmpDesignation.Focus();
return;
}
else if (txtAddress.Text == "")
{
MessageBox.Show("Please Enter Address", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
80 | P a g e
txtAddress.Focus();
return;
}
else if (txtMoNo.Text == "")
{
MessageBox.Show("Please Enter Mobile No.", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtMoNo.Focus();
return;
}
else if (cmbEmpStatus.Text == "")
{
MessageBox.Show("Please Enter Status", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
cmbEmpStatus.Focus();
return;
}
else if (cmbSalary.Text == "")
{
MessageBox.Show("Please Enter Salary", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
cmbSalary.Focus();
return;
}
else if (cmbQualification.Text == "")
{
MessageBox.Show("Please Enter Qualification", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Information);
cmbQualification.Focus();
return;
}
else if (txtRecordDate.Text == "")
{
MessageBox.Show("Joining Date Rquired", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtRecordDate.Focus();
return;
}
else
{
CheckIdDuplicate();
savefeDetailinfo();
EmpIdAutoGenerate();
txtEmpid.Focus();
}
}
private void txtEmpid_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtEmpName.Focus();
}
}
private void txtEmpName_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtDob.Focus();
}
}
private void txtDob_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
81 | P a g e
{
CmbEmpDesignation.Focus();
}
}
private void CmbEmpDesignation_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
txtAddress.Focus();
}
}
private void txtAddress_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtMoNo.Focus();
}
}
private void txtMoNo_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
cmbEmpStatus.Focus();
}
}
private void cmbEmpStatus_KeyPress(object sender, KeyPressEventArgs e)
{
}
private void cmbSalary_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
cmbQualification.Focus();
}
}
private void cmbQualification_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
TsSave.PerformClick();
}
}
private void cmbEmpStatus_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
cmbSalary.Focus();
}
}
private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void toolStripButton3_Click(object sender, EventArgs e)
{
if (toolStripTextBox1.Text == "")
{
82 | P a g e
MessageBox.Show("Enter Id To Print", "Warning...!");
toolStripTextBox1.Focus();
return;
}
else
{
FrmShowEmpDetail1 frmempshow = new FrmShowEmpDetail1();
RptEmployeeDetail detail = new RptEmployeeDetail();
frmempshow.crystalReportViewer1.ReportSource = detail;
detail.Refresh();
frmempshow.crystalReportViewer1.SelectionFormula =
"{TbleEmployeeDetail.Empid} = " + toolStripTextBox1.Text + " ";
frmempshow.Show();
toolStripTextBox1.Clear();
}
}
private void deleteEmployeeinfo()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
if (MessageBox.Show(" Do you want to Delete?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
str = "Delete from TbleEmployeeDetail where EmpId=" + txtEmpid.Text +
"";
cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = str;
cmd.ExecuteNonQuery();
MessageBox.Show("Data Deleted Successfully");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void CheckIdDuplicate()
{
string id;
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
cmd = new OleDbCommand(" Select * from TbleEmployeeDetail where EmpId=" +
txtEmpid.Text.Trim() + "", con);
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
id = dr["EmpId"].ToString();
if (txtEmpid.Text == id)
{
fillEmployeedetail();
}
dr.Close();
};
}
catch (Exception )
{
}
}
private void fillEmployeedetail()
{
try
{
83 | P a g e
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
cmd = new OleDbCommand(" Select * from TbleEmployeeDetail where EmpId=" +
txtEmpid.Text.Trim() + "", con);
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtEmpid.Text = dr["EmpId"].ToString();
txtEmpName.Text = dr["EmpName"].ToString();
txtDob.Text = dr["EmpDob"].ToString();
CmbEmpDesignation.Text = dr["EmpDesignation"].ToString();
txtAddress.Text = dr["EmpAddress"].ToString();
txtMoNo.Text = dr["EmpMo"].ToString();
cmbEmpStatus.Text = dr["EmpStatus"].ToString();
cmbQualification.Text = dr["EmpQualification"].ToString();
txtRecordDate.Text = dr["RecordDate"].ToString();
cmbSalary.Text = dr["EmpSalary"].ToString();
}
dr.Close();
}
catch (Exception )
{
EmpIdAutoGenerate();
}
}
private void toolStripTextBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
toolStripButton3.PerformClick();
}
}
private void txtEmpid_TextChanged(object sender, EventArgs e)
{
CheckIdDuplicate();
}
private void CmbEmpDesignation_Leave(object sender, EventArgs e)
{
int index = CmbEmpDesignation.FindString(CmbEmpDesignation.Text);
if (index < 0)
{
MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
CmbEmpDesignation.Focus();
CmbEmpDesignation.Text = "";
return;
}
}
private void cmbEmpStatus_Leave(object sender, EventArgs e)
{
int index = cmbEmpStatus.FindString(cmbEmpStatus.Text);
if (index < 0)
{
MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
cmbEmpStatus.Focus();
cmbEmpStatus.Text = "";
return;
}
}
84 | P a g e
private void TsBtnDelete_Click(object sender, EventArgs e)
{
if (txtEmpid.Text == "")
{
MessageBox.Show("Id Required....!");
txtEmpid.Focus();
return;
}
else
{
deleteEmpinfo();
resetControl();
EmpIdAutoGenerate();
DgvShowEmpDetail();
}
}
private void label10_Click(object sender, EventArgs e)
{
EmpIdAutoGenerate();
}
private void TsBtnUpdate_Click(object sender, EventArgs e)
{
if (txtEmpid.Text == "")
{
MessageBox.Show("Id Required....!", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtEmpid.Focus();
return;
}
else if (txtEmpName.Text == "")
{
MessageBox.Show("Please Enter Name", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtEmpName.Focus();
return;
}
else if (txtDob.Text == "")
{
MessageBox.Show("Please Enter DOB", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtDob.Focus();
return;
}
else if(CmbEmpDesignation.Text=="")
{
MessageBox.Show("Select Correct Value");
CmbEmpDesignation.Focus();
return;
}
else if (txtAddress.Text == "")
{
MessageBox.Show("Please Enter Address", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtAddress.Focus();
return;
}
else if (txtMoNo.Text == "")
{
MessageBox.Show("Please Enter Mobile No.", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtMoNo.Focus();
return;
}
else if (cmbEmpStatus.Text == "")
85 | P a g e
{
MessageBox.Show("Please Enter Status", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
cmbEmpStatus.Focus();
return;
}
else if (cmbSalary.Text == "")
{
MessageBox.Show("Please Enter Salary", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
cmbSalary.Focus();
return;
}
else if (cmbQualification.Text == "")
{
MessageBox.Show("Please Enter Qualification", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Information);
cmbQualification.Focus();
return;
}
else if (txtRecordDate.Text == "")
{
MessageBox.Show("Joining Date Rquired", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Information);
txtRecordDate.Focus();
return;
}
else
{
updateEmpinfo();
resetControl();
EmpIdAutoGenerate();
DgvShowEmpDetail();
txtEmpid.Focus();
}
}
}
}
86 | P a g e
Employee Salary Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
namespace FeeEntrySystem
{
public partial class FrmAddSalary : Form
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data
Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha");
OleDbCommand cmd;
OleDbDataAdapter da;
DataSet ds;
DataTable dt;
string str;
public FrmAddSalary()
{
InitializeComponent();
}
private void resetControl()
{
// txtEmpid.Clear();
txtAddress.Clear();
txtDob.Clear();
txtEmpName.Clear();
txtMoNo.Clear();
CmbEmpDesignation.Text = "";
cmbEmpStatus.SelectedIndex = -1;
cmbQualification.SelectedIndex = -1;
cmbSalary.Clear();
cmbEmpStatus.SelectedIndex = -1;
}
public void DgvShowEmpDetail()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
str = "Select * from TbleEmployeeDetail";
da = new OleDbDataAdapter(str, con);
ds = new DataSet();
dt = new DataTable();
da.Fill(dt);
dgvViewFee.DataSource = dt;
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void savefeDetailinfo()
{
try
{
if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part
Durgesh o level_2nd_part

More Related Content

Similar to Durgesh o level_2nd_part

Bright copy
Bright   copyBright   copy
Bright copy
Natasha Bains
 
Bright
BrightBright
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science Project
Ashwin Francis
 
CP_FINAL_PPT.pptx
CP_FINAL_PPT.pptxCP_FINAL_PPT.pptx
CP_FINAL_PPT.pptx
PARTHSHAH477682
 
OS Password-Manager-Report.docx
OS Password-Manager-Report.docxOS Password-Manager-Report.docx
OS Password-Manager-Report.docx
rinim85726
 
Online examination management system..pdf
Online examination management system..pdfOnline examination management system..pdf
Online examination management system..pdf
Kamal Acharya
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
Kamal Acharya
 
College Management System project
College Management System projectCollege Management System project
College Management System project
Manish Kushwaha
 
Preliminry report
 Preliminry report Preliminry report
Preliminry report
Jiten Ahuja
 
online news portal system
online news portal systemonline news portal system
online news portal system
Arman Ahmed
 
Project report
Project report Project report
Project report
MansiKulkarni18
 
Brilient login system
Brilient login systemBrilient login system
Brilient login system
vasanthvellore
 
Real Estate Management System in Vb.Net
Real Estate Management System in Vb.NetReal Estate Management System in Vb.Net
Real Estate Management System in Vb.Net
Nafis Shaikh
 
Project Documentation Student Management System format.pptx
Project Documentation Student Management System format.pptxProject Documentation Student Management System format.pptx
Project Documentation Student Management System format.pptx
AjayPatre1
 
Vade Meccum_Book reading and publishing software NetBeans.docx
Vade Meccum_Book reading and publishing software NetBeans.docxVade Meccum_Book reading and publishing software NetBeans.docx
Vade Meccum_Book reading and publishing software NetBeans.docx
GeetaShreeprabha
 
Documentation project of college management [1]
Documentation project of college management [1]Documentation project of college management [1]
Documentation project of college management [1]
Priyaranjan Verma
 
construction management system final year report
construction management system final year reportconstruction management system final year report
construction management system final year report
chiragbarasiya
 
Office automation system report
Office automation system reportOffice automation system report
Office automation system report
Amit Kulkarni
 
Office automation system report
Office automation system reportOffice automation system report
Office automation system report
Amit Kulkarni
 
Student report
Student reportStudent report
Student report
anuragsharma12nov
 

Similar to Durgesh o level_2nd_part (20)

Bright copy
Bright   copyBright   copy
Bright copy
 
Bright
BrightBright
Bright
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science Project
 
CP_FINAL_PPT.pptx
CP_FINAL_PPT.pptxCP_FINAL_PPT.pptx
CP_FINAL_PPT.pptx
 
OS Password-Manager-Report.docx
OS Password-Manager-Report.docxOS Password-Manager-Report.docx
OS Password-Manager-Report.docx
 
Online examination management system..pdf
Online examination management system..pdfOnline examination management system..pdf
Online examination management system..pdf
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
 
College Management System project
College Management System projectCollege Management System project
College Management System project
 
Preliminry report
 Preliminry report Preliminry report
Preliminry report
 
online news portal system
online news portal systemonline news portal system
online news portal system
 
Project report
Project report Project report
Project report
 
Brilient login system
Brilient login systemBrilient login system
Brilient login system
 
Real Estate Management System in Vb.Net
Real Estate Management System in Vb.NetReal Estate Management System in Vb.Net
Real Estate Management System in Vb.Net
 
Project Documentation Student Management System format.pptx
Project Documentation Student Management System format.pptxProject Documentation Student Management System format.pptx
Project Documentation Student Management System format.pptx
 
Vade Meccum_Book reading and publishing software NetBeans.docx
Vade Meccum_Book reading and publishing software NetBeans.docxVade Meccum_Book reading and publishing software NetBeans.docx
Vade Meccum_Book reading and publishing software NetBeans.docx
 
Documentation project of college management [1]
Documentation project of college management [1]Documentation project of college management [1]
Documentation project of college management [1]
 
construction management system final year report
construction management system final year reportconstruction management system final year report
construction management system final year report
 
Office automation system report
Office automation system reportOffice automation system report
Office automation system report
 
Office automation system report
Office automation system reportOffice automation system report
Office automation system report
 
Student report
Student reportStudent report
Student report
 

Recently uploaded

What’s New in VictoriaLogs - Q2 2024 Update
What’s New in VictoriaLogs - Q2 2024 UpdateWhat’s New in VictoriaLogs - Q2 2024 Update
What’s New in VictoriaLogs - Q2 2024 Update
VictoriaMetrics
 
Going AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applicationsGoing AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applications
Alina Yurenko
 
Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
sapnasaifi408
 
NLJUG speaker academy 2024 - session 1, June 2024
NLJUG speaker academy 2024 - session 1, June 2024NLJUG speaker academy 2024 - session 1, June 2024
NLJUG speaker academy 2024 - session 1, June 2024
Bert Jan Schrijver
 
Enhancing non-Perl bioinformatic applications with Perl
Enhancing non-Perl bioinformatic applications with PerlEnhancing non-Perl bioinformatic applications with Perl
Enhancing non-Perl bioinformatic applications with Perl
Christos Argyropoulos
 
SAP ECC & S4 HANA PPT COMPARISON MM.pptx
SAP ECC & S4 HANA PPT COMPARISON MM.pptxSAP ECC & S4 HANA PPT COMPARISON MM.pptx
SAP ECC & S4 HANA PPT COMPARISON MM.pptx
aneeshmanikantan2341
 
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsEnsuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
OnePlan Solutions
 
Introduction to Python and Basic Syntax.pptx
Introduction to Python and Basic Syntax.pptxIntroduction to Python and Basic Syntax.pptx
Introduction to Python and Basic Syntax.pptx
GevitaChinnaiah
 
What’s new in VictoriaMetrics - Q2 2024 Update
What’s new in VictoriaMetrics - Q2 2024 UpdateWhat’s new in VictoriaMetrics - Q2 2024 Update
What’s new in VictoriaMetrics - Q2 2024 Update
VictoriaMetrics
 
Refactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contextsRefactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contexts
Michał Kurzeja
 
Female Bangalore Call Girls 👉 7023059433 👈 Vip Escorts Service Available
Female Bangalore Call Girls 👉 7023059433 👈 Vip Escorts Service AvailableFemale Bangalore Call Girls 👉 7023059433 👈 Vip Escorts Service Available
Female Bangalore Call Girls 👉 7023059433 👈 Vip Escorts Service Available
isha sharman06
 
Erotic Call Girls Bangalore🫱9079923931🫲 High Quality Call Girl Service Right ...
Erotic Call Girls Bangalore🫱9079923931🫲 High Quality Call Girl Service Right ...Erotic Call Girls Bangalore🫱9079923931🫲 High Quality Call Girl Service Right ...
Erotic Call Girls Bangalore🫱9079923931🫲 High Quality Call Girl Service Right ...
meenusingh4354543
 
Happy Birthday Kubernetes, 10th Birthday edition of Kubernetes Birthday in Au...
Happy Birthday Kubernetes, 10th Birthday edition of Kubernetes Birthday in Au...Happy Birthday Kubernetes, 10th Birthday edition of Kubernetes Birthday in Au...
Happy Birthday Kubernetes, 10th Birthday edition of Kubernetes Birthday in Au...
Chad Crowell
 
Trailhead Talks_ Journey of an All-Star Ranger .pptx
Trailhead Talks_ Journey of an All-Star Ranger .pptxTrailhead Talks_ Journey of an All-Star Ranger .pptx
Trailhead Talks_ Journey of an All-Star Ranger .pptx
ImtiazBinMohiuddin
 
How GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdfHow GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdf
Zycus
 
High-Class Call Girls In Chennai 📞7014168258 Available With Direct Cash Payme...
High-Class Call Girls In Chennai 📞7014168258 Available With Direct Cash Payme...High-Class Call Girls In Chennai 📞7014168258 Available With Direct Cash Payme...
High-Class Call Girls In Chennai 📞7014168258 Available With Direct Cash Payme...
shoeb2926
 
Top Call Girls Lucknow ✔ 9352988975 ✔ Hi I Am Divya Vip Call Girl Services Pr...
Top Call Girls Lucknow ✔ 9352988975 ✔ Hi I Am Divya Vip Call Girl Services Pr...Top Call Girls Lucknow ✔ 9352988975 ✔ Hi I Am Divya Vip Call Girl Services Pr...
Top Call Girls Lucknow ✔ 9352988975 ✔ Hi I Am Divya Vip Call Girl Services Pr...
simmi singh$A17
 
Photo Copier Xerox Machine annual maintenance contract system.pdf
Photo Copier Xerox Machine annual maintenance contract system.pdfPhoto Copier Xerox Machine annual maintenance contract system.pdf
Photo Copier Xerox Machine annual maintenance contract system.pdf
SERVE WELL CRM NASHIK
 
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdfTheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
Ortus Solutions, Corp
 

Recently uploaded (20)

What’s New in VictoriaLogs - Q2 2024 Update
What’s New in VictoriaLogs - Q2 2024 UpdateWhat’s New in VictoriaLogs - Q2 2024 Update
What’s New in VictoriaLogs - Q2 2024 Update
 
Going AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applicationsGoing AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applications
 
Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
 
NLJUG speaker academy 2024 - session 1, June 2024
NLJUG speaker academy 2024 - session 1, June 2024NLJUG speaker academy 2024 - session 1, June 2024
NLJUG speaker academy 2024 - session 1, June 2024
 
Enhancing non-Perl bioinformatic applications with Perl
Enhancing non-Perl bioinformatic applications with PerlEnhancing non-Perl bioinformatic applications with Perl
Enhancing non-Perl bioinformatic applications with Perl
 
SAP ECC & S4 HANA PPT COMPARISON MM.pptx
SAP ECC & S4 HANA PPT COMPARISON MM.pptxSAP ECC & S4 HANA PPT COMPARISON MM.pptx
SAP ECC & S4 HANA PPT COMPARISON MM.pptx
 
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsEnsuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
 
Introduction to Python and Basic Syntax.pptx
Introduction to Python and Basic Syntax.pptxIntroduction to Python and Basic Syntax.pptx
Introduction to Python and Basic Syntax.pptx
 
What’s new in VictoriaMetrics - Q2 2024 Update
What’s new in VictoriaMetrics - Q2 2024 UpdateWhat’s new in VictoriaMetrics - Q2 2024 Update
What’s new in VictoriaMetrics - Q2 2024 Update
 
Refactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contextsRefactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contexts
 
Female Bangalore Call Girls 👉 7023059433 👈 Vip Escorts Service Available
Female Bangalore Call Girls 👉 7023059433 👈 Vip Escorts Service AvailableFemale Bangalore Call Girls 👉 7023059433 👈 Vip Escorts Service Available
Female Bangalore Call Girls 👉 7023059433 👈 Vip Escorts Service Available
 
Erotic Call Girls Bangalore🫱9079923931🫲 High Quality Call Girl Service Right ...
Erotic Call Girls Bangalore🫱9079923931🫲 High Quality Call Girl Service Right ...Erotic Call Girls Bangalore🫱9079923931🫲 High Quality Call Girl Service Right ...
Erotic Call Girls Bangalore🫱9079923931🫲 High Quality Call Girl Service Right ...
 
bgiolcb
bgiolcbbgiolcb
bgiolcb
 
Happy Birthday Kubernetes, 10th Birthday edition of Kubernetes Birthday in Au...
Happy Birthday Kubernetes, 10th Birthday edition of Kubernetes Birthday in Au...Happy Birthday Kubernetes, 10th Birthday edition of Kubernetes Birthday in Au...
Happy Birthday Kubernetes, 10th Birthday edition of Kubernetes Birthday in Au...
 
Trailhead Talks_ Journey of an All-Star Ranger .pptx
Trailhead Talks_ Journey of an All-Star Ranger .pptxTrailhead Talks_ Journey of an All-Star Ranger .pptx
Trailhead Talks_ Journey of an All-Star Ranger .pptx
 
How GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdfHow GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdf
 
High-Class Call Girls In Chennai 📞7014168258 Available With Direct Cash Payme...
High-Class Call Girls In Chennai 📞7014168258 Available With Direct Cash Payme...High-Class Call Girls In Chennai 📞7014168258 Available With Direct Cash Payme...
High-Class Call Girls In Chennai 📞7014168258 Available With Direct Cash Payme...
 
Top Call Girls Lucknow ✔ 9352988975 ✔ Hi I Am Divya Vip Call Girl Services Pr...
Top Call Girls Lucknow ✔ 9352988975 ✔ Hi I Am Divya Vip Call Girl Services Pr...Top Call Girls Lucknow ✔ 9352988975 ✔ Hi I Am Divya Vip Call Girl Services Pr...
Top Call Girls Lucknow ✔ 9352988975 ✔ Hi I Am Divya Vip Call Girl Services Pr...
 
Photo Copier Xerox Machine annual maintenance contract system.pdf
Photo Copier Xerox Machine annual maintenance contract system.pdfPhoto Copier Xerox Machine annual maintenance contract system.pdf
Photo Copier Xerox Machine annual maintenance contract system.pdf
 
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdfTheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
 

Durgesh o level_2nd_part

  • 1. 4 | P a g e PREFACE The computer world has undergone a revolution since the invention of C# .NET language. C# .NET is called High Level Language. Our project word has been designed in c# .NET . The project “School Management System” handle tasks at the single instruction of the user with done so much effort. The approach of project designing is very simple, lucid and comprehensive, which results in a very sophisticated project. We hope that our project will work very easily and efficient. We do our best to complete this project. Today’s commercial world is built around money. Every commercial transaction needs to be supported using a financial transaction. Traditional procedure for maintaining, records using Ledgers, Day Book etc. is very timer consuming and may lead to error if not performed carefully. Keeping in mind that today in School world is built around management, and all the systems going on computerized, so I have made an effort automate the School System by developing a small package. “SMS” is developed using C# .NET, ADO.NET, Crystal Report and MS ACCESS 2010. C# .NET is used as front-end for the following reason: * C#.NET is flexible * C# .NET supports has Common Language Report (CLR) feature. * Structured programming language The Project has used MS ACCESS 2010 as back-end for database management. MS ACCESS provides more handy and safe database management tools.
  • 2. 5 | P a g e INTRODUCTION About The Project : School Management is the important and hence are an integral part of the every school. Today a Every school management plays a vital role in fee and management related actions. The project entitled “School Management System” is and effort towards designing an information system that would provide most of the requirements of a managing the school efficiently. The project has been designed using the MS ACCESS 2010 Database Management System. MS ACCESS 2010 is an RDBMS, It uses the relational we have used the concept of the relations to stored and manipulate the data of the information system. Physically these relations have been stored in form of the tables. Corresponding to each entitle and the relationships we have a database table. These tables contain the columns as the fields of table. Further, each column have some attributes such as data types, size, default values etc. which defines and validate the data. In the design “School Management System” we have exploited the rich facilities (tools) of c#.NET. C#.NET is Microsoft’s strategic language for Rapid Application Development (RAD) and its also have feature of Common Language Runtime(CLR). It is easy to use, efficient, flexible and more powerful for developing a Database related programming as well as Net programming. I prefer this language because one can build a Windows program quicker and with less effort with C#.NET than with any other programming language. It’s is natural language for building database applications, owing to the level and sophistication of the tools included with the language.
  • 3. 6 | P a g e We have used C#.NET for designing the data entry screens corresponding to each table. These forms have been further customized using the toolstrip button, option button, datagrid, Datetime picker and functions to provide the functionality to make them as user friendly and easy to use as possible. We are providing the data retrieval and the data manipulation task a matter by clicking the desire buttons and the result of the task mentioned on button would be displayed on the screen. We designed reports that would request the users parameter and provide the result based on the query define the data model of the report and the parameter passed by the users. These objectives have been achieved using the form. Various forms have been used to design the screen and these screens have been used along with the coded buttons to integrate objects.
  • 4. 7 | P a g e OBJECTIVES The main objective of the project entitled “School Management System” is to facilitate reliable, fast and easy information of students,Fee Details, Employee Entry,Vehicle Entry with Day book on single keystroke. In this I am trying to facilitates the School services of the Management System is fully computerized. The main objective of my project is to reduce complexities to traditional work and facilitate them through computerized services. The primary goal behind the development of the “School Mangement System” is to improve the quality of the work in the school .It increases the Easiness and maintain the records of staffs. The secondary goals was to achieve better and efficient output in less amount of time, and finally to increase the profits. There is also a mechanism of quick detail of every student with their fee receipt generation and day Book support. Management of School Services is main objective in this project. Everything has been automatised for this purpose. A paperless office will be there. The software should be user friendly, easily understandable to the user, flexible and further modification should be possible in future.
  • 5. 8 | P a g e SYSTEM STUDY Analysis: I had to undertake a logical and proficient analysis to scrutinize the feasibility of the project.The types of considerations that were taken were economical, technical and resource wise. The resources like the users who will operate the computer, were thoroughly studied ensure total compatibility with the objectives of the project. An effort was made to make the School Management efficient in all type of day to day Fee Related Transactions. Existing System with Limitations: The existing system has a manual work system. The manual works system takes more time and then it may also be possible that the system has errors. The manual systems work is very slow, has emotions, tiredness and some other problems. The existing “Manual School Management” has many limitations. It takes a reasonable time to search a particular fees in account ledger and takes reasonable time in checking, updating various activities. Major problem faced during fee deposition if the user do not entry his receipt. Proposed System with Objectives: The approach adopted in “School Management” system is very simple, lucid, comprehensive, and user friendly. The proposed system can efficiently handle all the tasks as keeping the record of the student and it’s through different sides. This task can be efficiently handled at the single instruction of the user without taking more time, which on the become very hazardous when done manually. The Menu’s have been so easily defined one within the other so that there is no difficulty in understanding it. It is very sophisticated software and can be used by any School to store their information in an efficient manner and we hope that it will be of great help to them. This project has been designed to reduce the manual work.
  • 6. 9 | P a g e Design: The prototype was iteratively enhanced. Each new enhanced prototype was sought to be more powerful and robust. The process of constant enhancement was carried out until the Project Guide and some other concerning persons were fully satisfied with the system design in hand. After the analysis of the project, the most creative phase of the project was commenced, that of the designing. The designing dealt with the conception of system designs that are to be implemented to execute the project. Data Flow drawings were doesn’t to define the accurate glow of DATA. After various rounds of discussion and arguments the design was finalized. Implementation : The next stage, that of implementation dealt with the synergizing of the System design and application of the various technical tools. The final prototype that was designed was coded in the tools, most convenient, powerful and glexible for the implementation of the various modules. Various modules were codec very carefully only after considering every conditions and cases that may affect the functionality of the module. Online help comprising of MSDN provides a valuable help in coding. Debugging: After successfully coding the individual modules, all the modules were cross checked. The debugging was performed to ensure that no software bugs existed. Debugging is recursively performed until the newly designed system resembles the proposed system. Ite was ensure that all the modules were logically and syntactically correctly codec. During debugging, the entire module combined together by systematically checking and correcting the modules one at a time.
  • 7. 10 | P a g e Deployment & System Testing: The Phase of deployment and system testing involved the task of the linking of all the individual modules to establish the actual and complete project. The system testing involved string testing(to check the compatibility of the modules with one another to establish integration). Overall testing (validation of system against failures) and ensurence to the original project guidelines. Any discrepancy found was immediately removed and all the testing were undertaken once more to establish System Credibility. The Project – Guide was demonstrated the project and all his challenging enquiries were fully satisfied.
  • 8. 11 | P a g e Hardware & Software Requirements:- Hardware Configuration: (Recommended) Processor : Dual Core Main Memory : 1024 MB RAM Hard Disk Capacity : 80 GB Compact Disk Drive : 650 MB Monitor : SVGA Keyboard : At 104 Keyboard Software Configuration: Operating System : Windows 7/8/10 Front-End : C# .NET Back-End : MS ACCESS 2010
  • 9. 12 | P a g e C#.Net The .NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet. The .NET Framework is designed to fulfill the following objectives: To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet- distributed, or executed remotely. To provide a code-execution environment that minimizes software deployment and versioning conflicts. To provide a code-execution environment that guarantees safe execution of code, including code created by an unknown or semi-trusted third party. To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments. To make the developer experience consistent across widely varying types of applications, such as Windows-based applications and Web-based applications. To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code. The .NET Framework has two main components: the common language runtime and the .NET Framework class library. The common language runtime is the foundation of the .NET Framework. You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness. In fact, the concept of code management is a fundamental principle of
  • 10. 13 | P a g e the runtime. Code that targets the runtime is known as managed code, while code that does not target the runtime is known as unmanaged code. The class library, the other main component of the .NET Framework, is a comprehensive, object-oriented collection of reusable types that you can use to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest innovations provided by the following sections describe the main components and features of the .NET Framework in greater detail. Features of the Common Language Runtime The common language runtime manages memory, thread execution, code execution, code safety verification, compilation, and other system services. These features are intrinsic to the managed code that runs on the common language runtime. With regards to security, managed components are awarded varying degrees of trust, depending on a number of factors that include their origin (such as the Internet, enterprise network, or local computer). This means that a managed component might or might not be able to perform file-access operations, registry- access operations, or other sensitive functions, even if it is being used in the same active application. The runtime enforces code access security. For example, users can trust that an executable embedded in a Web page can play an animation on screen or sing a song, but cannot access their personal data, file system, or network. The security features of the runtime thus enable legitimate Internet-deployed software to be exceptionally feature rich.
  • 11. 14 | P a g e ADO.NET ADO.NET provides consistent access to data sources such as Microsoft SQL Server,MS ACCESS as well as data sources exposed through OLE DB and XML. Data- sharing consumer applications can use ADO.NET to connect to these data sources and retrieve, manipulate, and update data. ADO.NET cleanly factors data access from data manipulation into discrete components that can be used separately or in tandem. ADO.NET includes .NET Framework data providers for connecting to a database, executing commands, and retrieving results. Those results are either processed directly, or placed in an ADO.NET DataSet object in order to be exposed to the user in an ad-hoc manner, combined with data from multiple sources, or remoted between tiers. The ADO.NET DataSet object can also be used independently of a .NET Framework data provider to manage data local to the application or sourced from XML. The ADO.NET classes are found in System.Data.dll, and are integrated with the XML classes found in System.Xml.dll. When compiling code that uses the System.Data namespace, reference both System.Data.dll and System.Xml.dll. For an example of compiling an ADO.NET application using a command line compiler. ADO.NET provides functionality to developers writing managed code similar to the functionality provided to native COM developers by ADO. In my software, I have been uses OLEDB data connection object class of ADO.NET. By the feature of having “Provider” property of OLEDB its is easier to connect any database plateform to your application. With the OLEDB we can very easily transit all the the transactions as per our requirement.
  • 12. 15 | P a g e Crystal report Crystal Reports is a report design tool that allows you to create reports capable of retrieving and formatting a result set from a database of other data source. In addition to simply reading data from a data source, Crystal Reports has its own formula language `for creating calculations and includes a number of features that can be used to turn raw data into presentation- quality reports, with graphs, charts, running totals, and so on. Crystal Reports .NET includes and integrated Report Designer available within the Visual Studio IDE that you can use to create report files (. rpt) to integrate with your application. This Report Designer features a number of experts to help you get started creating reports. It will guide you thorugh the report development process, from selecting ad data source dn the field that will appear on your report, to determining what records should appear.
  • 13. 16 | P a g e DATA FLOW Diagram 0 Level DFD 1 Level DFD
  • 14. 17 | P a g e Table Structure 1. Table Name - TbleLogin Primary Key - UserId1 2. Table Name - StudentInfo Primary Key - EnrollInfo Column Name Data Type UserId1 Number Username1 Text Password1 Text Column Name Data Type EnrollInfo Number StudentName Text FathersName Text DOB Date/Time Admission Text Class Text Transport Required Text TransportFee Number
  • 15. 18 | P a g e 3. Table Name - TbleEmployeeDetail Primary Key - EmpId 4. Table Name - TbleEmployeeSalary Primary Key - PaySlipRefNo Column Name Data Type EmpId Number EmpName Text EmpDob Text EmpDesignation Text EmpAddress Text EmpMo Text EmpStatus Text EmpQualification Text RecordDate Text EmpSalary Number Column Name Data Type PayslipRefNo Number Empid Number RecordDate Text EmpSalart Number MonthOf Text PayBegDate Text PayendDate Text PayType Text Absent Text NOWD Number Description Text TSAD Number
  • 16. 19 | P a g e 5. Table Name - TbleFeeEntry Primary Key - ReceiptNo. Column Name Data Type ReceiptNo Number BillNo Number EnrollmentId Number StudentName Text FromDate Text ToDate Text TuitionFee Number NOM Number RegFee Number TransportFee Number ExamFee Number Fine Number AmeCharge Number OtherFee Number Description Text TotalAmount Number PaidAmount Number DueAmount Number EntryLoggedBy Text
  • 17. 20 | P a g e 6. Table Name - TbleEmployeeSalary Primary Key - PaySlipRefNo 7. Table Name - TbleSalesVoucher Primary Key - ID Column Name Data Type PayslipRefNo Number Empid Number RecordDate Text EmpSalart Number MonthOf Text PayBegDate Text PayendDate Text PayType Text Absent Text NOWD Number Description Text TSAD Number Column Name Data Type ID AutoNumber SalesVoucherNo Number SubmissionDate Text BillNo Number NameParty Text Quantity Number PayabaleAmount Number DueAmount Number NetAmount Number
  • 18. 21 | P a g e 8. Table Name - TbleSalesVoucherDetail Primary Key - ___________________ 9. Table Name - TbleTpSetup Primary Key - VehicleId 10. Table Name - TbleVehDayBook Primary Key - Entry_Id Column Name Data Type ID AutoNumber SalesVoucherNo Number BookName Text Quantity Number Rate Number Amount Number Column Name Data Type Vehicle ID Number VehicleName Text VehicleNo Text DriverName Text DriverDLNo Text DriverAddress Text DriverMobile Text Column Name Data Type Entry_Id Number Driver_Name Text Vehicle_No Text Paid_Amount Number Date_Issue Date/Time Description Text
  • 19. 22 | P a g e 11. Table Name - TbleLogData Primary Key - LogId 12. Table Name - TbleBookMaster Primary Key - BookId Column Name Data Type LogId Number UserName1 Text Role Text Logintime Text LogOutTime Text Column Name Data Type BookName Text BookCategory Text Quantity Number Rate Number Class Text
  • 20. 23 | P a g e
  • 21. 24 | P a g e Main Login Form Main Menu Form
  • 22. 25 | P a g e Authorization Form Admission Form
  • 23. 26 | P a g e Fee Entry Form DayWise Report Form
  • 24. 27 | P a g e Employee Detail Form Certificate Feeding Form
  • 25. 28 | P a g e Book Stock Entry Form Book Sales Entry Form
  • 26. 29 | P a g e Vehicle Master Entry Form Vehicle Day Book Entry Form
  • 27. 30 | P a g e
  • 28. 31 | P a g e Authorization Module using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.OleDb; using Excel = Microsoft.Office.Interop.Excel; namespace FeeEntrySystem { public partial class FrmMaintainLogin : Form { OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha"); OleDbCommand cmd; OleDbDataAdapter da; //OleDbDataReader dr; DataSet ds; DataTable dt; string str; public FrmMaintainLogin() { InitializeComponent(); } private void label5_Click(object sender, EventArgs e) { } private void textBox3_TextChanged(object sender, EventArgs e) { if (txtCnfPassword.Text == txtPassword.Text) { //label6.Text = "Password Matched"; } else { // label6.Text = ""; } } private void txtUserName_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtPassword.Focus(); } } private void txtPassword_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtCnfPassword.Focus(); } }
  • 29. 32 | P a g e private void AutoIdGenerate() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); // int i=0; string query = "SELECT max(UserId1)+1 from TbleLogin "; cmd = new OleDbCommand(); cmd.CommandText = query; cmd.Connection = con; textBox1.Text = cmd.ExecuteScalar().ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void Savelogin() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Insert into TbleLogin(UserId1,UserName1,Password1,Role)values(" + textBox1.Text.Trim() + ",'" + txtUserName.Text.Trim() + "','" + txtPassword.Text.Trim() + "','"+cmbrole1.Text+"')"; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Login Data Saved Successfully......"); } catch (Exception ex) { MessageBox.Show(ex.Message); txtUserName.Clear(); txtPassword.Clear(); txtCnfPassword.Clear(); txtUserName.Focus(); } } private void updateLogin() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Update TbleLogin set UserName1='" + txtUserName.Text.Trim() + "',Password1='" + txtPassword.Text.Trim() + "',Role='"+cmbrole1.Text+"' where UserId1=" + textBox1.Text.Trim() + ""; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void gridLogCheckData() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Select * from TblLogData"; da = new OleDbDataAdapter(str, con);
  • 30. 33 | P a g e ds = new DataSet(); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; con.Close(); dataGridView1.Columns[0].HeaderText = "Log Id"; dataGridView1.Columns[1].HeaderText = "User Name"; dataGridView1.Columns[3].HeaderText = "Log In Time"; dataGridView1.Columns[4].HeaderText = "Log Out Time"; } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void CheckDuplicateUser() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); cmd=new OleDbCommand("SELECT UserName1 from TbleLogin where UserName1='"+txtUserName.Text.Trim()+"'",con); OleDbDataReader dr = cmd.ExecuteReader(); cmd.Dispose(); if (dr.HasRows == true) { dr.Read(); MessageBox.Show("User Name Already Exist...", "Try Again"); txtUserName.Clear(); txtUserName.Focus(); return; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void FrmMaintainLogin_Load(object sender, EventArgs e) { gridLogCheckData(); gridLoginData(); AutoIdGenerate(); } private void gridLoginData() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Select * from TbleLogin"; da = new OleDbDataAdapter(str, con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); dgvLoginView.DataSource = dt; con.Close(); dgvLoginView.Columns[0].HeaderText = "User Sr. No."; dgvLoginView.Columns[1].HeaderText = "User Name"; dgvLoginView.Columns[2].HeaderText = "Password"; dgvLoginView.Columns[3].HeaderText = "Job Role "; } catch (Exception ex) { MessageBox.Show(ex.Message);
  • 31. 34 | P a g e } } private void toolStripButton1_Click(object sender, EventArgs e) { if (txtUserName.Text == "") { MessageBox.Show("Username-Required Field..."); txtUserName.Focus(); return; } else if (txtPassword.Text == "") { MessageBox.Show("Password-Required Field..."); txtPassword.Focus(); return; } else if (txtCnfPassword.Text == "") { MessageBox.Show("Confirm Password Required"); txtCnfPassword.Focus(); return; } else if (txtCnfPassword.Text != txtPassword.Text) { MessageBox.Show("Field Must Be Matchable..."); txtPassword.Clear(); txtCnfPassword.Clear(); txtPassword.Focus(); } else if (cmbrole1.Text == "") { MessageBox.Show("Role Initialization Required"); cmbrole1.Focus(); return; } else { Savelogin(); AutoIdGenerate(); resetControl(); gridLoginData(); } } private void resetControl() { txtUserName.Clear(); txtPassword.Clear(); txtCnfPassword.Clear(); } private void txtCnfPassword_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { cmbrole1.Focus(); } } private void dgvLoginView_AllowUserToAddRowsChanged(object sender, EventArgs e) { } private void dgvLoginView_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex >= 0)
  • 32. 35 | P a g e { DataGridViewRow row = dgvLoginView.Rows[e.RowIndex]; textBox1.Text = row.Cells[0].Value.ToString(); txtUserName.Text = row.Cells[1].Value.ToString(); txtPassword.Text = row.Cells[2].Value.ToString(); txtCnfPassword.Text = row.Cells[2].Value.ToString(); cmbrole1.Text = row.Cells[3].Value.ToString(); } tsSaveLogin.Enabled = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void toolStripButton2_Click(object sender, EventArgs e) { if (txtUserName.Text == "") { MessageBox.Show("Username-Required Field..."); txtUserName.Focus(); return; } else if (txtPassword.Text == "") { MessageBox.Show("Password-Required Field..."); txtPassword.Focus(); return; } else if (txtCnfPassword.Text == "") { MessageBox.Show("Confirm Password Required"); txtCnfPassword.Focus(); return; } else if (txtCnfPassword.Text != txtPassword.Text) { MessageBox.Show("Field Must Be Matchable..."); txtPassword.Clear(); txtCnfPassword.Clear(); txtPassword.Focus(); } else if (cmbrole1.Text == "") { MessageBox.Show("Role Initialization Required"); cmbrole1.Focus(); return; } else { updateLogin(); AutoIdGenerate(); resetControl(); gridLoginData(); tsSaveLogin.Enabled = true; } } private void deleteInfo() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); if (MessageBox.Show(" Do you want to Delete?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
  • 33. 36 | P a g e { str = "Delete from TbleLogin where UserId1=" + textBox1.Text.Trim() + ""; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Data Deleted Successfully"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void toolStripButton3_Click(object sender, EventArgs e) { deleteInfo(); AutoIdGenerate(); txtUserName.Clear(); txtCnfPassword.Clear(); txtPassword.Clear(); txtUserName.Focus(); } private void cmbrole1_Leave(object sender, EventArgs e) { int index = cmbrole1.FindString(cmbrole1.Text); if (index < 0) { MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbrole1.Focus(); cmbrole1.Text = ""; return; } } private void cmbrole1_KeyPress(object sender, KeyPressEventArgs e) { if(e.KeyChar==13) { tsSaveLogin.PerformClick(); } } private void btnlog_Click(object sender, EventArgs e) { int rowsTotal = 0; int colsTotal = 0; int I = 0; int j = 0; int iC = 0; System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; Excel.Application xlApp = new Excel.Application(); try {
  • 34. 37 | P a g e Excel.Workbook excelBook = xlApp.Workbooks.Add(); Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelBook.Worksheets[1]; xlApp.Visible = true; rowsTotal = dataGridView1.RowCount - 1; colsTotal = dataGridView1.Columns.Count - 1; var _with1 = excelWorksheet; _with1.Cells.Select(); _with1.Cells.Delete(); for (iC = 0; iC <= colsTotal; iC++) { _with1.Cells[1, iC + 1].Value = dataGridView1.Columns[iC].HeaderText; } for (I = 0; I <= rowsTotal; I++) { for (j = 0; j <= colsTotal; j++) { _with1.Cells[I + 2, j + 1].value = dataGridView1.Rows[I].Cells[j].Value; } } _with1.Rows["1:1"].Font.FontStyle = "Bold"; _with1.Rows["1:1"].Font.Size = 12; _with1.Cells.Columns.AutoFit(); _with1.Cells.Select(); _with1.Cells.EntireColumn.AutoFit(); _with1.Cells[1, 1].Select(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { //RELEASE ALLOACTED RESOURCES System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; xlApp = null; } } private void txtUserName_Leave(object sender, EventArgs e) { CheckDuplicateUser(); } } }
  • 35. 38 | P a g e Admission Module using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.OleDb; namespace FeeEntrySystem { public partial class FrmAddmission : Form { OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha"); OleDbCommand cmd; OleDbDataAdapter da; DataSet ds; DataTable dt; string str; public FrmAddmission() { InitializeComponent(); } public void dgvAddmissionView1() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Select * from StudentInfo where EnrollInfo=" + txtEnroll.Text + ""; da = new OleDbDataAdapter(str, con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); dgvFeeDetailView.DataSource = dt; con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } public void dgvAddmissionView12() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Select * from StudentInfo"; da = new OleDbDataAdapter(str, con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); dgvFeeDetailView.DataSource = dt; con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); }
  • 36. 39 | P a g e } private void resetinfo() { txtEnroll.Clear(); txtStudentName.Clear(); txtFathersName.Clear(); txtAddmissiondate.Clear(); cmbClass.Text = ""; txtFee.Clear(); cmbTpRequired.SelectedIndex =1; txtLastSchoolAttend.Clear(); txtMobileNo.Clear(); txtEnroll.Focus(); } private void validateEnrollment() { } private void updateInfo() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Update StudentInfo set StudentName='" + txtStudentName.Text.Trim() + "',FathersName='" + txtFathersName.Text.Trim() + "',DOB='" + dateTimePicker1.Value + "',AddmissionDate='" + txtAddmissiondate.Text.Trim() + "',Class='" + cmbClass.Text + "',Fee=" + txtFee.Text + ",TranspRequired='" + cmbTpRequired.Text + "',TransportFee=" + txtTpAmount.Text + ",MobileNo='" + txtMobileNo.Text + "',LSA='"+txtLastSchoolAttend.Text+"' where Enrollinfo=" + txtEnroll.Text + ""; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Your Data Updated....","Information"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void saveinfo() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Insert into StudentInfo(EnrollInfo,StudentName,FathersName,DOB,AddmissionDate,Class,Fee,TranspRequired, TransportFee,MobileNo,LSA)values(" + txtEnroll.Text.Trim() + ",'" + txtStudentName.Text.Trim() + "','" + txtFathersName.Text.Trim() + "','" + dateTimePicker1.Value + "','" + txtAddmissiondate.Text.Trim() + "','" + cmbClass.Text + "'," + txtFee.Text + ",'" + cmbTpRequired.Text.Trim() + "'," + txtTpAmount.Text + ",'" + txtMobileNo.Text.Trim() + "','" + txtLastSchoolAttend.Text + "')"; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Details Saved Successfully......"); resetinfo(); txtEnroll.Focus(); dgvAddmissionView12(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally {
  • 37. 40 | P a g e con.Close(); } } private void TsEnrollment_Click(object sender, EventArgs e) { if (txtEnroll.Text == "") { MessageBox.Show("Enrollment Required"); txtEnroll.Focus(); return; } if (txtStudentName.Text == "") { MessageBox.Show("Student Name Required...."); txtStudentName.Focus(); return; } else if (txtFathersName.Text == "") { MessageBox.Show("Father Name Required...."); txtFathersName.Focus(); return; } else if (txtAddmissiondate.Text == "") { MessageBox.Show("Addmission Date Required..."); txtAddmissiondate.Focus(); return; } else if (cmbClass.Text == "") { MessageBox.Show("Course Required......."); cmbClass.Focus(); return; } else if (txtFee.Text == "") { MessageBox.Show("Fee Submission Compulsory..."); txtFee.Focus(); return; } else if(cmbTpRequired.Text=="") { MessageBox.Show("Transport Status Required....."); cmbTpRequired.Focus(); return; } else if (txtTpAmount.Text == "") { MessageBox.Show("Transport Amount Required....."); txtTpAmount.Focus(); return; } else if (txtMobileNo.Text == "") { MessageBox.Show("Mobile No Required....."); txtTpAmount.Focus(); return; } else if (txtLastSchoolAttend.Text == "") { MessageBox.Show("LSA Record Required....."); txtTpAmount.Focus(); return; } else {
  • 38. 41 | P a g e saveinfo(); ROWCOUNT(); } } private void deleteinfo() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); if (MessageBox.Show(" Do you want to Delete?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { str = "Delete from StudentInfo where EnrollInfo=" + txtEnroll.Text + ""; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Data Deleted Successfully"); ROWCOUNT(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void ROWCOUNT() { int i; for (i = 0; i < dgvFeeDetailView.Rows.Count; i++) { toolStripTextBox1.Text = Convert.ToString(dgvFeeDetailView.Rows.Count); } } private void FrmAddmission_Load(object sender, EventArgs e) { cmbTpRequired.SelectedIndex = 1; dgvAddmissionView12(); ROWCOUNT(); } private void txtStudentName_Leave(object sender, EventArgs e) { } private void cmbClass_Leave(object sender, EventArgs e) { int index = cmbClass.FindString(cmbClass.Text); if (index < 0) { MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbClass.Focus(); cmbClass.Text = ""; return; } } private void txtEnroll_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) {
  • 39. 42 | P a g e txtStudentName.Focus(); } // dgvAddmissionView1(); } private void txtStudentName_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtFathersName.Focus(); } } private void txtFathersName_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { dateTimePicker1.Focus(); } } private void dateTimePicker1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { txtAddmissiondate.Focus(); } } private void txtAddmissiondate_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { cmbClass.Focus(); } } private void cmbCourse_KeyPress(object sender, KeyPressEventArgs e) { } private void txtFee_KeyPress(object sender, KeyPressEventArgs e) { if ((!char.IsControl(e.KeyChar)) && (!char.IsDigit(e.KeyChar))) { e.Handled = true; } base.OnKeyPress(e); if (e.KeyChar == 13) { cmbTpRequired.Focus(); } } private void txtAffiliatedto_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13)
  • 40. 43 | P a g e { txtMobileNo.Focus(); } } private void dgvAddmissionView_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex >= 0) { DataGridViewRow row = dgvFeeDetailView.Rows[e.RowIndex]; txtEnroll.Text = row.Cells[0].Value.ToString(); txtStudentName.Text = row.Cells[1].Value.ToString(); txtFathersName.Text = row.Cells[2].Value.ToString(); dateTimePicker1.Text = row.Cells[3].Value.ToString(); txtAddmissiondate.Text = row.Cells[4].Value.ToString(); cmbClass.Text = row.Cells[5].Value.ToString(); txtFee.Text = row.Cells[6].Value.ToString(); cmbTpRequired.Text = row.Cells[7].Value.ToString(); txtTpAmount.Text = row.Cells[8].Value.ToString(); txtMobileNo.Text = row.Cells[9].Value.ToString(); txtLastSchoolAttend.Text = row.Cells[10].Value.ToString(); txtEnroll.Focus(); } TsEnrollment.Enabled = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void TsEdit_Click(object sender, EventArgs e) { if (txtEnroll.Text == "") { MessageBox.Show("Enrollment Required"); txtEnroll.Focus(); return; } if (txtStudentName.Text == "") { MessageBox.Show("Student Name Required...."); txtStudentName.Focus(); return; } else if (txtFathersName.Text == "") { MessageBox.Show("Father Name Required...."); txtFathersName.Focus(); return; } else if (txtAddmissiondate.Text == "") { MessageBox.Show("Addmission Date Required..."); txtAddmissiondate.Focus(); return; } else if (cmbClass.Text == "") {
  • 41. 44 | P a g e MessageBox.Show("Course Required......."); cmbClass.Focus(); return; } else if (txtFee.Text == "") { MessageBox.Show("Fee Submission Compulsory..."); txtFee.Focus(); return; } else if (cmbTpRequired.Text == "") { MessageBox.Show("Transport Status Required....."); cmbTpRequired.Focus(); return; } else if (txtTpAmount.Text == "") { MessageBox.Show("Transport Amount Required....."); txtTpAmount.Focus(); return; } else if (txtMobileNo.Text == "") { MessageBox.Show("Mobile No Required....."); txtTpAmount.Focus(); return; } else if (txtLastSchoolAttend.Text == "") { MessageBox.Show("LSA Record Required....."); txtTpAmount.Focus(); return; } else { updateInfo(); dgvAddmissionView12(); ROWCOUNT(); resetinfo(); txtEnroll.Focus(); TsEnrollment.Enabled = true; } } private void TsDelete_Click(object sender, EventArgs e) { if (txtEnroll.Text == "") { MessageBox.Show("Enrollment Required"); txtEnroll.Focus(); return; } if (txtStudentName.Text == "") { MessageBox.Show("Student Name Required...."); txtStudentName.Focus(); return; } else if (txtFathersName.Text == "") { MessageBox.Show("Father Name Required...."); txtFathersName.Focus(); return;
  • 42. 45 | P a g e } else if (txtAddmissiondate.Text == "") { MessageBox.Show("Addmission Date Required..."); txtAddmissiondate.Focus(); return; } else if (cmbClass.Text == "") { MessageBox.Show("Course Required......."); cmbClass.Focus(); return; } else if (txtFee.Text == "") { MessageBox.Show("Fee Submission Compulsory..."); txtFee.Focus(); return; } else if (cmbTpRequired.Text == "") { MessageBox.Show("Transport Status Required....."); cmbTpRequired.Focus(); return; } else if (txtTpAmount.Text == "") { MessageBox.Show("Transport Amount Required....."); txtTpAmount.Focus(); return; } else if (txtMobileNo.Text == "") { MessageBox.Show("Mobile No Required....."); txtTpAmount.Focus(); return; } else if (txtLastSchoolAttend.Text == "") { MessageBox.Show("LSA Record Required....."); txtTpAmount.Focus(); return; } else { deleteinfo(); dgvAddmissionView1(); ROWCOUNT(); resetinfo(); txtEnroll.Focus(); TsEnrollment.Enabled = true; } } private void txtEnroll_Enter(object sender, EventArgs e) { dgvAddmissionView12(); } private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if ((!char.IsControl(e.KeyChar)) && (!char.IsDigit(e.KeyChar))) { e.Handled = true;
  • 43. 46 | P a g e } base.OnKeyPress(e); if (e.KeyChar == 13) { txtLastSchoolAttend.Focus(); } } private void toolStripTextBox2_TextChanged(object sender, EventArgs e) { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); da = new OleDbDataAdapter("Select * from StudentInfo where StudentName like '" + toolStripTextBox2.Text + "%'", con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); dgvFeeDetailView.DataSource = dt; con.Close(); } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { //txtAffiliatedto.Text = comboBox1.Text; } private void cmbCourse_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { txtFee.Focus(); } } private void cmbTpRequired_Leave(object sender, EventArgs e) { int index = cmbTpRequired.FindString(cmbTpRequired.Text); if (index < 0) { MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbTpRequired.Focus(); cmbTpRequired.Text = ""; return; } } private void cmbTpRequired_SelectedIndexChanged(object sender, EventArgs e) { if (cmbTpRequired.SelectedItem.ToString() == "YES") { txtTpAmount.Enabled = true; txtTpAmount.Focus(); txtTpAmount.SelectAll(); } else { int a = 0; txtTpAmount.Text = a.ToString(); txtTpAmount.Enabled = false; } }
  • 44. 47 | P a g e private void cmbTpRequired_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (cmbTpRequired.SelectedItem.ToString()=="NO") { txtMobileNo.Focus(); } } } private void txtTpAmount_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtMobileNo.Focus(); } } private void txtLastSchoolAttend_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { if (TsEnrollment.Enabled == true) { TsEnrollment.PerformClick(); } else { TsEdit.PerformClick(); } } } private void TsReset_Click(object sender, EventArgs e) { resetinfo(); } private void button1_Click(object sender, EventArgs e) { try { var _with1 = openFileDialog1; _with1.Filter = ("Image Files |*.png; *.bmp; *.jpg;*.jpeg; *.gif;"); _with1.FilterIndex = 4; //Reset the file name openFileDialog1.FileName = ""; if (openFileDialog1.ShowDialog() == DialogResult.OK) { pictureBox1.Image = Image.FromFile(openFileDialog1.FileName); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
  • 45. 48 | P a g e Fee Entry Module- Fee Entry Form using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.OleDb; namespace FeeEntrySystem { public partial class FrmFee : Form { OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha"); OleDbCommand cmd; OleDbDataAdapter da; //OleDbDataReader dr; DataSet ds; DataTable dt; string str; public FrmFee() { InitializeComponent(); } private void ReceiptAutoGenerate() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); // int i=0; string query = "SELECT max(ReceiptNo)+1 from TbleFeeEntry "; cmd = new OleDbCommand(); cmd.CommandText = query; cmd.Connection = con; txtReceiptNo.Text= cmd.ExecuteScalar().ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void BillAutoGenerate() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); string query = "SELECT max(BillNo)+1 from TbleFeeEntry "; cmd = new OleDbCommand(); cmd.CommandText = query; cmd.Connection = con; txtBillNo.Text = cmd.ExecuteScalar().ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void CmbEnrollmentFill() {
  • 46. 49 | P a g e try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); string str = "Select * From StudentInfo"; OleDbDataAdapter da = new OleDbDataAdapter(str, con); ds = new DataSet(); da.Fill(ds); cmbEnroll.DataSource = ds.Tables[0]; cmbEnroll.DisplayMember = "EnrollInfo"; cmbEnroll.ValueMember = "EnrollInfo"; cmbEnroll.SelectedIndex = -1; } catch (Exception ex) { MessageBox.Show(ex.Message); } } //This function is used to load the data i.e Transport fee and Tuition fee when gets updated by the Data grid view private void fillstudentDgv() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); cmd = new OleDbCommand(" Select Fee,TransportFee from StudentInfo where EnrollInfo=" + cmbEnroll.Text + "", con); OleDbDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { txtApplicable.Text = dr["Fee"].ToString(); txtTpFee.Text = dr["TransportFee"].ToString(); } dr.Close(); } catch (Exception) { } } //This fills the student detail criteria selected According to the ComboBox. private void fillstudentdetail() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); cmd = new OleDbCommand(" Select StudentName,Class,Fee,TransportFee from StudentInfo where EnrollInfo=" + cmbEnroll.Text + "", con); OleDbDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { txtStudentName.Text = dr["StudentName"].ToString(); txtCourse.Text = dr["Class"].ToString(); txtApplicable.Text = dr["Fee"].ToString(); txtTpFee.Text = dr["TransportFee"].ToString(); } dr.Close(); } catch (Exception) { } } private void deletefeeinfo() { try
  • 47. 50 | P a g e { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); if (MessageBox.Show(" Do you want to Delete?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { str = "Delete from TbleFeeEntry where ReceiptNo=" + txtReceiptNo.Text + ""; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Data Deleted Successfully"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void FeePrintModule() { FrmFeePrint frmprint = new FrmFeePrint(); RptFeeReceipt FEE = new RptFeeReceipt(); frmprint.crystalReportViewer1.ReportSource = FEE; FEE.Refresh(); frmprint.crystalReportViewer1.SelectionFormula = "{TbleFeeEntry.ReceiptNo} = " + txtReceiptNo.Text + " "; frmprint.Show(); } private void FeePrintCmbReceipt() { FrmFeePrint frmprint = new FrmFeePrint(); RptFeeReceipt FEE = new RptFeeReceipt(); frmprint.crystalReportViewer1.ReportSource = FEE; FEE.Refresh(); frmprint.crystalReportViewer1.SelectionFormula = "{TbleFeeEntry.ReceiptNo} = " + TsTxtReceipt.Text + " "; frmprint.Show(); } private void FeeLedgerPrint() { FrmFeeLedger frmledger = new FrmFeeLedger(); RptFeeLedger FEE1 = new RptFeeLedger(); frmledger.crystalReportViewer1.ReportSource = FEE1; FEE1.Refresh(); frmledger.crystalReportViewer1.SelectionFormula = "{TbleFeeEntry.EnrollmentId} = " + TsTxtReceipt.Text + " "; frmledger.Show(); } private void countInstallment() { int i; for (i = 0; i < dgvViewF.Rows.Count; i++) { label21.Text = Convert.ToString(dgvViewF.Rows.Count); } } private void TsDelet_Load(object sender, EventArgs e) { cmbEnroll.Select(); txtSubmissionDate.Text = monthCalendar1.TodayDate.ToShortDateString();
  • 48. 51 | P a g e ReceiptAutoGenerate(); BillAutoGenerate(); CmbEnrollmentFill(); } private void savefeeinfo() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Insert into TbleFeeEntry(ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate ,TuitionFee,NOM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,Total Amount,PaidAmount,DueAmount,EntryLoggedBy)values(" + txtReceiptNo.Text.Trim() + "," + txtBillNo.Text.Trim() + ",'" + cmbEnroll.Text.Trim() + "','" + txtStudentName.Text.Trim() + "','" + txtCourse.Text.Trim() + "','" + txtSubmissionDate.Text.Trim() + "','" + dateTimePicker2.Value + "','" + dateTimePicker3.Value + "'," + txtTuition.Text.Trim() + "," + txtNOM.Text.Trim() + "," + txtRegFee.Text.Trim() + "," + txtTransportFee.Text.Trim() + "," + txtExamFee.Text.Trim() + "," + txtFine.Text.Trim() + "," + txtAmenCh.Text.Trim() + "," + txtOtherFee.Text.Trim() + ",'" + txtDescription.Text.Trim() + "'," + txtAmount.Text.Trim() + "," + txtPaidAmount.Text.Trim() + "," + txtDueAmount.Text.Trim() + ",'" + txtUser.Text.Trim() + "')"; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Fee Data Saved Successfully......"); if (MessageBox.Show(" Do you want to Print Receipt?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { FeePrintModule(); } Resetcontrol(); cmbEnroll.Focus(); initialvalue(); ReceiptAutoGenerate(); BillAutoGenerate(); } catch (Exception ex) { MessageBox.Show(ex.Message); ReceiptAutoGenerate(); } } private void dueCalculateFee() { try { int due1 = 0; for (int k = 0; k < dgvViewF.Rows.Count; k++) { due1 = due1 + Convert.ToInt32(dgvViewF.Rows[k].Cells[19].Value); } label23.Text = due1.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void updatefeeinfo()
  • 49. 52 | P a g e { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Update TbleFeeEntry set EnrollmentId=" + cmbEnroll.Text.Trim() + ",StudentName='" + txtStudentName.Text.Trim() + "',Class='" + txtCourse.Text.Trim() + "',SubmissionDate='" + txtSubmissionDate.Text.Trim() + "',FromDate='" + dateTimePicker2.Value + "',ToDate='" + dateTimePicker3.Value + "', TuitionFee=" + txtTuition.Text + ",NOM=" + txtNOM.Text + ",RegFee=" + txtRegFee.Text + ",TransportFee=" + txtTransportFee.Text.Trim() + ",ExamFee=" + txtExamFee.Text.Trim() + ",Fine=" + txtFine.Text + ",AmenitiesCharge=" + txtAmenCh.Text.Trim() + ",OtherFee=" + txtOtherFee.Text + ",Description='" + txtDescription.Text + "',TotalAmount=" + txtAmount.Text + ",PaidAmount=" + txtPaidAmount.Text + ",DueAmount=" + txtDueAmount.Text + ",EntryLoggedBy='" + txtUser.Text.Trim() + "' where ReceiptNo=" + txtReceiptNo.Text + ""; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Your Data Updated...."); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void duecalculation() { try { int due; due = Convert.ToInt32(txtAmount.Text) - Convert.ToInt32(txtPaidAmount.Text); txtDueAmount.Text = Convert.ToString(due); txtDueAmount.SelectAll(); } catch (Exception) { txtDueAmount.Clear(); } } public void dgvFeeView() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Select ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate,TuitionFee,N OM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,TotalAmount,PaidAm ount,DueAmount,EntryLoggedBy from TbleFeeEntry"; da = new OleDbDataAdapter(str, con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); dgvViewF.DataSource = dt; con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } //This function loads the particular enrollement detail with Enrollid public void dgvFeeView1()
  • 50. 53 | P a g e { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Select ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate,TuitionFee,N OM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,TotalAmount,PaidAm ount,DueAmount,EntryLoggedBy from TbleFeeEntry Where EnrollmentId=" + cmbEnroll.Text + ""; da = new OleDbDataAdapter(str, con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); dgvViewF.DataSource = dt; con.Close(); } catch (Exception) { MessageBox.Show("Try Again", "Warning"); } } //This function calculate the Fee as per NOM is given and is placed at NOM Leave event private void FeeCalculate() { int FeeAmount; FeeAmount = Convert.ToInt32(txtApplicable.Text) * Convert.ToInt32(txtNOM.Text); txtTuition.Text = Convert.ToString(FeeAmount); } //This function calculate the TP FEE as per NOM is given and is placed at NOM Leave event private void TransportFeeCalculate() { int TPAmount; TPAmount = Convert.ToInt32(txtTpFee.Text) * Convert.ToInt32(txtNOM.Text); txtTransportFee.Text = Convert.ToString(TPAmount); } private void totalamount() { int TotalAmount; TotalAmount = Convert.ToInt32(txtTuition.Text) + Convert.ToInt32(txtTransportFee.Text) + Convert.ToInt32(txtExamFee.Text) + Convert.ToInt32(txtFine.Text) + Convert.ToInt32(txtOtherFee.Text) + Convert.ToInt32(txtAmenCh.Text); txtAmount.Text = Convert.ToString(TotalAmount); } private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e) { TsTxtReceipt.Focus(); } private void txtOtherFee_Leave(object sender, EventArgs e) { try { if (Convert.ToInt32(txtOtherFee.Text) < 0) { MessageBox.Show("Negative Value Not Allowed"); txtOtherFee.Focus();
  • 51. 54 | P a g e txtOtherFee.Text = Convert.ToString(0); txtOtherFee.Select(); } FeeCalculate(); TransportFeeCalculate(); } catch (Exception) { txtOtherFee.Text = Convert.ToString(0); txtOtherFee.Select(); } } private void txtAmount_Leave(object sender, EventArgs e) { try { if (Convert.ToInt32(txtAmount.Text) <= 0) { MessageBox.Show("Total Amount is Zero", "Warning"); cmbEnroll.Focus(); return; } } catch (Exception) { } } private void txtPaidAmount_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtDueAmount.Focus(); } } private void txtPaidAmount_Leave(object sender, EventArgs e) { try { if (Convert.ToInt32(txtPaidAmount.Text) < 0) { MessageBox.Show("Paid Cannot Be Negative"); txtPaidAmount.Focus(); txtPaidAmount.Text = Convert.ToString(0); txtPaidAmount.SelectAll(); } duecalculation(); } catch (Exception ) { MessageBox.Show("Try Again"); } } private void txtAmount_TextChanged(object sender, EventArgs e) { txtPaidAmount.Text = txtAmount.Text; } private void txtPaidAmount_TextChanged(object sender, EventArgs e) {
  • 52. 55 | P a g e duecalculation(); try { if (Convert.ToInt32(txtPaidAmount.Text) > Convert.ToInt32(txtAmount.Text)) { MessageBox.Show("Paid Amount is Overflow", "Warning"); txtPaidAmount.Text = txtAmount.Text; txtPaidAmount.SelectAll(); } } catch (Exception) { } } private void TsAddButton_Click(object sender, EventArgs e) { if (txtReceiptNo.Text == "") { MessageBox.Show("Receipt No Compulsory"); txtReceiptNo.Focus(); return; } else if (txtBillNo.Text == "") { MessageBox.Show("Bill NO. Required"); txtBillNo.Focus(); return; } else if (cmbEnroll.Text == "") { MessageBox.Show("Enroll Id Compulsory"); cmbEnroll.Focus(); return; } else if (txtStudentName.Text == "") { MessageBox.Show("Student Name Required"); txtStudentName.Focus(); return; } else if (txtCourse.Text == "") { MessageBox.Show("Class Entry Compulsory"); txtCourse.Focus(); return; } else if (txtNOM.Text == "") { MessageBox.Show("NOM Field Required"); txtNOM.Focus(); return; } else if (txtTuition.Text == "") { MessageBox.Show("Tuition Fee Compulsory"); txtTuition.Focus(); return; } else if (txtRegFee.Text == "") { MessageBox.Show("Tuition Fee Compulsory"); txtRegFee.Focus(); return; } else if (txtTransportFee.Text == "")
  • 53. 56 | P a g e { MessageBox.Show("Initial Value Required-Transport Fee"); txtTransportFee.Focus(); return; } else if (txtExamFee.Text == "") { MessageBox.Show("Exam Fee Compulsory"); txtExamFee.Focus(); return; } else if (txtFine.Text == "") { MessageBox.Show("Fine Value Required"); txtFine.Focus(); return; } else if (txtOtherFee.Text == "") { MessageBox.Show("Other Fee Required"); txtOtherFee.Focus(); return; } else if (txtAmenCh.Text == "") { MessageBox.Show("Amenities Charge Required"); txtAmenCh.Focus(); return; } else if (txtDescription.Text == "") { MessageBox.Show("Description Required"); txtDescription.Focus(); return; } else if (txtAmount.Text == "") { MessageBox.Show("Total Amount Compulsory"); totalamount(); txtAmount.Focus(); return; } else if (txtPaidAmount.Text == "") { MessageBox.Show("Paid Amount Must be Compulsory"); txtPaidAmount.Text = txtAmount.Text; txtPaidAmount.Focus(); txtPaidAmount.SelectAll(); return; } else if (txtDueAmount.Text == "") { int i = 0; MessageBox.Show("Due Amount Initial Value Required."); txtDueAmount.Text = Convert.ToString(i); txtDueAmount.Focus(); return; } else { savefeeinfo(); } } private void txtReceiptNo_KeyPress(object sender, KeyPressEventArgs e)
  • 54. 57 | P a g e { } private void cmbEnroll_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { fillstudentdetail(); dgvFeeView1(); dueCalculateFee(); txtStudentName.Focus(); } } private void txtStudentName_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtCourse.Focus(); } } private void txtCourse_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { dateTimePicker2.Focus(); } } private void txtAffiliated_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { dateTimePicker2.Focus(); } } private void dateTimePicker2_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { dateTimePicker3.Focus(); } } private void dateTimePicker3_KeyPress(object sender, KeyPressEventArgs e) { } private void txtTuition_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtRegFee.Focus(); } } private void txtNOM_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtTuition.Focus();
  • 55. 58 | P a g e } } private void txtRegFee_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtTransportFee.Focus(); } } private void txtFine_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtOtherFee.Focus(); } } private void txtOtherFee_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtAmenCh.Focus(); } } private void txtDescription_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtAmount.Focus(); } } private void Resetcontrol() { cmbEnroll.SelectedIndex = -1; txtStudentName.Clear(); txtCourse.Clear(); txtTuition.Clear(); txtNOM.Clear(); txtRegFee.Clear(); txtTpFee.Clear(); txtTransportFee.Clear(); txtAmenCh.Clear(); txtFine.Clear(); txtApplicable.Clear(); txtOtherFee.Clear(); txtAmount.Clear(); txtPaidAmount.Clear(); txtDueAmount.Clear(); } private void Resetcontrol1() { cmbEnroll.SelectedIndex = -1; txtStudentName.Clear(); txtCourse.Clear(); txtTpFee.Clear(); txtApplicable.Clear(); txtTuition.Clear(); } private void initialvalue() { int a = 0, b = 1; txtNOM.Text = Convert.ToString(b); txtRegFee.Text = Convert.ToString(a); txtFine.Text = Convert.ToString(a);
  • 56. 59 | P a g e txtOtherFee.Text = Convert.ToString(a); txtTransportFee.Text = Convert.ToString(a); txtAmenCh.Text = Convert.ToString(a); txtAmount.Text = Convert.ToString(a); txtTuition.Text = Convert.ToString(a); txtPaidAmount.Text = Convert.ToString(a); txtDueAmount.Text = Convert.ToString(a); txtExamFee.Text = Convert.ToString(a); label23.Text = Convert.ToString(a); } private void txtAmount_KeyPress(object sender, KeyPressEventArgs e) { if ((!char.IsControl(e.KeyChar)) && (!char.IsDigit(e.KeyChar))) { e.Handled = true; } base.OnKeyPress(e); if (e.KeyChar == 13) { txtPaidAmount.Focus(); } } private void txtDueAmount_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { if (TsAddButton.Enabled == true) { TsAddButton.PerformClick(); } else { TsEdit.PerformClick(); } } } private void cmbEnroll_Leave(object sender, EventArgs e) { countInstallment(); int index = cmbEnroll.FindString(cmbEnroll.Text); if (index < 0) { MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbEnroll.Focus(); cmbEnroll.Text = ""; return; } } private void dgvFeeViewEntry_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { //ReceiptNo1,BillNo2,EnrollmentId3,StudentName4,Class5,SubmissionDate6,FromDate6,ToDate7,Tu itionFee8,9NOM, //10RegFee,11TransportFee,12ExamFee,13Fine,14AmenitiesCharge,15therFee,16Description,17Tota lAmount,18PaidAmount,19DueAmount,20EntryLoggedBy if (e.RowIndex >= 0) { DataGridViewRow row = dgvViewF.Rows[e.RowIndex];
  • 57. 60 | P a g e txtReceiptNo.Text = row.Cells[0].Value.ToString(); txtBillNo.Text = row.Cells[1].Value.ToString(); cmbEnroll.Text = row.Cells[2].Value.ToString(); txtStudentName.Text = row.Cells[3].Value.ToString(); txtCourse.Text = row.Cells[4].Value.ToString(); txtSubmissionDate.Text = row.Cells[5].Value.ToString(); dateTimePicker2.Text = row.Cells[6].Value.ToString(); dateTimePicker3.Text = row.Cells[7].Value.ToString(); txtTuition.Text = row.Cells[8].Value.ToString(); txtNOM.Text = row.Cells[9].Value.ToString(); txtRegFee.Text = row.Cells[10].Value.ToString(); txtTransportFee.Text = row.Cells[11].Value.ToString(); txtExamFee.Text = row.Cells[12].Value.ToString(); txtFine.Text = row.Cells[13].Value.ToString(); txtAmenCh.Text = row.Cells[14].Value.ToString(); txtOtherFee.Text = row.Cells[15].Value.ToString(); txtDescription.Text = row.Cells[16].Value.ToString(); txtAmount.Text = row.Cells[17].Value.ToString(); txtPaidAmount.Text = row.Cells[18].Value.ToString(); txtDueAmount.Text = row.Cells[19].Value.ToString(); textBox2.Text = row.Cells[20].Value.ToString(); } TsAddButton.Enabled = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void TsReset_Click(object sender, EventArgs e) { Resetcontrol1(); TsAddButton.Enabled = true; initialvalue(); ReceiptAutoGenerate(); BillAutoGenerate(); cmbEnroll.Focus(); } private void toolStripButton1_Click(object sender, EventArgs e) { if (txtUser.Text != textBox2.Text) { MessageBox.Show("You are not a Valid Logger-To Delete"); if (MessageBox.Show("Want to Override Authorization?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { label24.Visible = true; textBox1.Visible = true; button1.Visible = true; cmbTask.Visible = true; textBox1.Focus(); } return; } if (txtReceiptNo.Text == "") { MessageBox.Show("Receipt No Compulsory"); txtReceiptNo.Focus(); return; } else if (txtBillNo.Text == "") { MessageBox.Show("Bill NO. Required");
  • 58. 61 | P a g e txtBillNo.Focus(); return; } else if (cmbEnroll.Text == "") { MessageBox.Show("Enroll Id Compulsory"); cmbEnroll.Focus(); return; } else if (txtStudentName.Text == "") { MessageBox.Show("Student Name Required"); txtStudentName.Focus(); return; } else if (txtCourse.Text == "") { MessageBox.Show("Class Entry Compulsory"); txtCourse.Focus(); return; } else if (txtTuition.Text == "") { MessageBox.Show("Tuition Field Required"); txtTuition.Focus(); return; } else if (txtNOM.Text == "") { MessageBox.Show("No of Month Entry Compulsory (No Only)"); txtNOM.Focus(); return; } else if (txtRegFee.Text == "") { MessageBox.Show("Tuition Fee Compulsory"); txtRegFee.Focus(); return; } else if (txtTransportFee.Text == "") { MessageBox.Show("Initial Value Required-Transport Fee"); txtTransportFee.Focus(); return; } else if (txtExamFee.Text == "") { MessageBox.Show("Exam Fee Compulsory"); txtExamFee.Focus(); return; } else if (txtFine.Text == "") { MessageBox.Show("Fine Value Required"); txtFine.Focus(); return; } else if (txtOtherFee.Text == "") { MessageBox.Show("Other Fee Required"); txtOtherFee.Focus(); return; } else if (txtAmenCh.Text == "") { MessageBox.Show("Amenities Charge Fee Required"); txtAmenCh.Focus();
  • 59. 62 | P a g e return; } else if (txtDescription.Text == "") { MessageBox.Show("Description Required"); txtDescription.Focus(); return; } else if (txtAmount.Text == "") { MessageBox.Show("Total Amount Compulsory"); totalamount(); txtAmount.Focus(); return; } else if (txtPaidAmount.Text == "") { MessageBox.Show("Paid Amount Must be Compulsory"); txtPaidAmount.Text = txtAmount.Text; txtPaidAmount.Focus(); txtPaidAmount.SelectAll(); return; } else if (txtDueAmount.Text == "") { int i = 0; MessageBox.Show("Due Amount Initial Value Required."); txtDueAmount.Text = Convert.ToString(i); txtDueAmount.Focus(); return; } else { deletefeeinfo(); dgvFeeView1(); Resetcontrol(); ReceiptAutoGenerate(); BillAutoGenerate(); initialvalue(); cmbEnroll.Focus(); TsAddButton.Enabled = true; } } private void TsEdit_Click(object sender, EventArgs e) { if (txtUser.Text != textBox2.Text) { MessageBox.Show("You are not a Valid Logger-To Update"); if (MessageBox.Show("Want to Override Authorization?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { label24.Visible = true; textBox1.Visible = true; button1.Visible = true; cmbTask.Visible = true; textBox1.Focus(); } return; } if (txtReceiptNo.Text == "") { MessageBox.Show("Receipt No Compulsory"); txtReceiptNo.Focus(); return; }
  • 60. 63 | P a g e else if (txtBillNo.Text == "") { MessageBox.Show("Bill NO. Required"); txtBillNo.Focus(); return; } else if (cmbEnroll.Text == "") { MessageBox.Show("Enroll Id Compulsory"); cmbEnroll.Focus(); return; } else if (txtStudentName.Text == "") { MessageBox.Show("Student Name Required"); txtStudentName.Focus(); return; } else if (txtCourse.Text == "") { MessageBox.Show("Class Entry Compulsory"); txtCourse.Focus(); return; } else if (txtTuition.Text == "") { MessageBox.Show("Tuition Field Required"); txtTuition.Focus(); return; } else if (txtNOM.Text == "") { MessageBox.Show("No of Month Entry Compulsory (No Only)"); txtNOM.Focus(); return; } else if (txtRegFee.Text == "") { MessageBox.Show("Tuition Fee Compulsory"); txtRegFee.Focus(); return; } else if (txtTransportFee.Text == "") { MessageBox.Show("Initial Value Required-Transport Fee"); txtTransportFee.Focus(); return; } else if (txtExamFee.Text == "") { MessageBox.Show("Exam Fee Compulsory"); txtExamFee.Focus(); return; } else if (txtFine.Text == "") { MessageBox.Show("Fine Value Required"); txtFine.Focus(); return; } else if (txtOtherFee.Text == "") { MessageBox.Show("Other Fee Required"); txtOtherFee.Focus(); return; }
  • 61. 64 | P a g e else if (txtAmenCh.Text == "") { MessageBox.Show("Amenities Charge Required"); txtAmenCh.Focus(); return; } else if (txtDescription.Text == "") { MessageBox.Show("Description Required"); txtDescription.Focus(); return; } else if (txtAmount.Text == "") { MessageBox.Show("Total Amount Compulsory"); totalamount(); txtAmount.Focus(); return; } else if (txtPaidAmount.Text == "") { MessageBox.Show("Paid Amount Must be Compulsory"); txtPaidAmount.Text = txtAmount.Text; txtPaidAmount.Focus(); txtPaidAmount.SelectAll(); return; } else if (txtDueAmount.Text == "") { int i = 0; MessageBox.Show("Due Amount Initial Value Required."); txtDueAmount.Text = Convert.ToString(i); txtDueAmount.Focus(); return; } else { updatefeeinfo(); dgvFeeView1(); Resetcontrol1(); initialvalue(); ReceiptAutoGenerate(); BillAutoGenerate(); cmbEnroll.Focus(); TsAddButton.Enabled = true; } } private void TsTxtReceipt_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { TsPrintBtn.PerformClick(); } } private void toolStripButton2_Click(object sender, EventArgs e) { if (TsTxtReceipt.Text == "") { MessageBox.Show("Enter Value to Print"); TsTxtReceipt.Focus(); } else if (TsCmbReceiept.Text == "By Receipt No.") {
  • 62. 65 | P a g e FeePrintCmbReceipt(); TsTxtReceipt.Clear(); } else { FeeLedgerPrint(); TsTxtReceipt.Clear(); } } private void dateTimePicker2_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { dateTimePicker3.Focus(); } } private void dateTimePicker2_KeyPress_1(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { dateTimePicker3.Focus(); } } private void dateTimePicker3_KeyPress_1(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtNOM.Focus(); } } private void toolStripLabel3_Click(object sender, EventArgs e) { dgvFeeView(); } private void groupBox1_Enter(object sender, EventArgs e) { label24.Visible = false; textBox1.Visible = false; textBox1.Clear(); button1.Visible = false; cmbTask.Visible = false; } private void button1_Click_1(object sender, EventArgs e) { if (cmbTask.Text == "Edit") { if (textBox1.Text == "07071979") { if (txtReceiptNo.Text == "") { MessageBox.Show("Receipt No Compulsory"); txtReceiptNo.Focus(); return; }
  • 63. 66 | P a g e else if (txtBillNo.Text == "") { MessageBox.Show("Bill NO. Required"); txtBillNo.Focus(); return; } else if (cmbEnroll.Text == "") { MessageBox.Show("Enroll Id Compulsory"); cmbEnroll.Focus(); return; } else if (txtStudentName.Text == "") { MessageBox.Show("Student Name Required"); txtStudentName.Focus(); return; } else if (txtCourse.Text == "") { MessageBox.Show("Class Entry Compulsory"); txtCourse.Focus(); return; } else if (txtTuition.Text == "") { MessageBox.Show("Tuition Field Required"); txtTuition.Focus(); return; } else if (txtNOM.Text == "") { MessageBox.Show("No of Month Entry Compulsory (No Only)"); txtNOM.Focus(); return; } else if (txtRegFee.Text == "") { MessageBox.Show("Tuition Fee Compulsory"); txtRegFee.Focus(); return; } else if (txtTransportFee.Text == "") { MessageBox.Show("Initial Value Required-Transport Fee"); txtTransportFee.Focus(); return; } else if (txtExamFee.Text == "") { MessageBox.Show("Exam Fee Compulsory"); txtExamFee.Focus(); return; } else if (txtFine.Text == "") { MessageBox.Show("Fine Value Required"); txtFine.Focus(); return; } else if (txtOtherFee.Text == "") { MessageBox.Show("Other Fee Required"); txtOtherFee.Focus(); return; } else if (txtDescription.Text == "")
  • 64. 67 | P a g e { MessageBox.Show("Description Required"); txtDescription.Focus(); return; } else if (txtAmount.Text == "") { MessageBox.Show("Total Amount Compulsory"); totalamount(); txtAmount.Focus(); return; } else if (txtPaidAmount.Text == "") { MessageBox.Show("Paid Amount Must be Compulsory"); txtPaidAmount.Text = txtAmount.Text; txtPaidAmount.Focus(); txtPaidAmount.SelectAll(); return; } else if (txtDueAmount.Text == "") { int i = 0; MessageBox.Show("Due Amount Initial Value Required."); txtDueAmount.Text = Convert.ToString(i); txtDueAmount.Focus(); return; } else { updatefeeinfo(); dgvFeeView1(); Resetcontrol1(); initialvalue(); ReceiptAutoGenerate(); BillAutoGenerate(); cmbEnroll.Focus(); TsAddButton.Enabled = true; textBox1.Clear(); label24.Visible = false; textBox1.Visible = false; button1.Visible = false; cmbTask.Visible = false; } } } else if (cmbTask.Text == "Delete") { if (textBox1.Text == "07071979") { if (txtReceiptNo.Text == "") { MessageBox.Show("Receipt No Compulsory"); txtReceiptNo.Focus(); return; } else if (txtBillNo.Text == "") { MessageBox.Show("Bill NO. Required"); txtBillNo.Focus(); return; } else if (cmbEnroll.Text == "") { MessageBox.Show("Enroll Id Compulsory");
  • 65. 68 | P a g e cmbEnroll.Focus(); return; } else if (txtStudentName.Text == "") { MessageBox.Show("Student Name Required"); txtStudentName.Focus(); return; } else if (txtCourse.Text == "") { MessageBox.Show("Class Entry Compulsory"); txtCourse.Focus(); return; } else if (txtTuition.Text == "") { MessageBox.Show("Tuition Field Required"); txtTuition.Focus(); return; } else if (txtNOM.Text == "") { MessageBox.Show("No of Month Entry Compulsory (No Only)"); txtNOM.Focus(); return; } else if (txtRegFee.Text == "") { MessageBox.Show("Tuition Fee Compulsory"); txtRegFee.Focus(); return; } else if (txtTransportFee.Text == "") { MessageBox.Show("Initial Value Required-Transport Fee"); txtTransportFee.Focus(); return; } else if (txtExamFee.Text == "") { MessageBox.Show("Exam Fee Compulsory"); txtExamFee.Focus(); return; } else if (txtFine.Text == "") { MessageBox.Show("Fine Value Required"); txtFine.Focus(); return; } else if (txtOtherFee.Text == "") { MessageBox.Show("Other Fee Required"); txtOtherFee.Focus(); return; } else if (txtDescription.Text == "") { MessageBox.Show("Description Required"); txtDescription.Focus(); return; } else if (txtAmount.Text == "") { MessageBox.Show("Total Amount Compulsory");
  • 66. 69 | P a g e totalamount(); txtAmount.Focus(); return; } else if (txtPaidAmount.Text == "") { MessageBox.Show("Paid Amount Must be Compulsory"); txtPaidAmount.Text = txtAmount.Text; txtPaidAmount.Focus(); txtPaidAmount.SelectAll(); return; } else if (txtDueAmount.Text == "") { int i = 0; MessageBox.Show("Due Amount Initial Value Required."); txtDueAmount.Text = Convert.ToString(i); txtDueAmount.Focus(); return; } else { deletefeeinfo(); dgvFeeView1(); Resetcontrol(); ReceiptAutoGenerate(); BillAutoGenerate(); initialvalue(); cmbEnroll.Focus(); TsAddButton.Enabled = true; } } } else if (textBox1.Text == "") { MessageBox.Show("Null Code Not Permitted", "Warning"); textBox1.Focus(); return; } } private void txtTransportFee_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtExamFee.Focus(); } } private void txtExamFee_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtFine.Focus(); } } private void txtAmenCh_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtDescription.Focus(); } } private void txtNOM_Leave(object sender, EventArgs e) {
  • 67. 70 | P a g e int errorassign = 1; try { if (Convert.ToInt32(txtNOM.Text) < 0) { MessageBox.Show("Negative Value Not Allowed"); txtNOM.Focus(); txtNOM.Text = Convert.ToString(errorassign); txtNOM.Select(); } FeeCalculate(); TransportFeeCalculate(); } catch (Exception) { txtNOM.Text = Convert.ToString(errorassign); txtNOM.Select(); } } private void txtDescription_Leave(object sender, EventArgs e) { // int a = 0; try { totalamount(); } catch (Exception) { //txtOtherFee.Text = Convert.ToString(a); } } private void txtRegFee_Leave(object sender, EventArgs e) { try { if (Convert.ToInt32(txtRegFee.Text) < 0) { MessageBox.Show("Negative Value Not Allowed"); txtRegFee.Focus(); txtRegFee.Text = Convert.ToString(0); txtRegFee.Select(); } } catch (Exception) { txtRegFee.Focus(); txtRegFee.Text = Convert.ToString(0); txtRegFee.Select(); } } private void txtTransportFee_Leave(object sender, EventArgs e) { try { if (Convert.ToInt32(txtTransportFee.Text) < 0) { MessageBox.Show("Negative Value Not Allowed"); txtTransportFee.Focus(); txtTransportFee.Text = Convert.ToString(0);
  • 68. 71 | P a g e txtTransportFee.Select(); } } catch (Exception) { txtTransportFee.Focus(); txtTransportFee.Text = Convert.ToString(0); txtTransportFee.Select(); } } private void txtExamFee_Leave(object sender, EventArgs e) { try { if (Convert.ToInt32(txtExamFee.Text) < 0) { MessageBox.Show("Negative Value Not Allowed"); txtExamFee.Focus(); txtExamFee.Text = Convert.ToString(0); txtExamFee.Select(); } } catch (Exception) { txtExamFee.Focus(); txtExamFee.Text = Convert.ToString(0); txtExamFee.Select(); } } private void txtFine_Leave(object sender, EventArgs e) { try { if (Convert.ToInt32(txtFine.Text) < 0) { MessageBox.Show("Negative Value Not Allowed"); txtFine.Focus(); txtFine.Text = Convert.ToString(0); txtFine.Select(); } } catch (Exception) { txtFine.Focus(); txtFine.Text = Convert.ToString(0); txtFine.Select(); } } private void txtAmenCh_Leave(object sender, EventArgs e) { try { if (Convert.ToInt32(txtAmenCh.Text) < 0) { MessageBox.Show("Negative Value Not Allowed"); txtAmenCh.Focus(); txtAmenCh.Text = Convert.ToString(0); txtAmenCh.Select(); } } catch (Exception) { txtFine.Focus();
  • 69. 72 | P a g e txtFine.Text = Convert.ToString(0); txtFine.Select(); } } private void txtBillNo_KeyPress(object sender, KeyPressEventArgs e) { if ((!char.IsControl(e.KeyChar)) && (!char.IsDigit(e.KeyChar))) { e.Handled = true; } base.OnKeyPress(e); } } } Day Book Form using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.OleDb; using Excel = Microsoft.Office.Interop.Excel; namespace FeeEntrySystem { public partial class FrmFeeViewByDate : Form { OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha"); // OleDbCommand cmd; OleDbDataAdapter da; DataSet ds; DataTable dt; string a; public FrmFeeViewByDate() { InitializeComponent(); } public void dgvFeeViewByDate() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); a = "Select ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate,TuitionFee,N OM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,TotalAmount,PaidAm ount,DueAmount,EntryLoggedBy from TbleFeeEntry Where SubmissionDate='" + textBox4.Text.Trim() + "'"; da = new OleDbDataAdapter(a, con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); DataGridView1.DataSource = dt; con.Close(); } catch (Exception EX) { MessageBox.Show(EX.Message); ; }
  • 70. 73 | P a g e } public void dgvIndividualFeeRecord() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); a = "Select ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate,TuitionFee,N OM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,TotalAmount,PaidAm ount,DueAmount,EntryLoggedBy from TbleFeeEntry Where EnrollmentId=" + textBox2.Text + ""; da = new OleDbDataAdapter(a, con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); DataGridView1.DataSource = dt; DataGridView1.Columns[1].Visible = false; con.Close(); } catch (Exception ) { textBox2.Text = Convert.ToString(0); textBox2.SelectAll(); } } private void dateReport() { FrmDaywiseReport frmdaywise1 = new FrmDaywiseReport(); RptDayWisePrint FEE2 = new RptDayWisePrint(); frmdaywise1.crystalReportViewer1.ReportSource = FEE2; FEE2.Refresh(); frmdaywise1.crystalReportViewer1.SelectionFormula = "{TbleFeeEntry.SubmissionDate} = #"+dateTimePicker1.Text+"#"; frmdaywise1.Show(); } private void TotalAmount() { try { decimal sum = 0.00m; for (int k = 0; k < DataGridView1.Rows.Count; k++) { sum = sum + Convert.ToDecimal(DataGridView1.Rows[k].Cells[18].Value); } textBox1.Text= sum.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void dueCalculate() { try { decimal due = 0.00m; for (int k = 0; k < DataGridView1.Rows.Count; k++) { due = due + Convert.ToDecimal(DataGridView1.Rows[k].Cells[19].Value); } textBox3.Text = due.ToString(); }
  • 71. 74 | P a g e catch (Exception ex) { MessageBox.Show(ex.Message); } } private void daterangeverify() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); a = "Select ReceiptNo,BillNo,EnrollmentId,StudentName,Class,SubmissionDate,FromDate,ToDate,TuitionFee,N OM,RegFee,TransportFee,ExamFee,Fine,AmenitiesCharge,OtherFee,Description,TotalAmount,PaidAm ount,DueAmount,EntryLoggedBy from TbleFeeEntry Where SubmissionDate between #" + textBox4.Text.Trim() + "# and #" + textBox5.Text.Trim() + "# ORDER BY SubmissionDate Asc"; da = new OleDbDataAdapter(a, con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); DataGridView1.DataSource = dt; con.Close(); } catch (Exception EX) { MessageBox.Show(EX.Message); ; } } private void FrmFeeViewByDate_Load(object sender, EventArgs e) { textBox4.Text = monthCalendar1.TodayDate.ToShortDateString(); textBox5.Text = monthCalendar1.TodayDate.ToShortDateString(); TotalAmount(); dueCalculate(); } private void dateTimePicker1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { button1.PerformClick(); } } private void button1_Click(object sender, EventArgs e) { dateReport(); } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.Text == "Individual Fee Record") { textBox2.Visible = true; textBox2.Focus(); textBox4.Visible = false; textBox5.Visible = false; } else { daterangeverify(); textBox4.Text = monthCalendar1.TodayDate.ToShortDateString(); textBox4.Visible = true; textBox5.Visible = true; textBox2.Clear(); textBox2.Visible = false;
  • 72. 75 | P a g e TotalAmount(); dueCalculate(); } } private void textBox2_TextChanged(object sender, EventArgs e) { try { dgvIndividualFeeRecord(); TotalAmount(); dueCalculate(); } catch (Exception ex) { MessageBox.Show(ex.Message); textBox2.Text = Convert.ToString(0); textBox2.SelectAll(); } } private void textBox2_KeyPress(object sender, KeyPressEventArgs e) { if ((!char.IsControl(e.KeyChar)) && (!char.IsDigit(e.KeyChar))) { e.Handled = true; } base.OnKeyPress(e); } private void textBox4_TextChanged(object sender, EventArgs e) { } private void textBox4_TextChanged_1(object sender, EventArgs e) { } private void textBox4_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { textBox5.Focus(); } } private void textBox5_TextChanged(object sender, EventArgs e) { } private void textBox5_KeyPress(object sender, KeyPressEventArgs e) { } private void button2_Click(object sender, EventArgs e) { int rowsTotal = 0; int colsTotal = 0; int I = 0; int j = 0;
  • 73. 76 | P a g e int iC = 0; System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; Excel.Application xlApp = new Excel.Application(); try { Excel.Workbook excelBook = xlApp.Workbooks.Add(); Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelBook.Worksheets[1]; xlApp.Visible = true; rowsTotal = DataGridView1.RowCount - 1; colsTotal = DataGridView1.Columns.Count - 1; var _with1 = excelWorksheet; _with1.Cells.Select(); _with1.Cells.Delete(); for (iC = 0; iC <= colsTotal; iC++) { _with1.Cells[1, iC + 1].Value = DataGridView1.Columns[iC].HeaderText; } for (I = 0; I <= rowsTotal; I++) { for (j = 0; j <= colsTotal; j++) { _with1.Cells[I + 2, j + 1].value = DataGridView1.Rows[I].Cells[j].Value; } } _with1.Rows["1:1"].Font.FontStyle = "Bold"; _with1.Rows["1:1"].Font.Size = 12; _with1.Cells.Columns.AutoFit(); _with1.Cells.Select(); _with1.Cells.EntireColumn.AutoFit(); _with1.Cells[1, 1].Select(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { //RELEASE ALLOACTED RESOURCES System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; xlApp = null; } } private void textBox6_KeyPress(object sender, KeyPressEventArgs e) { } private void textBox5_KeyPress_1(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { daterangeverify(); TotalAmount(); dueCalculate(); } } } }
  • 74. 77 | P a g e Employee Module- Employee Detail Form using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.OleDb; namespace FeeEntrySystem { public partial class FrmAddSalary : Form { OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha"); OleDbCommand cmd; OleDbDataAdapter da; DataSet ds; DataTable dt; string str; public FrmAddSalary() { InitializeComponent(); } private void resetControl() { txtAddress.Clear(); txtDob.Clear(); txtEmpName.Clear(); txtMoNo.Clear(); CmbEmpDesignation.Text = ""; cmbEmpStatus.SelectedIndex = -1; cmbQualification.SelectedIndex = -1; cmbSalary.Clear(); cmbEmpStatus.SelectedIndex = -1; } public void DgvShowEmpDetail() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Select * from TbleEmployeeDetail"; da = new OleDbDataAdapter(str, con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); dgvViewFee.DataSource = dt; con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void savefeDetailinfo() { try {
  • 75. 78 | P a g e if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Insert into TbleEmployeeDetail(EmpId,EmpName,EmpDob,EmpDesignation,EmpAddress,EmpMo,EmpStatus,EmpQualif ication,RecordDate,EmpSalary)values(" + txtEmpid.Text.Trim() + ",'" + txtEmpName.Text.Trim() + "','" + txtDob.Text.Trim() + "','" + CmbEmpDesignation.Text.Trim() + "','" + txtAddress.Text.Trim() + "','" + txtMoNo.Text.Trim() + "','" + cmbEmpStatus.Text.Trim() + "','" + cmbQualification.Text.Trim() + "','" + txtRecordDate.Text.Trim() + "'," + cmbSalary.Text.Trim() + ")"; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Employee Data Saved Successfully......"); resetControl(); DgvShowEmpDetail(); } catch (Exception ) { MessageBox.Show("Duplicate Id Found...","Warning...!"); } } private void updateEmpinfo() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Update TbleEmployeeDetail set EmpName='" + txtEmpName.Text.Trim() + "',EmpDob='" + txtDob.Text.Trim() + "',EmpDesignation='" + CmbEmpDesignation.Text.Trim() + "',EmpAddress='" + txtAddress.Text.Trim() + "',EmpMo='" + txtMoNo.Text.Trim() + "',EmpStatus='" + cmbEmpStatus.Text.Trim() + "', EmpQualification='" + cmbQualification.Text.Trim() + "',RecordDate=" + txtRecordDate.Text + ",EmpSalary=" + cmbSalary.Text.Trim() + " where EmpId=" + txtEmpid.Text + ""; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Your Data Updated...."); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void deleteEmpinfo() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); if (MessageBox.Show(" Do you want to Delete?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { str = "Delete from TbleEmployeeDetail where EmpId=" + txtEmpid.Text + ""; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Data Deleted Successfully"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void EmpIdAutoGenerate()
  • 76. 79 | P a g e { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); // int i=0; string query = "SELECT max(EmpId)+1 from TbleEmployeeDetail "; cmd = new OleDbCommand(); cmd.CommandText = query; cmd.Connection = con; txtEmpid.Text = cmd.ExecuteScalar().ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void TsBtnSave12_Load(object sender, EventArgs e) { DgvShowEmpDetail(); txtRecordDate.Text = DateTime.Today.ToShortDateString(); EmpIdAutoGenerate(); } private void toolStripButton2_Click(object sender, EventArgs e) { resetControl(); } private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { } private void toolStripButton1_Click(object sender, EventArgs e) { if (txtEmpid.Text == "") { MessageBox.Show("Id Required....!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtEmpid.Focus(); return; } else if (txtEmpName.Text == "") { MessageBox.Show("Please Enter Name", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtEmpName.Focus(); return; } else if (txtDob.Text == "") { MessageBox.Show("Please Enter DOB", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtDob.Focus(); return; } else if(CmbEmpDesignation.Text=="") { MessageBox.Show("Select Correct Value"); CmbEmpDesignation.Focus(); return; } else if (txtAddress.Text == "") { MessageBox.Show("Please Enter Address", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
  • 77. 80 | P a g e txtAddress.Focus(); return; } else if (txtMoNo.Text == "") { MessageBox.Show("Please Enter Mobile No.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtMoNo.Focus(); return; } else if (cmbEmpStatus.Text == "") { MessageBox.Show("Please Enter Status", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbEmpStatus.Focus(); return; } else if (cmbSalary.Text == "") { MessageBox.Show("Please Enter Salary", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbSalary.Focus(); return; } else if (cmbQualification.Text == "") { MessageBox.Show("Please Enter Qualification", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbQualification.Focus(); return; } else if (txtRecordDate.Text == "") { MessageBox.Show("Joining Date Rquired", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtRecordDate.Focus(); return; } else { CheckIdDuplicate(); savefeDetailinfo(); EmpIdAutoGenerate(); txtEmpid.Focus(); } } private void txtEmpid_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtEmpName.Focus(); } } private void txtEmpName_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtDob.Focus(); } } private void txtDob_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13)
  • 78. 81 | P a g e { CmbEmpDesignation.Focus(); } } private void CmbEmpDesignation_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { txtAddress.Focus(); } } private void txtAddress_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { txtMoNo.Focus(); } } private void txtMoNo_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { cmbEmpStatus.Focus(); } } private void cmbEmpStatus_KeyPress(object sender, KeyPressEventArgs e) { } private void cmbSalary_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { cmbQualification.Focus(); } } private void cmbQualification_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { TsSave.PerformClick(); } } private void cmbEmpStatus_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { cmbSalary.Focus(); } } private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { } private void toolStripButton3_Click(object sender, EventArgs e) { if (toolStripTextBox1.Text == "") {
  • 79. 82 | P a g e MessageBox.Show("Enter Id To Print", "Warning...!"); toolStripTextBox1.Focus(); return; } else { FrmShowEmpDetail1 frmempshow = new FrmShowEmpDetail1(); RptEmployeeDetail detail = new RptEmployeeDetail(); frmempshow.crystalReportViewer1.ReportSource = detail; detail.Refresh(); frmempshow.crystalReportViewer1.SelectionFormula = "{TbleEmployeeDetail.Empid} = " + toolStripTextBox1.Text + " "; frmempshow.Show(); toolStripTextBox1.Clear(); } } private void deleteEmployeeinfo() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); if (MessageBox.Show(" Do you want to Delete?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { str = "Delete from TbleEmployeeDetail where EmpId=" + txtEmpid.Text + ""; cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = str; cmd.ExecuteNonQuery(); MessageBox.Show("Data Deleted Successfully"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void CheckIdDuplicate() { string id; try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); cmd = new OleDbCommand(" Select * from TbleEmployeeDetail where EmpId=" + txtEmpid.Text.Trim() + "", con); OleDbDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { id = dr["EmpId"].ToString(); if (txtEmpid.Text == id) { fillEmployeedetail(); } dr.Close(); }; } catch (Exception ) { } } private void fillEmployeedetail() { try {
  • 80. 83 | P a g e if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); cmd = new OleDbCommand(" Select * from TbleEmployeeDetail where EmpId=" + txtEmpid.Text.Trim() + "", con); OleDbDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { txtEmpid.Text = dr["EmpId"].ToString(); txtEmpName.Text = dr["EmpName"].ToString(); txtDob.Text = dr["EmpDob"].ToString(); CmbEmpDesignation.Text = dr["EmpDesignation"].ToString(); txtAddress.Text = dr["EmpAddress"].ToString(); txtMoNo.Text = dr["EmpMo"].ToString(); cmbEmpStatus.Text = dr["EmpStatus"].ToString(); cmbQualification.Text = dr["EmpQualification"].ToString(); txtRecordDate.Text = dr["RecordDate"].ToString(); cmbSalary.Text = dr["EmpSalary"].ToString(); } dr.Close(); } catch (Exception ) { EmpIdAutoGenerate(); } } private void toolStripTextBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { toolStripButton3.PerformClick(); } } private void txtEmpid_TextChanged(object sender, EventArgs e) { CheckIdDuplicate(); } private void CmbEmpDesignation_Leave(object sender, EventArgs e) { int index = CmbEmpDesignation.FindString(CmbEmpDesignation.Text); if (index < 0) { MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); CmbEmpDesignation.Focus(); CmbEmpDesignation.Text = ""; return; } } private void cmbEmpStatus_Leave(object sender, EventArgs e) { int index = cmbEmpStatus.FindString(cmbEmpStatus.Text); if (index < 0) { MessageBox.Show("Type/Select Correct Value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbEmpStatus.Focus(); cmbEmpStatus.Text = ""; return; } }
  • 81. 84 | P a g e private void TsBtnDelete_Click(object sender, EventArgs e) { if (txtEmpid.Text == "") { MessageBox.Show("Id Required....!"); txtEmpid.Focus(); return; } else { deleteEmpinfo(); resetControl(); EmpIdAutoGenerate(); DgvShowEmpDetail(); } } private void label10_Click(object sender, EventArgs e) { EmpIdAutoGenerate(); } private void TsBtnUpdate_Click(object sender, EventArgs e) { if (txtEmpid.Text == "") { MessageBox.Show("Id Required....!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtEmpid.Focus(); return; } else if (txtEmpName.Text == "") { MessageBox.Show("Please Enter Name", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtEmpName.Focus(); return; } else if (txtDob.Text == "") { MessageBox.Show("Please Enter DOB", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtDob.Focus(); return; } else if(CmbEmpDesignation.Text=="") { MessageBox.Show("Select Correct Value"); CmbEmpDesignation.Focus(); return; } else if (txtAddress.Text == "") { MessageBox.Show("Please Enter Address", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtAddress.Focus(); return; } else if (txtMoNo.Text == "") { MessageBox.Show("Please Enter Mobile No.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtMoNo.Focus(); return; } else if (cmbEmpStatus.Text == "")
  • 82. 85 | P a g e { MessageBox.Show("Please Enter Status", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbEmpStatus.Focus(); return; } else if (cmbSalary.Text == "") { MessageBox.Show("Please Enter Salary", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbSalary.Focus(); return; } else if (cmbQualification.Text == "") { MessageBox.Show("Please Enter Qualification", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbQualification.Focus(); return; } else if (txtRecordDate.Text == "") { MessageBox.Show("Joining Date Rquired", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); txtRecordDate.Focus(); return; } else { updateEmpinfo(); resetControl(); EmpIdAutoGenerate(); DgvShowEmpDetail(); txtEmpid.Focus(); } } } }
  • 83. 86 | P a g e Employee Salary Form using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.OleDb; namespace FeeEntrySystem { public partial class FrmAddSalary : Form { OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.Oledb.12.0;Data Source=" + Application.StartupPath + "Fes.accdb;Jet OLEDB:Database Password=bravoalpha"); OleDbCommand cmd; OleDbDataAdapter da; DataSet ds; DataTable dt; string str; public FrmAddSalary() { InitializeComponent(); } private void resetControl() { // txtEmpid.Clear(); txtAddress.Clear(); txtDob.Clear(); txtEmpName.Clear(); txtMoNo.Clear(); CmbEmpDesignation.Text = ""; cmbEmpStatus.SelectedIndex = -1; cmbQualification.SelectedIndex = -1; cmbSalary.Clear(); cmbEmpStatus.SelectedIndex = -1; } public void DgvShowEmpDetail() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); str = "Select * from TbleEmployeeDetail"; da = new OleDbDataAdapter(str, con); ds = new DataSet(); dt = new DataTable(); da.Fill(dt); dgvViewFee.DataSource = dt; con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void savefeDetailinfo() { try { if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
  翻译: