Ejemplo n.º 1
0
        private void OnBtAddClick(object sender, System.EventArgs e)
        {
            var dialog = new PersonForm();

            dialog.StartPosition = FormStartPosition.CenterParent;
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Storage.Add(dialog.Person);
                _bs.ResetBindings(true);
                //lbxData.Items.Add(dialog.Person);
            }
        }
Ejemplo n.º 2
0
        private void OnBtEditClick(object sender, System.EventArgs e)
        {
            var index = table.SelectedRows[0].Index;

            if (index < 0)
            {
                return;
            }

            var dialog = new PersonForm();

            dialog.Person        = Storage.People[index];
            dialog.StartPosition = FormStartPosition.CenterParent;
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Storage.EditByIndex(index, dialog.Person);
                _bs.ResetBindings(false);
            }
        }