Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication4
- {
- static class Program
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new prod_line());
- }
- }
- }
- namespace WindowsFormsApplication4
- {
- partial class prod_line
- {
- /// <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.radioButton1 = new System.Windows.Forms.RadioButton();
- this.radioButton2 = new System.Windows.Forms.RadioButton();
- this.radioButton3 = new System.Windows.Forms.RadioButton();
- this.label1 = new System.Windows.Forms.Label();
- this.button1 = new System.Windows.Forms.Button();
- this.pictureBox1 = new System.Windows.Forms.PictureBox();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
- this.SuspendLayout();
- //
- // radioButton1
- //
- this.radioButton1.AutoSize = true;
- this.radioButton1.Font = new System.Drawing.Font("Perpetua Titling MT", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.radioButton1.Location = new System.Drawing.Point(175, 182);
- this.radioButton1.Name = "radioButton1";
- this.radioButton1.Size = new System.Drawing.Size(58, 20);
- this.radioButton1.TabIndex = 0;
- this.radioButton1.TabStop = true;
- this.radioButton1.Text = "PL3E";
- this.radioButton1.UseVisualStyleBackColor = true;
- this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
- //
- // radioButton2
- //
- this.radioButton2.AutoSize = true;
- this.radioButton2.Font = new System.Drawing.Font("Perpetua Titling MT", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.radioButton2.Location = new System.Drawing.Point(172, 240);
- this.radioButton2.Name = "radioButton2";
- this.radioButton2.Size = new System.Drawing.Size(61, 20);
- this.radioButton2.TabIndex = 1;
- this.radioButton2.TabStop = true;
- this.radioButton2.Text = "PL24";
- this.radioButton2.UseVisualStyleBackColor = true;
- //
- // radioButton3
- //
- this.radioButton3.AutoSize = true;
- this.radioButton3.Font = new System.Drawing.Font("Perpetua Titling MT", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.radioButton3.Location = new System.Drawing.Point(175, 298);
- this.radioButton3.Name = "radioButton3";
- this.radioButton3.Size = new System.Drawing.Size(59, 20);
- this.radioButton3.TabIndex = 2;
- this.radioButton3.TabStop = true;
- this.radioButton3.Text = "PL25";
- this.radioButton3.UseVisualStyleBackColor = true;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Font = new System.Drawing.Font("Palatino Linotype", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label1.Location = new System.Drawing.Point(111, 132);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(205, 27);
- this.label1.TabIndex = 4;
- this.label1.Text = "PRODUCTION LINE";
- //
- // button1
- //
- this.button1.Font = new System.Drawing.Font("Perpetua Titling MT", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.button1.Location = new System.Drawing.Point(257, 374);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 5;
- this.button1.Text = "OK";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // pictureBox1
- //
- this.pictureBox1.Image = global::WindowsFormsApplication4.Properties.Resources.Keysight_Signature_Pref_Color;
- this.pictureBox1.Location = new System.Drawing.Point(143, 40);
- this.pictureBox1.Name = "pictureBox1";
- this.pictureBox1.Size = new System.Drawing.Size(139, 73);
- this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.pictureBox1.TabIndex = 6;
- this.pictureBox1.TabStop = false;
- //
- // prod_line
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(419, 478);
- this.Controls.Add(this.pictureBox1);
- this.Controls.Add(this.button1);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.radioButton3);
- this.Controls.Add(this.radioButton2);
- this.Controls.Add(this.radioButton1);
- this.Name = "prod_line";
- this.Text = "prod_line";
- this.Load += new System.EventHandler(this.prod_line_Load);
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- #endregion
- private System.Windows.Forms.RadioButton radioButton1;
- private System.Windows.Forms.RadioButton radioButton2;
- private System.Windows.Forms.RadioButton radioButton3;
- // private System.Windows.Forms.PictureBox pictureBox1;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.PictureBox pictureBox1;
- }
- }
- 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 MySql.Data.MySqlClient;
- namespace WindowsFormsApplication4
- {
- public partial class prod_line : Form
- {
- TesterList test = new TesterList();
- public prod_line()
- {
- InitializeComponent();
- }
- private void prod_line_Load(object sender, EventArgs e)
- {
- radioButton1.Checked = true;
- }
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- try
- {
- MySqlConnection connection = new MySqlConnection("Datasource=localhost;port=3306;username=root;password=");
- string selectQuery = "SELECT * FROM keysight.tester where prod_id = 1";
- connection.Open();
- MySqlCommand command = new MySqlCommand(selectQuery, connection);
- MySqlDataReader reader = command.ExecuteReader();
- while (reader.Read())
- {
- comboBox1.Items.Add(reader.GetString("test_name"));
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (radioButton1.Checked == true)
- {
- TesterList obj = new TesterList();
- if (obj == null)
- {
- obj.Parent = this;
- }
- obj.Show();
- this.Hide();
- }
- }
- }
- }
- namespace WindowsFormsApplication4
- {
- partial class TesterList
- {
- /// <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.comboBox1 = new System.Windows.Forms.ComboBox();
- this.button1 = new System.Windows.Forms.Button();
- this.pictureBox1 = new System.Windows.Forms.PictureBox();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
- this.SuspendLayout();
- //
- // comboBox1
- //
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Location = new System.Drawing.Point(121, 192);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(237, 24);
- this.comboBox1.TabIndex = 0;
- this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(283, 305);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 1;
- this.button1.Text = "OK";
- this.button1.UseVisualStyleBackColor = true;
- //
- // pictureBox1
- //
- this.pictureBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
- this.pictureBox1.Image = global::WindowsFormsApplication4.Properties.Resources.Keysight_Signature_Pref_Color;
- this.pictureBox1.Location = new System.Drawing.Point(153, 51);
- this.pictureBox1.Name = "pictureBox1";
- this.pictureBox1.Size = new System.Drawing.Size(174, 100);
- this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.pictureBox1.TabIndex = 8;
- this.pictureBox1.TabStop = false;
- //
- // TesterList
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(472, 489);
- this.Controls.Add(this.pictureBox1);
- this.Controls.Add(this.button1);
- this.Controls.Add(this.comboBox1);
- this.Name = "TesterList";
- this.Text = "TesterList";
- this.Load += new System.EventHandler(this.TesterList_Load);
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- private System.Windows.Forms.ComboBox comboBox1;
- private System.Windows.Forms.Button button1;
- //private System.Windows.Forms.RadioButton radioButton1;
- private System.Windows.Forms.PictureBox pictureBox1;
- }
- }
- 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 MySql.Data.MySqlClient;
- namespace WindowsFormsApplication4
- {
- public partial class TesterList : Form
- {
- prod_line p = new prod_line();
- public TesterList()
- {
- InitializeComponent();
- }
- private void TesterList_Load(object sender, EventArgs e)
- {
- if (radioButton1.Checked == true)
- {
- try
- {
- MySqlConnection connection = new MySqlConnection("Datasource=localhost;port=3306;username=root;password=");
- string selectQuery = "SELECT * FROM keysight.tester where prod_id = 1";
- connection.Open();
- MySqlCommand command = new MySqlCommand(selectQuery, connection);
- MySqlDataReader reader = command.ExecuteReader();
- while (reader.Read())
- {
- comboBox1.Items.Add(reader.GetString("test_name"));
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- }
Add Comment
Please, Sign In to add comment