Browse Source

возможность выбрать уровень комфорта и форма бронированиея

chernyshyov.2000 5 years ago
parent
commit
0584c69af2

+ 21 - 8
testkonkurs1/Form3.Designer.cs

@@ -41,6 +41,7 @@
             this.konkursDataSetBindingSource = new System.Windows.Forms.BindingSource(this.components);
             this.comfortBindingSource = new System.Windows.Forms.BindingSource(this.components);
             this.comfortTableAdapter = new testkonkurs1.konkursDataSetTableAdapters.comfortTableAdapter();
+            this.button2 = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.konkursDataSetBindingSource1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.konkursDataSet)).BeginInit();
@@ -56,7 +57,7 @@
             // 
             // dateTimePicker1
             // 
-            this.dateTimePicker1.Location = new System.Drawing.Point(62, 68);
+            this.dateTimePicker1.Location = new System.Drawing.Point(130, 55);
             this.dateTimePicker1.Name = "dateTimePicker1";
             this.dateTimePicker1.Size = new System.Drawing.Size(184, 20);
             this.dateTimePicker1.TabIndex = 0;
@@ -64,7 +65,7 @@
             // 
             // textBox1
             // 
-            this.textBox1.Location = new System.Drawing.Point(279, 68);
+            this.textBox1.Location = new System.Drawing.Point(348, 54);
             this.textBox1.Name = "textBox1";
             this.textBox1.Size = new System.Drawing.Size(125, 20);
             this.textBox1.TabIndex = 1;
@@ -77,7 +78,7 @@
             "1-комнатный",
             "2-комнатный",
             "показать все"});
-            this.comboBox1.Location = new System.Drawing.Point(444, 67);
+            this.comboBox1.Location = new System.Drawing.Point(520, 54);
             this.comboBox1.Name = "comboBox1";
             this.comboBox1.Size = new System.Drawing.Size(133, 21);
             this.comboBox1.TabIndex = 2;
@@ -86,7 +87,7 @@
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(634, 93);
+            this.button1.Location = new System.Drawing.Point(520, 186);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(133, 50);
             this.button1.TabIndex = 3;
@@ -97,9 +98,9 @@
             // dataGridView1
             // 
             this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dataGridView1.Location = new System.Drawing.Point(76, 181);
+            this.dataGridView1.Location = new System.Drawing.Point(130, 137);
             this.dataGridView1.Name = "dataGridView1";
-            this.dataGridView1.Size = new System.Drawing.Size(807, 276);
+            this.dataGridView1.Size = new System.Drawing.Size(343, 291);
             this.dataGridView1.TabIndex = 5;
             this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
             // 
@@ -127,18 +128,29 @@
             // 
             this.comfortTableAdapter.ClearBeforeFill = true;
             // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(520, 279);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(133, 60);
+            this.button2.TabIndex = 6;
+            this.button2.Text = "забронировать номер";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
             // Form3
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(959, 492);
+            this.ClientSize = new System.Drawing.Size(685, 492);
+            this.Controls.Add(this.button2);
             this.Controls.Add(this.dataGridView1);
             this.Controls.Add(this.button1);
             this.Controls.Add(this.comboBox1);
             this.Controls.Add(this.textBox1);
             this.Controls.Add(this.dateTimePicker1);
             this.Name = "Form3";
-            this.Text = "Form3";
+            this.Text = "Панель менеджера";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form3_FormClosing);
             this.Load += new System.EventHandler(this.Form3_Load);
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
@@ -165,5 +177,6 @@
         private System.Windows.Forms.BindingSource konkursDataSetBindingSource;
         private System.Windows.Forms.BindingSource comfortBindingSource;
         private konkursDataSetTableAdapters.comfortTableAdapter comfortTableAdapter;
+        private System.Windows.Forms.Button button2;
     }
 }

+ 32 - 29
testkonkurs1/Form3.cs

@@ -116,11 +116,13 @@ namespace testkonkurs1
                             Mesta.Close();
                         }
                     }
+                int count = 0;
                 for (int j = 0; j < 20; j++)
                 {
-                    if (comboBox1.SelectedIndex == 0)
+
+                    if (comboBox1.SelectedIndex == 2)
                     {
-                        if (nomer_comnat[j] != 2)
+                        if (nomer_comnat[j] != 0)
                         {
                             dataGridView1.Rows.Add();
                             dataGridView1.Rows[j].Cells[0].Value = nomer_comnat[j];
@@ -128,42 +130,36 @@ namespace testkonkurs1
                             dataGridView1.Rows[j].Cells[2].Value = price[j];
                         }
                     }
-
-                        if (comboBox1.SelectedIndex == 1)
-                        {
+                    if (comboBox1.SelectedIndex == 1)
+                    {
                         if (nomer_comnat[j] != 0)
                         {
-                            if (lvl_comfort[j].ToString() != "1-местный ")
+                            if(lvl_comfort[j] == "2-местный ")
                             {
+       
                                 dataGridView1.Rows.Add();
-                                dataGridView1.Rows[j].Cells[0].Value = nomer_comnat[j];
-                                dataGridView1.Rows[j].Cells[1].Value = lvl_comfort[j];
-                                dataGridView1.Rows[j].Cells[2].Value = price[j];
+                                dataGridView1.Rows[count].Cells[0].Value = nomer_comnat[j];
+                                dataGridView1.Rows[count].Cells[1].Value = lvl_comfort[j];
+                                dataGridView1.Rows[count].Cells[2].Value = price[j];
+                                count++;
                             }
-
-
-
-                            if (comboBox1.SelectedIndex == 2)
+                        }
+                    }
+                    if (comboBox1.SelectedIndex == 0)
+                    {
+                        if (nomer_comnat[j] != 0)
+                        {
+                            if (lvl_comfort[j] == "1-местный ")
                             {
-                                if (nomer_comnat[j] != 0)
-                                {
-                                    if (lvl_comfort[j].ToString() != "2-местный ")
-                                    {
-                                        dataGridView1.Rows.Add();
-                                        dataGridView1.Rows[j].Cells[0].Value = nomer_comnat[j];
-                                        dataGridView1.Rows[j].Cells[1].Value = lvl_comfort[j];
-                                        dataGridView1.Rows[j].Cells[2].Value = price[j];
-                                    }
-
-
-                                }
+                                dataGridView1.Rows.Add();
+                                dataGridView1.Rows[count].Cells[0].Value = nomer_comnat[j];
+                                dataGridView1.Rows[count].Cells[1].Value = lvl_comfort[j];
+                                dataGridView1.Rows[count].Cells[2].Value = price[j];
+                                count++;
                             }
                         }
                     }
-
-                    }
-
-
+                }
 
             }
 
@@ -199,6 +195,13 @@ namespace testkonkurs1
         {
 
         }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            Form4 fr4 = new Form4();
+            fr4.Show();
+            this.Hide();
+        }
     }
 
     }

+ 192 - 0
testkonkurs1/Form4.Designer.cs

@@ -0,0 +1,192 @@
+namespace testkonkurs1
+{
+    partial class Form4
+    {
+        /// <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.last_name = new System.Windows.Forms.TextBox();
+            this.name = new System.Windows.Forms.MaskedTextBox();
+            this.surname = new System.Windows.Forms.TextBox();
+            this.data_zaezda = new System.Windows.Forms.TextBox();
+            this.data_broni = new System.Windows.Forms.TextBox();
+            this.coldays = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.nomerComnati = new System.Windows.Forms.TextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.button1 = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // last_name
+            // 
+            this.last_name.Location = new System.Drawing.Point(63, 35);
+            this.last_name.Name = "last_name";
+            this.last_name.Size = new System.Drawing.Size(157, 20);
+            this.last_name.TabIndex = 0;
+            // 
+            // name
+            // 
+            this.name.Location = new System.Drawing.Point(63, 61);
+            this.name.Name = "name";
+            this.name.Size = new System.Drawing.Size(157, 20);
+            this.name.TabIndex = 1;
+            // 
+            // surname
+            // 
+            this.surname.Location = new System.Drawing.Point(63, 87);
+            this.surname.Name = "surname";
+            this.surname.Size = new System.Drawing.Size(157, 20);
+            this.surname.TabIndex = 2;
+            // 
+            // data_zaezda
+            // 
+            this.data_zaezda.Location = new System.Drawing.Point(334, 35);
+            this.data_zaezda.Name = "data_zaezda";
+            this.data_zaezda.Size = new System.Drawing.Size(81, 20);
+            this.data_zaezda.TabIndex = 3;
+            // 
+            // data_broni
+            // 
+            this.data_broni.Location = new System.Drawing.Point(334, 175);
+            this.data_broni.Name = "data_broni";
+            this.data_broni.Size = new System.Drawing.Size(81, 20);
+            this.data_broni.TabIndex = 4;
+            // 
+            // coldays
+            // 
+            this.coldays.Location = new System.Drawing.Point(334, 87);
+            this.coldays.Name = "coldays";
+            this.coldays.Size = new System.Drawing.Size(81, 20);
+            this.coldays.TabIndex = 5;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(60, 9);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(78, 13);
+            this.label1.TabIndex = 6;
+            this.label1.Text = "введите ФИО";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(331, 9);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(112, 13);
+            this.label2.TabIndex = 7;
+            this.label2.Text = "введите дату заезда";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(331, 68);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(136, 13);
+            this.label3.TabIndex = 8;
+            this.label3.Text = "введите количество дней";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(331, 146);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(148, 13);
+            this.label4.TabIndex = 9;
+            this.label4.Text = "введите дату бронирования";
+            // 
+            // nomerComnati
+            // 
+            this.nomerComnati.Location = new System.Drawing.Point(63, 175);
+            this.nomerComnati.Name = "nomerComnati";
+            this.nomerComnati.Size = new System.Drawing.Size(81, 20);
+            this.nomerComnati.TabIndex = 10;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(60, 146);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(131, 13);
+            this.label5.TabIndex = 11;
+            this.label5.Text = "введите номер комнаты";
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(173, 260);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(162, 36);
+            this.button1.TabIndex = 12;
+            this.button1.Text = "забронировать";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // Form4
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(528, 373);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.nomerComnati);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.coldays);
+            this.Controls.Add(this.data_broni);
+            this.Controls.Add(this.data_zaezda);
+            this.Controls.Add(this.surname);
+            this.Controls.Add(this.name);
+            this.Controls.Add(this.last_name);
+            this.Name = "Form4";
+            this.Text = "бронирование";
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form4_FormClosed);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TextBox last_name;
+        private System.Windows.Forms.MaskedTextBox name;
+        private System.Windows.Forms.TextBox surname;
+        private System.Windows.Forms.TextBox data_zaezda;
+        private System.Windows.Forms.TextBox data_broni;
+        private System.Windows.Forms.TextBox coldays;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.TextBox nomerComnati;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Button button1;
+    }
+}

+ 30 - 0
testkonkurs1/Form4.cs

@@ -0,0 +1,30 @@
+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;
+
+namespace testkonkurs1
+{
+    public partial class Form4 : Form
+    {
+        public Form4()
+        {
+            InitializeComponent();
+        }
+
+        private void Form4_FormClosed(object sender, FormClosedEventArgs e)
+        {
+            Application.Exit();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 120 - 0
testkonkurs1/Form4.resx

@@ -0,0 +1,120 @@
+<?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>
+</root>

+ 9 - 0
testkonkurs1/testkonkurs1.csproj

@@ -65,6 +65,12 @@
     <Compile Include="Form3.Designer.cs">
       <DependentUpon>Form3.cs</DependentUpon>
     </Compile>
+    <Compile Include="Form4.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form4.Designer.cs">
+      <DependentUpon>Form4.cs</DependentUpon>
+    </Compile>
     <Compile Include="konkursDataSet.Designer.cs">
       <AutoGen>True</AutoGen>
       <DesignTime>True</DesignTime>
@@ -81,6 +87,9 @@
     <EmbeddedResource Include="Form3.resx">
       <DependentUpon>Form3.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Form4.resx">
+      <DependentUpon>Form4.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>