Files
ramb_stacja/StacjaProb/dictionariesAddForm.cs
2026-09-03 10:50:01 +02:00

43 lines
1.3 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 dictionariesAddForm : Form
{
public dictionariesAddForm()
{
InitializeComponent();
}
private void buttonSave_Click(object sender, EventArgs e)
{
if (textBoxNewDic.TextLength>2)
{
mySqlFunctions.initConnection();
if (mySqlFunctions.OpenConnection())
{
if (mySqlFunctions.sqlIntValue("select count(*) from sys_dictionaries where DIC_TYPE_ID=1 and DIC_POL_LANG='" + textBoxNewDic.Text + "'") == 0)
{
mySqlFunctions.Insert("INSERT INTO sys_dictionaries SET DIC_TYPE='DEV_RESOURCES',DIC_TYPE_ID=1,DIC_POL_LANG='" + textBoxNewDic.Text + "'");
this.Close();
}
else
{
MessageBox.Show("Wprowadzona wartość istnieje w systemie – wprowadź inną lub anuluj działanie.");
}
mySqlFunctions.CloseConnection();
}
}
}
}
}