12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 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 project
- {
- public partial class RedactorProfile : Form
- {
- DataBase dataBase = new DataBase();
- public RedactorProfile()
- {
- InitializeComponent();
- }
- private void RedactorProfile_Load(object sender, EventArgs e)
- {
- comboBox1.Text = Convert.ToString(comboBox1.Items[0]);
- textBox1.Text = Login.name;
- textBox2.Text = Login.surname;
- textBox3.Text = Login.number;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- dataBase.openConnection();
- var addQuery = $"update Employee set name = '{Convert.ToString(textBox1.Text)}', surname = '{Convert.ToString(textBox2.Text)}', number = '{Convert.ToString(textBox3.Text)}', pol = '{Convert.ToString(comboBox1.Text)}' where login = '{Login.login}'";
- var command = new SqlCommand(addQuery, dataBase.GetConnection());
- command.ExecuteNonQuery();
- dataBase.closeConnection();
- this.Hide();
- Profile profile = new Profile();
- profile.Show();
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void label2_Click(object sender, EventArgs e)
- {
- }
- }
- }
|