private void button13_Click(object sender, EventArgs e) { worker_table worker = new worker_table(); int check = int.Parse(textBox1.Text.Trim()); if (db.worker_table.Any(o => o.worker_id == check)) { MessageBox.Show("dude u r gay"); } else { worker.worker_id = int.Parse(textBox1.Text.Trim()); worker.name = textBox2.Text.Trim(); worker.phone_number = int.Parse(textBox3.Text.Trim()); worker.street = textBox4.Text.Trim(); worker.flat = textBox5.Text.Trim(); worker.house = textBox6.Text.Trim(); worker.job = comboBox1.Text.Trim(); worker.wage = int.Parse(textBox7.Text.Trim()); db.worker_table.Add(worker); db.SaveChanges(); dataGridView1.DataSource = db.worker_table.ToList(); } }
public MainFormEconom(worker_table client) { InitializeComponent(); user = client; AboutMeTextSetter(); }