Ejemplo n.º 1
0
        private void Edit()
        {
            try
            {
                if (grdPersons.SelectedRows.Count < 1)
                {
                    return;
                }

                object obj_pid = grdPersons.SelectedRows[0].Cells[0].Value;
                int    p_id    = -1;

                // Geçersiz Person Id gönderilme ihtimaline karşı önlem
                if (!int.TryParse(string.Format("{0}", obj_pid), out p_id))
                {
                    return;
                }

                FrmPerson frm_p = new FrmPerson(p_id);
                frm_p.FormClosed += frm_p_FormClosed;
                frm_p.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                RefreshLst();
            }
        }
Ejemplo n.º 2
0
        private void Add()
        {
            FrmPerson frm_p = new FrmPerson();

            frm_p.FormClosed += frm_p_FormClosed;
            frm_p.ShowDialog();
        }