private void save_Click(object sender, EventArgs e) { if (building == null) { isNew = true; building = new Building(); } building.Name = txtName.Text; building.ArabicName = txtArabicName.Text; if (isNew) { da.AddBuilding(building); } else { da.Update(); } this.Close(); }