Minor changes

This commit is contained in:
David Baranyai 2019-03-21 11:49:43 -04:00
parent c6a1e2a475
commit 1e0c05d33a
2 changed files with 5 additions and 10 deletions

View File

@ -86,11 +86,11 @@
this.dateTimePicker1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.dateTimePicker1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.dateTimePicker1.Checked = false;
this.dateTimePicker1.Location = new System.Drawing.Point(156, 78); this.dateTimePicker1.Location = new System.Drawing.Point(156, 78);
this.dateTimePicker1.Name = "dateTimePicker1"; this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(350, 26); this.dateTimePicker1.Size = new System.Drawing.Size(350, 26);
this.dateTimePicker1.TabIndex = 4; this.dateTimePicker1.TabIndex = 4;
this.dateTimePicker1.Value = new System.DateTime(2019, 3, 15, 0, 0, 0, 0);
// //
// browseButton // browseButton
// //

View File

@ -36,12 +36,6 @@ namespace trayToDB
private List<SiPMData> listOfData; private List<SiPMData> listOfData;
private DateTime shippingDate; private DateTime shippingDate;
private static string server = "localhost";
private static string user = "sipm";
private static string database = "sipmtest";
private static string port = "3306";
//private static string password = "";
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
@ -51,7 +45,7 @@ namespace trayToDB
openFileDialog1.Filter = "Excel sheets (*.xls;*.xlsx)|*.xls;*.xlsx"; openFileDialog1.Filter = "Excel sheets (*.xls;*.xlsx)|*.xls;*.xlsx";
openFileDialog1.Multiselect = false; openFileDialog1.Multiselect = false;
openFileDialog1.CheckFileExists = true; openFileDialog1.CheckFileExists = true;
dateTimePicker1.MaxDate = DateTime.Today;
} }
private void Form1_Load(object sender, EventArgs e) private void Form1_Load(object sender, EventArgs e)
@ -183,7 +177,7 @@ namespace trayToDB
MySqlConnection conn = new MySqlConnection(connStr); MySqlConnection conn = new MySqlConnection(connStr);
try try
{ {
statusTextbox.AppendText("Connecting to " + user + "@" + server + ":" + port + "\n"); statusTextbox.AppendText("Connecting to " + Properties.Settings.Default.user + "@" + Properties.Settings.Default.server + ":" + Properties.Settings.Default.port + "\n");
conn.Open(); conn.Open();
statusTextbox.AppendText("Successfully connected\n"); statusTextbox.AppendText("Successfully connected\n");
// Perform database operations // Perform database operations
@ -258,7 +252,8 @@ namespace trayToDB
for (int j = 0; j < listOfData[i].noOfSipm; j++) for (int j = 0; j < listOfData[i].noOfSipm; j++)
{ {
cmd.Parameters.Clear(); cmd.Parameters.Clear();
cmd.CommandText = "INSERT INTO sipmtable (hamamatsutrayid, hamamatsutrayposition, outputtrayid, outputtrayposition) VALUES (@trayid ,@j , 1, 1)"; //cmd.CommandText = "INSERT INTO sipmtable (hamamatsutrayid, hamamatsutrayposition, outputtrayid, outputtrayposition) VALUES (@trayid ,@j , 1, 1)";
cmd.CommandText = "INSERT INTO sipmtable (hamamatsutrayid, hamamatsutrayposition) VALUES (@trayid ,@j)";
cmd.Parameters.AddWithValue("@shipping", shippingDate); cmd.Parameters.AddWithValue("@shipping", shippingDate);
cmd.Parameters.AddWithValue("@trayid", trayid); cmd.Parameters.AddWithValue("@trayid", trayid);
cmd.Parameters.AddWithValue("@trayno", listOfData[i].trayNo); cmd.Parameters.AddWithValue("@trayno", listOfData[i].trayNo);