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

42 lines
1.4 KiB
C#

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 CompanyListsDataAdd : Form
{
public CompanyListsDataAdd()
{
InitializeComponent();
}
private void CompanyListsDataAdd_Load(object sender, EventArgs e)
{
}
private void buttonSave_Click(object sender, EventArgs e)
{
if (textBoxShortName.TextLength>2 && textBoxFullName.TextLength>2)
{
if (mySqlFunctions.sqlIntValue("select count(*) from sys_participants where PRT_NAME='" + textBoxShortName.Text + "' and PRT_DESCRIPTION='" + textBoxFullName.Text + "'") == 0)
{
mySqlFunctions.Insert("INSERT INTO sys_participants SET PRT_NAME='" + textBoxShortName.Text + "',PRT_DESCRIPTION='" + textBoxFullName.Text + "',PRT_SYSTEM_TYPE='SoftSPM_test',PRT_SYSTEM_ACCESS_LEVEL=1,PRT_STATUS='1',PRT_AUDIT_CU='" + vGlobal.tst_login_name + "',PRT_AUDIT_CD=now()");
this.Close();
}
}
else
{
MessageBox.Show("Wprowadzone nazwy muszą zawierać co najmniej 3 znaki.");
}
}
}
}