Initial commit
This commit is contained in:
@@ -0,0 +1,929 @@
|
||||
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 StacjaProb
|
||||
{
|
||||
public partial class pumpCatalogueAdd : Form
|
||||
{
|
||||
|
||||
public int pumpID;
|
||||
public int manufID = 0;
|
||||
public string selectedManufactures = "";
|
||||
|
||||
public pumpCatalogueAdd()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void pumpCatalogueAdd_Load(object sender, EventArgs e)
|
||||
{
|
||||
loadProducent();
|
||||
|
||||
if (pumpID>0)
|
||||
{
|
||||
this.Text = "Edycja danych";
|
||||
|
||||
mySqlFunctions.initConnection();
|
||||
if (mySqlFunctions.OpenConnection())
|
||||
{
|
||||
//wpisuje parametry dla H
|
||||
int index = 1;
|
||||
MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand("select PEP_X_PARAM,PEP_Y_PARAM from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=" + pumpID + " order by PEP_X_PARAM", mySqlFunctions.connection);
|
||||
MySql.Data.MySqlClient.MySqlDataReader dataReader = cmd.ExecuteReader();
|
||||
while (dataReader.Read())
|
||||
{
|
||||
//comboBoxStanowisko.Items.Insert(Convert.ToInt32(dataReader["TPL_ID"]), dataReader["TPL_NAME"].ToString());
|
||||
if (index == 1)
|
||||
{
|
||||
q1Val.Text = dataReader["PEP_X_PARAM"].ToString();
|
||||
textBoxQ1.Text = dataReader["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 2)
|
||||
{
|
||||
q2Val.Text = dataReader["PEP_X_PARAM"].ToString();
|
||||
textBoxQ2.Text = dataReader["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 3)
|
||||
{
|
||||
q3Val.Text = dataReader["PEP_X_PARAM"].ToString();
|
||||
textBoxQ3.Text = dataReader["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 4)
|
||||
{
|
||||
q4Val.Text = dataReader["PEP_X_PARAM"].ToString();
|
||||
textBoxQ4.Text = dataReader["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 5)
|
||||
{
|
||||
q5Val.Text = dataReader["PEP_X_PARAM"].ToString();
|
||||
textBoxQ5.Text = dataReader["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 6)
|
||||
{
|
||||
q6Val.Text = dataReader["PEP_X_PARAM"].ToString();
|
||||
textBoxQ6.Text = dataReader["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 7)
|
||||
{
|
||||
q7Val.Text = dataReader["PEP_X_PARAM"].ToString();
|
||||
textBoxQ7.Text = dataReader["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 8)
|
||||
{
|
||||
q8Val.Text = dataReader["PEP_X_PARAM"].ToString();
|
||||
textBoxQ8.Text = dataReader["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
index++;
|
||||
}
|
||||
dataReader.Close();
|
||||
mySqlFunctions.CloseConnection();
|
||||
//comboBoxStanowisko.SelectedIndex = 0;
|
||||
|
||||
}
|
||||
|
||||
mySqlFunctions.initConnection();
|
||||
if (mySqlFunctions.OpenConnection())
|
||||
{
|
||||
//wpisuje parametry dla H
|
||||
int index = 1;
|
||||
MySql.Data.MySqlClient.MySqlCommand cmd_ETA = new MySql.Data.MySqlClient.MySqlCommand("select PEP_X_PARAM,PEP_Y_PARAM from seg_pump_eng_param where PEP_TYPE='ETA' and PEP_PUP_ID="+pumpID+" order by PEP_X_PARAM", mySqlFunctions.connection);
|
||||
MySql.Data.MySqlClient.MySqlDataReader dataReader_ETA = cmd_ETA.ExecuteReader();
|
||||
while (dataReader_ETA.Read())
|
||||
{
|
||||
//comboBoxStanowisko.Items.Insert(Convert.ToInt32(dataReader["TPL_ID"]), dataReader["TPL_NAME"].ToString());
|
||||
if (index==1)
|
||||
{
|
||||
q1Val1.Text = dataReader_ETA["PEP_X_PARAM"].ToString();
|
||||
textBoxETA1.Text = dataReader_ETA["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 2)
|
||||
{
|
||||
q2Val1.Text = dataReader_ETA["PEP_X_PARAM"].ToString();
|
||||
textBoxETA2.Text = dataReader_ETA["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 3)
|
||||
{
|
||||
q3Val1.Text = dataReader_ETA["PEP_X_PARAM"].ToString();
|
||||
textBoxETA3.Text = dataReader_ETA["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 4)
|
||||
{
|
||||
q4Val1.Text = dataReader_ETA["PEP_X_PARAM"].ToString();
|
||||
textBoxETA4.Text = dataReader_ETA["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 5)
|
||||
{
|
||||
q5Val1.Text = dataReader_ETA["PEP_X_PARAM"].ToString();
|
||||
textBoxETA5.Text = dataReader_ETA["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 6)
|
||||
{
|
||||
q6Val1.Text = dataReader_ETA["PEP_X_PARAM"].ToString();
|
||||
textBoxETA6.Text = dataReader_ETA["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 7)
|
||||
{
|
||||
q7Val1.Text = dataReader_ETA["PEP_X_PARAM"].ToString();
|
||||
textBoxETA7.Text = dataReader_ETA["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
else if (index == 8)
|
||||
{
|
||||
q8Val1.Text = dataReader_ETA["PEP_X_PARAM"].ToString();
|
||||
textBoxETA8.Text = dataReader_ETA["PEP_Y_PARAM"].ToString();
|
||||
}
|
||||
index++;
|
||||
}
|
||||
dataReader_ETA.Close();
|
||||
mySqlFunctions.CloseConnection();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
buttonSave.Enabled = false;
|
||||
|
||||
q1Val.Text = "0,00";
|
||||
q2Val.Text = "0,00";
|
||||
q3Val.Text = "0,00";
|
||||
q4Val.Text = "0,00";
|
||||
q5Val.Text = "0,00";
|
||||
q6Val.Text = "0,00";
|
||||
q7Val.Text = "0,00";
|
||||
q8Val.Text = "0,00";
|
||||
|
||||
q1Val1.Text = "0,00";
|
||||
q2Val1.Text = "0,00";
|
||||
q3Val1.Text = "0,00";
|
||||
q4Val1.Text = "0,00";
|
||||
q5Val1.Text = "0,00";
|
||||
q6Val1.Text = "0,00";
|
||||
q7Val1.Text = "0,00";
|
||||
q8Val1.Text = "0,00";
|
||||
|
||||
textBoxQ1.Enabled = false;
|
||||
textBoxQ2.Enabled = false;
|
||||
textBoxQ3.Enabled = false;
|
||||
textBoxQ4.Enabled = false;
|
||||
textBoxQ5.Enabled = false;
|
||||
textBoxQ6.Enabled = false;
|
||||
textBoxQ7.Enabled = false;
|
||||
textBoxQ8.Enabled = false;
|
||||
|
||||
textBoxETA1.Enabled = false;
|
||||
textBoxETA2.Enabled = false;
|
||||
textBoxETA3.Enabled = false;
|
||||
textBoxETA4.Enabled = false;
|
||||
textBoxETA5.Enabled = false;
|
||||
textBoxETA6.Enabled = false;
|
||||
textBoxETA7.Enabled = false;
|
||||
textBoxETA8.Enabled = false;
|
||||
}
|
||||
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
else buttonSave.Enabled = false;
|
||||
}
|
||||
|
||||
|
||||
public void loadProducent()
|
||||
{
|
||||
this.comboBoxProd.Items.Clear();
|
||||
|
||||
mySqlFunctions.initConnection();
|
||||
if (mySqlFunctions.OpenConnection())
|
||||
{
|
||||
int index = 0;
|
||||
MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand("select MCF_ID,MCF_NAME from seg_manufacturers order by MCF_NAME", mySqlFunctions.connection);
|
||||
MySql.Data.MySqlClient.MySqlDataReader dataReader = cmd.ExecuteReader();
|
||||
while (dataReader.Read())
|
||||
{
|
||||
comboBoxProd.Items.Insert(index, dataReader["MCF_NAME"].ToString());
|
||||
if (dataReader["MCF_NAME"].ToString() == selectedManufactures)
|
||||
comboBoxProd.SelectedIndex = comboBoxProd.Items.Count - 1;
|
||||
index++;
|
||||
}
|
||||
mySqlFunctions.CloseConnection();
|
||||
}
|
||||
}
|
||||
|
||||
private void textBox3_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxQn.Text = textBoxQn.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxQn.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxQn.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxQn.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
q1Val.Text = "0,00";
|
||||
q2Val.Text = Math.Round(0.25 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q3Val.Text = Math.Round(0.55 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q4Val.Text = Math.Round(0.7 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q5Val.Text = Math.Round(1 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q6Val.Text = Math.Round(1.22 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q7Val.Text = Math.Round(1.35 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q8Val.Text = Math.Round(1.42 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
|
||||
q1Val1.Text = "0,00";
|
||||
q2Val1.Text = Math.Round(0.25 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q3Val1.Text = Math.Round(0.55 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q4Val1.Text = Math.Round(0.7 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q5Val1.Text = Math.Round(1 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q6Val1.Text = Math.Round(1.22 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q7Val1.Text = Math.Round(1.35 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
q8Val1.Text = Math.Round(1.42 * Convert.ToDouble(textBoxQn.Text), 2).ToString();
|
||||
|
||||
textBoxQ1.Enabled = true;
|
||||
textBoxQ2.Enabled = true;
|
||||
textBoxQ3.Enabled = true;
|
||||
textBoxQ4.Enabled = true;
|
||||
textBoxQ5.Enabled = true;
|
||||
textBoxQ6.Enabled = true;
|
||||
textBoxQ7.Enabled = true;
|
||||
textBoxQ8.Enabled = true;
|
||||
|
||||
textBoxETA1.Enabled = true;
|
||||
textBoxETA2.Enabled = true;
|
||||
textBoxETA3.Enabled = true;
|
||||
textBoxETA4.Enabled = true;
|
||||
textBoxETA5.Enabled = true;
|
||||
textBoxETA6.Enabled = true;
|
||||
textBoxETA7.Enabled = true;
|
||||
textBoxETA8.Enabled = true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
|
||||
|
||||
private bool checkFillFields()
|
||||
{
|
||||
|
||||
bool isCloseActive = false;
|
||||
if (
|
||||
(!String.IsNullOrEmpty(textBoxTypPompy.Text))
|
||||
&&
|
||||
(comboBoxProd.SelectedIndex >= 0)
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxQn.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxHp.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxETAmax.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxDlugosc.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxSrednica.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxMasa.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxQ1.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxQ2.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxQ3.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxQ4.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxQ5.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxQ6.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxQ7.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxQ8.Text))
|
||||
&&
|
||||
|
||||
(!String.IsNullOrEmpty(textBoxETA1.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxETA2.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxETA3.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxETA4.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxETA5.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxETA6.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxETA7.Text))
|
||||
&&
|
||||
(!String.IsNullOrEmpty(textBoxETA8.Text))
|
||||
) isCloseActive = true;
|
||||
else isCloseActive = false;
|
||||
|
||||
|
||||
return isCloseActive;
|
||||
}
|
||||
|
||||
private void comboBoxProd_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
|
||||
}
|
||||
|
||||
private void textBoxTypPompy_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
string query_insert = "";
|
||||
string prodID = "9";
|
||||
|
||||
try
|
||||
{
|
||||
prodID = mySqlFunctions.sqlStringValue("select MCF_ID from seg_manufacturers where MCF_NAME='" + comboBoxProd.SelectedItem.ToString() + "'", "MCF_ID");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
|
||||
mySqlFunctions.initConnection();
|
||||
if (mySqlFunctions.OpenConnection())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pumpID > 0)
|
||||
query_insert = "update seg_pumps SET PUP_MCF_ID=" + prodID
|
||||
+ ",PUP_NAME='" + textBoxTypPompy.Text + "'"
|
||||
+ ",PUP_Q_N=" + textBoxQn.Text.Replace(",", ".")
|
||||
+ ",PUP_Q_MIN=" + q3Val1.Text.Replace(",", ".")
|
||||
+ ",PUP_Q_MAX=" + q7Val1.Text.Replace(",", ".")
|
||||
+ ",PUP_H_P=" + textBoxHp.Text.Replace(",", ".")
|
||||
+ ",PUP_H_MIN=" + textBoxQ7.Text.Replace(",", ".")
|
||||
+ ",PUP_H_MAX=" + textBoxQ3.Text.Replace(",", ".")
|
||||
+ ",PUP_ETA_MAX=" + textBoxETAmax.Text.Replace(",", ".")
|
||||
+ ",PUP_PUMP_LENGTH=" + textBoxDlugosc.Text.Replace(",", ".")
|
||||
+ ",PUP_WEIGHT=" + textBoxMasa.Text.Replace(",", ".")
|
||||
+ ",PUP_DIAMETER=" + textBoxSrednica.Text.Replace(",", ".")
|
||||
+ ",PUP_STATUS='1aaaaaa' where PUP_ID=" + pumpID.ToString();
|
||||
else
|
||||
query_insert = "INSERT INTO seg_pumps SET PUP_MCF_ID=" + prodID
|
||||
+ ",PUP_NAME='" + textBoxTypPompy.Text + "'"
|
||||
+ ",PUP_Q_N=" + textBoxQn.Text.Replace(",", ".")
|
||||
+ ",PUP_Q_MIN=" + q3Val1.Text.Replace(",", ".")
|
||||
+ ",PUP_Q_MAX=" + q7Val1.Text.Replace(",", ".")
|
||||
+ ",PUP_H_P=" + textBoxHp.Text.Replace(",", ".")
|
||||
+ ",PUP_H_MIN=" + textBoxQ7.Text.Replace(",", ".")
|
||||
+ ",PUP_H_MAX=" + textBoxQ3.Text.Replace(",", ".")
|
||||
+ ",PUP_ETA_MAX=" + textBoxETAmax.Text.Replace(",", ".")
|
||||
+ ",PUP_PUMP_LENGTH=" + textBoxDlugosc.Text.Replace(",", ".")
|
||||
+ ",PUP_WEIGHT=" + textBoxMasa.Text.Replace(",", ".")
|
||||
+ ",PUP_DIAMETER=" + textBoxSrednica.Text.Replace(",", ".")
|
||||
+ ",PUP_STATUS='1'";
|
||||
|
||||
MySql.Data.MySqlClient.MySqlCommand cmd_01 = new MySql.Data.MySqlClient.MySqlCommand(query_insert, mySqlFunctions.connection);
|
||||
cmd_01.ExecuteNonQuery();
|
||||
|
||||
if (pumpID > 0)
|
||||
{
|
||||
MySql.Data.MySqlClient.MySqlCommand cmd_02 = new MySql.Data.MySqlClient.MySqlCommand("delete from seg_pump_eng_param where PEP_PUP_ID=" + pumpID.ToString(), mySqlFunctions.connection);
|
||||
cmd_02.ExecuteNonQuery();
|
||||
}
|
||||
else
|
||||
{
|
||||
MySql.Data.MySqlClient.MySqlCommand cmd_02 = new MySql.Data.MySqlClient.MySqlCommand("select max(PUP_ID) from seg_pumps", mySqlFunctions.connection);
|
||||
pumpID = Convert.ToInt32(cmd_02.ExecuteScalar());
|
||||
}
|
||||
|
||||
|
||||
string query_insert_h = "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q1Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxQ1.Text.Replace(",", ".") + ",PEP_TYPE='H'; ";
|
||||
query_insert_h += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q2Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxQ2.Text.Replace(",", ".") + ",PEP_TYPE='H'; ";
|
||||
query_insert_h += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q3Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxQ3.Text.Replace(",", ".") + ",PEP_TYPE='H'; ";
|
||||
query_insert_h += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q4Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxQ4.Text.Replace(",", ".") + ",PEP_TYPE='H'; ";
|
||||
query_insert_h += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q5Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxQ5.Text.Replace(",", ".") + ",PEP_TYPE='H'; ";
|
||||
query_insert_h += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q6Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxQ6.Text.Replace(",", ".") + ",PEP_TYPE='H'; ";
|
||||
query_insert_h += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q7Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxQ7.Text.Replace(",", ".") + ",PEP_TYPE='H'; ";
|
||||
query_insert_h += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q8Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxQ8.Text.Replace(",", ".") + ",PEP_TYPE='H'; ";
|
||||
|
||||
MySql.Data.MySqlClient.MySqlCommand cmd_03 = new MySql.Data.MySqlClient.MySqlCommand(query_insert_h, mySqlFunctions.connection);
|
||||
cmd_03.ExecuteNonQuery();
|
||||
|
||||
string query_insert_eta = "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q1Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxETA1.Text.Replace(",", ".") + ",PEP_TYPE='ETA'; ";
|
||||
query_insert_eta += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q2Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxETA2.Text.Replace(",", ".") + ",PEP_TYPE='ETA'; ";
|
||||
query_insert_eta += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q3Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxETA3.Text.Replace(",", ".") + ",PEP_TYPE='ETA'; ";
|
||||
query_insert_eta += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q4Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxETA4.Text.Replace(",", ".") + ",PEP_TYPE='ETA'; ";
|
||||
query_insert_eta += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q5Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxETA5.Text.Replace(",", ".") + ",PEP_TYPE='ETA'; ";
|
||||
query_insert_eta += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q6Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxETA6.Text.Replace(",", ".") + ",PEP_TYPE='ETA'; ";
|
||||
query_insert_eta += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q7Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxETA7.Text.Replace(",", ".") + ",PEP_TYPE='ETA'; ";
|
||||
query_insert_eta += "INSERT INTO seg_pump_eng_param SET PEP_PUP_ID=" + pumpID.ToString() + ",PEP_X_PARAM=" + q8Val.Text.Replace(",", ".") + ",PEP_Y_PARAM=" + textBoxETA8.Text.Replace(",", ".") + ",PEP_TYPE='ETA'; ";
|
||||
|
||||
MySql.Data.MySqlClient.MySqlCommand cmd_04 = new MySql.Data.MySqlClient.MySqlCommand(query_insert_eta, mySqlFunctions.connection);
|
||||
cmd_04.ExecuteNonQuery();
|
||||
|
||||
mySqlFunctions.CloseConnection();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
this.Close();
|
||||
}
|
||||
|
||||
|
||||
private void textBoxQn_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxHp_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxETAmax_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxDlugosc_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxSrednica_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxMasa_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxQ1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxQ2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxQ3_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxQ4_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxQ5_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxQ6_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxQ7_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxQ8_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxETA1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxETA2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxETA3_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxETA4_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxETA5_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxETA6_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxETA7_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxETA8_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkFillFields()) buttonSave.Enabled = true;
|
||||
}
|
||||
|
||||
private void textBoxHp_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxHp.Text = textBoxHp.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxHp.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxHp.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxHp.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxETAmax_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxETAmax.Text = textBoxETAmax.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxETAmax.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxETAmax.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxETAmax.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxDlugosc_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxDlugosc.Text = textBoxDlugosc.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxDlugosc.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxDlugosc.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxDlugosc.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxSrednica_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxSrednica.Text = textBoxSrednica.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxSrednica.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxSrednica.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxSrednica.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxMasa_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxMasa.Text = textBoxMasa.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxMasa.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxMasa.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxMasa.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void textBoxQ1_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxQ1.Text = textBoxQ1.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxQ1.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxQ1.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxQ1.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxQ2_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxQ2.Text = textBoxQ2.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxQ2.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxQ2.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxQ2.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxQ3_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxQ3.Text = textBoxQ3.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxQ3.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxQ3.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxQ3.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxQ4_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxQ4.Text = textBoxQ4.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxQ4.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxQ4.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxQ4.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxQ5_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxQ5.Text = textBoxQ5.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxQ5.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxQ5.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxQ5.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxQ6_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxQ6.Text = textBoxQ6.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxQ6.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxQ6.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxQ6.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxQ7_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxQ7.Text = textBoxQ7.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxQ7.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxQ7.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxQ7.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxQ8_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxQ8.Text = textBoxQ8.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxQ8.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxQ8.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxQ8.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void textBoxETA1_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxETA1.Text = textBoxETA1.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxETA1.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxETA1.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxETA1.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxETA2_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxETA2.Text = textBoxETA2.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxETA2.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxETA2.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxETA2.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxETA3_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxETA3.Text = textBoxETA3.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxETA3.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxETA3.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxETA3.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxETA4_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxETA4.Text = textBoxETA4.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxETA4.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxETA4.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxETA4.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxETA5_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxETA5.Text = textBoxETA5.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxETA5.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxETA5.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxETA5.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxETA6_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxETA6.Text = textBoxETA6.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxETA6.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxETA6.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxETA6.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxETA7_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxETA7.Text = textBoxETA7.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxETA7.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxETA7.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxETA7.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void textBoxETA8_Leave(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
textBoxETA8.Text = textBoxETA8.Text.Replace(".", ",");
|
||||
double myInt;
|
||||
bool isNumerical = double.TryParse(textBoxETA8.Text, out myInt);
|
||||
|
||||
if (!isNumerical && textBoxETA8.Text.Length > 0)
|
||||
{
|
||||
MessageBox.Show("Wprowadzona wartość musi być liczbą!\nWprowadź proszę ponownie.");
|
||||
textBoxETA8.Focus();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void buttonClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user