private void BtnDelete_Click(object sender, EventArgs e) { Car MyCar = new Car(); if (TxtCarId.Text != "" && TxtPlateNo.Text != "") { DialogResult dialogResult = MessageBox.Show("Car Record Management System." + Environment.NewLine + "Remove the current Record?" + Environment.NewLine + Environment.NewLine + "Click [OK] to continue...", "Remove Record", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (dialogResult == DialogResult.OK) { dynamic MyProfile = MyCar.Delete(TxtCarId.Text).Result; int RecordCountDeleted = Convert.ToInt32(MyProfile.RecordCountDeleted); if (RecordCountDeleted >= 1) { MyFormControl.CleareAllControlsRecursive(this); TxtCarId.Focus(); } MessageBox.Show(MyProfile.Status + Environment.NewLine + "Record Count Deleted :" + MyProfile.RecordCountDeleted, "Remove Current Record.."); } } }
private void BtnNew_Click(object sender, EventArgs e) { MyFormControl.CleareAllControlsRecursive(this); TxtCarId.Focus(); }