private void btnSave_Click(object sender, EventArgs e) { RawMaterialBL raw = new RawMaterialBL(); if (table == null) { raw.AddRawMaterial(txtType.Text, txtColor.Text, txtName.Text); } else { raw.UpdateRawMaterial((int)table.Rows[0]["RawMaterialID"], txtType.Text, txtColor.Text, txtName.Text); } this.Close(); LoadRawMaterial(); }