Exemplo n.º 1
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            Client MyStudent = new Client();

            if (TxtClientId.Text != "" && TxtFirstName.Text != "")
            {
                DialogResult dialogResult = MessageBox.Show("Client 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          = MyStudent.Delete(TxtClientId.Text).Result;
                    int     RecordCountDeleted = Convert.ToInt32(MyProfile.RecordCountDeleted);

                    if (RecordCountDeleted >= 1)
                    {
                        MyFormControl.CleareAllControlsRecursive(this);
                        TxtClientId.Focus();
                    }
                    MessageBox.Show(MyProfile.Status + Environment.NewLine + "Record Count Deleted :"
                                    + MyProfile.RecordCountDeleted, "Remove Current Record..");
                }
            }
        }
Exemplo n.º 2
0
 private void BtnNew_Click(object sender, EventArgs e)
 {
     MyFormControl.CleareAllControlsRecursive(this);
     TxtClientId.Focus();
 }