Example #1
0
        private void AddRow(object sender, EventArgs e)
        {
            using (AddOrEditDialog dialog = new AddOrEditDialog(null))
            {
                dialog.Text = "Создание";
                dialog.ShowDialog();

                //_history.AddRecord(dialog.GetResult());
                calcLogTableAdapter.Fill(calculatorHistoryDataSet.CalcLog);
            }
        }
Example #2
0
        private void EditRow(object sender, EventArgs e)
        {
            var             Value  = (int)gvCalcLog.GetRowCellValue(gvCalcLog.FocusedRowHandle, "id");
            AddOrEditDialog dialog = new AddOrEditDialog(_history.GetRecord(Value, _culture));

            dialog.Text = "Редактирование";
            dialog.ShowDialog();
            var updateResult = dialog.GetResult();

            if (updateResult != null)
            {
                _history.UpdateRecord(updateResult, Value);
                calcLogTableAdapter.Fill(calculatorHistoryDataSet.CalcLog);
            }
        }