Browse Source

работа с формами 2 и 3

Kuzmenco 1 year ago
parent
commit
30dca3b3dc
5 changed files with 203 additions and 8 deletions
  1. 142 4
      Form2.Designer.cs
  2. 10 0
      Form2.cs
  3. 21 0
      Form2.resx
  4. 19 4
      Form3.Designer.cs
  5. 11 0
      Form3.cs

+ 142 - 4
Form2.Designer.cs

@@ -44,6 +44,17 @@ namespace ПрокатАвто03
             this.Стоимость_дня_проката = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.prokatavto03DataSet = new ПрокатАвто03.Prokatavto03DataSet();
             this.prokatavto03DataSetBindingSource = new System.Windows.Forms.BindingSource(this.components);
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.listBox1 = new System.Windows.Forms.ListBox();
+            this.button5 = new System.Windows.Forms.Button();
+            this.radioButton1 = new System.Windows.Forms.RadioButton();
+            this.radioButton2 = new System.Windows.Forms.RadioButton();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.textBox2 = new System.Windows.Forms.TextBox();
+            this.button6 = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.prokatavto03DataSet)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.prokatavto03DataSetBindingSource)).BeginInit();
@@ -84,7 +95,7 @@ namespace ПрокатАвто03
             // button1
             // 
             this.button1.Font = new System.Drawing.Font("Times New Roman", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
-            this.button1.Location = new System.Drawing.Point(42, 243);
+            this.button1.Location = new System.Drawing.Point(720, 38);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(122, 29);
             this.button1.TabIndex = 2;
@@ -95,17 +106,18 @@ namespace ПрокатАвто03
             // button2
             // 
             this.button2.Font = new System.Drawing.Font("Times New Roman", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
-            this.button2.Location = new System.Drawing.Point(193, 243);
+            this.button2.Location = new System.Drawing.Point(720, 89);
             this.button2.Name = "button2";
             this.button2.Size = new System.Drawing.Size(122, 29);
             this.button2.TabIndex = 3;
             this.button2.Text = "удалять";
             this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
             // 
             // button3
             // 
             this.button3.Font = new System.Drawing.Font("Times New Roman", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
-            this.button3.Location = new System.Drawing.Point(335, 243);
+            this.button3.Location = new System.Drawing.Point(720, 141);
             this.button3.Name = "button3";
             this.button3.Size = new System.Drawing.Size(174, 29);
             this.button3.TabIndex = 4;
@@ -164,12 +176,126 @@ namespace ПрокатАвто03
             this.prokatavto03DataSetBindingSource.DataSource = this.prokatavto03DataSet;
             this.prokatavto03DataSetBindingSource.Position = 0;
             // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("Times New Roman", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+            this.label2.Location = new System.Drawing.Point(54, 205);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(130, 24);
+            this.label2.TabIndex = 6;
+            this.label2.Text = "Сортировка:";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("Times New Roman", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+            this.label3.Location = new System.Drawing.Point(453, 205);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(78, 24);
+            this.label3.TabIndex = 7;
+            this.label3.Text = "Поиск:";
+            // 
+            // listBox1
+            // 
+            this.listBox1.BackColor = System.Drawing.Color.Teal;
+            this.listBox1.FormattingEnabled = true;
+            this.listBox1.Location = new System.Drawing.Point(181, 208);
+            this.listBox1.Name = "listBox1";
+            this.listBox1.Size = new System.Drawing.Size(120, 95);
+            this.listBox1.TabIndex = 8;
+            // 
+            // button5
+            // 
+            this.button5.Font = new System.Drawing.Font("Times New Roman", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+            this.button5.Location = new System.Drawing.Point(47, 292);
+            this.button5.Name = "button5";
+            this.button5.Size = new System.Drawing.Size(128, 29);
+            this.button5.TabIndex = 9;
+            this.button5.Text = "Сортировать";
+            this.button5.UseVisualStyleBackColor = true;
+            // 
+            // radioButton1
+            // 
+            this.radioButton1.AutoSize = true;
+            this.radioButton1.Location = new System.Drawing.Point(58, 232);
+            this.radioButton1.Name = "radioButton1";
+            this.radioButton1.Size = new System.Drawing.Size(85, 17);
+            this.radioButton1.TabIndex = 10;
+            this.radioButton1.TabStop = true;
+            this.radioButton1.Text = "radioButton1";
+            this.radioButton1.UseVisualStyleBackColor = true;
+            // 
+            // radioButton2
+            // 
+            this.radioButton2.AutoSize = true;
+            this.radioButton2.Location = new System.Drawing.Point(58, 256);
+            this.radioButton2.Name = "radioButton2";
+            this.radioButton2.Size = new System.Drawing.Size(85, 17);
+            this.radioButton2.TabIndex = 11;
+            this.radioButton2.TabStop = true;
+            this.radioButton2.Text = "radioButton2";
+            this.radioButton2.UseVisualStyleBackColor = true;
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(612, 208);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(100, 20);
+            this.textBox1.TabIndex = 12;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(555, 213);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(35, 13);
+            this.label4.TabIndex = 13;
+            this.label4.Text = "label4";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(555, 242);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(35, 13);
+            this.label5.TabIndex = 14;
+            this.label5.Text = "label5";
+            // 
+            // textBox2
+            // 
+            this.textBox2.Location = new System.Drawing.Point(612, 242);
+            this.textBox2.Name = "textBox2";
+            this.textBox2.Size = new System.Drawing.Size(100, 20);
+            this.textBox2.TabIndex = 15;
+            // 
+            // button6
+            // 
+            this.button6.Font = new System.Drawing.Font("Times New Roman", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+            this.button6.Location = new System.Drawing.Point(746, 220);
+            this.button6.Name = "button6";
+            this.button6.Size = new System.Drawing.Size(128, 29);
+            this.button6.TabIndex = 16;
+            this.button6.Text = "Поиск";
+            this.button6.UseVisualStyleBackColor = true;
+            // 
             // Form2
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.Teal;
-            this.ClientSize = new System.Drawing.Size(807, 296);
+            this.ClientSize = new System.Drawing.Size(905, 364);
+            this.Controls.Add(this.button6);
+            this.Controls.Add(this.textBox2);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.textBox1);
+            this.Controls.Add(this.radioButton2);
+            this.Controls.Add(this.radioButton1);
+            this.Controls.Add(this.button5);
+            this.Controls.Add(this.listBox1);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
             this.Controls.Add(this.button4);
             this.Controls.Add(this.button3);
             this.Controls.Add(this.button2);
@@ -178,6 +304,7 @@ namespace ПрокатАвто03
             this.Controls.Add(this.label1);
             this.Name = "Form2";
             this.Text = "Список автомобилей";
+            this.Load += new System.EventHandler(this.Form2_Load);
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.prokatavto03DataSet)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.prokatavto03DataSetBindingSource)).EndInit();
@@ -202,5 +329,16 @@ namespace ПрокатАвто03
         private System.Windows.Forms.DataGridViewTextBoxColumn Стоимость_дня_проката;
         private System.Windows.Forms.BindingSource prokatavto03DataSetBindingSource;
         private Prokatavto03DataSet prokatavto03DataSet;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.ListBox listBox1;
+        private System.Windows.Forms.Button button5;
+        private System.Windows.Forms.RadioButton radioButton1;
+        private System.Windows.Forms.RadioButton radioButton2;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.TextBox textBox2;
+        private System.Windows.Forms.Button button6;
     }
 }

+ 10 - 0
Form2.cs

@@ -46,5 +46,15 @@ namespace ПрокатАвто03
             Form3 fr3 = new Form3();
             fr3.Show();
         }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            MessageBox.Show("хотите удалить");
+        }
+
+        private void Form2_Load(object sender, EventArgs e)
+        {
+
+        }
     }
 }

+ 21 - 0
Form2.resx

@@ -138,9 +138,30 @@
   <metadata name="prokatavto03DataSetBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>184, 17</value>
   </metadata>
+  <metadata name="Модель.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Цвет.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Год_выпуска.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Госномер.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Страховка.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Стоимость_дня_проката.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="prokatavto03DataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
+  <metadata name="prokatavto03DataSetBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>184, 17</value>
+  </metadata>
   <metadata name="prokatavto03DataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>

+ 19 - 4
Form3.Designer.cs

@@ -42,6 +42,7 @@ namespace ПрокатАвто03
             this.textBox5 = new System.Windows.Forms.TextBox();
             this.textBox6 = new System.Windows.Forms.TextBox();
             this.button1 = new System.Windows.Forms.Button();
+            this.button2 = new System.Windows.Forms.Button();
             this.SuspendLayout();
             // 
             // label1
@@ -150,19 +151,32 @@ namespace ПрокатАвто03
             // button1
             // 
             this.button1.Font = new System.Drawing.Font("Times New Roman", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
-            this.button1.Location = new System.Drawing.Point(286, 274);
+            this.button1.Location = new System.Drawing.Point(260, 263);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(140, 40);
+            this.button1.Size = new System.Drawing.Size(140, 62);
             this.button1.TabIndex = 12;
-            this.button1.Text = "сохранить";
+            this.button1.Text = "сохранить изменение";
             this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // button2
+            // 
+            this.button2.Font = new System.Drawing.Font("Times New Roman", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+            this.button2.Location = new System.Drawing.Point(73, 263);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(140, 62);
+            this.button2.TabIndex = 13;
+            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.BackColor = System.Drawing.Color.Teal;
-            this.ClientSize = new System.Drawing.Size(454, 326);
+            this.ClientSize = new System.Drawing.Size(463, 330);
+            this.Controls.Add(this.button2);
             this.Controls.Add(this.button1);
             this.Controls.Add(this.textBox6);
             this.Controls.Add(this.textBox5);
@@ -199,5 +213,6 @@ namespace ПрокатАвто03
         private System.Windows.Forms.TextBox textBox5;
         private System.Windows.Forms.TextBox textBox6;
         private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.Button button2;
     }
 }

+ 11 - 0
Form3.cs

@@ -24,6 +24,7 @@ namespace ПрокатАвто03
 
         private void Form3_Load(object sender, EventArgs e)
         {
+
             string Модель = textBox1.Text;
             string Цвет = textBox2.Text;
             string Год_выпуска = textBox3.Text;
@@ -34,6 +35,16 @@ namespace ПрокатАвто03
 
 
 
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            prokatavto03DataSetBindingSource.AddNew();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+
         }
     }
 }