示例#1
0
        private void btnAddTask_Click(object sender, EventArgs e)
        {
            var task = new Task.Core.Task();

            using (var frm = new TaskAddEditForm(task))
            {
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    _taskListControl.UpdateGrid();
                }
            }
        }
        private void GvTasks_DoubleClick(object sender, EventArgs e)
        {
            var view       = (sender as GridView);
            var commentDto = view.GetRow(view.FocusedRowHandle) as Task.DTO.CommentDTO;

            if (commentDto != null)
            {
                var task = Task.Core.Task.GetByID(commentDto.TaskID);
                using (var frm = new TaskAddEditForm(task))
                {
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        //Update grid
                        UpdateGrid();
                        //int i = _taskList.IndexOf(taskDTO);
                        //_taskList[i] = Task.Core.Task.CreateDTOFromTask(task);
                        //gcTasks.RefreshDataSource();
                    }
                }
            }
        }