コード例 #1
0
 private void RemoveTask(KonsulatTask vt)
 {
     _tasks.Remove(vt);
     KonsulatTask.Save(_tasks, KonsulatTaskEntityType.New);
     _completedTasks.Add(vt);
     KonsulatTask.Save(_completedTasks, KonsulatTaskEntityType.Completed);
 }
コード例 #2
0
 private void btnAddTask_Click(object sender, EventArgs e)
 {
     _tasks.Add(fillKonsulatTask());
     KonsulatTask.Save(_tasks, KonsulatTaskEntityType.New);
     _engine.RefreshViewTabs();
     dataGridView1.Refresh();
 }
コード例 #3
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            KonsulatTask task = dataGridView1.Rows[e.RowIndex].DataBoundItem as KonsulatTask;

            fillDataToControlFromKonsulatTask(task);

            DialogForm form = new DialogForm();

            form.Text = "Редактирование задачи";
            form.Size = new Size(panel1.Size.Width, panel1.Size.Height + 50);
            form.Controls.Add(okCancelControl1);
            form.Controls.Add(panel1);
            okCancelControl1.SendToBack();
            okCancelControl1.OnOk     += form.okCancelControl1_OnOk;
            okCancelControl1.OnCancel += form.okCancelControl1_OnCancel;
            groupBox6.Visible          = groupBox7.Visible = false;
            okCancelControl1.Visible   = true;
            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _tasks.Remove(task);
                var newTask = fillKonsulatTask();
                _tasks.Add(newTask);
                dataGridView1.Refresh();
                KonsulatTask.Save(_tasks, KonsulatTaskEntityType.New);
            }
            groupBox6.Visible        = groupBox7.Visible = true;
            okCancelControl1.Visible = false;
        }