Ejemplo n.º 1
0
 private void btnSavee_Click(object sender, EventArgs e)
 {
     Ref_PersonViewModel.Save(txtTitle.Text, txtPhoneNumber.Text, txtMobile.Text);
     dgvPerson.DataSource = Ref_PersonViewModel.FillGrid();
     MessageBox.Show("Successfully Saved");
     txtTitle.Text       = "";
     txtPhoneNumber.Text = "";
     txtMobile.Text      = "";
 }
Ejemplo n.º 2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int          id  = Convert.ToInt32(dgvPerson[0, dgvPerson.CurrentRow.Index].Value);
            DialogResult res = MessageBox.Show("Are you sure you want to delete ?", "Confirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

            if (res == DialogResult.OK)
            {
                Ref_PersonViewModel.Delete(id);
                MessageBox.Show("deleted");
                dgvPerson.DataSource = Ref_PersonViewModel.FillGrid();
            }
        }
Ejemplo n.º 3
0
 private void FillGrid()
 {
     dgvPerson.DataSource = Ref_PersonViewModel.FillGrid();
     Clear();
 }
Ejemplo n.º 4
0
 private void btnRefresh_Click(object sender, EventArgs e)
 {
     dgvPerson.DataSource = Ref_PersonViewModel.FillGrid();
 }