Exemplo n.º 1
0
        /// <summary>
        /// Добавление нового элемента в текущий справочник
        /// </summary>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmAddEditReferences frmAddEditReferences = new frmAddEditReferences();

            if (frmAddEditReferences.ShowDialog() == DialogResult.OK)
            {
                selectCurrentReference(CurrentReference);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Редактирование выбранного элемента
        /// </summary>
        private void EditReferenceItem()
        {
            IsEdit = true;
            IdEdit = Int32.Parse(dgv.CurrentRow.Cells[0].Value.ToString());
            int rowId = dgv.FirstDisplayedScrollingRowIndex;
            int id    = dgv.CurrentCell.RowIndex;
            frmAddEditReferences frmAddEditReferences = new frmAddEditReferences();

            if (frmAddEditReferences.ShowDialog() == DialogResult.OK)
            {
                selectCurrentReference(CurrentReference);
            }
            dgv.FirstDisplayedScrollingRowIndex = rowId;
            dgv.CurrentCell = dgv.Rows[id].Cells[1];
            IsEdit          = false;
        }