School Commit Init

This commit is contained in:
2024-08-31 12:07:21 +03:00
commit 0b130ee18c
2801 changed files with 4720552 additions and 0 deletions
@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34622.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbmsLab1", "DbmsLab1\DbmsLab1.csproj", "{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3BA95047-F50B-4CC2-B40B-C4FB6F0F3673}
EndGlobalSection
EndGlobal
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="DbmsLab1.Properties.Settings.masterConnectionString"
connectionString="Data Source=DANIELCUJBA\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;TrustServerCertificate=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>WindowsFormsApp1</RootNamespace>
<AssemblyName>WindowsFormsApp1</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,38 @@
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace DbmsLab1
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
private DataSet ds;
private DataGridView dataGridView1;
private DataGridView dataGridView2;
private DataSet ds2;
private Button UpdateBtn;
private SqlDataAdapter adapter;
private SqlDataAdapter adapter2;
private Button DeleteBtn;
private int SelectedChildId = -1;
}
}
@@ -0,0 +1,161 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace DbmsLab1
{
public partial class Form1 : Form
{
public SqlConnection sqlconnection = new SqlConnection("Data Source=DANIELCUJBA\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;");
public Form1()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.ds = new System.Data.DataSet();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.dataGridView2 = new System.Windows.Forms.DataGridView();
this.ds2 = new System.Data.DataSet();
this.UpdateBtn = new System.Windows.Forms.Button();
this.DeleteBtn = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.ds)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ds2)).BeginInit();
this.SuspendLayout();
//
// ds
//
this.ds.DataSetName = "NewDataSet";
//
// dataGridView1
//
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Location = new System.Drawing.Point(79, 12);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(745, 150);
this.dataGridView1.TabIndex = 0;
this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
//
// dataGridView2
//
this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView2.Location = new System.Drawing.Point(79, 196);
this.dataGridView2.Name = "dataGridView2";
this.dataGridView2.Size = new System.Drawing.Size(745, 150);
this.dataGridView2.TabIndex = 1;
this.dataGridView2.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView2_CellContentClick);
//
// ds2
//
this.ds2.DataSetName = "NewDataSet";
//
// UpdateBtn
//
this.UpdateBtn.Location = new System.Drawing.Point(364, 389);
this.UpdateBtn.Name = "UpdateBtn";
this.UpdateBtn.Size = new System.Drawing.Size(138, 46);
this.UpdateBtn.TabIndex = 2;
this.UpdateBtn.Text = "Save Changes to DB";
this.UpdateBtn.UseVisualStyleBackColor = true;
this.UpdateBtn.Click += new System.EventHandler(this.UpdateBtn_Click);
//
// DeleteBtn
//
this.DeleteBtn.Location = new System.Drawing.Point(624, 389);
this.DeleteBtn.Name = "DeleteBtn";
this.DeleteBtn.Size = new System.Drawing.Size(108, 45);
this.DeleteBtn.TabIndex = 3;
this.DeleteBtn.Text = "Delete";
this.DeleteBtn.UseVisualStyleBackColor = true;
this.DeleteBtn.Click += new System.EventHandler(this.DeleteBtn_Click);
//
// Form1
//
this.ClientSize = new System.Drawing.Size(890, 473);
this.Controls.Add(this.DeleteBtn);
this.Controls.Add(this.UpdateBtn);
this.Controls.Add(this.dataGridView2);
this.Controls.Add(this.dataGridView1);
this.Name = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.ds)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ds2)).EndInit();
this.ResumeLayout(false);
}
private void Form1_Load(object sender, EventArgs e)
{
var command = new SqlCommand("SELECT * FROM CardSet", sqlconnection);
this.adapter = new SqlDataAdapter(command);
this.ds = new DataSet("CardSet");
this.adapter.Fill(ds, "CardSet");
dataGridView1.DataSource= this.ds.Tables["CardSet"];
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
var id = dataGridView1.Rows[e.RowIndex].Cells[0].Value;
var command = new SqlCommand(string.Format("SELECT * FROM Cards WHERE cardset = {0}",id), sqlconnection);
this.adapter2 = new SqlDataAdapter(command);
this.ds2 = new DataSet("Cards");
this.adapter2.Fill(ds2, "Cards");
dataGridView2.DataSource = this.ds2.Tables["Cards"];
}
private void UpdateBtn_Click(object sender, EventArgs e)
{
var builder = new SqlCommandBuilder(adapter2);
adapter2.UpdateCommand = builder.GetUpdateCommand();
try
{
this.adapter2.Update((DataTable)this.dataGridView2.DataSource);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void DeleteBtn_Click(object sender, EventArgs e)
{
try
{
var builder = new SqlCommandBuilder(adapter2);
adapter2.UpdateCommand = builder.GetUpdateCommand();
dataGridView2.Rows.RemoveAt(this.SelectedChildId);
this.adapter2.Update((DataTable)this.dataGridView2.DataSource);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
this.SelectedChildId = e.RowIndex;
}
}
}
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ds.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ds2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>83, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>106</value>
</metadata>
</root>
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DbmsLab1
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DbmsLab1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DbmsLab1")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("384eb98e-ce0a-4480-b73a-d043ccebae1d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DbmsLab1.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DbmsLab1.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,37 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DbmsLab1.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=DANIELCUJBA\\SQLEXPRESS;Initial Catalog=master;Integrated Security=Tru" +
"e;TrustServerCertificate=True")]
public string masterConnectionString {
get {
return ((string)(this["masterConnectionString"]));
}
}
}
}
@@ -0,0 +1,14 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DbmsLab1.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="masterConnectionString" Type="(Connection string)" Scope="Application">
<DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;SerializableConnectionString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;ConnectionString&gt;Data Source=DANIELCUJBA\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;TrustServerCertificate=True&lt;/ConnectionString&gt;
&lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
&lt;/SerializableConnectionString&gt;</DesignTimeValue>
<Value Profile="(Default)">Data Source=DANIELCUJBA\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;TrustServerCertificate=True</Value>
</Setting>
</Settings>
</SettingsFile>
@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34622.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbmsLab2", "DbmsLab2\DbmsLab2.csproj", "{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3BA95047-F50B-4CC2-B40B-C4FB6F0F3673}
EndGlobalSection
EndGlobal
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="DbmsLab2.Properties.Settings.masterConnectionString"
connectionString="Data Source=DANIELCUJBA\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;TrustServerCertificate=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<appSettings>
<add key="MasterTable" value="CardSet"/>
<add key="ChildTable" value="Cards"/>
<add key="FK" value="cardset"/>
<!--<add key="mastertable" value="Factions"/>
<add key="childtable" value="Cards"/>
<add key="fk" value="faction"/>-->
</appSettings>
</configuration>
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{384EB98E-CE0A-4480-B73A-D043CCEBAE1D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>WindowsFormsApp1</RootNamespace>
<AssemblyName>WindowsFormsApp1</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,38 @@
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace DbmsLab2
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
private DataSet ds;
private DataGridView dataGridView1;
private DataGridView dataGridView2;
private DataSet ds2;
private Button UpdateBtn;
private SqlDataAdapter adapter;
private SqlDataAdapter adapter2;
private Button DeleteBtn;
private int SelectedChildId = -1;
}
}
@@ -0,0 +1,162 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;
namespace DbmsLab2
{
public partial class Form1 : Form
{
public SqlConnection sqlconnection = new SqlConnection("Data Source=DANIELCUJBA\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;");
public Form1()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.ds = new System.Data.DataSet();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.dataGridView2 = new System.Windows.Forms.DataGridView();
this.ds2 = new System.Data.DataSet();
this.UpdateBtn = new System.Windows.Forms.Button();
this.DeleteBtn = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.ds)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ds2)).BeginInit();
this.SuspendLayout();
//
// ds
//
this.ds.DataSetName = "NewDataSet";
//
// dataGridView1
//
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Location = new System.Drawing.Point(79, 12);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(745, 150);
this.dataGridView1.TabIndex = 0;
this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
//
// dataGridView2
//
this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView2.Location = new System.Drawing.Point(79, 196);
this.dataGridView2.Name = "dataGridView2";
this.dataGridView2.Size = new System.Drawing.Size(745, 150);
this.dataGridView2.TabIndex = 1;
this.dataGridView2.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView2_CellContentClick);
//
// ds2
//
this.ds2.DataSetName = "NewDataSet";
//
// UpdateBtn
//
this.UpdateBtn.Location = new System.Drawing.Point(364, 389);
this.UpdateBtn.Name = "UpdateBtn";
this.UpdateBtn.Size = new System.Drawing.Size(138, 46);
this.UpdateBtn.TabIndex = 2;
this.UpdateBtn.Text = "Save Changes to DB";
this.UpdateBtn.UseVisualStyleBackColor = true;
this.UpdateBtn.Click += new System.EventHandler(this.UpdateBtn_Click);
//
// DeleteBtn
//
this.DeleteBtn.Location = new System.Drawing.Point(624, 389);
this.DeleteBtn.Name = "DeleteBtn";
this.DeleteBtn.Size = new System.Drawing.Size(108, 45);
this.DeleteBtn.TabIndex = 3;
this.DeleteBtn.Text = "Delete";
this.DeleteBtn.UseVisualStyleBackColor = true;
this.DeleteBtn.Click += new System.EventHandler(this.DeleteBtn_Click);
//
// Form1
//
this.ClientSize = new System.Drawing.Size(890, 473);
this.Controls.Add(this.DeleteBtn);
this.Controls.Add(this.UpdateBtn);
this.Controls.Add(this.dataGridView2);
this.Controls.Add(this.dataGridView1);
this.Name = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.ds)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ds2)).EndInit();
this.ResumeLayout(false);
}
private void Form1_Load(object sender, EventArgs e)
{
var command = new SqlCommand($"SELECT * FROM {ConfigurationManager.AppSettings["MasterTable"]}", sqlconnection);
this.adapter = new SqlDataAdapter(command);
this.ds = new DataSet(ConfigurationManager.AppSettings["MasterTable"]);
this.adapter.Fill(ds, ConfigurationManager.AppSettings["MasterTable"]);
dataGridView1.DataSource= this.ds.Tables[ConfigurationManager.AppSettings["MasterTable"]];
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
var id = dataGridView1.Rows[e.RowIndex].Cells[0].Value;
var command = new SqlCommand($"SELECT * FROM {ConfigurationManager.AppSettings["ChildTable"]} WHERE {ConfigurationManager.AppSettings["FK"]} = {id}", sqlconnection);
this.adapter2 = new SqlDataAdapter(command);
this.ds2 = new DataSet(ConfigurationManager.AppSettings["ChildTable"]);
this.adapter2.Fill(ds2, ConfigurationManager.AppSettings["ChildTable"]);
dataGridView2.DataSource = this.ds2.Tables[ConfigurationManager.AppSettings["ChildTable"]];
}
private void UpdateBtn_Click(object sender, EventArgs e)
{
var builder = new SqlCommandBuilder(adapter2);
adapter2.UpdateCommand = builder.GetUpdateCommand();
try
{
this.adapter2.Update((DataTable)this.dataGridView2.DataSource);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void DeleteBtn_Click(object sender, EventArgs e)
{
try
{
var builder = new SqlCommandBuilder(adapter2);
adapter2.UpdateCommand = builder.GetUpdateCommand();
dataGridView2.Rows.RemoveAt(this.SelectedChildId);
this.adapter2.Update((DataTable)this.dataGridView2.DataSource);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
this.SelectedChildId = e.RowIndex;
}
}
}
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ds.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ds2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>83, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>106</value>
</metadata>
</root>
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DbmsLab2
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DbmsLab2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DbmsLab2")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("384eb98e-ce0a-4480-b73a-d043ccebae1d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DbmsLab2.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DbmsLab2.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,37 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DbmsLab2.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=DANIELCUJBA\\SQLEXPRESS;Initial Catalog=master;Integrated Security=Tru" +
"e;TrustServerCertificate=True")]
public string masterConnectionString {
get {
return ((string)(this["masterConnectionString"]));
}
}
}
}
@@ -0,0 +1,14 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DbmsLab2.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="masterConnectionString" Type="(Connection string)" Scope="Application">
<DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;SerializableConnectionString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;ConnectionString&gt;Data Source=DANIELCUJBA\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;TrustServerCertificate=True&lt;/ConnectionString&gt;
&lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
&lt;/SerializableConnectionString&gt;</DesignTimeValue>
<Value Profile="(Default)">Data Source=DANIELCUJBA\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;TrustServerCertificate=True</Value>
</Setting>
</Settings>
</SettingsFile>
@@ -0,0 +1,15 @@
begin tran
update Cards set name = 'CardTest3' where hmy=1260
waitfor delay '00:00:05'
update Cards set name = 'CardTest4' where hmy=1261
commit
set tran isolation level serializable
insert into Cards(name, faction, description, action, image, cost, type, power, color, cardset) values ('CardTest1',1,'Test card 1','Test action 1','Test image 1',1,'Unit',1,'Bronze',1);
insert into Cards(name, faction, description, action, image, cost, type, power, color, cardset) values ('CardTest2',2,'Test card 2','Test action 2','Test image 2',2,'special',2,'gold',2);
select * from Cards where name like 'CardTest%';
delete from Cards where name like 'CardTest%';
update Cards set name = 'CardTest1' where hmy=1248
update Cards set name = 'CardTest2' where hmy=1249
@@ -0,0 +1,5 @@
begin tran
update Cards set name = 'CardTest4' where hmy=1261
waitfor delay '00:00:05'
update Cards set name = 'CardTest3' where hmy=1260
commit
@@ -0,0 +1,26 @@
create or alter procedure write_and_rollback
as
begin
begin tran
update Cards set name = 'Test Dirty Reads' where hmy = 1
waitfor delay '00:00:05'
rollback tran
end
go
create or alter procedure read_multiple_times
as
begin
begin tran
select * from Cards where hmy = 1
waitfor delay '00:00:05'
select * from Cards where hmy = 1
waitfor delay '00:00:05'
select * from Cards where hmy = 1
commit tran
end
go
set transaction isolation level read uncommitted
exec read_multiple_times
@@ -0,0 +1 @@
exec write_and_rollback
@@ -0,0 +1,142 @@
-- This script creates a stored procedure that inserts data into the Players, Cards and Decks tables.
-- The procedure is wrapped in a transaction and uses a try-catch block to ensure that all inserts are successful or none are.
-- If an error occurs, the transaction is rolled back and no data is inserted.
create or alter procedure all_or_nothing_insert
as
begin
set nocount on
declare @player1 int, @player2 int, @card1 int, @card2 int
begin transaction
begin try
insert into Players(name, totalMatches, totalWins, totalLosses, totalDraws, reward_points, scraps, ores, meteorite_powder, rank) values ('PlayerTest1',10,5,3,2,100,100,100,100,1);
insert into Players(name, totalMatches, totalWins, totalLosses, totalDraws, reward_points, scraps, ores, meteorite_powder, rank) values ('PlayerTest2',20,10,6,4,200,200,200,200,2);
insert into Cards(name, faction, description, action, image, cost, type, power, color, cardset) values ('CardTest1',1,'Test card 1','Test action 1','Test image 1',1,'Unit',1,'Bronze',1);
insert into Cards(name, faction, description, action, image, cost, type, power, color, cardset) values ('CardTest2',2,'Test card 2','Test action 2','Test image 2',2,'special',2,'gold',2);
set @player1 = (select hmy from Players where name = 'PlayerTest1');
set @player2 = (select hmy from Players where name = 'PlayerTest2');
set @card1 = (select hmy from Cards where name = 'CardTest1');
set @card2 = (select hmy from Cards where name = 'CardTest2');
insert into CardsOwnership(hPlayer, hCard, nrOfCards, nrOfPremiumCards) values (@player1, @card1, 1, 1);
insert into CardsOwnership(hPlayer, hCard, nrOfCards, nrOfPremiumCards) values (@player2, @card2, 1, 1);
commit transaction
print 'All inserts succeeded'
end try
begin catch
rollback transaction
end catch
end
go
exec all_or_nothing_insert
go
-- This script creates a stored procedure that inserts data into the Players, Cards and Decks tables.
-- The procedure is wrapped in a transaction and uses savepoints to ensure that if an error occurs, only the failed insert is rolled back.
-- The procedure also uses a try-catch block to handle errors and print messages to the console.
create or alter procedure partial_insert
as
begin
set nocount on
declare @player1 int, @player2 int, @card1 int, @card2 int, @savepoint1 int, @savepoint2 int
set @savepoint1 = 1
set @savepoint2 = 1
begin transaction
begin try
insert into Players(name, totalMatches, totalWins, totalLosses, totalDraws, reward_points, scraps, ores, meteorite_powder, rank) values ('PlayerTest1',10,5,3,2,100,100,100,100,1);
insert into Players(name, totalMatches, totalWins, totalLosses, totalDraws, reward_points, scraps, ores, meteorite_powder, rank) values ('PlayerTest2',20,10,6,4,200,200,200,200,2);
save transaction InsertPlayers
set @savepoint1 = 0
insert into Cards(name, faction, description, action, image, cost, type, power, color, cardset) values ('CardTest1',1,'Test card 1','Test action 1','Test image 1',1,'Unit',1,'Bronze',1);
insert into Cards(name, faction, description, action, image, cost, type, power, color, cardset) values ('CardTest2',2,'Test card 2','Test action 2','Test image 2',2,'special',2,'gold',2);
save transaction InsertCards
set @savepoint2 = 0
set @player1 = (select hmy from Players where name = 'PlayerTest1');
set @player2 = (select hmy from Players where name = 'PlayerTest2');
set @card1 = (select hmy from Cards where name = 'CardTest1');
set @card2 = (select hmy from Cards where name = 'CardTest2');
insert into CardsOwnership(hPlayer, hCard, nrOfCards, nrOfPremiumCards) values (@player1, @card1, 1, 1);
insert into CardsOwnership(hPlayer, hCard, nrOfCards, nrOfPremiumCards) values (@player2, @card2, 1, 1);
commit transaction
print 'All inserts succeeded'
end try
begin catch
if @@TRANCOUNT > 0
begin
if @savepoint1 = 1
begin
print 'Players insert failed'
rollback tran
print error_message()
end
else if @savepoint2 = 1
begin
print 'Cards insert failed'
rollback tran InsertPlayers
print error_message()
commit tran
end
else
begin
print 'CardsOwnership insert failed'
print error_message()
rollback tran InsertCards
commit tran
end
end
else
print error_message()
end catch
end
go
exec partial_insert
-- This script deletes all the inserted data from the Players, Cards and Decks tables.
go
create or alter proc delete_added
as
begin
begin try
declare @player1 int, @player2 int, @card1 int, @card2 int, @cardOwnership1 int, @cardOwnership2 int
set @player1 = (select hmy from Players where name = 'PlayerTest1');
set @player2 = (select hmy from Players where name = 'PlayerTest2');
set @card1 = (select hmy from Cards where name = 'CardTest1');
set @card2 = (select hmy from Cards where name = 'CardTest2');
if @player1 is not null and @player2 is not null and @card1 is not null and @card2 is not null
begin
delete from CardsOwnership where hCard = @card1 and hPlayer = @player1
delete from CardsOwnership where hCard = @card2 and hPlayer = @player2
end
if @card1 is not null and @card2 is not null
begin
delete from Cards where hmy = @card1
delete from Cards where hmy = @card2
end
if @player1 is not null and @player2 is not null
begin
delete from Players where hmy = @player1
delete from Players where hmy = @player2
end
end try
begin catch
print error_message()
delete from Cards where name = 'CardTest1'
delete from Cards where name = 'CardTest2'
delete from Players where name = 'PlayerTest1'
delete from Players where name = 'PlayerTest2'
end catch
end
go
exec delete_added
@@ -0,0 +1,8 @@
begin tran
select * from Cards where name like 'CardTest%'
waitfor delay '00:00:03'
select * from Cards where name like 'CardTest%'
commit tran
set transaction isolation level repeatable read
@@ -0,0 +1,11 @@
begin tran
insert into Cards(name, faction, description, action, image, cost, type, power, color, cardset) values ('CardTest2',2,'Test card 2','Test action 2','Test image 2',2,'special',2,'gold',2);
waitfor delay '00:00:05'
commit tran
insert into Cards(name, faction, description, action, image, cost, type, power, color, cardset) values ('CardTest1',1,'Test card 1','Test action 1','Test image 1',1,'Unit',1,'Bronze',1);
insert into Cards(name, faction, description, action, image, cost, type, power, color, cardset) values ('CardTest2',2,'Test card 2','Test action 2','Test image 2',2,'special',2,'gold',2);
delete from Cards where name = 'CardTest2';
delete from Cards where name like 'CardTest%';
@@ -0,0 +1,7 @@
begin tran
select * from Cards where hmy = 1
waitfor delay '00:00:03'
select * from Cards where hmy = 1
commit tran
set transaction isolation level read committed
@@ -0,0 +1,4 @@
begin tran
update Cards set name = 'Test unrepetable reads' where hmy = 1
waitfor delay '00:00:05'
commit tran
@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Practic", "Practic\Practic.csproj", "{1E1F18BC-F95C-41B1-A472-6E928149DC0A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1E1F18BC-F95C-41B1-A472-6E928149DC0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E1F18BC-F95C-41B1-A472-6E928149DC0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E1F18BC-F95C-41B1-A472-6E928149DC0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E1F18BC-F95C-41B1-A472-6E928149DC0A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {893F237B-72BB-4745-BD59-72F8EB1C6821}
EndGlobalSection
EndGlobal
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="Practic.Properties.Settings.HotelConnectionString"
connectionString="Data Source=DANIELCUJBA\SQLEXPRESS;Initial Catalog=Hotel;Integrated Security=True;TrustServerCertificate=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
+235
View File
@@ -0,0 +1,235 @@
using System.Data;
using System.Data.SqlClient;
namespace Practic
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.dgvGuest = new System.Windows.Forms.DataGridView();
this.idDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.emailDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.phoneDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.guestBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.hotelDataSet = new Practic.HotelDataSet();
this.guestTableAdapter = new Practic.HotelDataSetTableAdapters.GuestTableAdapter();
this.dgvReservations = new System.Windows.Forms.DataGridView();
this.idDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.guestIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.roomIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.checkInDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.checkOutDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.paidDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.reservationBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.reservationTableAdapter = new Practic.HotelDataSetTableAdapters.ReservationTableAdapter();
this.saveBtn = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvGuest)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.guestBindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.hotelDataSet)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvReservations)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.reservationBindingSource)).BeginInit();
this.SuspendLayout();
//
// dgvGuest
//
this.dgvGuest.AutoGenerateColumns = false;
this.dgvGuest.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvGuest.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.idDataGridViewTextBoxColumn,
this.nameDataGridViewTextBoxColumn,
this.emailDataGridViewTextBoxColumn,
this.phoneDataGridViewTextBoxColumn});
this.dgvGuest.DataSource = this.guestBindingSource;
this.dgvGuest.Location = new System.Drawing.Point(149, 23);
this.dgvGuest.Name = "dgvGuest";
this.dgvGuest.Size = new System.Drawing.Size(444, 150);
this.dgvGuest.TabIndex = 0;
this.dgvGuest.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvGuest_CellContentClick);
//
// idDataGridViewTextBoxColumn
//
this.idDataGridViewTextBoxColumn.DataPropertyName = "Id";
this.idDataGridViewTextBoxColumn.HeaderText = "Id";
this.idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn";
this.idDataGridViewTextBoxColumn.ReadOnly = true;
//
// nameDataGridViewTextBoxColumn
//
this.nameDataGridViewTextBoxColumn.DataPropertyName = "name";
this.nameDataGridViewTextBoxColumn.HeaderText = "name";
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
//
// emailDataGridViewTextBoxColumn
//
this.emailDataGridViewTextBoxColumn.DataPropertyName = "email";
this.emailDataGridViewTextBoxColumn.HeaderText = "email";
this.emailDataGridViewTextBoxColumn.Name = "emailDataGridViewTextBoxColumn";
//
// phoneDataGridViewTextBoxColumn
//
this.phoneDataGridViewTextBoxColumn.DataPropertyName = "phone";
this.phoneDataGridViewTextBoxColumn.HeaderText = "phone";
this.phoneDataGridViewTextBoxColumn.Name = "phoneDataGridViewTextBoxColumn";
//
// guestBindingSource
//
this.guestBindingSource.DataMember = "Guest";
this.guestBindingSource.DataSource = this.hotelDataSet;
//
// hotelDataSet
//
this.hotelDataSet.DataSetName = "HotelDataSet";
this.hotelDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
//
// guestTableAdapter
//
this.guestTableAdapter.ClearBeforeFill = true;
//
// dgvReservations
//
this.dgvReservations.AutoGenerateColumns = false;
this.dgvReservations.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvReservations.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.idDataGridViewTextBoxColumn1,
this.guestIdDataGridViewTextBoxColumn,
this.roomIdDataGridViewTextBoxColumn,
this.checkInDataGridViewTextBoxColumn,
this.checkOutDataGridViewTextBoxColumn,
this.paidDataGridViewCheckBoxColumn});
this.dgvReservations.DataSource = this.reservationBindingSource;
this.dgvReservations.Location = new System.Drawing.Point(77, 195);
this.dgvReservations.Name = "dgvReservations";
this.dgvReservations.Size = new System.Drawing.Size(645, 150);
this.dgvReservations.TabIndex = 1;
//
// idDataGridViewTextBoxColumn1
//
this.idDataGridViewTextBoxColumn1.DataPropertyName = "Id";
this.idDataGridViewTextBoxColumn1.HeaderText = "Id";
this.idDataGridViewTextBoxColumn1.Name = "idDataGridViewTextBoxColumn1";
this.idDataGridViewTextBoxColumn1.ReadOnly = true;
//
// guestIdDataGridViewTextBoxColumn
//
this.guestIdDataGridViewTextBoxColumn.DataPropertyName = "guestId";
this.guestIdDataGridViewTextBoxColumn.HeaderText = "guestId";
this.guestIdDataGridViewTextBoxColumn.Name = "guestIdDataGridViewTextBoxColumn";
//
// roomIdDataGridViewTextBoxColumn
//
this.roomIdDataGridViewTextBoxColumn.DataPropertyName = "roomId";
this.roomIdDataGridViewTextBoxColumn.HeaderText = "roomId";
this.roomIdDataGridViewTextBoxColumn.Name = "roomIdDataGridViewTextBoxColumn";
//
// checkInDataGridViewTextBoxColumn
//
this.checkInDataGridViewTextBoxColumn.DataPropertyName = "checkIn";
this.checkInDataGridViewTextBoxColumn.HeaderText = "checkIn";
this.checkInDataGridViewTextBoxColumn.Name = "checkInDataGridViewTextBoxColumn";
//
// checkOutDataGridViewTextBoxColumn
//
this.checkOutDataGridViewTextBoxColumn.DataPropertyName = "checkOut";
this.checkOutDataGridViewTextBoxColumn.HeaderText = "checkOut";
this.checkOutDataGridViewTextBoxColumn.Name = "checkOutDataGridViewTextBoxColumn";
//
// paidDataGridViewCheckBoxColumn
//
this.paidDataGridViewCheckBoxColumn.DataPropertyName = "paid";
this.paidDataGridViewCheckBoxColumn.HeaderText = "paid";
this.paidDataGridViewCheckBoxColumn.Name = "paidDataGridViewCheckBoxColumn";
//
// reservationBindingSource
//
this.reservationBindingSource.DataMember = "Reservation";
this.reservationBindingSource.DataSource = this.hotelDataSet;
//
// reservationTableAdapter
//
this.reservationTableAdapter.ClearBeforeFill = true;
//
// saveBtn
//
this.saveBtn.Location = new System.Drawing.Point(343, 437);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(75, 23);
this.saveBtn.TabIndex = 2;
this.saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true;
this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 594);
this.Controls.Add(this.saveBtn);
this.Controls.Add(this.dgvReservations);
this.Controls.Add(this.dgvGuest);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.dgvGuest)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.guestBindingSource)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.hotelDataSet)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvReservations)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.reservationBindingSource)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgvGuest;
private HotelDataSet hotelDataSet;
private System.Windows.Forms.BindingSource guestBindingSource;
private HotelDataSetTableAdapters.GuestTableAdapter guestTableAdapter;
private System.Windows.Forms.DataGridViewTextBoxColumn idDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn emailDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn phoneDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridView dgvReservations;
private System.Windows.Forms.BindingSource reservationBindingSource;
private HotelDataSetTableAdapters.ReservationTableAdapter reservationTableAdapter;
private System.Windows.Forms.DataGridViewTextBoxColumn idDataGridViewTextBoxColumn1;
private System.Windows.Forms.DataGridViewTextBoxColumn guestIdDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn roomIdDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn checkInDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn checkOutDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewCheckBoxColumn paidDataGridViewCheckBoxColumn;
private System.Windows.Forms.Button saveBtn;
private SqlDataAdapter adapter1;
private SqlDataAdapter adapter2;
private DataSet ds1;
private DataSet ds2;
}
}
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Practic
{
public partial class Form1 : Form
{
public SqlConnection connection = new SqlConnection("Data Source=DANIELCUJBA\\SQLEXPRESS;Initial Catalog=Hotel;Integrated Security=True;");
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
var command = new SqlCommand("SELECT * FROM Guest", connection);
this.adapter1 = new SqlDataAdapter(command);
this.ds1 = new DataSet("Guest");
this.adapter1.Fill(ds1, "Guest");
this.dgvGuest.DataSource = ds1.Tables["Guest"];
}
private void dgvGuest_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
var id = dgvGuest.Rows[e.RowIndex].Cells[0].Value;
var command = new SqlCommand($"SELECT * FROM Reservation WHERE guestId = ${id}", connection);
this.adapter2 = new SqlDataAdapter(command);
this.ds2 = new DataSet("Reservation");
this.adapter2.Fill(ds2, "Reservation");
this.dgvReservations.DataSource = ds2.Tables["Reservation"];
}
private void saveBtn_Click(object sender, EventArgs e)
{
var builder = new SqlCommandBuilder(adapter2);
adapter2.UpdateCommand = builder.GetUpdateCommand();
try
{
this.adapter2.Update((DataTable)this.dgvReservations.DataSource);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="guestBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>138, 17</value>
</metadata>
<metadata name="hotelDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="guestTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>298, 17</value>
</metadata>
<metadata name="reservationBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>450, 17</value>
</metadata>
<metadata name="reservationTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>639, 17</value>
</metadata>
</root>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@

@@ -0,0 +1,432 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="HotelDataSet" targetNamespace="http://tempuri.org/HotelDataSet.xsd" xmlns:mstns="http://tempuri.org/HotelDataSet.xsd" xmlns="http://tempuri.org/HotelDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="HotelConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="HotelConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.Practic.Properties.Settings.GlobalReference.Default.HotelConnectionString" Provider="System.Data.SqlClient" />
</Connections>
<Tables>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="GuestTableAdapter" GeneratorDataComponentClassName="GuestTableAdapter" Name="Guest" UserDataComponentName="GuestTableAdapter">
<MainSource>
<DbSource ConnectionRef="HotelConnectionString (Settings)" DbObjectName="Hotel.dbo.Guest" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
<DeleteCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>DELETE FROM [dbo].[Guest] WHERE (([Id] = @Original_Id) AND ([name] = @Original_name) AND ([email] = @Original_email) AND ([phone] = @Original_phone))</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="name" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_email" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="email" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_phone" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="phone" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</DeleteCommand>
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>INSERT INTO [dbo].[Guest] ([name], [email], [phone]) VALUES (@name, @email, @phone);
SELECT Id, name, email, phone FROM Guest WHERE (Id = SCOPE_IDENTITY())</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="name" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@email" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="email" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@phone" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="phone" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</InsertCommand>
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>SELECT Id, name, email, phone FROM dbo.Guest</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>
<UpdateCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>UPDATE [dbo].[Guest] SET [name] = @name, [email] = @email, [phone] = @phone WHERE (([Id] = @Original_Id) AND ([name] = @Original_name) AND ([email] = @Original_email) AND ([phone] = @Original_phone));
SELECT Id, name, email, phone FROM Guest WHERE (Id = @Id)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="name" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@email" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="email" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@phone" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="phone" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="name" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_email" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="email" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_phone" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="phone" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="Id" DataSourceName="Hotel.dbo.Guest" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</UpdateCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="Id" DataSetColumn="Id" />
<Mapping SourceColumn="name" DataSetColumn="name" />
<Mapping SourceColumn="email" DataSetColumn="email" />
<Mapping SourceColumn="phone" DataSetColumn="phone" />
</Mappings>
<Sources />
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="PaymentTableAdapter" GeneratorDataComponentClassName="PaymentTableAdapter" Name="Payment" UserDataComponentName="PaymentTableAdapter">
<MainSource>
<DbSource ConnectionRef="HotelConnectionString (Settings)" DbObjectName="Hotel.dbo.Payment" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
<DeleteCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>DELETE FROM [dbo].[Payment] WHERE (([Id] = @Original_Id) AND ([reservationId] = @Original_reservationId) AND ([amount] = @Original_amount) AND ([serviceId] = @Original_serviceId))</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_reservationId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="reservationId" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_amount" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="amount" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_serviceId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="serviceId" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</DeleteCommand>
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>INSERT INTO [dbo].[Payment] ([reservationId], [amount], [serviceId]) VALUES (@reservationId, @amount, @serviceId);
SELECT Id, reservationId, amount, serviceId FROM Payment WHERE (Id = SCOPE_IDENTITY())</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@reservationId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="reservationId" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@amount" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="amount" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@serviceId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="serviceId" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</InsertCommand>
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>SELECT Id, reservationId, amount, serviceId FROM dbo.Payment</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>
<UpdateCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>UPDATE [dbo].[Payment] SET [reservationId] = @reservationId, [amount] = @amount, [serviceId] = @serviceId WHERE (([Id] = @Original_Id) AND ([reservationId] = @Original_reservationId) AND ([amount] = @Original_amount) AND ([serviceId] = @Original_serviceId));
SELECT Id, reservationId, amount, serviceId FROM Payment WHERE (Id = @Id)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@reservationId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="reservationId" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@amount" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="amount" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@serviceId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="serviceId" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_reservationId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="reservationId" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_amount" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="amount" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_serviceId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="serviceId" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="Id" DataSourceName="Hotel.dbo.Payment" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</UpdateCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="Id" DataSetColumn="Id" />
<Mapping SourceColumn="reservationId" DataSetColumn="reservationId" />
<Mapping SourceColumn="amount" DataSetColumn="amount" />
<Mapping SourceColumn="serviceId" DataSetColumn="serviceId" />
</Mappings>
<Sources />
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ReservationTableAdapter" GeneratorDataComponentClassName="ReservationTableAdapter" Name="Reservation" UserDataComponentName="ReservationTableAdapter">
<MainSource>
<DbSource ConnectionRef="HotelConnectionString (Settings)" DbObjectName="Hotel.dbo.Reservation" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
<DeleteCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>DELETE FROM [dbo].[Reservation] WHERE (([Id] = @Original_Id) AND ([guestId] = @Original_guestId) AND ([roomId] = @Original_roomId) AND ([checkIn] = @Original_checkIn) AND ([checkOut] = @Original_checkOut) AND ([paid] = @Original_paid))</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_guestId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="guestId" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_roomId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="roomId" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_checkIn" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="checkIn" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_checkOut" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="checkOut" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_paid" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="paid" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</DeleteCommand>
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>INSERT INTO [dbo].[Reservation] ([guestId], [roomId], [checkIn], [checkOut], [paid]) VALUES (@guestId, @roomId, @checkIn, @checkOut, @paid);
SELECT Id, guestId, roomId, checkIn, checkOut, paid FROM Reservation WHERE (Id = SCOPE_IDENTITY())</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@guestId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="guestId" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@roomId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="roomId" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@checkIn" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="checkIn" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@checkOut" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="checkOut" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@paid" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="paid" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</InsertCommand>
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>SELECT Id, guestId, roomId, checkIn, checkOut, paid FROM dbo.Reservation</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>
<UpdateCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>UPDATE [dbo].[Reservation] SET [guestId] = @guestId, [roomId] = @roomId, [checkIn] = @checkIn, [checkOut] = @checkOut, [paid] = @paid WHERE (([Id] = @Original_Id) AND ([guestId] = @Original_guestId) AND ([roomId] = @Original_roomId) AND ([checkIn] = @Original_checkIn) AND ([checkOut] = @Original_checkOut) AND ([paid] = @Original_paid));
SELECT Id, guestId, roomId, checkIn, checkOut, paid FROM Reservation WHERE (Id = @Id)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@guestId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="guestId" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@roomId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="roomId" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@checkIn" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="checkIn" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@checkOut" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="checkOut" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@paid" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="paid" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_guestId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="guestId" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_roomId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="roomId" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_checkIn" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="checkIn" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_checkOut" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="checkOut" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_paid" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="paid" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="Id" DataSourceName="Hotel.dbo.Reservation" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</UpdateCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="Id" DataSetColumn="Id" />
<Mapping SourceColumn="guestId" DataSetColumn="guestId" />
<Mapping SourceColumn="roomId" DataSetColumn="roomId" />
<Mapping SourceColumn="checkIn" DataSetColumn="checkIn" />
<Mapping SourceColumn="checkOut" DataSetColumn="checkOut" />
<Mapping SourceColumn="paid" DataSetColumn="paid" />
</Mappings>
<Sources />
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RoomTableAdapter" GeneratorDataComponentClassName="RoomTableAdapter" Name="Room" UserDataComponentName="RoomTableAdapter">
<MainSource>
<DbSource ConnectionRef="HotelConnectionString (Settings)" DbObjectName="Hotel.dbo.Room" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
<DeleteCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>DELETE FROM [dbo].[Room] WHERE (([Id] = @Original_Id) AND ([type] = @Original_type) AND ([capacity] = @Original_capacity) AND ([price] = @Original_price))</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_type" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="type" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_capacity" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="capacity" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_price" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="price" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</DeleteCommand>
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>INSERT INTO [dbo].[Room] ([type], [capacity], [price]) VALUES (@type, @capacity, @price);
SELECT Id, type, capacity, price FROM Room WHERE (Id = SCOPE_IDENTITY())</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@type" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="type" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@capacity" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="capacity" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@price" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="price" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</InsertCommand>
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>SELECT Id, type, capacity, price FROM dbo.Room</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>
<UpdateCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>UPDATE [dbo].[Room] SET [type] = @type, [capacity] = @capacity, [price] = @price WHERE (([Id] = @Original_Id) AND ([type] = @Original_type) AND ([capacity] = @Original_capacity) AND ([price] = @Original_price));
SELECT Id, type, capacity, price FROM Room WHERE (Id = @Id)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@type" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="type" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@capacity" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="capacity" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@price" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="price" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_type" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="type" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_capacity" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="capacity" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_price" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="price" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="Id" DataSourceName="Hotel.dbo.Room" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</UpdateCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="Id" DataSetColumn="Id" />
<Mapping SourceColumn="type" DataSetColumn="type" />
<Mapping SourceColumn="capacity" DataSetColumn="capacity" />
<Mapping SourceColumn="price" DataSetColumn="price" />
</Mappings>
<Sources />
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ServiceTableAdapter" GeneratorDataComponentClassName="ServiceTableAdapter" Name="Service" UserDataComponentName="ServiceTableAdapter">
<MainSource>
<DbSource ConnectionRef="HotelConnectionString (Settings)" DbObjectName="Hotel.dbo.Service" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
<DeleteCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>DELETE FROM [dbo].[Service] WHERE (([Id] = @Original_Id) AND ([name] = @Original_name) AND ([description] = @Original_description) AND ([price] = @Original_price))</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="name" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="description" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_price" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="price" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</DeleteCommand>
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>INSERT INTO [dbo].[Service] ([name], [description], [price]) VALUES (@name, @description, @price);
SELECT Id, name, description, price FROM Service WHERE (Id = SCOPE_IDENTITY())</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="name" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="description" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@price" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="price" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</InsertCommand>
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>SELECT Id, name, description, price FROM dbo.Service</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>
<UpdateCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>UPDATE [dbo].[Service] SET [name] = @name, [description] = @description, [price] = @price WHERE (([Id] = @Original_Id) AND ([name] = @Original_name) AND ([description] = @Original_description) AND ([price] = @Original_price));
SELECT Id, name, description, price FROM Service WHERE (Id = @Id)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="name" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="description" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@price" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="price" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="name" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="description" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_price" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="price" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="Id" DataSourceName="Hotel.dbo.Service" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</UpdateCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="Id" DataSetColumn="Id" />
<Mapping SourceColumn="name" DataSetColumn="name" />
<Mapping SourceColumn="description" DataSetColumn="description" />
<Mapping SourceColumn="price" DataSetColumn="price" />
</Mappings>
<Sources />
</TableAdapter>
</Tables>
<Sources />
</DataSource>
</xs:appinfo>
</xs:annotation>
<xs:element name="HotelDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="True" msprop:Generator_UserDSName="HotelDataSet" msprop:Generator_DataSetName="HotelDataSet">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Guest" msprop:Generator_RowEvHandlerName="GuestRowChangeEventHandler" msprop:Generator_RowDeletedName="GuestRowDeleted" msprop:Generator_RowDeletingName="GuestRowDeleting" msprop:Generator_RowEvArgName="GuestRowChangeEvent" msprop:Generator_TablePropName="Guest" msprop:Generator_RowChangedName="GuestRowChanged" msprop:Generator_RowChangingName="GuestRowChanging" msprop:Generator_TableClassName="GuestDataTable" msprop:Generator_RowClassName="GuestRow" msprop:Generator_TableVarName="tableGuest" msprop:Generator_UserTableName="Guest">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnPropNameInTable="IdColumn" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_UserColumnName="Id" type="xs:int" />
<xs:element name="name" msprop:Generator_ColumnPropNameInRow="name" msprop:Generator_ColumnPropNameInTable="nameColumn" msprop:Generator_ColumnVarNameInTable="columnname" msprop:Generator_UserColumnName="name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="email" msprop:Generator_ColumnPropNameInRow="email" msprop:Generator_ColumnPropNameInTable="emailColumn" msprop:Generator_ColumnVarNameInTable="columnemail" msprop:Generator_UserColumnName="email">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="phone" msprop:Generator_ColumnPropNameInRow="phone" msprop:Generator_ColumnPropNameInTable="phoneColumn" msprop:Generator_ColumnVarNameInTable="columnphone" msprop:Generator_UserColumnName="phone">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Payment" msprop:Generator_RowEvHandlerName="PaymentRowChangeEventHandler" msprop:Generator_RowDeletedName="PaymentRowDeleted" msprop:Generator_RowDeletingName="PaymentRowDeleting" msprop:Generator_RowEvArgName="PaymentRowChangeEvent" msprop:Generator_TablePropName="Payment" msprop:Generator_RowChangedName="PaymentRowChanged" msprop:Generator_RowChangingName="PaymentRowChanging" msprop:Generator_TableClassName="PaymentDataTable" msprop:Generator_RowClassName="PaymentRow" msprop:Generator_TableVarName="tablePayment" msprop:Generator_UserTableName="Payment">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnPropNameInTable="IdColumn" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_UserColumnName="Id" type="xs:int" />
<xs:element name="reservationId" msprop:Generator_ColumnPropNameInRow="reservationId" msprop:Generator_ColumnPropNameInTable="reservationIdColumn" msprop:Generator_ColumnVarNameInTable="columnreservationId" msprop:Generator_UserColumnName="reservationId" type="xs:int" />
<xs:element name="amount" msprop:Generator_ColumnPropNameInRow="amount" msprop:Generator_ColumnPropNameInTable="amountColumn" msprop:Generator_ColumnVarNameInTable="columnamount" msprop:Generator_UserColumnName="amount" type="xs:int" />
<xs:element name="serviceId" msprop:Generator_ColumnPropNameInRow="serviceId" msprop:Generator_ColumnPropNameInTable="serviceIdColumn" msprop:Generator_ColumnVarNameInTable="columnserviceId" msprop:Generator_UserColumnName="serviceId" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Reservation" msprop:Generator_RowEvHandlerName="ReservationRowChangeEventHandler" msprop:Generator_RowDeletedName="ReservationRowDeleted" msprop:Generator_RowDeletingName="ReservationRowDeleting" msprop:Generator_RowEvArgName="ReservationRowChangeEvent" msprop:Generator_TablePropName="Reservation" msprop:Generator_RowChangedName="ReservationRowChanged" msprop:Generator_RowChangingName="ReservationRowChanging" msprop:Generator_TableClassName="ReservationDataTable" msprop:Generator_RowClassName="ReservationRow" msprop:Generator_TableVarName="tableReservation" msprop:Generator_UserTableName="Reservation">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnPropNameInTable="IdColumn" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_UserColumnName="Id" type="xs:int" />
<xs:element name="guestId" msprop:Generator_ColumnPropNameInRow="guestId" msprop:Generator_ColumnPropNameInTable="guestIdColumn" msprop:Generator_ColumnVarNameInTable="columnguestId" msprop:Generator_UserColumnName="guestId" type="xs:int" />
<xs:element name="roomId" msprop:Generator_ColumnPropNameInRow="roomId" msprop:Generator_ColumnPropNameInTable="roomIdColumn" msprop:Generator_ColumnVarNameInTable="columnroomId" msprop:Generator_UserColumnName="roomId" type="xs:int" />
<xs:element name="checkIn" msprop:Generator_ColumnPropNameInRow="checkIn" msprop:Generator_ColumnPropNameInTable="checkInColumn" msprop:Generator_ColumnVarNameInTable="columncheckIn" msprop:Generator_UserColumnName="checkIn" type="xs:dateTime" />
<xs:element name="checkOut" msprop:Generator_ColumnPropNameInRow="checkOut" msprop:Generator_ColumnPropNameInTable="checkOutColumn" msprop:Generator_ColumnVarNameInTable="columncheckOut" msprop:Generator_UserColumnName="checkOut" type="xs:dateTime" />
<xs:element name="paid" msprop:Generator_ColumnPropNameInRow="paid" msprop:Generator_ColumnPropNameInTable="paidColumn" msprop:Generator_ColumnVarNameInTable="columnpaid" msprop:Generator_UserColumnName="paid" type="xs:boolean" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Room" msprop:Generator_RowEvHandlerName="RoomRowChangeEventHandler" msprop:Generator_RowDeletedName="RoomRowDeleted" msprop:Generator_RowDeletingName="RoomRowDeleting" msprop:Generator_RowEvArgName="RoomRowChangeEvent" msprop:Generator_TablePropName="Room" msprop:Generator_RowChangedName="RoomRowChanged" msprop:Generator_RowChangingName="RoomRowChanging" msprop:Generator_TableClassName="RoomDataTable" msprop:Generator_RowClassName="RoomRow" msprop:Generator_TableVarName="tableRoom" msprop:Generator_UserTableName="Room">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnPropNameInTable="IdColumn" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_UserColumnName="Id" type="xs:int" />
<xs:element name="type" msprop:Generator_ColumnPropNameInRow="type" msprop:Generator_ColumnPropNameInTable="typeColumn" msprop:Generator_ColumnVarNameInTable="columntype" msprop:Generator_UserColumnName="type">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="capacity" msprop:Generator_ColumnPropNameInRow="capacity" msprop:Generator_ColumnPropNameInTable="capacityColumn" msprop:Generator_ColumnVarNameInTable="columncapacity" msprop:Generator_UserColumnName="capacity" type="xs:int" />
<xs:element name="price" msprop:Generator_ColumnPropNameInRow="price" msprop:Generator_ColumnPropNameInTable="priceColumn" msprop:Generator_ColumnVarNameInTable="columnprice" msprop:Generator_UserColumnName="price" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Service" msprop:Generator_RowEvHandlerName="ServiceRowChangeEventHandler" msprop:Generator_RowDeletedName="ServiceRowDeleted" msprop:Generator_RowDeletingName="ServiceRowDeleting" msprop:Generator_RowEvArgName="ServiceRowChangeEvent" msprop:Generator_TablePropName="Service" msprop:Generator_RowChangedName="ServiceRowChanged" msprop:Generator_RowChangingName="ServiceRowChanging" msprop:Generator_TableClassName="ServiceDataTable" msprop:Generator_RowClassName="ServiceRow" msprop:Generator_TableVarName="tableService" msprop:Generator_UserTableName="Service">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnPropNameInTable="IdColumn" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_UserColumnName="Id" type="xs:int" />
<xs:element name="name" msprop:Generator_ColumnPropNameInRow="name" msprop:Generator_ColumnPropNameInTable="nameColumn" msprop:Generator_ColumnVarNameInTable="columnname" msprop:Generator_UserColumnName="name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="description" msprop:Generator_ColumnPropNameInRow="description" msprop:Generator_ColumnPropNameInTable="descriptionColumn" msprop:Generator_ColumnVarNameInTable="columndescription" msprop:Generator_UserColumnName="description">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="price" msprop:Generator_ColumnPropNameInRow="price" msprop:Generator_ColumnPropNameInTable="priceColumn" msprop:Generator_ColumnVarNameInTable="columnprice" msprop:Generator_UserColumnName="price" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Guest" />
<xs:field xpath="mstns:Id" />
</xs:unique>
<xs:unique name="Payment_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Payment" />
<xs:field xpath="mstns:Id" />
</xs:unique>
<xs:unique name="Reservation_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Reservation" />
<xs:field xpath="mstns:Id" />
</xs:unique>
<xs:unique name="Room_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Room" />
<xs:field xpath="mstns:Id" />
</xs:unique>
<xs:unique name="Service_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Service" />
<xs:field xpath="mstns:Id" />
</xs:unique>
</xs:element>
<xs:annotation>
<xs:appinfo>
<msdata:Relationship name="FK__Payment__reserva__5629CD9C" msdata:parent="Reservation" msdata:child="Payment" msdata:parentkey="Id" msdata:childkey="reservationId" msprop:Generator_UserParentTable="Reservation" msprop:Generator_UserChildTable="Payment" msprop:Generator_RelationVarName="relationFK__Payment__reserva__5629CD9C" msprop:Generator_UserRelationName="FK__Payment__reserva__5629CD9C" msprop:Generator_ChildPropName="GetPaymentRows" msprop:Generator_ParentPropName="ReservationRow" />
<msdata:Relationship name="FK__Payment__service__571DF1D5" msdata:parent="Service" msdata:child="Payment" msdata:parentkey="Id" msdata:childkey="serviceId" msprop:Generator_UserParentTable="Service" msprop:Generator_UserChildTable="Payment" msprop:Generator_RelationVarName="relationFK__Payment__service__571DF1D5" msprop:Generator_UserRelationName="FK__Payment__service__571DF1D5" msprop:Generator_ChildPropName="GetPaymentRows" msprop:Generator_ParentPropName="ServiceRow" />
<msdata:Relationship name="FK__Reservati__guest__5070F446" msdata:parent="Guest" msdata:child="Reservation" msdata:parentkey="Id" msdata:childkey="guestId" msprop:Generator_UserParentTable="Guest" msprop:Generator_UserChildTable="Reservation" msprop:Generator_RelationVarName="relationFK__Reservati__guest__5070F446" msprop:Generator_ChildPropName="GetReservationRows" msprop:Generator_ParentPropName="GuestRow" msprop:Generator_UserRelationName="FK__Reservati__guest__5070F446" />
<msdata:Relationship name="FK__Reservati__roomI__5165187F" msdata:parent="Room" msdata:child="Reservation" msdata:parentkey="Id" msdata:childkey="roomId" msprop:Generator_UserParentTable="Room" msprop:Generator_UserChildTable="Reservation" msprop:Generator_RelationVarName="relationFK__Reservati__roomI__5165187F" msprop:Generator_UserRelationName="FK__Reservati__roomI__5165187F" msprop:Generator_ChildPropName="GetReservationRows" msprop:Generator_ParentPropName="RoomRow" />
</xs:appinfo>
</xs:annotation>
</xs:schema>
@@ -0,0 +1 @@

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1E1F18BC-F95C-41B1-A472-6E928149DC0A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Practic</RootNamespace>
<AssemblyName>Practic</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="HotelDataSet.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>HotelDataSet.xsd</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="HotelDataSet.xsc">
<DependentUpon>HotelDataSet.xsd</DependentUpon>
</None>
<None Include="HotelDataSet.xsd">
<Generator>MSDataSetGenerator</Generator>
<LastGenOutput>HotelDataSet.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</None>
<None Include="HotelDataSet.xss">
<DependentUpon>HotelDataSet.xsd</DependentUpon>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Practic
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Practic")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Practic")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1e1f18bc-f95c-41b1-a472-6e928149dc0a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Practic.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Practic.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,37 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Practic.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=DANIELCUJBA\\SQLEXPRESS;Initial Catalog=Hotel;Integrated Security=True" +
";TrustServerCertificate=True")]
public string HotelConnectionString {
get {
return ((string)(this["HotelConnectionString"]));
}
}
}
}
@@ -0,0 +1,14 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Practic.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="HotelConnectionString" Type="(Connection string)" Scope="Application">
<DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;SerializableConnectionString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;ConnectionString&gt;Data Source=DANIELCUJBA\SQLEXPRESS;Initial Catalog=Hotel;Integrated Security=True;TrustServerCertificate=True&lt;/ConnectionString&gt;
&lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
&lt;/SerializableConnectionString&gt;</DesignTimeValue>
<Value Profile="(Default)">Data Source=DANIELCUJBA\SQLEXPRESS;Initial Catalog=Hotel;Integrated Security=True;TrustServerCertificate=True</Value>
</Setting>
</Settings>
</SettingsFile>