private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure to delete this model?", "TP 2.0", MessageBoxButtons.YesNo) == DialogResult.Yes) { int ModelId = Int32.Parse(tbId.Text); if (ModelClient.Delete(ModelId).StatusCode == HttpStatusCode.OK) { if (MessageBox.Show(String.Format("Model '{0}' has deleted", tbFilename.Text)) == DialogResult.OK) { this.FormSendEvent(1); this.Close(); } } } }