private void button3_Click(object sender, EventArgs e) { if (textBox1.Text != "") { using (var db = new Corporation()) { db.Persons.Add(new Person() { EmployeeFullName = textBox1.Text.Trim(), CellPhone = textBox2.Text.Trim(), EmployeeMaried = false, EmployeeBirth = DateTime.Now, IdentityNumber = "0" }); db.SaveChanges(); this.Dispose(); } } else { textBox1.Focus(); } }
private void GetData() { Corporation db = new Corporation(); ListstorageItem = db.StorageItems.AsNoTracking().Include("Storage").ToList(); Listtype = db.TypeStorages.ToList(); }