12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- 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;
- using System.Data.SqlClient;
- namespace Blanki_ekzamena.Izmenie
- {
- public partial class Sotrudnik_min_othes : Form
- {
- public static string parol;
- public static string login;
- public static string id;
- public Sotrudnik_min_othes()
- {
- InitializeComponent();
- fam.Text = Vnytri.Sotrudnik.familia_s;
- Im.Text = Vnytri.Sotrudnik.ima_s;
- label4.Text = Vnytri.Sotrudnik.dolgnost_s;
- label2.Text = login;
- label5.Text = parol;
- }
- private void btn_soxr_Click(object sender, EventArgs e)
- {
- using (Vnytri.Sotrudnik fl = new Vnytri.Sotrudnik())
- {
- this.Hide();
- fl.ShowDialog();
- this.Close();
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- const string sql = "delete from Sotrudnik where id_sotr = @id";
- DataTable table = new DataTable();
- SqlCommand cmd = new SqlCommand(sql, DataBase.connect());
- SqlDataAdapter adapter = new SqlDataAdapter();
- cmd.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, 50));
- cmd.Parameters["@id"].Value = id;
- adapter.SelectCommand = cmd;
- adapter.Fill(table);
- using (Vnytri.Sotrudnik fl = new Vnytri.Sotrudnik())
- {
- this.Hide();
- fl.ShowDialog();
- this.Close();
- }
- }
- }
- }
|