Ejemplo n.º 1
0
        private void btnAddTask_Click(object sender, EventArgs e)
        {
            TaskForm form = new TaskForm();

            if (DialogResult.OK == form.ShowDialog(this))
            {
                CreateTask createTask = new CreateTask(form.textCode.Text, form.textName.Text);
                var        project    = managementService.CreateTask(createTask);
                UpdateGridTasks();
            }
        }
Ejemplo n.º 2
0
        private void btnTaskEdit_Click(object sender, EventArgs e)
        {
            TaskForm form      = new TaskForm();
            var      selected  = gridTask.SelectedRows[0];
            int      projectId = int.Parse(selected.Cells[0].Value.ToString());
            var      toEdit    = managementService.GetTask(projectId.ToString());

            form.textId.Text   = toEdit.Id.ToString();
            form.textName.Text = toEdit.Name;
            form.textCode.Text = toEdit.Code;
            if (DialogResult.OK == form.ShowDialog(this))
            {
                central.dto.Task updateTask = new central.dto.Task(int.Parse(form.textId.Text), form.textCode.Text, form.textName.Text);
                var branch = managementService.UpdateTask(form.textId.Text, updateTask);
                UpdateGridTasks();
            }
        }