コード例 #1
0
        private void Add_button_Click(object sender, EventArgs e)
        {
            dataSet = BusinessLogic.ReadWorkStatuses();
            AddEditWorkStatusesForm AddWorkStatus = new AddEditWorkStatusesForm(dataSet.WorkStatuses, null);

            AddWorkStatus.Text = "Добавление рабочего статуса";
            this.Enabled       = false;
            AddWorkStatus.ShowDialog();
            if (AddWorkStatus.DialogResult == DialogResult.OK)
            {
                dataSet = BusinessLogic.WriteWorkStatuses(dataSet);
                ReloadWorkStatuses();
            }
            this.Enabled = true;
        }
コード例 #2
0
        private void Edit_button_Click(object sender, EventArgs e)
        {
            dataSet            = BusinessLogic.ReadWorkStatuses();
            LastSelectionIndex = WorkStatuses_dataGridView.SelectedRows[0].Index;
            AddEditWorkStatusesForm EditWorkStatus = new AddEditWorkStatusesForm(dataSet.WorkStatuses, dataSet.WorkStatuses.Rows.Find(WorkStatuses_dataGridView.SelectedRows[0].Cells["ID"].Value));

            EditWorkStatus.Text = "Редактирование рабочего статуса";
            this.Enabled        = false;
            EditWorkStatus.ShowDialog();
            if (EditWorkStatus.DialogResult == DialogResult.OK)
            {
                dataSet = BusinessLogic.WriteWorkStatuses(dataSet);
                ReloadWorkStatuses();
            }
            this.Enabled = true;
        }