├── Hotel_System
├── mysql-connector-net-8.0.25-noinstall
│ ├── INFO_SRC
│ ├── INFO_BIN
│ ├── CHANGES
│ ├── v4.8
│ │ ├── libzstd.dll
│ │ ├── MySql.Web.dll
│ │ ├── MySql.Data.dll
│ │ ├── System.Buffers.dll
│ │ ├── Zstandard.Net.dll
│ │ ├── Google.Protobuf.dll
│ │ ├── K4os.Hash.xxHash.dll
│ │ ├── Ubiety.Dns.Core.dll
│ │ ├── BouncyCastle.Crypto.dll
│ │ ├── K4os.Compression.LZ4.dll
│ │ ├── MySql.Data.EntityFramework.dll
│ │ ├── K4os.Compression.LZ4.Streams.dll
│ │ └── System.Runtime.CompilerServices.Unsafe.dll
│ ├── v4.5.2
│ │ ├── libzstd.dll
│ │ ├── MySql.Data.dll
│ │ ├── MySql.Web.dll
│ │ ├── Google.Protobuf.dll
│ │ ├── System.Buffers.dll
│ │ ├── Ubiety.Dns.Core.dll
│ │ ├── Zstandard.Net.dll
│ │ ├── K4os.Hash.xxHash.dll
│ │ ├── BouncyCastle.Crypto.dll
│ │ ├── K4os.Compression.LZ4.dll
│ │ ├── MySql.Data.EntityFramework.dll
│ │ ├── K4os.Compression.LZ4.Streams.dll
│ │ ├── System.Runtime.CompilerServices.Unsafe.dll
│ │ └── MySql.Data.EntityFramework.xml
│ ├── README
│ └── Release Notes.txt
├── Resources
│ └── profileUser.png
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Program.cs
├── DBConnection.cs
├── MainForm.cs
├── LoginForm.cs
├── Reservation.cs
├── Client.cs
├── MainForm.Designer.cs
├── ManageClientsForm.cs
├── ManageRoomsForm.cs
├── Hotel_System.csproj
├── LoginForm.resx
├── ManageClientsForm.resx
├── ManageRoomsForm.resx
├── ManageReservationsForm.resx
├── MainForm.resx
├── Room.cs
├── hotel_system.sql
├── ManageReservationsForm.cs
├── LoginForm.Designer.cs
├── ManageClientsForm.Designer.cs
├── ManageRoomsForm.Designer.cs
└── ManageReservationsForm.Designer.cs
├── Hotel_System.sln
├── README.md
├── .gitattributes
└── .gitignore
/Hotel_System/mysql-connector-net-8.0.25-noinstall/INFO_SRC:
--------------------------------------------------------------------------------
1 | version: 8.0.25
--------------------------------------------------------------------------------
/Hotel_System/Resources/profileUser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/Resources/profileUser.png
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/INFO_BIN:
--------------------------------------------------------------------------------
1 | build-date: 2021-04-27 10:45:54
2 | os-info: WINDOWS-10.0
3 | build-type: Release
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/CHANGES:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/CHANGES
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/libzstd.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/libzstd.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/libzstd.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/libzstd.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/MySql.Web.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/MySql.Web.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/MySql.Data.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/MySql.Data.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/MySql.Web.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/MySql.Web.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/MySql.Data.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/MySql.Data.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/System.Buffers.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/System.Buffers.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/Zstandard.Net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/Zstandard.Net.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/Google.Protobuf.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/Google.Protobuf.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/System.Buffers.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/System.Buffers.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/Ubiety.Dns.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/Ubiety.Dns.Core.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/Zstandard.Net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/Zstandard.Net.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/Google.Protobuf.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/Google.Protobuf.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/K4os.Hash.xxHash.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/K4os.Hash.xxHash.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/Ubiety.Dns.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/Ubiety.Dns.Core.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/K4os.Hash.xxHash.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/K4os.Hash.xxHash.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/BouncyCastle.Crypto.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/BouncyCastle.Crypto.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/BouncyCastle.Crypto.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/BouncyCastle.Crypto.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/K4os.Compression.LZ4.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/K4os.Compression.LZ4.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/K4os.Compression.LZ4.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/K4os.Compression.LZ4.dll
--------------------------------------------------------------------------------
/Hotel_System/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/MySql.Data.EntityFramework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/MySql.Data.EntityFramework.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/MySql.Data.EntityFramework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/MySql.Data.EntityFramework.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/K4os.Compression.LZ4.Streams.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/K4os.Compression.LZ4.Streams.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/K4os.Compression.LZ4.Streams.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/K4os.Compression.LZ4.Streams.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/System.Runtime.CompilerServices.Unsafe.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.8/System.Runtime.CompilerServices.Unsafe.dll
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/System.Runtime.CompilerServices.Unsafe.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anjat99/Hotel_System/HEAD/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/System.Runtime.CompilerServices.Unsafe.dll
--------------------------------------------------------------------------------
/Hotel_System/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Hotel_System/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace Hotel_System
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new LoginForm());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/README:
--------------------------------------------------------------------------------
1 | Copyright (c) 2004, 2021, Oracle and/or its affiliates.
2 |
3 | This is a release of MySQL Connector/NET, Oracle's fully managed ADO .NET Driver for MySQL.
4 |
5 | License information can be found in the LICENSE file.
6 |
7 | This distribution may include materials developed by third parties.
8 | For license and attribution notices for these materials, please refer to the LICENSE file.
9 |
10 | For more information on MySQL Connector/NET, visit
11 | http://dev.mysql.com/doc/connector-net/en/
12 |
13 | For additional downloads and the source of MySQL Connector/NET, visit
14 | http://dev.mysql.com/downloads
15 |
16 | MySQL Connector/NET is brought to you by the MySQL team at Oracle.
17 |
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/Release Notes.txt:
--------------------------------------------------------------------------------
1 | Connector/NET 8.0 Release Notes
2 | ------------------------------------
3 | Welcome to the release notes for Connector/NET 8.0
4 |
5 | What's new in 8.0
6 | --------------------
7 | Connector/NET has implemented the new X DevAPI that enables communication
8 | using the X Protocol with a MySQL Server running the X Plugin, released
9 | with MySQL 5.7.x. With the X DevAPI you can write code that treats
10 | MySQL Server as a document database, using a NoSQL-like syntax that does
11 | not assume previous experience writing traditional SQL.
12 | To learn more about how to write applications using X DevAPI see
13 | http://dev.mysql.com/doc/x-devapi-userguide/en/index.html.
14 |
15 | This version also includes the support for .NET Core Framework, which enables
16 | MySQL Connector/NET > = 7.0.4 to be run in all the platforms supported for this
17 | framework. Entity Framework Core support is also included.
18 |
19 | For General documentation about how to get started using MySQL as a document
20 | database, see http://dev.mysql.com/doc/refman/5.7/en/document-database.html.
21 |
22 |
--------------------------------------------------------------------------------
/Hotel_System/DBConnection.cs:
--------------------------------------------------------------------------------
1 | using MySql.Data.MySqlClient;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace Hotel_System
10 | {
11 | /*
12 | * connection between app and MySQL database
13 | */
14 | class DBConnection
15 | {
16 | private MySqlConnection _connection = new MySqlConnection("datasource=localhost;port=3306;username=root;password=;database=hotel_system");
17 |
18 | //return connection
19 | public MySqlConnection GetConnection()
20 | {
21 | return _connection;
22 | }
23 |
24 | //open connection
25 | public void OpenConnection()
26 | {
27 | if(_connection.State == ConnectionState.Closed)
28 | {
29 | _connection.Open();
30 | }
31 | }
32 |
33 | //close connection
34 | public void CloseConnection()
35 | {
36 | if(_connection.State == ConnectionState.Open)
37 | {
38 | _connection.Close();
39 | }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Hotel_System.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31205.134
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hotel_System", "Hotel_System\Hotel_System.csproj", "{68030EB0-345A-4F76-81C2-470D4487CB6D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {68030EB0-345A-4F76-81C2-470D4487CB6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {68030EB0-345A-4F76-81C2-470D4487CB6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {68030EB0-345A-4F76-81C2-470D4487CB6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {68030EB0-345A-4F76-81C2-470D4487CB6D}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {0331AFD5-A747-4E0C-BEB3-CBFDE210FDB4}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Hotel_System/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 |
12 | namespace Hotel_System.Properties
13 | {
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
17 | {
18 |
19 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
20 |
21 | public static Settings Default
22 | {
23 | get
24 | {
25 | return defaultInstance;
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Hotel_System/MainForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace Hotel_System
12 | {
13 | public partial class MainForm : Form
14 | {
15 | public MainForm()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
21 | {
22 | Application.Exit();
23 | }
24 |
25 | private void manageClientsToolStripMenuItem_Click(object sender, EventArgs e)
26 | {
27 | ManageClientsForm manageCF = new ManageClientsForm();
28 | manageCF.ShowDialog();
29 | }
30 |
31 | private void manageRoomsToolStripMenuItem_Click(object sender, EventArgs e)
32 | {
33 | ManageRoomsForm manageRF = new ManageRoomsForm();
34 | manageRF.ShowDialog();
35 | }
36 |
37 | private void manageReservationsToolStripMenuItem_Click(object sender, EventArgs e)
38 | {
39 | ManageReservationsForm manageResF = new ManageReservationsForm();
40 | manageResF.ShowDialog();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Hotel_System/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Hotel_System")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Hotel_System")]
13 | [assembly: AssemblyCopyright("Copyright © 2021")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("68030eb0-345a-4f76-81c2-470d4487cb6d")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
C# Hotel Management System Project
3 |
4 |
5 | ## About Project
6 |
7 | A simple admin panel for managing system for hotel built using C#, WindowsForms, MySQL.
8 |
9 | ## Features
10 |
11 | - The Admin can see all clients ie. to read each separately.
12 | - The Admin can also do insert new or update and delete existing client
13 |
14 | - The admin adds hotel rooms, but he also updates the data or deletes an existing room if needed.
15 |
16 | - Admin adds new room reservations, and as soon as the room is booked it becomes unavailable, so no one else can book it unless someone cancels the reservation
17 |
18 |
19 | 
20 |
21 | 
22 |
23 |
24 |
25 | 
26 | 
27 | 
28 | 
29 | 
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/Hotel_System/LoginForm.cs:
--------------------------------------------------------------------------------
1 | using MySql.Data.MySqlClient;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 |
12 | namespace Hotel_System
13 | {
14 | public partial class LoginForm : Form
15 | {
16 | public LoginForm()
17 | {
18 | InitializeComponent();
19 | }
20 |
21 | private void btnLogin_Click(object sender, EventArgs e)
22 | {
23 | try
24 | {
25 | DBConnection conn = new DBConnection();
26 | DataTable table = new DataTable();
27 | MySqlDataAdapter adapter = new MySqlDataAdapter();
28 | MySqlCommand command = new MySqlCommand();
29 | String query = "SELECT * FROM users WHERE username = @username AND password = @password";
30 |
31 | command.CommandText = query;
32 | command.Connection = conn.GetConnection();
33 |
34 | command.Parameters.Add("@username", MySqlDbType.VarChar).Value = tbUsername.Text;
35 | command.Parameters.Add("@password", MySqlDbType.VarChar).Value = tbPassword.Text;
36 |
37 | adapter.SelectCommand = command;
38 | adapter.Fill(table);
39 |
40 | //if the username and the password exists
41 | if (table.Rows.Count > 0)
42 | {
43 | //show the main form
44 | this.Hide();
45 | MainForm mainForm = new MainForm();
46 | mainForm.Show();
47 | }
48 | else
49 | {
50 | if (tbUsername.Text.Trim().Equals(""))
51 | {
52 | MessageBox.Show("Enter your username to Login", "Empty Username", MessageBoxButtons.OK, MessageBoxIcon.Error);
53 | }
54 | else if (tbPassword.Text.Trim().Equals(""))
55 | {
56 | MessageBox.Show("Enter your Password to Login", "Empty Password", MessageBoxButtons.OK, MessageBoxIcon.Error);
57 | }
58 | else
59 | {
60 | MessageBox.Show("This username or password does not exists", "Wrong Username/Password", MessageBoxButtons.OK, MessageBoxIcon.Error);
61 | }
62 | }
63 | }
64 | catch(Exception ex)
65 | {
66 | MessageBox.Show(ex.Message);
67 | }
68 |
69 |
70 |
71 |
72 | }
73 |
74 |
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/Hotel_System/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Hotel_System.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Hotel_System.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap profileUser {
67 | get {
68 | object obj = ResourceManager.GetObject("profileUser", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/Hotel_System/Reservation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Data;
7 | using MySql.Data.MySqlClient;
8 |
9 | namespace Hotel_System
10 | {
11 | class Reservation
12 | {
13 | DBConnection conn = new DBConnection();
14 | //get all reservations
15 | public DataTable GetAllReservations()
16 | {
17 | MySqlCommand command = new MySqlCommand("SELECT * FROM reservations", conn.GetConnection());
18 | MySqlDataAdapter adapter = new MySqlDataAdapter();
19 | DataTable table = new DataTable();
20 |
21 | adapter.SelectCommand = command;
22 | adapter.Fill(table);
23 |
24 | return table;
25 | }
26 |
27 | //make new reservation
28 | public bool MakeReservation(int number, int client, DateTime dateIn, DateTime dateOut)
29 | {
30 | MySqlCommand command = new MySqlCommand();
31 | String queryInsert = "INSERT INTO `reservations`(`room_number`, `client_id`, `date_in`, `date_out`) VALUES (@number, @client, @dateIn, @dateOut)";
32 | command.CommandText = queryInsert;
33 | command.Connection = conn.GetConnection();
34 |
35 | command.Parameters.Add("@number", MySqlDbType.Int32).Value = number;
36 | command.Parameters.Add("@client", MySqlDbType.Int32).Value = client;
37 | command.Parameters.Add("@dateIn", MySqlDbType.Date).Value = dateIn;
38 | command.Parameters.Add("@dateOut", MySqlDbType.Date).Value = dateOut;
39 |
40 | conn.OpenConnection();
41 | if (command.ExecuteNonQuery() == 1)
42 | {
43 | conn.CloseConnection();
44 | return true;
45 | }
46 | else
47 | {
48 | conn.CloseConnection();
49 | return false;
50 | }
51 | }
52 |
53 | //edit reservation
54 | public bool EditReservation(int id, int number, int client, DateTime dateIn, DateTime dateOut)
55 | {
56 | MySqlCommand command = new MySqlCommand();
57 | String queryUpdate = "UPDATE `reservations` SET `room_number`=@number,`client_id`=@client,`date_in`=@dateIn,`date_out`=@dateOut WHERE id=@id";
58 | command.CommandText = queryUpdate;
59 | command.Connection = conn.GetConnection();
60 |
61 | command.Parameters.Add("@id", MySqlDbType.Int32).Value = id;
62 | command.Parameters.Add("@number", MySqlDbType.Int32).Value = number;
63 | command.Parameters.Add("@client", MySqlDbType.Int32).Value = client;
64 | command.Parameters.Add("@dateIn", MySqlDbType.Date).Value = dateIn;
65 | command.Parameters.Add("@dateOut", MySqlDbType.Date).Value = dateOut;
66 |
67 | conn.OpenConnection();
68 | if (command.ExecuteNonQuery() == 1)
69 | {
70 | conn.CloseConnection();
71 | return true;
72 | }
73 | else
74 | {
75 | conn.CloseConnection();
76 | return false;
77 | }
78 | }
79 |
80 | //remove room
81 | public bool RemoveReservation(int id)
82 | {
83 | MySqlCommand command = new MySqlCommand();
84 | String queryDelete = "DELETE FROM reservations WHERE id=@id";
85 | command.CommandText = queryDelete;
86 | command.Connection = conn.GetConnection();
87 |
88 | command.Parameters.Add("@id", MySqlDbType.Int32).Value = id;
89 |
90 | conn.OpenConnection();
91 | if (command.ExecuteNonQuery() == 1)
92 | {
93 | conn.CloseConnection();
94 | return true;
95 | }
96 | else
97 | {
98 | conn.CloseConnection();
99 | return false;
100 | }
101 | }
102 |
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/Hotel_System/Client.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Data;
7 | using MySql.Data.MySqlClient;
8 |
9 | namespace Hotel_System
10 | {
11 |
12 | /*
13 | * class for insert/update/delete/get all client
14 | *
15 | * */
16 | class Client
17 | {
18 | DBConnection conn = new DBConnection();
19 |
20 | //insert new client
21 | public bool InsertClient(String fname, String lname, String phone, String country)
22 | {
23 | MySqlCommand command = new MySqlCommand();
24 | String queryInsert = "INSERT INTO clients(first_name,last_name,phone,country) VALUES (@fname, @lname, @phone, @country)";
25 | command.CommandText = queryInsert;
26 | command.Connection = conn.GetConnection();
27 |
28 | command.Parameters.Add("@fname", MySqlDbType.VarChar).Value = fname;
29 | command.Parameters.Add("@lname", MySqlDbType.VarChar).Value = lname;
30 | command.Parameters.Add("@phone", MySqlDbType.VarChar).Value = phone;
31 | command.Parameters.Add("@country", MySqlDbType.VarChar).Value = country;
32 |
33 | conn.OpenConnection();
34 | if(command.ExecuteNonQuery() == 1)
35 | {
36 | conn.CloseConnection();
37 | return true;
38 | }
39 | else
40 | {
41 | conn.CloseConnection();
42 | return false;
43 | }
44 | }
45 |
46 | //get all clients
47 | public DataTable GetAllClients()
48 | {
49 | MySqlCommand command = new MySqlCommand("SELECT * FROM clients", conn.GetConnection());
50 | MySqlDataAdapter adapter = new MySqlDataAdapter();
51 | DataTable table = new DataTable();
52 |
53 | adapter.SelectCommand = command;
54 | adapter.Fill(table);
55 |
56 | return table;
57 | }
58 |
59 | //edit client data
60 | public bool EditClient(int id, String fname, String lname, String phone, String country)
61 | {
62 | MySqlCommand command = new MySqlCommand();
63 | String queryUpdate = "UPDATE clients SET first_name=@fname, last_name=@lname, phone=@phone, country=@country WHERE id=@cid";
64 | command.CommandText = queryUpdate;
65 | command.Connection = conn.GetConnection();
66 |
67 | command.Parameters.Add("@cid", MySqlDbType.Int32).Value = id;
68 | command.Parameters.Add("@fname", MySqlDbType.VarChar).Value = fname;
69 | command.Parameters.Add("@lname", MySqlDbType.VarChar).Value = lname;
70 | command.Parameters.Add("@phone", MySqlDbType.VarChar).Value = phone;
71 | command.Parameters.Add("@country", MySqlDbType.VarChar).Value = country;
72 |
73 | conn.OpenConnection();
74 | if (command.ExecuteNonQuery() == 1)
75 | {
76 | conn.CloseConnection();
77 | return true;
78 | }
79 | else
80 | {
81 | conn.CloseConnection();
82 | return false;
83 | }
84 | }
85 |
86 | //remove client
87 | public bool RemoveClient(int id)
88 | {
89 | MySqlCommand command = new MySqlCommand();
90 | String queryDelete = "DELETE FROM clients WHERE id=@cid";
91 | command.CommandText = queryDelete;
92 | command.Connection = conn.GetConnection();
93 |
94 | command.Parameters.Add("@cid", MySqlDbType.Int32).Value = id;
95 |
96 | conn.OpenConnection();
97 | if (command.ExecuteNonQuery() == 1)
98 | {
99 | conn.CloseConnection();
100 | return true;
101 | }
102 | else
103 | {
104 | conn.CloseConnection();
105 | return false;
106 | }
107 | }
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/Hotel_System/MainForm.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Hotel_System
3 | {
4 | partial class MainForm
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | this.menuStrip1 = new System.Windows.Forms.MenuStrip();
33 | this.manageClientsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
34 | this.manageReservationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
35 | this.manageRoomsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
36 | this.menuStrip1.SuspendLayout();
37 | this.SuspendLayout();
38 | //
39 | // menuStrip1
40 | //
41 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
42 | this.manageClientsToolStripMenuItem,
43 | this.manageRoomsToolStripMenuItem,
44 | this.manageReservationsToolStripMenuItem});
45 | this.menuStrip1.Location = new System.Drawing.Point(0, 0);
46 | this.menuStrip1.Name = "menuStrip1";
47 | this.menuStrip1.Size = new System.Drawing.Size(847, 24);
48 | this.menuStrip1.TabIndex = 1;
49 | this.menuStrip1.Text = "menuStrip1";
50 | //
51 | // manageClientsToolStripMenuItem
52 | //
53 | this.manageClientsToolStripMenuItem.Name = "manageClientsToolStripMenuItem";
54 | this.manageClientsToolStripMenuItem.Size = new System.Drawing.Size(101, 20);
55 | this.manageClientsToolStripMenuItem.Text = "Manage Clients";
56 | this.manageClientsToolStripMenuItem.Click += new System.EventHandler(this.manageClientsToolStripMenuItem_Click);
57 | //
58 | // manageReservationsToolStripMenuItem
59 | //
60 | this.manageReservationsToolStripMenuItem.Name = "manageReservationsToolStripMenuItem";
61 | this.manageReservationsToolStripMenuItem.Size = new System.Drawing.Size(131, 20);
62 | this.manageReservationsToolStripMenuItem.Text = "Manage Reservations";
63 | this.manageReservationsToolStripMenuItem.Click += new System.EventHandler(this.manageReservationsToolStripMenuItem_Click);
64 | //
65 | // manageRoomsToolStripMenuItem
66 | //
67 | this.manageRoomsToolStripMenuItem.Name = "manageRoomsToolStripMenuItem";
68 | this.manageRoomsToolStripMenuItem.Size = new System.Drawing.Size(102, 20);
69 | this.manageRoomsToolStripMenuItem.Text = "Manage Rooms";
70 | this.manageRoomsToolStripMenuItem.Click += new System.EventHandler(this.manageRoomsToolStripMenuItem_Click);
71 | //
72 | // MainForm
73 | //
74 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
75 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
76 | this.ClientSize = new System.Drawing.Size(847, 450);
77 | this.Controls.Add(this.menuStrip1);
78 | this.IsMdiContainer = true;
79 | this.MainMenuStrip = this.menuStrip1;
80 | this.Name = "MainForm";
81 | this.Text = "MainForm";
82 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
83 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
84 | this.menuStrip1.ResumeLayout(false);
85 | this.menuStrip1.PerformLayout();
86 | this.ResumeLayout(false);
87 | this.PerformLayout();
88 |
89 | }
90 |
91 | #endregion
92 |
93 | private System.Windows.Forms.MenuStrip menuStrip1;
94 | private System.Windows.Forms.ToolStripMenuItem manageClientsToolStripMenuItem;
95 | private System.Windows.Forms.ToolStripMenuItem manageRoomsToolStripMenuItem;
96 | private System.Windows.Forms.ToolStripMenuItem manageReservationsToolStripMenuItem;
97 | }
98 | }
--------------------------------------------------------------------------------
/Hotel_System/ManageClientsForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace Hotel_System
12 | {
13 | public partial class ManageClientsForm : Form
14 | {
15 | Client client = new Client();
16 | public ManageClientsForm()
17 | {
18 | InitializeComponent();
19 | }
20 |
21 | private void btnClearFields_Click(object sender, EventArgs e)
22 | {
23 | tbID.Text = "";
24 | tbFirstName.Text = "";
25 | tbLastName.Text = "";
26 | tbPhone.Text = "";
27 | tbCountry.Text = "";
28 | }
29 |
30 | private void btnAdd_Click(object sender, EventArgs e)
31 | {
32 | String fname = tbFirstName.Text;
33 | String lname = tbLastName.Text;
34 | String phone = tbPhone.Text;
35 | String country = tbCountry.Text;
36 |
37 | if(fname.Trim().Equals("") || lname.Trim().Equals("") || phone.Trim().Equals(""))
38 | {
39 | MessageBox.Show("Required fields - Firstname/Lastname/Phone", "Empty Fields", MessageBoxButtons.OK, MessageBoxIcon.Error);
40 | }
41 | else
42 | {
43 | Boolean IsInsertedClient = client.InsertClient(fname, lname, phone, country);
44 |
45 | if (IsInsertedClient)
46 | {
47 | dgvClients.DataSource = client.GetAllClients();
48 | MessageBox.Show("Client inserted successfully!", "Client Add", MessageBoxButtons.OK, MessageBoxIcon.Information);
49 | btnClearFields.PerformClick();
50 | }
51 | else
52 | {
53 | MessageBox.Show("ERROR - Client not inserted!", "Client Add", MessageBoxButtons.OK, MessageBoxIcon.Error);
54 | }
55 | }
56 |
57 |
58 | }
59 |
60 | private void ManageClientsForm_Load(object sender, EventArgs e)
61 | {
62 | dgvClients.DataSource = client.GetAllClients();
63 | }
64 |
65 | private void btnEdit_Click(object sender, EventArgs e)
66 | {
67 | int id;
68 | String fname = tbFirstName.Text;
69 | String lname = tbLastName.Text;
70 | String phone = tbPhone.Text;
71 | String country = tbCountry.Text;
72 |
73 | try
74 | {
75 | id = Convert.ToInt32(tbID.Text);
76 |
77 | if (fname.Trim().Equals("") || lname.Trim().Equals("") || phone.Trim().Equals(""))
78 | {
79 | MessageBox.Show("Required fields - Firstname/Lastname/Phone", "Empty Fields", MessageBoxButtons.OK, MessageBoxIcon.Error);
80 | }
81 | else
82 | {
83 | Boolean IsUpdatedClient = client.EditClient(id, fname, lname, phone, country);
84 |
85 | if (IsUpdatedClient)
86 | {
87 | dgvClients.DataSource = client.GetAllClients();
88 | MessageBox.Show("Client updated successfully!", "Client Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
89 | }
90 | else
91 | {
92 | MessageBox.Show("ERROR - Client not updated!", "Client Update", MessageBoxButtons.OK, MessageBoxIcon.Error);
93 | }
94 | }
95 | }
96 | catch(Exception ex)
97 | {
98 | MessageBox.Show(ex.Message, "ID error", MessageBoxButtons.OK, MessageBoxIcon.Error);
99 | }
100 |
101 |
102 | }
103 |
104 |
105 | private void dgvClients_CellClick(object sender, DataGridViewCellEventArgs e)
106 | {
107 | tbID.Text = dgvClients.CurrentRow.Cells[0].Value.ToString();
108 | tbFirstName.Text = dgvClients.CurrentRow.Cells[1].Value.ToString();
109 | tbLastName.Text = dgvClients.CurrentRow.Cells[2].Value.ToString();
110 | tbPhone.Text = dgvClients.CurrentRow.Cells[3].Value.ToString();
111 | tbCountry.Text = dgvClients.CurrentRow.Cells[4].Value.ToString();
112 | }
113 |
114 | private void btnRemove_Click(object sender, EventArgs e)
115 | {
116 | try
117 | {
118 | int id = Convert.ToInt32(tbID.Text);
119 |
120 | if (client.RemoveClient(id))
121 | {
122 | dgvClients.DataSource = client.GetAllClients();
123 | MessageBox.Show("Client deleted successfully!", "Client Delete", MessageBoxButtons.OK, MessageBoxIcon.Information);
124 | btnClearFields.PerformClick();
125 | }
126 | else
127 | {
128 | MessageBox.Show("ERROR - Client not deleted!", "Client Delete", MessageBoxButtons.OK, MessageBoxIcon.Error);
129 | }
130 | }
131 | catch (Exception ex)
132 | {
133 | MessageBox.Show(ex.Message, "ID error", MessageBoxButtons.OK, MessageBoxIcon.Error);
134 | }
135 | }
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/Hotel_System/ManageRoomsForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace Hotel_System
12 | {
13 | public partial class ManageRoomsForm : Form
14 | {
15 | public ManageRoomsForm()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | Room room = new Room();
21 | private void ManageRoomsForm_Load(object sender, EventArgs e)
22 | {
23 | cbRoomType.DataSource = room.RoomTypeList();
24 | cbRoomType.DisplayMember = "label";
25 | cbRoomType.ValueMember = "id";
26 |
27 | dgvRooms.DataSource = room.GetAllRooms();
28 |
29 | }
30 |
31 | private void btnAdd_Click(object sender, EventArgs e)
32 | {
33 |
34 | int type = Convert.ToInt32(cbRoomType.SelectedValue.ToString());
35 | String phone = tbPhone.Text;
36 | String free = "";
37 |
38 | try
39 | {
40 | int number = Convert.ToInt32(tbNumber.Text);
41 | if (rbYes.Checked)
42 | {
43 | free = "YES";
44 | }
45 | else if (rbNo.Checked)
46 | {
47 | free = "NO";
48 | }
49 |
50 | if (room.InsertRoom(number, type, phone, free))
51 | {
52 | dgvRooms.DataSource = room.GetAllRooms();
53 | MessageBox.Show("Room inserted successfully!", "Room Add", MessageBoxButtons.OK, MessageBoxIcon.Information);
54 | btnClearFields.PerformClick();
55 | }
56 | else
57 | {
58 | MessageBox.Show("ERROR - Room not inserted!", "Room Add", MessageBoxButtons.OK, MessageBoxIcon.Error);
59 | }
60 | }
61 | catch (Exception ex)
62 | {
63 | MessageBox.Show(ex.Message, "Room number error", MessageBoxButtons.OK, MessageBoxIcon.Error);
64 | }
65 |
66 |
67 | }
68 |
69 | private void btnEdit_Click(object sender, EventArgs e)
70 | {
71 |
72 | int type = Convert.ToInt32(cbRoomType.SelectedValue.ToString());
73 | String phone = tbPhone.Text;
74 | String free = "";
75 |
76 | try
77 | {
78 | int number = Convert.ToInt32(tbNumber.Text);
79 |
80 | if (rbYes.Checked)
81 | {
82 | free = "YES";
83 | }
84 | else if (rbNo.Checked)
85 | {
86 | free = "NO";
87 | }
88 |
89 | if (room.EditRoom(number, type, phone, free))
90 | {
91 | dgvRooms.DataSource = room.GetAllRooms();
92 | MessageBox.Show("Room data updated successfully!", "Room Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
93 | }
94 | else
95 | {
96 | MessageBox.Show("ERROR - Room data not updated!", "Room Update", MessageBoxButtons.OK, MessageBoxIcon.Error);
97 | }
98 | }
99 | catch (Exception ex)
100 | {
101 | MessageBox.Show(ex.Message, "Room number error", MessageBoxButtons.OK, MessageBoxIcon.Error);
102 | }
103 |
104 | }
105 |
106 | private void btnRemove_Click(object sender, EventArgs e)
107 | {
108 | try
109 | {
110 | int number = Convert.ToInt32(tbNumber.Text);
111 |
112 | if (room.RemoveRoom(number))
113 | {
114 | dgvRooms.DataSource = room.GetAllRooms();
115 | MessageBox.Show("Room deleted successfully!", "Room Delete", MessageBoxButtons.OK, MessageBoxIcon.Information);
116 | btnClearFields.PerformClick();
117 | }
118 | else
119 | {
120 | MessageBox.Show("ERROR - Room not deleted!", "Room Delete", MessageBoxButtons.OK, MessageBoxIcon.Error);
121 | }
122 | }
123 | catch (Exception ex)
124 | {
125 | MessageBox.Show(ex.Message, "Room number error", MessageBoxButtons.OK, MessageBoxIcon.Error);
126 | }
127 |
128 | }
129 |
130 | private void btnClearFields_Click(object sender, EventArgs e)
131 | {
132 | tbNumber.Text = "";
133 | cbRoomType.SelectedIndex = 0;
134 | tbPhone.Text = "";
135 | rbYes.Checked = true;
136 | }
137 |
138 |
139 | private void dgvRooms_CellClick(object sender, DataGridViewCellEventArgs e)
140 | {
141 | tbNumber.Text = dgvRooms.CurrentRow.Cells[0].Value.ToString();
142 | cbRoomType.SelectedValue = dgvRooms.CurrentRow.Cells[1].Value;
143 | tbPhone.Text = dgvRooms.CurrentRow.Cells[2].Value.ToString();
144 |
145 | string free = dgvRooms.CurrentRow.Cells[3].Value.ToString();
146 |
147 | if (free.Equals("YES"))
148 | {
149 | rbYes.Checked = true;
150 | //rbNo.Checked = false;
151 | }
152 | else if (free.Equals("NO"))
153 | {
154 | // rbYes.Checked = false;
155 | rbNo.Checked = true;
156 | }
157 |
158 |
159 | }
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/Hotel_System/Hotel_System.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {68030EB0-345A-4F76-81C2-470D4487CB6D}
8 | WinExe
9 | Hotel_System
10 | Hotel_System
11 | v4.7.2
12 | 512
13 | true
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 | mysql-connector-net-8.0.25-noinstall\v4.5.2\MySql.Data.dll
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | Form
56 |
57 |
58 | LoginForm.cs
59 |
60 |
61 | Form
62 |
63 |
64 | MainForm.cs
65 |
66 |
67 | Form
68 |
69 |
70 | ManageClientsForm.cs
71 |
72 |
73 | Form
74 |
75 |
76 | ManageReservationsForm.cs
77 |
78 |
79 | Form
80 |
81 |
82 | ManageRoomsForm.cs
83 |
84 |
85 |
86 |
87 |
88 |
89 | LoginForm.cs
90 |
91 |
92 | MainForm.cs
93 |
94 |
95 | ManageClientsForm.cs
96 |
97 |
98 | ManageReservationsForm.cs
99 |
100 |
101 | ManageRoomsForm.cs
102 |
103 |
104 | ResXFileCodeGenerator
105 | Resources.Designer.cs
106 | Designer
107 |
108 |
109 | True
110 | Resources.resx
111 | True
112 |
113 |
114 | SettingsSingleFileGenerator
115 | Settings.Designer.cs
116 |
117 |
118 | True
119 | Settings.settings
120 | True
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/Hotel_System/LoginForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Hotel_System/ManageClientsForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Hotel_System/ManageRoomsForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Hotel_System/ManageReservationsForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Hotel_System/MainForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/Hotel_System/Room.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Data;
7 | using MySql.Data.MySqlClient;
8 |
9 | namespace Hotel_System
10 | {
11 | class Room
12 | {
13 | DBConnection conn = new DBConnection();
14 | //get all roomTypes
15 | public DataTable RoomTypeList()
16 | {
17 | MySqlCommand command = new MySqlCommand("SELECT * FROM rooms_type", conn.GetConnection());
18 | MySqlDataAdapter adapter = new MySqlDataAdapter();
19 | DataTable table = new DataTable();
20 |
21 | adapter.SelectCommand = command;
22 | adapter.Fill(table);
23 |
24 | return table;
25 | }
26 |
27 | //get all rooms based on type
28 | public DataTable RoomByType(int type)
29 | {
30 | MySqlCommand command = new MySqlCommand("SELECT * FROM rooms WHERE type=@type and free = 'YES'", conn.GetConnection());
31 | MySqlDataAdapter adapter = new MySqlDataAdapter();
32 | DataTable table = new DataTable();
33 |
34 | command.Parameters.Add("@type", MySqlDbType.Int32).Value = type;
35 |
36 | adapter.SelectCommand = command;
37 | adapter.Fill(table);
38 |
39 | return table;
40 | }
41 |
42 | //get room type id
43 | public int GetRoomType(int number)
44 | {
45 | MySqlCommand command = new MySqlCommand("SELECT type FROM rooms WHERE number=@number", conn.GetConnection());
46 | MySqlDataAdapter adapter = new MySqlDataAdapter();
47 | DataTable table = new DataTable();
48 |
49 | command.Parameters.Add("@number", MySqlDbType.Int32).Value = number;
50 |
51 | adapter.SelectCommand = command;
52 | adapter.Fill(table);
53 |
54 | return Convert.ToInt32(table.Rows[0][0].ToString());
55 | }
56 |
57 | //set free to NO/YES
58 | public bool SetRoomFree(int number, String isFree)
59 | {
60 | MySqlCommand command = new MySqlCommand("UPDATE `rooms` SET `free`=@isFree' WHERE `number`=@number", conn.GetConnection());
61 | MySqlDataAdapter adapter = new MySqlDataAdapter();
62 | DataTable table = new DataTable();
63 |
64 | command.Parameters.Add("@number", MySqlDbType.Int32).Value = number;
65 | command.Parameters.Add("@isFree", MySqlDbType.VarChar).Value = isFree;
66 |
67 | conn.OpenConnection();
68 | if (command.ExecuteNonQuery() == 1)
69 | {
70 | conn.CloseConnection();
71 | return true;
72 | }
73 | else
74 | {
75 | conn.CloseConnection();
76 | return false;
77 | }
78 | }
79 |
80 | //insert new room
81 | public bool InsertRoom(int number, int type, String phone, String free)
82 | {
83 | MySqlCommand command = new MySqlCommand();
84 | String queryInsert = "INSERT INTO `rooms`(`number`, `type`, `phone`, `free`) VALUES (@number, @type, @phone, @free)";
85 | command.CommandText = queryInsert;
86 | command.Connection = conn.GetConnection();
87 |
88 | command.Parameters.Add("@number", MySqlDbType.Int32).Value = number;
89 | command.Parameters.Add("@type", MySqlDbType.Int32).Value = type;
90 | command.Parameters.Add("@phone", MySqlDbType.VarChar).Value = phone;
91 | command.Parameters.Add("@free", MySqlDbType.VarChar).Value = free;
92 |
93 | conn.OpenConnection();
94 | if (command.ExecuteNonQuery() == 1)
95 | {
96 | conn.CloseConnection();
97 | return true;
98 | }
99 | else
100 | {
101 | conn.CloseConnection();
102 | return false;
103 | }
104 | }
105 |
106 | //get all rooms
107 | public DataTable GetAllRooms()
108 | {
109 | MySqlCommand command = new MySqlCommand("SELECT * FROM rooms", conn.GetConnection());
110 | MySqlDataAdapter adapter = new MySqlDataAdapter();
111 | DataTable table = new DataTable();
112 |
113 | adapter.SelectCommand = command;
114 | adapter.Fill(table);
115 |
116 | return table;
117 | }
118 |
119 |
120 | //edit ROOM data
121 | public bool EditRoom(int number, int type, String phone, String free)
122 | {
123 | MySqlCommand command = new MySqlCommand();
124 | String queryUpdate = "UPDATE rooms SET type=@type, phone=@phone, free=@free WHERE number=@number";
125 | command.CommandText = queryUpdate;
126 | command.Connection = conn.GetConnection();
127 |
128 | command.Parameters.Add("@number", MySqlDbType.Int32).Value = number;
129 | command.Parameters.Add("@type", MySqlDbType.Int32).Value = type;
130 | command.Parameters.Add("@phone", MySqlDbType.VarChar).Value = phone;
131 | command.Parameters.Add("@free", MySqlDbType.VarChar).Value = free;
132 |
133 | conn.OpenConnection();
134 | if (command.ExecuteNonQuery() == 1)
135 | {
136 | conn.CloseConnection();
137 | return true;
138 | }
139 | else
140 | {
141 | conn.CloseConnection();
142 | return false;
143 | }
144 | }
145 |
146 | //remove room
147 | public bool RemoveRoom(int number)
148 | {
149 | MySqlCommand command = new MySqlCommand();
150 | String queryDelete = "DELETE FROM rooms WHERE number=@number";
151 | command.CommandText = queryDelete;
152 | command.Connection = conn.GetConnection();
153 |
154 | command.Parameters.Add("@number", MySqlDbType.Int32).Value = number;
155 |
156 | conn.OpenConnection();
157 | if (command.ExecuteNonQuery() == 1)
158 | {
159 | conn.CloseConnection();
160 | return true;
161 | }
162 | else
163 | {
164 | conn.CloseConnection();
165 | return false;
166 | }
167 | }
168 | }
169 | }
170 |
--------------------------------------------------------------------------------
/Hotel_System/hotel_system.sql:
--------------------------------------------------------------------------------
1 | -- phpMyAdmin SQL Dump
2 | -- version 5.0.4
3 | -- https://www.phpmyadmin.net/
4 | --
5 | -- Host: 127.0.0.1
6 | -- Generation Time: May 27, 2021 at 10:22 PM
7 | -- Server version: 10.4.17-MariaDB
8 | -- PHP Version: 8.0.1
9 |
10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11 | START TRANSACTION;
12 | SET time_zone = "+00:00";
13 |
14 |
15 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
16 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
17 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
18 | /*!40101 SET NAMES utf8mb4 */;
19 |
20 | --
21 | -- Database: `hotel_system`
22 | --
23 |
24 | -- --------------------------------------------------------
25 |
26 | --
27 | -- Table structure for table `clients`
28 | --
29 |
30 | CREATE TABLE `clients` (
31 | `id` int(11) NOT NULL,
32 | `first_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
33 | `last_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
34 | `phone` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
35 | `country` varchar(100) COLLATE utf8_unicode_ci NOT NULL
36 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
37 |
38 | --
39 | -- Dumping data for table `clients`
40 | --
41 |
42 | INSERT INTO `clients` (`id`, `first_name`, `last_name`, `phone`, `country`) VALUES
43 | (1, 'pera', 'mikic', '0658526858', 'serbia'),
44 | (2, 'fname', 'lname', '191191191', 'usa'),
45 | (3, 'new', 'user', '+3817458948', 'macedonia');
46 |
47 | -- --------------------------------------------------------
48 |
49 | --
50 | -- Table structure for table `reservations`
51 | --
52 |
53 | CREATE TABLE `reservations` (
54 | `id` int(11) NOT NULL,
55 | `room_number` int(11) NOT NULL,
56 | `client_id` int(11) NOT NULL,
57 | `date_in` date NOT NULL,
58 | `date_out` date NOT NULL
59 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
60 |
61 | --
62 | -- Dumping data for table `reservations`
63 | --
64 |
65 | INSERT INTO `reservations` (`id`, `room_number`, `client_id`, `date_in`, `date_out`) VALUES
66 | (1, 2, 1, '2021-05-27', '2021-05-29'),
67 | (3, 3, 3, '2021-05-26', '2021-05-27');
68 |
69 | -- --------------------------------------------------------
70 |
71 | --
72 | -- Table structure for table `rooms`
73 | --
74 |
75 | CREATE TABLE `rooms` (
76 | `number` int(11) NOT NULL,
77 | `type` int(11) NOT NULL,
78 | `phone` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
79 | `free` varchar(10) COLLATE utf8_unicode_ci NOT NULL
80 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
81 |
82 | --
83 | -- Dumping data for table `rooms`
84 | --
85 |
86 | INSERT INTO `rooms` (`number`, `type`, `phone`, `free`) VALUES
87 | (2, 1, '19605152625', 'YES'),
88 | (3, 2, '196051582616', 'NO'),
89 | (5, 3, '1960515265656', 'YES'),
90 | (7, 3, '+381697458695', 'NO'),
91 | (9, 2, '126495626', 'YES'),
92 | (25, 4, '+3817485968', 'NO');
93 |
94 | -- --------------------------------------------------------
95 |
96 | --
97 | -- Table structure for table `rooms_type`
98 | --
99 |
100 | CREATE TABLE `rooms_type` (
101 | `id` int(11) NOT NULL,
102 | `label` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
103 | `price` decimal(9,2) NOT NULL
104 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
105 |
106 | --
107 | -- Dumping data for table `rooms_type`
108 | --
109 |
110 | INSERT INTO `rooms_type` (`id`, `label`, `price`) VALUES
111 | (1, 'single', '1000.00'),
112 | (2, 'double', '2000.00'),
113 | (3, 'family', '3000.00'),
114 | (4, 'suite', '5000.00');
115 |
116 | -- --------------------------------------------------------
117 |
118 | --
119 | -- Table structure for table `users`
120 | --
121 |
122 | CREATE TABLE `users` (
123 | `id` int(11) NOT NULL,
124 | `username` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
125 | `password` varchar(50) COLLATE utf8_unicode_ci NOT NULL
126 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
127 |
128 | --
129 | -- Dumping data for table `users`
130 | --
131 |
132 | INSERT INTO `users` (`id`, `username`, `password`) VALUES
133 | (1, 'admin', 'admin');
134 |
135 | --
136 | -- Indexes for dumped tables
137 | --
138 |
139 | --
140 | -- Indexes for table `clients`
141 | --
142 | ALTER TABLE `clients`
143 | ADD PRIMARY KEY (`id`);
144 |
145 | --
146 | -- Indexes for table `reservations`
147 | --
148 | ALTER TABLE `reservations`
149 | ADD PRIMARY KEY (`id`),
150 | ADD KEY `fk_room_number` (`room_number`),
151 | ADD KEY `fk_client_id` (`client_id`);
152 |
153 | --
154 | -- Indexes for table `rooms`
155 | --
156 | ALTER TABLE `rooms`
157 | ADD PRIMARY KEY (`number`),
158 | ADD KEY `fk_type_id` (`type`);
159 |
160 | --
161 | -- Indexes for table `rooms_type`
162 | --
163 | ALTER TABLE `rooms_type`
164 | ADD PRIMARY KEY (`id`);
165 |
166 | --
167 | -- Indexes for table `users`
168 | --
169 | ALTER TABLE `users`
170 | ADD PRIMARY KEY (`id`),
171 | ADD UNIQUE KEY `username` (`username`);
172 |
173 | --
174 | -- AUTO_INCREMENT for dumped tables
175 | --
176 |
177 | --
178 | -- AUTO_INCREMENT for table `clients`
179 | --
180 | ALTER TABLE `clients`
181 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
182 |
183 | --
184 | -- AUTO_INCREMENT for table `reservations`
185 | --
186 | ALTER TABLE `reservations`
187 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
188 |
189 | --
190 | -- AUTO_INCREMENT for table `rooms_type`
191 | --
192 | ALTER TABLE `rooms_type`
193 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
194 |
195 | --
196 | -- AUTO_INCREMENT for table `users`
197 | --
198 | ALTER TABLE `users`
199 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
200 |
201 | --
202 | -- Constraints for dumped tables
203 | --
204 |
205 | --
206 | -- Constraints for table `reservations`
207 | --
208 | ALTER TABLE `reservations`
209 | ADD CONSTRAINT `fk_client_id` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
210 | ADD CONSTRAINT `fk_room_number` FOREIGN KEY (`room_number`) REFERENCES `rooms` (`number`) ON DELETE CASCADE ON UPDATE CASCADE;
211 |
212 | --
213 | -- Constraints for table `rooms`
214 | --
215 | ALTER TABLE `rooms`
216 | ADD CONSTRAINT `fk_type_id` FOREIGN KEY (`type`) REFERENCES `rooms_type` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
217 | COMMIT;
218 |
219 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
220 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
221 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
222 |
--------------------------------------------------------------------------------
/Hotel_System/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\profileUser.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------
/Hotel_System/ManageReservationsForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace Hotel_System
12 | {
13 | public partial class ManageReservationsForm : Form
14 | {
15 | public ManageReservationsForm()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | Room room = new Room();
21 | Reservation reservation = new Reservation();
22 | private void ManageReservationsForm_Load(object sender, EventArgs e)
23 | {
24 | //display room's type
25 | cbRoomType.DataSource = room.RoomTypeList();
26 | cbRoomType.DisplayMember = "label";
27 | cbRoomType.ValueMember = "id";
28 |
29 | //display free room's number depending on selected type
30 | int type = Convert.ToInt32(cbRoomType.SelectedValue.ToString());
31 | cbRoomNumber.DataSource = room.RoomByType(type);
32 | cbRoomNumber.DisplayMember = "number";
33 | cbRoomNumber.ValueMember = "number";
34 |
35 | dgvReservations.DataSource = reservation.GetAllReservations();
36 |
37 | }
38 |
39 | private void btnClearFields_Click(object sender, EventArgs e)
40 | {
41 | tbReservID.Text = "";
42 | tbClientID.Text = "";
43 | cbRoomType.SelectedIndex = 0;
44 | dateTimePickerIN.Value = DateTime.Now;
45 | dateTimePickerOUT.Value = DateTime.Now;
46 | }
47 |
48 | private void btnAdd_Click(object sender, EventArgs e)
49 | {
50 | try
51 | {
52 | int clientID = Convert.ToInt32(tbClientID.Text);
53 | int roomNumber = Convert.ToInt32(cbRoomNumber.SelectedValue);
54 | DateTime dateIn = dateTimePickerIN.Value;
55 | DateTime dateOut = dateTimePickerOUT.Value;
56 |
57 | if (dateIn < DateTime.Now)
58 | {
59 | MessageBox.Show("The Date must be Greater Or Equal than Current Date", "Invalid Date In", MessageBoxButtons.OK, MessageBoxIcon.Warning);
60 | }
61 | else if (dateOut < dateIn)
62 | {
63 | MessageBox.Show("The DateOut must be Greater Or Equal than DateIn", "Invalid Date Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
64 | }
65 | else
66 | {
67 | if (reservation.MakeReservation(roomNumber, clientID, dateIn, dateOut))
68 | {
69 | room.SetRoomFree(roomNumber,"NO");
70 | dgvReservations.DataSource = reservation.GetAllReservations();
71 | MessageBox.Show("Reservation made successfully!", "Make Reservation", MessageBoxButtons.OK, MessageBoxIcon.Information);
72 | btnClearFields.PerformClick();
73 | }
74 | else
75 | {
76 | MessageBox.Show("ERROR - Reservation not added!", "Make Reservation", MessageBoxButtons.OK, MessageBoxIcon.Error);
77 | }
78 | }
79 |
80 |
81 | }
82 | catch (Exception ex)
83 | {
84 | MessageBox.Show(ex.Message, "Make Reservation error", MessageBoxButtons.OK, MessageBoxIcon.Error);
85 | }
86 | }
87 |
88 | private void btnEdit_Click(object sender, EventArgs e)
89 | {
90 | try
91 | {
92 | int reservationID = Convert.ToInt32(tbReservID.Text);
93 | int clientID = Convert.ToInt32(tbClientID.Text);
94 | int roomNumber = Convert.ToInt32(dgvReservations.CurrentRow.Cells[1].Value.ToString());
95 | DateTime dateIn = dateTimePickerIN.Value;
96 | DateTime dateOut = dateTimePickerOUT.Value;
97 |
98 | if (dateIn < DateTime.Now)
99 | {
100 | MessageBox.Show("The Date must be Greater Or Equal than Current Date", "Invalid Date In", MessageBoxButtons.OK, MessageBoxIcon.Warning);
101 | }
102 | else if (dateOut < dateIn)
103 | {
104 | MessageBox.Show("The DateOut must be Greater Or Equal than DateIn", "Invalid Date Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
105 | }
106 | else
107 | {
108 | if (reservation.EditReservation(reservationID,roomNumber, clientID, dateIn, dateOut))
109 | {
110 | room.SetRoomFree(roomNumber,"NO");
111 | dgvReservations.DataSource = reservation.GetAllReservations();
112 | MessageBox.Show("Reservation data updated!", "Edit Reservation", MessageBoxButtons.OK, MessageBoxIcon.Information);
113 | }
114 | else
115 | {
116 | MessageBox.Show("ERROR - Reservation not updated!", "Edit Reservation", MessageBoxButtons.OK, MessageBoxIcon.Error);
117 | }
118 | }
119 |
120 |
121 | }
122 | catch (Exception ex)
123 | {
124 | MessageBox.Show(ex.Message, "Edit Reservation error", MessageBoxButtons.OK, MessageBoxIcon.Error);
125 | }
126 | }
127 |
128 | private void btnRemove_Click(object sender, EventArgs e)
129 | {
130 |
131 | try
132 | {
133 | int reservationID = Convert.ToInt32(tbReservID.Text);
134 | int roomNumber = Convert.ToInt32(dgvReservations.CurrentRow.Cells[1].Value.ToString());
135 |
136 | if (reservation.RemoveReservation(reservationID))
137 | {
138 | room.SetRoomFree(roomNumber, "YES");
139 | dgvReservations.DataSource = reservation.GetAllReservations();
140 | MessageBox.Show("Reservation deleted successfully!", "Reservation Delete", MessageBoxButtons.OK, MessageBoxIcon.Information);
141 | btnClearFields.PerformClick();
142 | }
143 | else
144 | {
145 | MessageBox.Show("ERROR - Reservation not deleted!", "Reservation Delete", MessageBoxButtons.OK, MessageBoxIcon.Error);
146 | }
147 | }
148 | catch (Exception ex)
149 | {
150 | MessageBox.Show(ex.Message, "Delete reservation error", MessageBoxButtons.OK, MessageBoxIcon.Error);
151 | }
152 | }
153 |
154 | private void cbRoomType_SelectedIndexChanged(object sender, EventArgs e)
155 | {
156 | try
157 | {
158 | //display room's number depending on selected type
159 | int type = Convert.ToInt32(cbRoomType.SelectedValue.ToString());
160 | cbRoomNumber.DataSource = room.RoomByType(type);
161 | cbRoomNumber.DisplayMember = "number";
162 | cbRoomNumber.ValueMember = "number";
163 | }
164 | catch (Exception ex)
165 | {
166 | //MessageBox.Show(ex.Message, "Room number error", MessageBoxButtons.OK, MessageBoxIcon.Error);
167 | }
168 | }
169 |
170 | private void dgvReservations_CellClick(object sender, DataGridViewCellEventArgs e)
171 | {
172 | tbReservID.Text = dgvReservations.CurrentRow.Cells[0].Value.ToString();
173 |
174 | //room ID
175 | int roomID = Convert.ToInt32(dgvReservations.CurrentRow.Cells[1].Value.ToString());
176 |
177 | //room type from ddl
178 | cbRoomType.SelectedValue = room.GetRoomType(roomID);
179 |
180 | //room number from ddl
181 | cbRoomNumber.SelectedValue = roomID;
182 |
183 | tbClientID.Text = dgvReservations.CurrentRow.Cells[2].Value.ToString();
184 |
185 | dateTimePickerIN.Value = Convert.ToDateTime(dgvReservations.CurrentRow.Cells[3].Value.ToString());
186 | dateTimePickerOUT.Value = Convert.ToDateTime(dgvReservations.CurrentRow.Cells[4].Value.ToString());
187 |
188 |
189 | }
190 | }
191 | }
192 |
--------------------------------------------------------------------------------
/Hotel_System/LoginForm.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Hotel_System
3 | {
4 | partial class LoginForm
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
33 | this.panel1 = new System.Windows.Forms.Panel();
34 | this.label1 = new System.Windows.Forms.Label();
35 | this.groupBox1 = new System.Windows.Forms.GroupBox();
36 | this.btnLogin = new System.Windows.Forms.Button();
37 | this.tbPassword = new System.Windows.Forms.TextBox();
38 | this.label3 = new System.Windows.Forms.Label();
39 | this.tbUsername = new System.Windows.Forms.TextBox();
40 | this.label2 = new System.Windows.Forms.Label();
41 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
42 | this.panel1.SuspendLayout();
43 | this.groupBox1.SuspendLayout();
44 | this.SuspendLayout();
45 | //
46 | // pictureBox1
47 | //
48 | this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
49 | this.pictureBox1.Image = global::Hotel_System.Properties.Resources.profileUser;
50 | this.pictureBox1.Location = new System.Drawing.Point(113, 12);
51 | this.pictureBox1.Name = "pictureBox1";
52 | this.pictureBox1.Size = new System.Drawing.Size(150, 150);
53 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
54 | this.pictureBox1.TabIndex = 0;
55 | this.pictureBox1.TabStop = false;
56 | //
57 | // panel1
58 | //
59 | this.panel1.BackColor = System.Drawing.Color.Gold;
60 | this.panel1.Controls.Add(this.label1);
61 | this.panel1.Location = new System.Drawing.Point(7, 168);
62 | this.panel1.Name = "panel1";
63 | this.panel1.Size = new System.Drawing.Size(376, 72);
64 | this.panel1.TabIndex = 1;
65 | //
66 | // label1
67 | //
68 | this.label1.BackColor = System.Drawing.Color.White;
69 | this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
70 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 39.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
71 | this.label1.Location = new System.Drawing.Point(0, 0);
72 | this.label1.Name = "label1";
73 | this.label1.Size = new System.Drawing.Size(376, 72);
74 | this.label1.TabIndex = 0;
75 | this.label1.Text = "Sign In";
76 | this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
77 | //
78 | // groupBox1
79 | //
80 | this.groupBox1.Controls.Add(this.btnLogin);
81 | this.groupBox1.Controls.Add(this.tbPassword);
82 | this.groupBox1.Controls.Add(this.label3);
83 | this.groupBox1.Controls.Add(this.tbUsername);
84 | this.groupBox1.Controls.Add(this.label2);
85 | this.groupBox1.Location = new System.Drawing.Point(7, 246);
86 | this.groupBox1.Name = "groupBox1";
87 | this.groupBox1.Size = new System.Drawing.Size(376, 188);
88 | this.groupBox1.TabIndex = 2;
89 | this.groupBox1.TabStop = false;
90 | //
91 | // btnLogin
92 | //
93 | this.btnLogin.BackColor = System.Drawing.Color.MidnightBlue;
94 | this.btnLogin.Cursor = System.Windows.Forms.Cursors.Hand;
95 | this.btnLogin.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
96 | this.btnLogin.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
97 | this.btnLogin.ForeColor = System.Drawing.Color.White;
98 | this.btnLogin.Location = new System.Drawing.Point(6, 131);
99 | this.btnLogin.Name = "btnLogin";
100 | this.btnLogin.Padding = new System.Windows.Forms.Padding(2);
101 | this.btnLogin.Size = new System.Drawing.Size(362, 47);
102 | this.btnLogin.TabIndex = 4;
103 | this.btnLogin.Text = "LOGIN";
104 | this.btnLogin.UseVisualStyleBackColor = false;
105 | this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
106 | //
107 | // tbPassword
108 | //
109 | this.tbPassword.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
110 | this.tbPassword.Location = new System.Drawing.Point(121, 74);
111 | this.tbPassword.Name = "tbPassword";
112 | this.tbPassword.Size = new System.Drawing.Size(249, 31);
113 | this.tbPassword.TabIndex = 3;
114 | this.tbPassword.UseSystemPasswordChar = true;
115 | //
116 | // label3
117 | //
118 | this.label3.AutoSize = true;
119 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
120 | this.label3.ForeColor = System.Drawing.Color.White;
121 | this.label3.Location = new System.Drawing.Point(6, 74);
122 | this.label3.Name = "label3";
123 | this.label3.Size = new System.Drawing.Size(112, 25);
124 | this.label3.TabIndex = 2;
125 | this.label3.Text = "Password:";
126 | //
127 | // tbUsername
128 | //
129 | this.tbUsername.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
130 | this.tbUsername.Location = new System.Drawing.Point(121, 26);
131 | this.tbUsername.Name = "tbUsername";
132 | this.tbUsername.Size = new System.Drawing.Size(249, 31);
133 | this.tbUsername.TabIndex = 1;
134 | //
135 | // label2
136 | //
137 | this.label2.AutoSize = true;
138 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
139 | this.label2.ForeColor = System.Drawing.Color.White;
140 | this.label2.Location = new System.Drawing.Point(6, 26);
141 | this.label2.Name = "label2";
142 | this.label2.Size = new System.Drawing.Size(116, 25);
143 | this.label2.TabIndex = 0;
144 | this.label2.Text = "Username:";
145 | //
146 | // LoginForm
147 | //
148 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
149 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
150 | this.BackColor = System.Drawing.Color.Teal;
151 | this.ClientSize = new System.Drawing.Size(389, 434);
152 | this.Controls.Add(this.groupBox1);
153 | this.Controls.Add(this.panel1);
154 | this.Controls.Add(this.pictureBox1);
155 | this.Name = "LoginForm";
156 | this.Text = "Login Form";
157 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
158 | this.panel1.ResumeLayout(false);
159 | this.groupBox1.ResumeLayout(false);
160 | this.groupBox1.PerformLayout();
161 | this.ResumeLayout(false);
162 |
163 | }
164 |
165 | #endregion
166 |
167 | private System.Windows.Forms.PictureBox pictureBox1;
168 | private System.Windows.Forms.Panel panel1;
169 | private System.Windows.Forms.Label label1;
170 | private System.Windows.Forms.GroupBox groupBox1;
171 | private System.Windows.Forms.Label label2;
172 | private System.Windows.Forms.TextBox tbPassword;
173 | private System.Windows.Forms.Label label3;
174 | private System.Windows.Forms.TextBox tbUsername;
175 | private System.Windows.Forms.Button btnLogin;
176 | }
177 | }
--------------------------------------------------------------------------------
/Hotel_System/ManageClientsForm.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Hotel_System
3 | {
4 | partial class ManageClientsForm
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | this.panel1 = new System.Windows.Forms.Panel();
33 | this.btnClearFields = new System.Windows.Forms.Button();
34 | this.btnRemove = new System.Windows.Forms.Button();
35 | this.btnEdit = new System.Windows.Forms.Button();
36 | this.btnAdd = new System.Windows.Forms.Button();
37 | this.dgvClients = new System.Windows.Forms.DataGridView();
38 | this.tbCountry = new System.Windows.Forms.TextBox();
39 | this.label6 = new System.Windows.Forms.Label();
40 | this.tbPhone = new System.Windows.Forms.TextBox();
41 | this.label5 = new System.Windows.Forms.Label();
42 | this.tbLastName = new System.Windows.Forms.TextBox();
43 | this.label4 = new System.Windows.Forms.Label();
44 | this.tbFirstName = new System.Windows.Forms.TextBox();
45 | this.label3 = new System.Windows.Forms.Label();
46 | this.tbID = new System.Windows.Forms.TextBox();
47 | this.label2 = new System.Windows.Forms.Label();
48 | this.panel2 = new System.Windows.Forms.Panel();
49 | this.label1 = new System.Windows.Forms.Label();
50 | this.panel1.SuspendLayout();
51 | ((System.ComponentModel.ISupportInitialize)(this.dgvClients)).BeginInit();
52 | this.panel2.SuspendLayout();
53 | this.SuspendLayout();
54 | //
55 | // panel1
56 | //
57 | this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(102)))), ((int)(((byte)(0)))));
58 | this.panel1.Controls.Add(this.btnClearFields);
59 | this.panel1.Controls.Add(this.btnRemove);
60 | this.panel1.Controls.Add(this.btnEdit);
61 | this.panel1.Controls.Add(this.btnAdd);
62 | this.panel1.Controls.Add(this.dgvClients);
63 | this.panel1.Controls.Add(this.tbCountry);
64 | this.panel1.Controls.Add(this.label6);
65 | this.panel1.Controls.Add(this.tbPhone);
66 | this.panel1.Controls.Add(this.label5);
67 | this.panel1.Controls.Add(this.tbLastName);
68 | this.panel1.Controls.Add(this.label4);
69 | this.panel1.Controls.Add(this.tbFirstName);
70 | this.panel1.Controls.Add(this.label3);
71 | this.panel1.Controls.Add(this.tbID);
72 | this.panel1.Controls.Add(this.label2);
73 | this.panel1.Controls.Add(this.panel2);
74 | this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
75 | this.panel1.Location = new System.Drawing.Point(0, 0);
76 | this.panel1.Name = "panel1";
77 | this.panel1.Size = new System.Drawing.Size(922, 514);
78 | this.panel1.TabIndex = 0;
79 | //
80 | // btnClearFields
81 | //
82 | this.btnClearFields.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
83 | this.btnClearFields.Location = new System.Drawing.Point(16, 443);
84 | this.btnClearFields.Name = "btnClearFields";
85 | this.btnClearFields.Size = new System.Drawing.Size(308, 45);
86 | this.btnClearFields.TabIndex = 15;
87 | this.btnClearFields.Text = "Clear Fields";
88 | this.btnClearFields.UseVisualStyleBackColor = true;
89 | this.btnClearFields.Click += new System.EventHandler(this.btnClearFields_Click);
90 | //
91 | // btnRemove
92 | //
93 | this.btnRemove.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
94 | this.btnRemove.Location = new System.Drawing.Point(243, 387);
95 | this.btnRemove.Name = "btnRemove";
96 | this.btnRemove.Size = new System.Drawing.Size(81, 41);
97 | this.btnRemove.TabIndex = 14;
98 | this.btnRemove.Text = "Remove";
99 | this.btnRemove.UseVisualStyleBackColor = true;
100 | this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click);
101 | //
102 | // btnEdit
103 | //
104 | this.btnEdit.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
105 | this.btnEdit.Location = new System.Drawing.Point(155, 387);
106 | this.btnEdit.Name = "btnEdit";
107 | this.btnEdit.Size = new System.Drawing.Size(82, 41);
108 | this.btnEdit.TabIndex = 13;
109 | this.btnEdit.Text = "Edit";
110 | this.btnEdit.UseVisualStyleBackColor = true;
111 | this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
112 | //
113 | // btnAdd
114 | //
115 | this.btnAdd.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
116 | this.btnAdd.Location = new System.Drawing.Point(16, 387);
117 | this.btnAdd.Name = "btnAdd";
118 | this.btnAdd.Size = new System.Drawing.Size(133, 41);
119 | this.btnAdd.TabIndex = 12;
120 | this.btnAdd.Text = "Add New Client";
121 | this.btnAdd.UseVisualStyleBackColor = true;
122 | this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
123 | //
124 | // dgvClients
125 | //
126 | this.dgvClients.AllowUserToAddRows = false;
127 | this.dgvClients.AllowUserToDeleteRows = false;
128 | this.dgvClients.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
129 | this.dgvClients.Location = new System.Drawing.Point(363, 101);
130 | this.dgvClients.Name = "dgvClients";
131 | this.dgvClients.ReadOnly = true;
132 | this.dgvClients.Size = new System.Drawing.Size(529, 387);
133 | this.dgvClients.TabIndex = 11;
134 | this.dgvClients.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvClients_CellClick);
135 | //
136 | // tbCountry
137 | //
138 | this.tbCountry.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
139 | this.tbCountry.Location = new System.Drawing.Point(122, 287);
140 | this.tbCountry.Name = "tbCountry";
141 | this.tbCountry.Size = new System.Drawing.Size(202, 29);
142 | this.tbCountry.TabIndex = 10;
143 | //
144 | // label6
145 | //
146 | this.label6.AutoSize = true;
147 | this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
148 | this.label6.Location = new System.Drawing.Point(36, 290);
149 | this.label6.Name = "label6";
150 | this.label6.Size = new System.Drawing.Size(80, 24);
151 | this.label6.TabIndex = 9;
152 | this.label6.Text = "Country:";
153 | //
154 | // tbPhone
155 | //
156 | this.tbPhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
157 | this.tbPhone.Location = new System.Drawing.Point(122, 240);
158 | this.tbPhone.Name = "tbPhone";
159 | this.tbPhone.Size = new System.Drawing.Size(202, 29);
160 | this.tbPhone.TabIndex = 8;
161 | //
162 | // label5
163 | //
164 | this.label5.AutoSize = true;
165 | this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
166 | this.label5.Location = new System.Drawing.Point(18, 243);
167 | this.label5.Name = "label5";
168 | this.label5.Size = new System.Drawing.Size(101, 24);
169 | this.label5.TabIndex = 7;
170 | this.label5.Text = "Phone No:";
171 | //
172 | // tbLastName
173 | //
174 | this.tbLastName.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
175 | this.tbLastName.Location = new System.Drawing.Point(122, 195);
176 | this.tbLastName.Name = "tbLastName";
177 | this.tbLastName.Size = new System.Drawing.Size(202, 29);
178 | this.tbLastName.TabIndex = 6;
179 | //
180 | // label4
181 | //
182 | this.label4.AutoSize = true;
183 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
184 | this.label4.Location = new System.Drawing.Point(18, 193);
185 | this.label4.Name = "label4";
186 | this.label4.Size = new System.Drawing.Size(104, 24);
187 | this.label4.TabIndex = 5;
188 | this.label4.Text = "Last Name:";
189 | //
190 | // tbFirstName
191 | //
192 | this.tbFirstName.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
193 | this.tbFirstName.Location = new System.Drawing.Point(122, 146);
194 | this.tbFirstName.Name = "tbFirstName";
195 | this.tbFirstName.Size = new System.Drawing.Size(202, 29);
196 | this.tbFirstName.TabIndex = 4;
197 | //
198 | // label3
199 | //
200 | this.label3.AutoSize = true;
201 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
202 | this.label3.Location = new System.Drawing.Point(18, 149);
203 | this.label3.Name = "label3";
204 | this.label3.Size = new System.Drawing.Size(106, 24);
205 | this.label3.TabIndex = 3;
206 | this.label3.Text = "First Name:";
207 | //
208 | // tbID
209 | //
210 | this.tbID.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
211 | this.tbID.Location = new System.Drawing.Point(122, 101);
212 | this.tbID.Name = "tbID";
213 | this.tbID.ReadOnly = true;
214 | this.tbID.Size = new System.Drawing.Size(202, 29);
215 | this.tbID.TabIndex = 2;
216 | //
217 | // label2
218 | //
219 | this.label2.AutoSize = true;
220 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
221 | this.label2.Location = new System.Drawing.Point(84, 101);
222 | this.label2.Name = "label2";
223 | this.label2.Size = new System.Drawing.Size(32, 24);
224 | this.label2.TabIndex = 1;
225 | this.label2.Text = "ID:";
226 | //
227 | // panel2
228 | //
229 | this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(142)))), ((int)(((byte)(68)))), ((int)(((byte)(173)))));
230 | this.panel2.Controls.Add(this.label1);
231 | this.panel2.Location = new System.Drawing.Point(0, 0);
232 | this.panel2.Name = "panel2";
233 | this.panel2.Size = new System.Drawing.Size(922, 65);
234 | this.panel2.TabIndex = 0;
235 | //
236 | // label1
237 | //
238 | this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
239 | this.label1.Font = new System.Drawing.Font("Arial", 32.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
240 | this.label1.ForeColor = System.Drawing.Color.White;
241 | this.label1.Location = new System.Drawing.Point(0, 0);
242 | this.label1.Name = "label1";
243 | this.label1.Size = new System.Drawing.Size(922, 65);
244 | this.label1.TabIndex = 0;
245 | this.label1.Text = "Manage Clients";
246 | this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
247 | //
248 | // ManageClientsForm
249 | //
250 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
251 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
252 | this.ClientSize = new System.Drawing.Size(922, 514);
253 | this.Controls.Add(this.panel1);
254 | this.Name = "ManageClientsForm";
255 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
256 | this.Text = "ManageClientsForm";
257 | this.Load += new System.EventHandler(this.ManageClientsForm_Load);
258 | this.panel1.ResumeLayout(false);
259 | this.panel1.PerformLayout();
260 | ((System.ComponentModel.ISupportInitialize)(this.dgvClients)).EndInit();
261 | this.panel2.ResumeLayout(false);
262 | this.ResumeLayout(false);
263 |
264 | }
265 |
266 | #endregion
267 |
268 | private System.Windows.Forms.Panel panel1;
269 | private System.Windows.Forms.Panel panel2;
270 | private System.Windows.Forms.Label label1;
271 | private System.Windows.Forms.TextBox tbPhone;
272 | private System.Windows.Forms.Label label5;
273 | private System.Windows.Forms.TextBox tbLastName;
274 | private System.Windows.Forms.Label label4;
275 | private System.Windows.Forms.TextBox tbFirstName;
276 | private System.Windows.Forms.Label label3;
277 | private System.Windows.Forms.TextBox tbID;
278 | private System.Windows.Forms.Label label2;
279 | private System.Windows.Forms.TextBox tbCountry;
280 | private System.Windows.Forms.Label label6;
281 | private System.Windows.Forms.DataGridView dgvClients;
282 | private System.Windows.Forms.Button btnAdd;
283 | private System.Windows.Forms.Button btnClearFields;
284 | private System.Windows.Forms.Button btnRemove;
285 | private System.Windows.Forms.Button btnEdit;
286 | }
287 | }
--------------------------------------------------------------------------------
/Hotel_System/ManageRoomsForm.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Hotel_System
3 | {
4 | partial class ManageRoomsForm
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.btnClearFields = new System.Windows.Forms.Button();
34 | this.btnRemove = new System.Windows.Forms.Button();
35 | this.btnEdit = new System.Windows.Forms.Button();
36 | this.btnAdd = new System.Windows.Forms.Button();
37 | this.dgvRooms = new System.Windows.Forms.DataGridView();
38 | this.tbPhone = new System.Windows.Forms.TextBox();
39 | this.label5 = new System.Windows.Forms.Label();
40 | this.label3 = new System.Windows.Forms.Label();
41 | this.tbNumber = new System.Windows.Forms.TextBox();
42 | this.label2 = new System.Windows.Forms.Label();
43 | this.panel2 = new System.Windows.Forms.Panel();
44 | this.panel1 = new System.Windows.Forms.Panel();
45 | this.panel3 = new System.Windows.Forms.Panel();
46 | this.rbNo = new System.Windows.Forms.RadioButton();
47 | this.rbYes = new System.Windows.Forms.RadioButton();
48 | this.label6 = new System.Windows.Forms.Label();
49 | this.cbRoomType = new System.Windows.Forms.ComboBox();
50 | ((System.ComponentModel.ISupportInitialize)(this.dgvRooms)).BeginInit();
51 | this.panel2.SuspendLayout();
52 | this.panel1.SuspendLayout();
53 | this.panel3.SuspendLayout();
54 | this.SuspendLayout();
55 | //
56 | // label1
57 | //
58 | this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
59 | this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
60 | this.label1.Font = new System.Drawing.Font("Arial", 32.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
61 | this.label1.ForeColor = System.Drawing.Color.White;
62 | this.label1.Location = new System.Drawing.Point(0, 0);
63 | this.label1.Name = "label1";
64 | this.label1.Size = new System.Drawing.Size(922, 65);
65 | this.label1.TabIndex = 0;
66 | this.label1.Text = "Manage Rooms";
67 | this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
68 | //
69 | // btnClearFields
70 | //
71 | this.btnClearFields.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
72 | this.btnClearFields.Location = new System.Drawing.Point(16, 443);
73 | this.btnClearFields.Name = "btnClearFields";
74 | this.btnClearFields.Size = new System.Drawing.Size(308, 45);
75 | this.btnClearFields.TabIndex = 15;
76 | this.btnClearFields.Text = "Clear Fields";
77 | this.btnClearFields.UseVisualStyleBackColor = true;
78 | this.btnClearFields.Click += new System.EventHandler(this.btnClearFields_Click);
79 | //
80 | // btnRemove
81 | //
82 | this.btnRemove.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
83 | this.btnRemove.Location = new System.Drawing.Point(243, 387);
84 | this.btnRemove.Name = "btnRemove";
85 | this.btnRemove.Size = new System.Drawing.Size(81, 41);
86 | this.btnRemove.TabIndex = 14;
87 | this.btnRemove.Text = "Remove";
88 | this.btnRemove.UseVisualStyleBackColor = true;
89 | this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click);
90 | //
91 | // btnEdit
92 | //
93 | this.btnEdit.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
94 | this.btnEdit.Location = new System.Drawing.Point(155, 387);
95 | this.btnEdit.Name = "btnEdit";
96 | this.btnEdit.Size = new System.Drawing.Size(82, 41);
97 | this.btnEdit.TabIndex = 13;
98 | this.btnEdit.Text = "Edit";
99 | this.btnEdit.UseVisualStyleBackColor = true;
100 | this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
101 | //
102 | // btnAdd
103 | //
104 | this.btnAdd.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
105 | this.btnAdd.Location = new System.Drawing.Point(16, 387);
106 | this.btnAdd.Name = "btnAdd";
107 | this.btnAdd.Size = new System.Drawing.Size(133, 41);
108 | this.btnAdd.TabIndex = 12;
109 | this.btnAdd.Text = "Add New Room";
110 | this.btnAdd.UseVisualStyleBackColor = true;
111 | this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
112 | //
113 | // dgvRooms
114 | //
115 | this.dgvRooms.AllowUserToAddRows = false;
116 | this.dgvRooms.AllowUserToDeleteRows = false;
117 | this.dgvRooms.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
118 | this.dgvRooms.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
119 | this.dgvRooms.Location = new System.Drawing.Point(363, 101);
120 | this.dgvRooms.Name = "dgvRooms";
121 | this.dgvRooms.ReadOnly = true;
122 | this.dgvRooms.Size = new System.Drawing.Size(529, 387);
123 | this.dgvRooms.TabIndex = 11;
124 | this.dgvRooms.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvRooms_CellClick);
125 | //
126 | // tbPhone
127 | //
128 | this.tbPhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
129 | this.tbPhone.Location = new System.Drawing.Point(122, 192);
130 | this.tbPhone.Name = "tbPhone";
131 | this.tbPhone.Size = new System.Drawing.Size(202, 29);
132 | this.tbPhone.TabIndex = 8;
133 | //
134 | // label5
135 | //
136 | this.label5.AutoSize = true;
137 | this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
138 | this.label5.Location = new System.Drawing.Point(18, 195);
139 | this.label5.Name = "label5";
140 | this.label5.Size = new System.Drawing.Size(101, 24);
141 | this.label5.TabIndex = 7;
142 | this.label5.Text = "Phone No:";
143 | //
144 | // label3
145 | //
146 | this.label3.AutoSize = true;
147 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
148 | this.label3.Location = new System.Drawing.Point(6, 149);
149 | this.label3.Name = "label3";
150 | this.label3.Size = new System.Drawing.Size(114, 24);
151 | this.label3.TabIndex = 3;
152 | this.label3.Text = "Room Type:";
153 | //
154 | // tbNumber
155 | //
156 | this.tbNumber.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
157 | this.tbNumber.Location = new System.Drawing.Point(122, 101);
158 | this.tbNumber.Name = "tbNumber";
159 | this.tbNumber.Size = new System.Drawing.Size(202, 29);
160 | this.tbNumber.TabIndex = 2;
161 | //
162 | // label2
163 | //
164 | this.label2.AutoSize = true;
165 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
166 | this.label2.Location = new System.Drawing.Point(24, 101);
167 | this.label2.Name = "label2";
168 | this.label2.Size = new System.Drawing.Size(96, 24);
169 | this.label2.TabIndex = 1;
170 | this.label2.Text = "Room No:";
171 | //
172 | // panel2
173 | //
174 | this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(142)))), ((int)(((byte)(68)))), ((int)(((byte)(173)))));
175 | this.panel2.Controls.Add(this.label1);
176 | this.panel2.Location = new System.Drawing.Point(0, 0);
177 | this.panel2.Name = "panel2";
178 | this.panel2.Size = new System.Drawing.Size(922, 65);
179 | this.panel2.TabIndex = 0;
180 | //
181 | // panel1
182 | //
183 | this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
184 | this.panel1.Controls.Add(this.panel3);
185 | this.panel1.Controls.Add(this.label6);
186 | this.panel1.Controls.Add(this.cbRoomType);
187 | this.panel1.Controls.Add(this.btnClearFields);
188 | this.panel1.Controls.Add(this.btnRemove);
189 | this.panel1.Controls.Add(this.btnEdit);
190 | this.panel1.Controls.Add(this.btnAdd);
191 | this.panel1.Controls.Add(this.dgvRooms);
192 | this.panel1.Controls.Add(this.tbPhone);
193 | this.panel1.Controls.Add(this.label5);
194 | this.panel1.Controls.Add(this.label3);
195 | this.panel1.Controls.Add(this.tbNumber);
196 | this.panel1.Controls.Add(this.label2);
197 | this.panel1.Controls.Add(this.panel2);
198 | this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
199 | this.panel1.Location = new System.Drawing.Point(0, 0);
200 | this.panel1.Name = "panel1";
201 | this.panel1.Size = new System.Drawing.Size(922, 514);
202 | this.panel1.TabIndex = 1;
203 | //
204 | // panel3
205 | //
206 | this.panel3.BackColor = System.Drawing.Color.White;
207 | this.panel3.Controls.Add(this.rbNo);
208 | this.panel3.Controls.Add(this.rbYes);
209 | this.panel3.Location = new System.Drawing.Point(124, 245);
210 | this.panel3.Name = "panel3";
211 | this.panel3.Size = new System.Drawing.Size(200, 57);
212 | this.panel3.TabIndex = 19;
213 | //
214 | // rbNo
215 | //
216 | this.rbNo.AutoSize = true;
217 | this.rbNo.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
218 | this.rbNo.Location = new System.Drawing.Point(119, 16);
219 | this.rbNo.Name = "rbNo";
220 | this.rbNo.Size = new System.Drawing.Size(59, 28);
221 | this.rbNo.TabIndex = 1;
222 | this.rbNo.Text = "NO";
223 | this.rbNo.UseVisualStyleBackColor = true;
224 | //
225 | // rbYes
226 | //
227 | this.rbYes.AutoSize = true;
228 | this.rbYes.Checked = true;
229 | this.rbYes.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
230 | this.rbYes.Location = new System.Drawing.Point(16, 16);
231 | this.rbYes.Name = "rbYes";
232 | this.rbYes.Size = new System.Drawing.Size(68, 28);
233 | this.rbYes.TabIndex = 0;
234 | this.rbYes.TabStop = true;
235 | this.rbYes.Text = "YES";
236 | this.rbYes.UseVisualStyleBackColor = true;
237 | //
238 | // label6
239 | //
240 | this.label6.AutoSize = true;
241 | this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
242 | this.label6.Location = new System.Drawing.Point(54, 261);
243 | this.label6.Name = "label6";
244 | this.label6.Size = new System.Drawing.Size(66, 24);
245 | this.label6.TabIndex = 18;
246 | this.label6.Text = "FREE:";
247 | //
248 | // cbRoomType
249 | //
250 | this.cbRoomType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
251 | this.cbRoomType.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
252 | this.cbRoomType.FormattingEnabled = true;
253 | this.cbRoomType.Location = new System.Drawing.Point(122, 146);
254 | this.cbRoomType.Name = "cbRoomType";
255 | this.cbRoomType.Size = new System.Drawing.Size(202, 32);
256 | this.cbRoomType.TabIndex = 16;
257 | //
258 | // ManageRoomsForm
259 | //
260 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
261 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
262 | this.ClientSize = new System.Drawing.Size(922, 514);
263 | this.Controls.Add(this.panel1);
264 | this.Name = "ManageRoomsForm";
265 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
266 | this.Load += new System.EventHandler(this.ManageRoomsForm_Load);
267 | ((System.ComponentModel.ISupportInitialize)(this.dgvRooms)).EndInit();
268 | this.panel2.ResumeLayout(false);
269 | this.panel1.ResumeLayout(false);
270 | this.panel1.PerformLayout();
271 | this.panel3.ResumeLayout(false);
272 | this.panel3.PerformLayout();
273 | this.ResumeLayout(false);
274 |
275 | }
276 |
277 | #endregion
278 |
279 | private System.Windows.Forms.Label label1;
280 | private System.Windows.Forms.Button btnClearFields;
281 | private System.Windows.Forms.Button btnRemove;
282 | private System.Windows.Forms.Button btnEdit;
283 | private System.Windows.Forms.Button btnAdd;
284 | private System.Windows.Forms.DataGridView dgvRooms;
285 | private System.Windows.Forms.TextBox tbPhone;
286 | private System.Windows.Forms.Label label5;
287 | private System.Windows.Forms.Label label3;
288 | private System.Windows.Forms.TextBox tbNumber;
289 | private System.Windows.Forms.Label label2;
290 | private System.Windows.Forms.Panel panel2;
291 | private System.Windows.Forms.Panel panel1;
292 | private System.Windows.Forms.ComboBox cbRoomType;
293 | private System.Windows.Forms.Label label6;
294 | private System.Windows.Forms.Panel panel3;
295 | private System.Windows.Forms.RadioButton rbYes;
296 | private System.Windows.Forms.RadioButton rbNo;
297 | }
298 | }
--------------------------------------------------------------------------------
/Hotel_System/ManageReservationsForm.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Hotel_System
3 | {
4 | partial class ManageReservationsForm
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | this.btnClearFields = new System.Windows.Forms.Button();
33 | this.btnRemove = new System.Windows.Forms.Button();
34 | this.btnEdit = new System.Windows.Forms.Button();
35 | this.btnAdd = new System.Windows.Forms.Button();
36 | this.dgvReservations = new System.Windows.Forms.DataGridView();
37 | this.panel2 = new System.Windows.Forms.Panel();
38 | this.label1 = new System.Windows.Forms.Label();
39 | this.panel1 = new System.Windows.Forms.Panel();
40 | this.dateTimePickerOUT = new System.Windows.Forms.DateTimePicker();
41 | this.label7 = new System.Windows.Forms.Label();
42 | this.dateTimePickerIN = new System.Windows.Forms.DateTimePicker();
43 | this.label6 = new System.Windows.Forms.Label();
44 | this.cbRoomNumber = new System.Windows.Forms.ComboBox();
45 | this.label5 = new System.Windows.Forms.Label();
46 | this.cbRoomType = new System.Windows.Forms.ComboBox();
47 | this.tbClientID = new System.Windows.Forms.TextBox();
48 | this.label4 = new System.Windows.Forms.Label();
49 | this.label3 = new System.Windows.Forms.Label();
50 | this.tbReservID = new System.Windows.Forms.TextBox();
51 | this.label2 = new System.Windows.Forms.Label();
52 | ((System.ComponentModel.ISupportInitialize)(this.dgvReservations)).BeginInit();
53 | this.panel2.SuspendLayout();
54 | this.panel1.SuspendLayout();
55 | this.SuspendLayout();
56 | //
57 | // btnClearFields
58 | //
59 | this.btnClearFields.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
60 | this.btnClearFields.Location = new System.Drawing.Point(16, 453);
61 | this.btnClearFields.Name = "btnClearFields";
62 | this.btnClearFields.Size = new System.Drawing.Size(331, 49);
63 | this.btnClearFields.TabIndex = 15;
64 | this.btnClearFields.Text = "Clear Fields";
65 | this.btnClearFields.UseVisualStyleBackColor = true;
66 | this.btnClearFields.Click += new System.EventHandler(this.btnClearFields_Click);
67 | //
68 | // btnRemove
69 | //
70 | this.btnRemove.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
71 | this.btnRemove.Location = new System.Drawing.Point(266, 406);
72 | this.btnRemove.Name = "btnRemove";
73 | this.btnRemove.Size = new System.Drawing.Size(81, 41);
74 | this.btnRemove.TabIndex = 14;
75 | this.btnRemove.Text = "Remove";
76 | this.btnRemove.UseVisualStyleBackColor = true;
77 | this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click);
78 | //
79 | // btnEdit
80 | //
81 | this.btnEdit.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
82 | this.btnEdit.Location = new System.Drawing.Point(176, 406);
83 | this.btnEdit.Name = "btnEdit";
84 | this.btnEdit.Size = new System.Drawing.Size(82, 41);
85 | this.btnEdit.TabIndex = 13;
86 | this.btnEdit.Text = "Edit";
87 | this.btnEdit.UseVisualStyleBackColor = true;
88 | this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
89 | //
90 | // btnAdd
91 | //
92 | this.btnAdd.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
93 | this.btnAdd.Location = new System.Drawing.Point(14, 406);
94 | this.btnAdd.Name = "btnAdd";
95 | this.btnAdd.Size = new System.Drawing.Size(156, 41);
96 | this.btnAdd.TabIndex = 12;
97 | this.btnAdd.Text = "Make Reservations";
98 | this.btnAdd.UseVisualStyleBackColor = true;
99 | this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
100 | //
101 | // dgvReservations
102 | //
103 | this.dgvReservations.AllowUserToAddRows = false;
104 | this.dgvReservations.AllowUserToDeleteRows = false;
105 | this.dgvReservations.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
106 | this.dgvReservations.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
107 | this.dgvReservations.Location = new System.Drawing.Point(381, 99);
108 | this.dgvReservations.Name = "dgvReservations";
109 | this.dgvReservations.ReadOnly = true;
110 | this.dgvReservations.Size = new System.Drawing.Size(529, 403);
111 | this.dgvReservations.TabIndex = 11;
112 | this.dgvReservations.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvReservations_CellClick);
113 | //
114 | // panel2
115 | //
116 | this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(142)))), ((int)(((byte)(68)))), ((int)(((byte)(173)))));
117 | this.panel2.Controls.Add(this.label1);
118 | this.panel2.Location = new System.Drawing.Point(0, 0);
119 | this.panel2.Name = "panel2";
120 | this.panel2.Size = new System.Drawing.Size(922, 65);
121 | this.panel2.TabIndex = 0;
122 | //
123 | // label1
124 | //
125 | this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
126 | this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
127 | this.label1.Font = new System.Drawing.Font("Arial", 32.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
128 | this.label1.ForeColor = System.Drawing.Color.White;
129 | this.label1.Location = new System.Drawing.Point(0, 0);
130 | this.label1.Name = "label1";
131 | this.label1.Size = new System.Drawing.Size(922, 65);
132 | this.label1.TabIndex = 0;
133 | this.label1.Text = "Manage Reservations";
134 | this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
135 | //
136 | // panel1
137 | //
138 | this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
139 | this.panel1.Controls.Add(this.tbReservID);
140 | this.panel1.Controls.Add(this.label2);
141 | this.panel1.Controls.Add(this.dateTimePickerOUT);
142 | this.panel1.Controls.Add(this.label7);
143 | this.panel1.Controls.Add(this.dateTimePickerIN);
144 | this.panel1.Controls.Add(this.label6);
145 | this.panel1.Controls.Add(this.cbRoomNumber);
146 | this.panel1.Controls.Add(this.label5);
147 | this.panel1.Controls.Add(this.cbRoomType);
148 | this.panel1.Controls.Add(this.tbClientID);
149 | this.panel1.Controls.Add(this.label4);
150 | this.panel1.Controls.Add(this.btnClearFields);
151 | this.panel1.Controls.Add(this.btnRemove);
152 | this.panel1.Controls.Add(this.btnEdit);
153 | this.panel1.Controls.Add(this.btnAdd);
154 | this.panel1.Controls.Add(this.dgvReservations);
155 | this.panel1.Controls.Add(this.label3);
156 | this.panel1.Controls.Add(this.panel2);
157 | this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
158 | this.panel1.Location = new System.Drawing.Point(0, 0);
159 | this.panel1.Name = "panel1";
160 | this.panel1.Size = new System.Drawing.Size(922, 514);
161 | this.panel1.TabIndex = 2;
162 | //
163 | // dateTimePickerOUT
164 | //
165 | this.dateTimePickerOUT.CalendarFont = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
166 | this.dateTimePickerOUT.CustomFormat = "dd/MM/yyyy";
167 | this.dateTimePickerOUT.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
168 | this.dateTimePickerOUT.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
169 | this.dateTimePickerOUT.Location = new System.Drawing.Point(136, 331);
170 | this.dateTimePickerOUT.Name = "dateTimePickerOUT";
171 | this.dateTimePickerOUT.Size = new System.Drawing.Size(200, 29);
172 | this.dateTimePickerOUT.TabIndex = 26;
173 | //
174 | // label7
175 | //
176 | this.label7.AutoSize = true;
177 | this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
178 | this.label7.Location = new System.Drawing.Point(40, 335);
179 | this.label7.Name = "label7";
180 | this.label7.Size = new System.Drawing.Size(88, 24);
181 | this.label7.TabIndex = 24;
182 | this.label7.Text = "Date Out:";
183 | //
184 | // dateTimePickerIN
185 | //
186 | this.dateTimePickerIN.CalendarFont = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
187 | this.dateTimePickerIN.CustomFormat = "dd/MM/yyyy";
188 | this.dateTimePickerIN.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
189 | this.dateTimePickerIN.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
190 | this.dateTimePickerIN.Location = new System.Drawing.Point(136, 290);
191 | this.dateTimePickerIN.Name = "dateTimePickerIN";
192 | this.dateTimePickerIN.Size = new System.Drawing.Size(200, 29);
193 | this.dateTimePickerIN.TabIndex = 23;
194 | //
195 | // label6
196 | //
197 | this.label6.AutoSize = true;
198 | this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
199 | this.label6.Location = new System.Drawing.Point(55, 290);
200 | this.label6.Name = "label6";
201 | this.label6.Size = new System.Drawing.Size(73, 24);
202 | this.label6.TabIndex = 22;
203 | this.label6.Text = "Date In:";
204 | //
205 | // cbRoomNumber
206 | //
207 | this.cbRoomNumber.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
208 | this.cbRoomNumber.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
209 | this.cbRoomNumber.FormattingEnabled = true;
210 | this.cbRoomNumber.Location = new System.Drawing.Point(136, 241);
211 | this.cbRoomNumber.Name = "cbRoomNumber";
212 | this.cbRoomNumber.Size = new System.Drawing.Size(202, 32);
213 | this.cbRoomNumber.TabIndex = 21;
214 | //
215 | // label5
216 | //
217 | this.label5.AutoSize = true;
218 | this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
219 | this.label5.Location = new System.Drawing.Point(32, 241);
220 | this.label5.Name = "label5";
221 | this.label5.Size = new System.Drawing.Size(96, 24);
222 | this.label5.TabIndex = 20;
223 | this.label5.Text = "Room No:";
224 | //
225 | // cbRoomType
226 | //
227 | this.cbRoomType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
228 | this.cbRoomType.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
229 | this.cbRoomType.FormattingEnabled = true;
230 | this.cbRoomType.Location = new System.Drawing.Point(136, 194);
231 | this.cbRoomType.Name = "cbRoomType";
232 | this.cbRoomType.Size = new System.Drawing.Size(202, 32);
233 | this.cbRoomType.TabIndex = 19;
234 | this.cbRoomType.SelectedIndexChanged += new System.EventHandler(this.cbRoomType_SelectedIndexChanged);
235 | //
236 | // tbClientID
237 | //
238 | this.tbClientID.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
239 | this.tbClientID.Location = new System.Drawing.Point(136, 148);
240 | this.tbClientID.Name = "tbClientID";
241 | this.tbClientID.Size = new System.Drawing.Size(202, 29);
242 | this.tbClientID.TabIndex = 18;
243 | //
244 | // label4
245 | //
246 | this.label4.AutoSize = true;
247 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
248 | this.label4.Location = new System.Drawing.Point(32, 148);
249 | this.label4.Name = "label4";
250 | this.label4.Size = new System.Drawing.Size(84, 24);
251 | this.label4.TabIndex = 17;
252 | this.label4.Text = "Client ID:";
253 | //
254 | // label3
255 | //
256 | this.label3.AutoSize = true;
257 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
258 | this.label3.Location = new System.Drawing.Point(16, 194);
259 | this.label3.Name = "label3";
260 | this.label3.Size = new System.Drawing.Size(114, 24);
261 | this.label3.TabIndex = 3;
262 | this.label3.Text = "Room Type:";
263 | //
264 | // tbReservID
265 | //
266 | this.tbReservID.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
267 | this.tbReservID.Location = new System.Drawing.Point(136, 99);
268 | this.tbReservID.Name = "tbReservID";
269 | this.tbReservID.Size = new System.Drawing.Size(202, 29);
270 | this.tbReservID.TabIndex = 28;
271 | //
272 | // label2
273 | //
274 | this.label2.AutoSize = true;
275 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
276 | this.label2.Location = new System.Drawing.Point(32, 99);
277 | this.label2.Name = "label2";
278 | this.label2.Size = new System.Drawing.Size(96, 24);
279 | this.label2.TabIndex = 27;
280 | this.label2.Text = "Reserv ID:";
281 | //
282 | // ManageReservationsForm
283 | //
284 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
285 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
286 | this.ClientSize = new System.Drawing.Size(922, 514);
287 | this.Controls.Add(this.panel1);
288 | this.Name = "ManageReservationsForm";
289 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
290 | this.Text = "ManageReservationsForm";
291 | this.Load += new System.EventHandler(this.ManageReservationsForm_Load);
292 | ((System.ComponentModel.ISupportInitialize)(this.dgvReservations)).EndInit();
293 | this.panel2.ResumeLayout(false);
294 | this.panel1.ResumeLayout(false);
295 | this.panel1.PerformLayout();
296 | this.ResumeLayout(false);
297 |
298 | }
299 |
300 | #endregion
301 | private System.Windows.Forms.Button btnClearFields;
302 | private System.Windows.Forms.Button btnRemove;
303 | private System.Windows.Forms.Button btnEdit;
304 | private System.Windows.Forms.Button btnAdd;
305 | private System.Windows.Forms.DataGridView dgvReservations;
306 | private System.Windows.Forms.Panel panel2;
307 | private System.Windows.Forms.Label label1;
308 | private System.Windows.Forms.Panel panel1;
309 | private System.Windows.Forms.Label label4;
310 | private System.Windows.Forms.Label label3;
311 | private System.Windows.Forms.TextBox tbClientID;
312 | private System.Windows.Forms.ComboBox cbRoomType;
313 | private System.Windows.Forms.ComboBox cbRoomNumber;
314 | private System.Windows.Forms.Label label5;
315 | private System.Windows.Forms.Label label6;
316 | private System.Windows.Forms.Label label7;
317 | private System.Windows.Forms.DateTimePicker dateTimePickerIN;
318 | private System.Windows.Forms.DateTimePicker dateTimePickerOUT;
319 | private System.Windows.Forms.TextBox tbReservID;
320 | private System.Windows.Forms.Label label2;
321 | }
322 | }
--------------------------------------------------------------------------------
/Hotel_System/mysql-connector-net-8.0.25-noinstall/v4.5.2/MySql.Data.EntityFramework.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MySql.Data.EntityFramework
5 |
6 |
7 |
8 |
9 | Visitor for SqlFragment and derived classes, useful for postprocessing and optimizations.
10 |
11 |
12 |
13 |
14 | Visitor to replace old table names with new table names. Used as part postprocessing of the code for fusing nested selects.
15 |
16 |
17 |
18 |
19 | Specifies the operation types supported.
20 |
21 |
22 |
23 |
24 | If input sqlFragment is a group by structure, is flattened to remove some nested correlation queries.
25 |
26 |
27 |
28 |
29 |
30 |
31 | If current fragment is select and its from clause is another select, try fuse the inner select with the outer select.
32 | (Thus removing a nested query, which may have bad performance in Mysql).
33 |
34 | The fragment to probe and posibly optimize
35 | The fragment fused, or the original one.
36 |
37 |
38 |
39 | Examines a binary expression to see if it is an special case suitable to conversion
40 | to a more efficient and equivalent LIKE sql expression.
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | Used for creating connections in Code First 4.3.
50 |
51 |
52 |
53 |
54 | Provides the capability to resolve a dependency.
55 |
56 |
57 |
58 |
59 | Attempts to resolve a dependency for a given contract type and optionally a given key.
60 |
61 | The base class that defines the dependency to be resolved.
62 | Optionally, the key of the dependency to be resolved.
63 | The resolved dependency.
64 |
65 |
66 |
67 | Attempts to resolve a dependency for all of the registered services with the given type and key combination.
68 |
69 | The base class that defines the dependency to be resolved.
70 | Optionally, the key of the dependency to be resolved.
71 | All services that resolve the dependency.
72 |
73 |
74 |
75 | Used to resolve a provider invariant name from a provider factory.
76 |
77 |
78 |
79 |
80 | Gets the name of the provider.
81 |
82 |
83 |
84 |
85 | Gets the name of the provider.
86 |
87 |
88 |
89 |
90 | Service that obtains the provider factory from a given connection.
91 |
92 |
93 |
94 |
95 | Returns the for the given connection.
96 |
97 | The database connection.
98 | The provider factory for the connection.
99 |
100 |
101 |
102 | Gets a provider manifest token for the given connection.
103 |
104 |
105 |
106 |
107 | Returns the manifest token to use for the given connection.
108 |
109 | The connection for which a manifest token is required.
110 | The manifest token to use.
111 |
112 |
113 |
114 | Represents a key value that uniquely identifies an Entity Framework model that has been loaded into memory.
115 |
116 |
117 |
118 |
119 | Determines whether the current cached model key is equal to the specified cached
120 | model key.
121 |
122 | The cached model key to compare to the current cached model key.
123 | true if the current cached model key is equal to the specified cached model key;
124 | otherwise, false.
125 |
126 |
127 |
128 | Returns the hash function for this cached model key.
129 |
130 | The hash function for this cached model key.
131 |
132 |
133 |
134 | Defines the configuration of an application to be used with Entity Framework.
135 |
136 |
137 |
138 |
139 | Initializes a new instance of class.
140 |
141 |
142 |
143 |
144 | An execution strategy tailored for handling MySql Server transient errors.
145 |
146 |
147 |
148 |
149 | Different back off algorithms used for different errors.
150 |
151 |
152 |
153 |
154 | The base class for backoff algorithms.
155 |
156 | Different transient error conditions require different approaches.
157 |
158 |
159 |
160 | The default implementation is an exponential delay backoff.
161 |
162 |
163 |
164 |
165 |
166 | Resets a backoff algorithm, so they can be reused.
167 |
168 |
169 |
170 |
171 | Back-off algorithm customized for the MySql error code 1040 - Too many connections.
172 |
173 |
174 |
175 |
176 | Back-off algorithm for the Mysql error code 1614 - Transaction branch was rolled back: deadlock was detected.
177 |
178 |
179 |
180 |
181 | Back-off algorithm customized for the MySql error code 1205 - Lock wait timeout exceeded; try restarting transaction.
182 |
183 |
184 |
185 |
186 | Back-off algorithm customized for MySql error code 1213 - Deadlock found when trying to get lock; try restarting transaction.
187 |
188 |
189 |
190 |
191 | Back-off algorithm customized for MySql error code 2006 - MySQL server has gone away.
192 |
193 |
194 |
195 |
196 | Back-off algorithm customized for MySql error code 2013 - Lost connection to MySQL server during query.
197 |
198 |
199 |
200 |
201 | Back-off algorithm customized for MySql Cluster (NDB) errors.
202 |
203 |
204 |
205 |
206 | Class used to customized code generation
207 | to avoid dbo. prefix added on table names.
208 |
209 |
210 |
211 |
212 | Implementation of a MySql's Sql generator for EF 4.3 data migrations.
213 |
214 |
215 |
216 |
217 | Generates a migration operation to add a column.
218 |
219 | The operation that represents a column being added to a table.
220 | A migration operation to add a column.
221 |
222 |
223 |
224 | Generates a migration operation to drop a column.
225 |
226 | The operation that represents a column being dropped from a table.
227 | The migration operation to drop a column.
228 |
229 |
230 |
231 | Generates a migration operation to alter a column.
232 |
233 | The operation that represents altering an existing column.
234 | A migration operation to alter a column.
235 |
236 |
237 |
238 | Generates a migration operation to rename a column.
239 |
240 | The operation that represents a column being renamed.
241 | A migration operation to rename a column.
242 |
243 |
244 |
245 | Generates a migration operation to add a foreign key.
246 |
247 | the operation that represents a foreing key constraint being added to a table.
248 | A migration operation to add a foreign key constraint.
249 |
250 |
251 |
252 | Generates an SQL statement of a column model.
253 |
254 | The model that represents a column.
255 | A string containing an SQL statement of a column model.
256 |
257 |
258 |
259 | Generates a migration operation to drop a foreign key constraint from a table.
260 |
261 | The operation that represents a foreign key being added from a table.
262 | A migration operation to drop a foreign key.
263 |
264 |
265 |
266 | Generates a migration operation to create a database index.
267 |
268 | The operation that represents creating a database index.
269 | A migration operation to create a database index.
270 |
271 |
272 |
273 | Generates a migration operation to drop an existing database index.
274 |
275 | The operation that represents dropping am existing database index.
276 | A migration operation to drop an existing database index.
277 |
278 |
279 |
280 | Generates a migration operation to create a table.
281 |
282 | The operation that represents creating a table.
283 | A migration operation to create a table.
284 |
285 |
286 |
287 | Generates a migration operation to drop an existing table.
288 |
289 | The operation that represents dropping an existing table.
290 | A migration operation to drop an existing table.
291 |
292 |
293 |
294 | Generates a migration operation to add a primary key to a table.
295 |
296 | The operation that represents adding a primary key to a table.
297 | A migration operation to add a primary key to a table.
298 |
299 |
300 |
301 | Generates a migration operation to drpo an existing primary key.
302 |
303 | The operation that represents dropping an existing primary key.
304 | A migration operation to drop an existing primary key.
305 |
306 |
307 |
308 | Generates a migration operation to rename an existing table.
309 |
310 | The operation that represents renaming an existing table.
311 | A migration operation to rename an existing table.
312 |
313 |
314 |
315 | Not implemented yet.
316 |
317 | NA
318 | NA
319 |
320 |
321 |
322 | Generates a migration operation with a MySQL statement to be executed.
323 |
324 | The operation representing a MySQL statement to be executed directly against the database.
325 | A migration operation with a MySQL statement to be executed.
326 |
327 |
328 |
329 | A strongly-typed resource class, for looking up localized strings, etc.
330 |
331 |
332 |
333 |
334 | Returns the cached ResourceManager instance used by this class.
335 |
336 |
337 |
338 |
339 | Overrides the current thread's CurrentUICulture property for all
340 | resource lookups using this strongly typed resource class.
341 |
342 |
343 |
344 |
345 | Looks up a localized string similar to The connection parameter must reference an object of type MySql.Data.MySqlConnection.
346 |
347 |
348 |
349 |
350 | Looks up a localized string similar to There is no store type corresponding to the EDM type '{0}' of primitive type '{1}'..
351 |
352 |
353 |
354 |
355 | Looks up a localized string similar to The underlying provider does not support the type '{0}'..
356 |
357 |
358 |
359 |
360 | Looks up a localized string similar to Result type of a function is expected to be a collection of RowType or PrimitiveType.
361 |
362 |
363 |
364 |
365 | Constructs a script that generates a table.
366 |
367 |
368 |
369 |
370 | The implementation for the MySqlClient provider for MySQL Server.
371 |
372 |
373 |
374 |
375 | Sets the expected column types
376 |
377 |
378 |
379 |
380 | Sets the expected column types for a given query command tree
381 |
382 |
383 |
384 |
385 | Sets the expected column types for a given function command tree
386 |
387 |
388 |
389 |
390 |
--------------------------------------------------------------------------------