| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 | using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace СУБД_Кадры{    public partial class fAddClient : Form    {        public fAddClient()        {            InitializeComponent();        }        private void BtnSave_Click(object sender, EventArgs e)        {            if (tbSurname.Text.Trim() == "" || TbxPhone.Text.Trim() == ""|| TbxEmail.Text.Trim() == "")            {                MessageBox.Show("Вы заполнили не все поля", "Внимание!!!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);                return;            }            SqlConnection con = new SqlConnection(fMain.TxtCon);            con.Open();            SqlCommand comm = new SqlCommand($"Insert into Client (Surname,Name,Pathronymic,Phone,Email,Gender) values ('{tbSurname.Text.Trim()}','{tbName.Text.Trim()}','{tbPathronymic.Text.Trim()}','{TbxPhone.Text.Trim()}','{TbxEmail.Text.Trim()}','{LblGenderCode.Text.Trim()}')", con);            comm.ExecuteNonQuery();            con.Close();            this.Close();        }        private void RbtMale_CheckedChanged(object sender, EventArgs e)        {            LblGenderCode.Text = "мужской";        }        private void RbtFemale_CheckedChanged(object sender, EventArgs e)        {            LblGenderCode.Text = "женский";        }        private void BtnCancel_Click(object sender, EventArgs e)        {            this.Close();        }        private void fAddClient_Load(object sender, EventArgs e)        {        }    }}
 |