2 Revize 8e947c8c60 ... 0584c69af2

Autor SHA1 Zpráva Datum
  chernyshyov.2000 0584c69af2 возможность выбрать уровень комфорта и форма бронированиея před 4 roky
  chernyshyov.2000 949232e040 вывод в datagrid před 4 roky

+ 64 - 60
testkonkurs1/Form2.Designer.cs

@@ -30,19 +30,19 @@
         {
             this.tabControl1 = new System.Windows.Forms.TabControl();
             this.tabPage1 = new System.Windows.Forms.TabPage();
-            this.tabPage2 = new System.Windows.Forms.TabPage();
-            this.login = new System.Windows.Forms.TextBox();
-            this.password = new System.Windows.Forms.TextBox();
+            this.AddUser = new System.Windows.Forms.Button();
             this.panel1 = new System.Windows.Forms.Panel();
-            this.admin = new System.Windows.Forms.RadioButton();
             this.manager = new System.Windows.Forms.RadioButton();
-            this.AddUser = new System.Windows.Forms.Button();
-            this.LoginDel = new System.Windows.Forms.TextBox();
+            this.admin = new System.Windows.Forms.RadioButton();
+            this.password = new System.Windows.Forms.TextBox();
+            this.login = new System.Windows.Forms.TextBox();
+            this.tabPage2 = new System.Windows.Forms.TabPage();
             this.Delete = new System.Windows.Forms.Button();
+            this.LoginDel = new System.Windows.Forms.TextBox();
             this.tabControl1.SuspendLayout();
             this.tabPage1.SuspendLayout();
-            this.tabPage2.SuspendLayout();
             this.panel1.SuspendLayout();
+            this.tabPage2.SuspendLayout();
             this.SuspendLayout();
             // 
             // tabControl1
@@ -52,7 +52,7 @@
             this.tabControl1.Location = new System.Drawing.Point(0, 0);
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
-            this.tabControl1.Size = new System.Drawing.Size(788, 438);
+            this.tabControl1.Size = new System.Drawing.Size(369, 438);
             this.tabControl1.TabIndex = 0;
             // 
             // tabPage1
@@ -64,45 +64,42 @@
             this.tabPage1.Location = new System.Drawing.Point(4, 22);
             this.tabPage1.Name = "tabPage1";
             this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage1.Size = new System.Drawing.Size(780, 412);
+            this.tabPage1.Size = new System.Drawing.Size(361, 412);
             this.tabPage1.TabIndex = 0;
             this.tabPage1.Text = "Добавить";
             this.tabPage1.UseVisualStyleBackColor = true;
+            this.tabPage1.Click += new System.EventHandler(this.tabPage1_Click);
             // 
-            // tabPage2
-            // 
-            this.tabPage2.Controls.Add(this.Delete);
-            this.tabPage2.Controls.Add(this.LoginDel);
-            this.tabPage2.Location = new System.Drawing.Point(4, 22);
-            this.tabPage2.Name = "tabPage2";
-            this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage2.Size = new System.Drawing.Size(780, 412);
-            this.tabPage2.TabIndex = 1;
-            this.tabPage2.Text = "Удалить";
-            this.tabPage2.UseVisualStyleBackColor = true;
-            // 
-            // login
-            // 
-            this.login.Location = new System.Drawing.Point(150, 76);
-            this.login.Name = "login";
-            this.login.Size = new System.Drawing.Size(152, 20);
-            this.login.TabIndex = 0;
-            // 
-            // password
+            // AddUser
             // 
-            this.password.Location = new System.Drawing.Point(150, 123);
-            this.password.Name = "password";
-            this.password.Size = new System.Drawing.Size(151, 20);
-            this.password.TabIndex = 1;
+            this.AddUser.Location = new System.Drawing.Point(75, 298);
+            this.AddUser.Name = "AddUser";
+            this.AddUser.Size = new System.Drawing.Size(151, 34);
+            this.AddUser.TabIndex = 3;
+            this.AddUser.Text = "Добавить пользователя";
+            this.AddUser.UseVisualStyleBackColor = true;
+            this.AddUser.Click += new System.EventHandler(this.AddUser_Click);
             // 
             // panel1
             // 
             this.panel1.Controls.Add(this.manager);
             this.panel1.Controls.Add(this.admin);
-            this.panel1.Location = new System.Drawing.Point(127, 218);
+            this.panel1.Location = new System.Drawing.Point(52, 214);
             this.panel1.Name = "panel1";
             this.panel1.Size = new System.Drawing.Size(237, 49);
             this.panel1.TabIndex = 2;
+            this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
+            // 
+            // manager
+            // 
+            this.manager.AutoSize = true;
+            this.manager.Location = new System.Drawing.Point(121, 13);
+            this.manager.Name = "manager";
+            this.manager.Size = new System.Drawing.Size(77, 17);
+            this.manager.TabIndex = 1;
+            this.manager.TabStop = true;
+            this.manager.Text = "менеджер";
+            this.manager.UseVisualStyleBackColor = true;
             // 
             // admin
             // 
@@ -115,37 +112,37 @@
             this.admin.Text = "Админ";
             this.admin.UseVisualStyleBackColor = true;
             // 
-            // manager
+            // password
             // 
-            this.manager.AutoSize = true;
-            this.manager.Location = new System.Drawing.Point(121, 13);
-            this.manager.Name = "manager";
-            this.manager.Size = new System.Drawing.Size(77, 17);
-            this.manager.TabIndex = 1;
-            this.manager.TabStop = true;
-            this.manager.Text = "менеджер";
-            this.manager.UseVisualStyleBackColor = true;
+            this.password.Location = new System.Drawing.Point(75, 119);
+            this.password.Name = "password";
+            this.password.Size = new System.Drawing.Size(151, 20);
+            this.password.TabIndex = 1;
+            this.password.TextChanged += new System.EventHandler(this.password_TextChanged);
             // 
-            // AddUser
+            // login
             // 
-            this.AddUser.Location = new System.Drawing.Point(150, 302);
-            this.AddUser.Name = "AddUser";
-            this.AddUser.Size = new System.Drawing.Size(151, 34);
-            this.AddUser.TabIndex = 3;
-            this.AddUser.Text = "Добавить пользователя";
-            this.AddUser.UseVisualStyleBackColor = true;
-            this.AddUser.Click += new System.EventHandler(this.AddUser_Click);
+            this.login.Location = new System.Drawing.Point(75, 72);
+            this.login.Name = "login";
+            this.login.Size = new System.Drawing.Size(152, 20);
+            this.login.TabIndex = 0;
+            this.login.TextChanged += new System.EventHandler(this.login_TextChanged);
             // 
-            // LoginDel
+            // tabPage2
             // 
-            this.LoginDel.Location = new System.Drawing.Point(20, 22);
-            this.LoginDel.Name = "LoginDel";
-            this.LoginDel.Size = new System.Drawing.Size(100, 20);
-            this.LoginDel.TabIndex = 0;
+            this.tabPage2.Controls.Add(this.Delete);
+            this.tabPage2.Controls.Add(this.LoginDel);
+            this.tabPage2.Location = new System.Drawing.Point(4, 22);
+            this.tabPage2.Name = "tabPage2";
+            this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage2.Size = new System.Drawing.Size(361, 412);
+            this.tabPage2.TabIndex = 1;
+            this.tabPage2.Text = "Удалить";
+            this.tabPage2.UseVisualStyleBackColor = true;
             // 
             // Delete
             // 
-            this.Delete.Location = new System.Drawing.Point(8, 74);
+            this.Delete.Location = new System.Drawing.Point(94, 206);
             this.Delete.Name = "Delete";
             this.Delete.Size = new System.Drawing.Size(154, 23);
             this.Delete.TabIndex = 1;
@@ -153,11 +150,18 @@
             this.Delete.UseVisualStyleBackColor = true;
             this.Delete.Click += new System.EventHandler(this.Delete_Click);
             // 
+            // LoginDel
+            // 
+            this.LoginDel.Location = new System.Drawing.Point(120, 150);
+            this.LoginDel.Name = "LoginDel";
+            this.LoginDel.Size = new System.Drawing.Size(100, 20);
+            this.LoginDel.TabIndex = 0;
+            // 
             // Form2
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.ClientSize = new System.Drawing.Size(376, 450);
             this.Controls.Add(this.tabControl1);
             this.Name = "Form2";
             this.Text = "ПанельУправления";
@@ -165,10 +169,10 @@
             this.tabControl1.ResumeLayout(false);
             this.tabPage1.ResumeLayout(false);
             this.tabPage1.PerformLayout();
-            this.tabPage2.ResumeLayout(false);
-            this.tabPage2.PerformLayout();
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
+            this.tabPage2.ResumeLayout(false);
+            this.tabPage2.PerformLayout();
             this.ResumeLayout(false);
 
         }

+ 20 - 0
testkonkurs1/Form2.cs

@@ -75,5 +75,25 @@ namespace testkonkurs1
                 MessageBox.Show(ex.Message.ToString(), "", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
+
+        private void tabPage1_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void panel1_Paint(object sender, PaintEventArgs e)
+        {
+
+        }
+
+        private void password_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void login_TextChanged(object sender, EventArgs e)
+        {
+
+        }
     }
 }

+ 47 - 36
testkonkurs1/Form3.Designer.cs

@@ -35,16 +35,18 @@
             this.comboBox1 = new System.Windows.Forms.ComboBox();
             this.button1 = new System.Windows.Forms.Button();
             this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
-            this.listBox1 = new System.Windows.Forms.ListBox();
             this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.konkursDataSetBindingSource1 = new System.Windows.Forms.BindingSource(this.components);
             this.konkursDataSet = new testkonkurs1.konkursDataSet();
             this.konkursDataSetBindingSource = new System.Windows.Forms.BindingSource(this.components);
-            this.konkursDataSetBindingSource1 = new System.Windows.Forms.BindingSource(this.components);
-            this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            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();
             ((System.ComponentModel.ISupportInitialize)(this.konkursDataSetBindingSource)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.konkursDataSetBindingSource1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.comfortBindingSource)).BeginInit();
             this.SuspendLayout();
             // 
             // directorySearcher1
@@ -55,61 +57,58 @@
             // 
             // dateTimePicker1
             // 
-            this.dateTimePicker1.Location = new System.Drawing.Point(40, 37);
+            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;
+            this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged);
             // 
             // textBox1
             // 
-            this.textBox1.Location = new System.Drawing.Point(271, 37);
+            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;
+            this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
             // 
             // comboBox1
             // 
             this.comboBox1.FormattingEnabled = true;
             this.comboBox1.Items.AddRange(new object[] {
             "1-комнатный",
-            "2-комнатный"});
-            this.comboBox1.Location = new System.Drawing.Point(438, 36);
+            "2-комнатный",
+            "показать все"});
+            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;
             this.comboBox1.Text = "1-комнатный";
+            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(438, 95);
+            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;
-            this.button1.Text = "d";
+            this.button1.Text = "Показать список свободных номеров";
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.button1_Click);
             // 
-            // listBox1
-            // 
-            this.listBox1.FormattingEnabled = true;
-            this.listBox1.Location = new System.Drawing.Point(43, 158);
-            this.listBox1.Name = "listBox1";
-            this.listBox1.Size = new System.Drawing.Size(365, 212);
-            this.listBox1.TabIndex = 4;
-            // 
             // dataGridView1
             // 
-            this.dataGridView1.AutoGenerateColumns = false;
             this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.Column1});
-            this.dataGridView1.DataSource = this.konkursDataSetBindingSource1;
-            this.dataGridView1.Location = new System.Drawing.Point(528, 219);
+            this.dataGridView1.Location = new System.Drawing.Point(130, 137);
             this.dataGridView1.Name = "dataGridView1";
-            this.dataGridView1.Size = new System.Drawing.Size(196, 98);
+            this.dataGridView1.Size = new System.Drawing.Size(343, 291);
             this.dataGridView1.TabIndex = 5;
             this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
             // 
+            // konkursDataSetBindingSource1
+            // 
+            this.konkursDataSetBindingSource1.DataSource = this.konkursDataSet;
+            this.konkursDataSetBindingSource1.Position = 0;
+            // 
             // konkursDataSet
             // 
             this.konkursDataSet.DataSetName = "konkursDataSet";
@@ -120,34 +119,45 @@
             this.konkursDataSetBindingSource.DataSource = this.konkursDataSet;
             this.konkursDataSetBindingSource.Position = 0;
             // 
-            // konkursDataSetBindingSource1
+            // comfortBindingSource
             // 
-            this.konkursDataSetBindingSource1.DataSource = this.konkursDataSet;
-            this.konkursDataSetBindingSource1.Position = 0;
+            this.comfortBindingSource.DataMember = "comfort";
+            this.comfortBindingSource.DataSource = this.konkursDataSetBindingSource;
             // 
-            // Column1
+            // comfortTableAdapter
             // 
-            this.Column1.HeaderText = "Column1";
-            this.Column1.Name = "Column1";
+            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(800, 450);
+            this.ClientSize = new System.Drawing.Size(685, 492);
+            this.Controls.Add(this.button2);
             this.Controls.Add(this.dataGridView1);
-            this.Controls.Add(this.listBox1);
             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();
+            ((System.ComponentModel.ISupportInitialize)(this.konkursDataSetBindingSource1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.konkursDataSet)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.konkursDataSetBindingSource)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.konkursDataSetBindingSource1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.comfortBindingSource)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -161,11 +171,12 @@
         private System.Windows.Forms.ComboBox comboBox1;
         private System.Windows.Forms.Button button1;
         private System.ComponentModel.BackgroundWorker backgroundWorker1;
-        private System.Windows.Forms.ListBox listBox1;
         private System.Windows.Forms.DataGridView dataGridView1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
         private System.Windows.Forms.BindingSource konkursDataSetBindingSource1;
         private konkursDataSet konkursDataSet;
         private System.Windows.Forms.BindingSource konkursDataSetBindingSource;
+        private System.Windows.Forms.BindingSource comfortBindingSource;
+        private konkursDataSetTableAdapters.comfortTableAdapter comfortTableAdapter;
+        private System.Windows.Forms.Button button2;
     }
 }

+ 109 - 30
testkonkurs1/Form3.cs

@@ -30,14 +30,17 @@ namespace testkonkurs1
             conn.Open();
             SqlDataReader Reader = null;
 
-            try{
+            try
+            {
+                dataGridView1.Rows.Clear();
+                dataGridView1.Columns.Clear();
                 DateTime date_1start = dateTimePicker1.Value;
                 DateTime date_1end = date_1start.AddDays(Convert.ToInt32(textBox1.Text));
                 Reader = command.ExecuteReader();
-                listBox1.Items.Clear();
-                if(comboBox1.SelectedItem.ToString() == "1-комнатный")
+
+                if (comboBox1.SelectedItem.ToString() == "1-комнатный")
                 {
-                    
+
                 }
 
                 int[] cod_mesta = new int[20];
@@ -45,29 +48,45 @@ namespace testkonkurs1
                 String[] lvl_comfort = new String[20];
                 String[] price = new String[20];
                 int i = 0;
-                while (Reader.Read()) {
+                while (Reader.Read())
+                {
                     DateTime date_2_start = Convert.ToDateTime(Reader["date_zaezda"]);
                     DateTime date_2_end = date_2_start.AddDays(Convert.ToInt16(Reader["kol_days"]));
                     // bool intersect = !(date_2_end < date_1start || date_2_start > date_1end);
                     bool intersect = date_2_end >= date_1start && date_2_start <= date_1end;
-                    if (!intersect) {
-                        cod_mesta[i] = Convert.ToInt32( Reader["nomer_mesta"]);
-                        i+=1;
+                    if (!intersect)
+                    {
+                        cod_mesta[i] = Convert.ToInt32(Reader["nomer_mesta"]);
+                        i += 1;
                     }
                 }
                 Reader.Close();
 
-            
-                
+
+                DataGridViewTextBoxColumn nomer_comnatColum = new DataGridViewTextBoxColumn();
+                nomer_comnatColum.HeaderText = "номер комнаты";
+                nomer_comnatColum.Name = "text";
+                dataGridView1.Columns.AddRange(nomer_comnatColum);
+
+                DataGridViewTextBoxColumn lvlcomfortColum = new DataGridViewTextBoxColumn();
+                lvlcomfortColum.HeaderText = "Уровень комфорта";
+                lvlcomfortColum.Name = "text";
+                dataGridView1.Columns.AddRange(lvlcomfortColum);
+
+                DataGridViewTextBoxColumn pricecolum = new DataGridViewTextBoxColumn();
+                pricecolum.HeaderText = "цена проживания";
+                pricecolum.Name = "text";
+                dataGridView1.Columns.AddRange(pricecolum);
+
                 for (int j = 0; j < 20; j++)
                 {
-                    if(cod_mesta[j] != 0)
+                    if (cod_mesta[j] != 0)
                     {
                         SqlCommand takeMesta = new SqlCommand("SELECT * FROM mesto where cod_mesta = @nomer_mesta", conn);
                         takeMesta.Parameters.AddWithValue("@nomer_mesta", cod_mesta[j]);
                         SqlDataReader Mesta = takeMesta.ExecuteReader();
                         Mesta.Read();
-                        nomer_comnat[j] = Convert.ToInt32( Mesta["nomer_comnat"]);
+                        nomer_comnat[j] = Convert.ToInt32(Mesta["nomer_comnat"]);
                         Mesta.Close();
                     }
                 }
@@ -80,48 +99,108 @@ namespace testkonkurs1
                         takeMesta.Parameters.AddWithValue("@nomer_mesta", nomer_comnat[j]);
                         SqlDataReader Mesta = takeMesta.ExecuteReader();
                         Mesta.Read();
-             
+
                         lvl_comfort[j] = Mesta["lvl_comfort"].ToString();
                         Mesta.Close();
                     }
-                 
-                for (int j = 0; j < 20; j++)
-                {
-                    if (lvl_comfort[j] != null)
+                }
+                    for (int j = 0; j < 20; j++)
                     {
-                        SqlCommand takeMesta = new SqlCommand("SELECT * FROM comfort where [lvl-comfort] = @nomer_mesta", conn);
-                        takeMesta.Parameters.AddWithValue("@nomer_mesta", lvl_comfort[j]);
-                        SqlDataReader Mesta = takeMesta.ExecuteReader();
-                        Mesta.Read();
-                        price[j] = (Mesta["price_life"].ToString());
-                        Mesta.Close();
+                        if (lvl_comfort[j] != null)
+                        {
+                            SqlCommand takeMesta = new SqlCommand("SELECT * FROM comfort where [lvl-comfort] = @nomer_mesta", conn);
+                            takeMesta.Parameters.AddWithValue("@nomer_mesta", lvl_comfort[j]);
+                            SqlDataReader Mesta = takeMesta.ExecuteReader();
+                            Mesta.Read();
+                            price[j] = (Mesta["price_life"].ToString());
+                            Mesta.Close();
+                        }
                     }
-                }
+                int count = 0;
                 for (int j = 0; j < 20; j++)
                 {
-                    if (nomer_comnat[j] != 0)
+
+                    if (comboBox1.SelectedIndex == 2)
                     {
-                        listBox1.Items.Add(nomer_comnat[j] + " " + lvl_comfort[j] + " " + price[j]);    
+                        if (nomer_comnat[j] != 0)
+                        {
+                            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];
+                        }
+                    }
+                    if (comboBox1.SelectedIndex == 1)
+                    {
+                        if (nomer_comnat[j] != 0)
+                        {
+                            if(lvl_comfort[j] == "2-местный ")
+                            {
+       
+                                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++;
+                            }
+                        }
+                    }
+                    if (comboBox1.SelectedIndex == 0)
+                    {
+                        if (nomer_comnat[j] != 0)
+                        {
+                            if (lvl_comfort[j] == "1-местный ")
+                            {
+                                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++;
+                            }
+                        }
                     }
-                   
                 }
 
             }
+
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message.ToString(), "", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
+}
 
+        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        {
+  
+        }
 
+        private void Form3_Load(object sender, EventArgs e)
+        {
+            // TODO: данная строка кода позволяет загрузить данные в таблицу "konkursDataSet.comfort". При необходимости она может быть перемещена или удалена.
+            this.comfortTableAdapter.Fill(this.konkursDataSet.comfort);
 
+        }
 
+        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
+        {
 
+        }
 
-}
+        private void textBox1_TextChanged(object sender, EventArgs e)
+        {
 
-        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        }
+
+        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
         {
-  
+
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            Form4 fr4 = new Form4();
+            fr4.Show();
+            this.Hide();
         }
     }
 

+ 9 - 3
testkonkurs1/Form3.resx

@@ -123,16 +123,22 @@
   <metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>171, 17</value>
   </metadata>
-  <metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="konkursDataSetBindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>688, 17</value>
   </metadata>
   <metadata name="konkursDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>335, 17</value>
   </metadata>
+  <metadata name="konkursDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>335, 17</value>
+  </metadata>
   <metadata name="konkursDataSetBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>472, 17</value>
   </metadata>
+  <metadata name="comfortBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>911, 17</value>
+  </metadata>
+  <metadata name="comfortTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>1085, 17</value>
+  </metadata>
 </root>

+ 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>