Documente Academic
Documente Profesional
Documente Cultură
Developed by
Mujeeeb Rehman & Tamanna Solanki
Semester - B
2013
NIIT
NIIT
Hotel Management
Batch Code
: B130293
Start Date
: 03/05/2013
End Date
: 20/07/2013
: Akshay Nair
Date of Submission
:___/07/2013
-2-
Certificate
This is certifying that thesis work, Apple Inc. a bonfire
work has been successfully carried out and submitted in the
fulfillment of the requirement for the Semester -B of GNIIT
(Software Engineering) from NIIT. It is certified that all
correction / suggestion indicated for the internal assessment
have been incorporated in the Report. The report has been
approved as it satisfied the academic requirement in respect
of Minor work prescribed for the software Engineering
(GNIIT).
This thesis is done under the guidance of Akshay Nair by
Mujeeb Rehman & Tamanna Solanki of Semester B
GNIIT (Software Engineering).
-3-
Acknowledgement
We are very thankful to everyone who supported us for this
assignment and gives their guidance to complete our theses
work effectively and moreover on time.
Cpu
Monitor
Keyboard & Mouse
Minimum 2GB of RAM
Minimum 200 GB of HDD
Software
Microsoft Visual Studio Ultimate 2010
Microsoft SQL Server 2008 with Management Studio
.Net FrameWork 4.0
Active X Plugin for Full Support Of Connectivity
Operating System
Microsoft Windows 7 (Recommanded)
-5-
Contents
Page No.
1. Login Wizard
7.
9.
11.
14.
16.
18.
20.
8. Room AvailabilityWizard
24.
9. PaymentDetails
26.
27.
28.
12. Bibliography
29.
-6-
using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.SqlClient;
namespaceHotel_Management
{
publicpartialclassfrmLogin : Form
{
publicfrmLogin()
{
InitializeComponent();
}
staticint a;
privatevoidbtnExit_Click(object sender, EventArgs e)
{
this.Close();
}
privatevoidbtnLogin_Click(object sender, EventArgs e)
{
SqlConnection con1 = newSqlConnection("Data Source=ENGINEERPC\\SQLEXPRESS;Initial Catalog=HotelManagement;Integrated
Security=True;User ID=sa;Password=***********;");
SqlDataAdapter da = newSqlDataAdapter("Select Count(*) From Login Where
Username='" + txtUsername.Text + "' and Password='" + txtPassword.Text +
"'", con1);
DataTabledt = newDataTable();
da.Fill(dt);
if (((a < 2) || (txtPassword.Text == null)))
{
-7-
if (dt.Rows[0][0].ToString() == "1")
{
this.Hide();
Royal_Hotel_Management r = newRoyal_Hotel_Management();
r.Show();
}
else
{
MessageBox.Show("Please Check Your Username & Password...!!!");
a += 1;
}
}
else
{
MessageBox.Show("Invalid Username or Password ! Aborting...");
this.Close();
}
}
}
}
-8-
using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
namespaceHotel_Management
{
publicpartialclassRoyal_Hotel_Management : Form
{
publicRoyal_Hotel_Management()
{
InitializeComponent();
}
privatevoidexitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
-9-
- 10 -
using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.SqlClient;
using System.IO;
namespaceHotel_Management
{
publicpartialclassfrmStaffReg : Form
{
SqlConnection con = newSqlConnection("Data Source=ENGINEER-PC\\SQLEXPRESS;Initial
Catalog=HotelManagement;Persist Security Info=True;User ID=sa;Password=secret");
SqlCommand command;
stringimgloc = "";
publicfrmStaffReg()
{
InitializeComponent();
}
privatevoidbtnClose_Click(object sender, EventArgs e)
{
this.Close();
- 11 -
}
privatevoidbtnBrowse_Click(object sender, EventArgs e)
{
try
{
OpenFileDialogdlg = newOpenFileDialog();
dlg.Filter = "JPG Files(*.jpg)|*.jpg|GIF
Files(*.gif)|*.gif|AllFIles(*.*)|*.*";
dlg.Title = "Select Employee Picture";
if (dlg.ShowDialog() == DialogResult.OK)
{
imgloc = dlg.FileName.ToString();
pictureBox1.ImageLocation = imgloc;
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
privatevoidbtnSubmit_Click(object sender, EventArgs e)
{
try
{
FileStreamfs = newFileStream(imgloc, FileMode.OpenOrCreate,
FileAccess.Read);
BinaryReaderbr = newBinaryReader(fs);
//***************************
Byte[] img = null;
img = br.ReadBytes((int)fs.Length);
stringsql = "INSERT into
Staff(FirstName,LastName,Age,Address,City,State,Email,Phone,Sex,Designation,EmpPho
to,LastModifiedDate) values('" + textBox1.Text + "','" + textBox2.Text + "'," +
textBox3.Text + ",'" + textBox4.Text + "','" + textBox5.Text + "','" +
textBox6.Text + "','" + textBox7.Text + "'," + textBox8.Text + ",'" +
textBox9.Text + "','" + textBox10.Text + "',@img,getdate())";
if(con.State!= ConnectionState.Open)
con.Open();
command = newSqlCommand(sql,con);
command.Parameters.Add(newSqlParameter("@img",img));
int x= command.ExecuteNonQuery();
command.Clone();
MessageBox.Show(x.ToString()+"
Record(s) Saved...!");
con.Close();
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
textBox5.Text = "";
textBox6.Text = "";
textBox7.Text = "";
textBox8.Text = "";
textBox9.Text = "";
textBox10.Text = "";
//****************************
}
- 12 -
- 13 -
using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
namespaceHotel_Management
{
publicpartialclassfrmStaffDetails : Form
{
publicfrmStaffDetails()
{
InitializeComponent();
}
privatevoid Form4_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'hotelManagementDataSet1.Staff' table. You
can move, or remove it, as needed.
- 14 -
this.staffTableAdapter.Fill(this.hotelManagementDataSet1.Staff);
// TODO: This line of code loads data into the 'hotelManagementDataSet.Staff' table. You
can move, or remove it, as needed.
this.staffTableAdapter.Fill(this.hotelManagementDataSet1.Staff);
}
privatevoidbtnRefresh_Click(object sender, EventArgs e)
{
frmStaffDetailsfsd = newfrmStaffDetails();
this.Hide();
fsd.Show();
}
privatevoid button1_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
- 15 -
using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.SqlClient;
namespaceHotel_Management
{
publicpartialclassfrmSearch : Form
{
publicfrmSearch()
{
InitializeComponent();
}
privatevoidbtnSearch_Click(object sender, EventArgs e)
{
stringconnectionString = "Data Source=ENGINEER-PC\\SQLEXPRESS;Initial
Catalog=HotelManagement;Persist Security Info=True;User ID=sa;Password=secret";
SqlConnection con = newSqlConnection(connectionString);
con.Open();
try
{
SqlCommandcmd = newSqlCommand("select * from staff where Designation=@sn", con);
cmd.Parameters.Add(newSqlParameter("@sn", cmbboxDesig.Text));
DataSet ds = newDataSet();
- 16 -
DataTabledt = newDataTable();
SqlDataReaderdr = cmd.ExecuteReader();
dt.Load(dr);
dataGridViewSearch.DataSource = dt;
}
catch(SqlException ex)
{
MessageBox.Show("ERROR OCCURED" +ex);
}
}
privatevoidfrmSearch_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'hotelManagementDataSet1.Staff' table. You
can move, or remove it, as needed.
this.staffTableAdapter.Fill(this.hotelManagementDataSet1.Staff);
}
privatevoidbtnClose_Click(object sender, EventArgs e)
{
this.Close();
}
privatevoid label2_Click(object sender, EventArgs e)
{
}
}
}
- 17 -
using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.SqlClient;
namespaceHotel_Management
{
publicpartialclassfrmRoomInfo : Form
{
SqlConnection con = newSqlConnection("Data Source=ENGINEER-PC\\SQLEXPRESS;Initial
Catalog=HotelManagement;Persist Security Info=True;User ID=sa;Password=secret");
SqlCommandcmd;
SqlDataAdapter da = newSqlDataAdapter();
BindingSourcebs = newBindingSource();
publicfrmRoomInfo()
{
InitializeComponent();
}
privatevoidfrmRoomInfo_Load(object sender, EventArgs e)
{
- 18 -
// TODO: This line of code loads data into the 'hotelManagementDataSet.RoomInfo' table.
You can move, or remove it, as needed.
this.roomInfoTableAdapter.Fill(this.hotelManagementDataSet2.RoomInfo);
}
privatevoid toolStripButton2_Click(object sender, EventArgs e)
{
this.Close();
}
privatevoid toolStripButton1_Click(object sender, EventArgs e)
{
con.Open();
stringsql = "UPDATE RoomInfo set Status='" + txtStatus.Text + "',Assigned_To='" +
txtAssigTo.Text + "' WHERE Room_Number='" + txtRoomNo.Text + "'";
cmd = newSqlCommand(sql, con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record Updated");
}
}
}
- 19 -
- 20 -
using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.SqlClient;
namespaceHotel_Management
{
publicpartialclassfrmRoomReservation : Form
{
SqlConnection con = newSqlConnection("Data Source=ENGINEER-PC\\SQLEXPRESS;Initial
Catalog=HotelManagement;Persist Security Info=True;User
ID=sa;Password=secret;MultipleActiveResultSets = True");
SqlCommandcmd = newSqlCommand();
publicfrmRoomReservation()
{
InitializeComponent();
}
privatevoidfrmRoomReservation_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'hotelManagementDataSet31.RoomCategory'
table. You can move, or remove it, as needed.
this.roomCategoryTableAdapter.Fill(this.hotelManagementDataSet31.RoomCategory);
// TODO: This line of code loads data into the 'hotelManagementDataSet3.GuestInformation'
table. You can move, or remove it, as needed.
this.guestInformationTableAdapter.Fill(this.hotelManagementDataSet3.GuestInformation);
cmd.Connection = con;
}
privatevoidbtnRegister_Click(object sender, EventArgs e)
{
if (txtName.Text != "")
{
con.Open();
cmd.CommandText = "Insert Into GuestInformation(Name,Age,Gender,Email,ContactNum)
Values('" + txtName.Text + "'," + txtAge.Text + ",'" + txtGender.Text + "','" +
txtEmail.Text + "'," + txtContact.Text + ")";
cmd.ExecuteNonQuery();
cmd.Clone();
MessageBox.Show("Guest Record Registered !!");
con.Close();
txtName.Text = "";
txtAge.Text = "";
txtGender.Text = "";
txtEmail.Text = "";
txtContact.Text = "";
}
}
- 21 -
- 22 -
- 23 -
Room Availability
using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
namespaceHotel_Management
{
publicpartialclassfrmRoomAvailability : Form
{
publicfrmRoomAvailability()
{
InitializeComponent();
}
privatevoidfrmRoomAvailability_Load(object sender, EventArgs e)
{
- 24 -
- 25 -
Payment Details
namespaceHotel_Management
{
publicpartialclassfrmPaymnt : Form
{
publicfrmPaymnt()
{
InitializeComponent();
}
privatevoid Form13_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'hotelManagementDataSet7.Payement' table.
You can move, or remove it, as needed.
this.payementTableAdapter.Fill(this.hotelManagementDataSet7.Payement);
}
privatevoidbtnGetTotal_Click(object sender, EventArgs e)
{
int sum=0;
for (int a = 0; a < dataGridView1.Rows.Count; ++a)
{
sum += Convert.ToInt32(dataGridView1.Rows[a].Cells[4].Value);
}
MessageBox.Show("Total Rs/- "+ sum.ToString());
}
}
}
- 26 -
- 27 -
Announcements
- 28 -
Bibliography
******************************************
StackOverFlow.com
Msdn.com
w3schools.com
NIIT .NET Project Guide
NIIT ADO.Net Student Reference.
******************************************
- 29 -