Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var form = new MovementForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                var moment = form.Moment;
                AddRow(moment);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Кнопка изменения движений в таблице
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ModifyMovements_Click(object sender, EventArgs e)
        {
            var form = new MovementForm();

            form.Moment = Moments[dataGridView1.CurrentRow.Index];
            if (form.ShowDialog() == DialogResult.OK)
            {
                var newMoment = form.Moment;
                ModifyRow(newMoment, dataGridView1.CurrentRow.Index);
                Moments.RemoveAt(dataGridView1.CurrentRow.Index);
                Moments.Insert(dataGridView1.CurrentRow.Index, newMoment);
            }
        }