Beispiel #1
0
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            Auth.AuthUserEdit aue = new AuthUserEdit();
            if (aue.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                int col = dgUsers.CurrentCell.ColumnIndex;

                FillDataGrid();

                dgUsers.CurrentCell = dgUsers[col, dgUsers.Rows.Count - 1];
            }
        }
Beispiel #2
0
        private void tsbEdit_Click(object sender, EventArgs e)
        {
            DataRow curr_row = GreenLight.Tools.FindCurrentRow(dgUsers);

            if (curr_row == null)
            {
                return;
            }

            int curr_id = (int)curr_row["Идентификатор"];

            Auth.AuthUserEdit aue = new AuthUserEdit();
            aue.user_id = curr_id;

            if (aue.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                int col = dgUsers.CurrentCell.ColumnIndex;
                int row = dgUsers.CurrentCell.RowIndex;

                FillDataGrid();

                dgUsers.CurrentCell = dgUsers[col, row];
            }
        }