Exemplo n.º 1
0
 public TaskForm(int taskID)
 {
     InitializeComponent();
     this.taskID         = taskID;
     this.Text           = "Güncelleme Formu";
     task                = _taskBusiness.GetById(taskID);
     txtDescription.Text = task.Description;
 }
        public void BenchMarkGetTaskById()
        {
            TaskViewModel             task;
            IRepository <ProjectTask> taskRepository       = new Repository <ProjectTask>();
            IRepository <ParentTask>  parenttaskRepository = new Repository <ParentTask>();
            IParentTaskBusiness       taskbusiness         = new ParentTaskBusiness(parenttaskRepository);


            IRepository <Project> projectRepository = new Repository <Project>();
            IRepository <User>    userRepository    = new Repository <User>();
            IProjectBusiness      projectBusiness   = new ProjectBusiness(projectRepository, userRepository, taskRepository);

            TaskBusiness taskBusiness = new TaskBusiness(taskRepository, taskbusiness, projectBusiness, userRepository);

            task = taskBusiness.GetById(1);
        }
Exemplo n.º 3
0
        private void miDelete_Click(object sender, EventArgs e)
        {
            if (dgvTask.SelectedRows.Count > 0)
            {
                try
                {
                    object cellValue = dgvTask.SelectedRows[0].Cells["ID"].Value;
                    int    taskID    = (int)cellValue;

                    _task = _businessTask.GetById(taskID);

                    DialogResult dr = MessageBox.Show("Silmek istediğinize eminmisiniz", "Dikkat", MessageBoxButtons.YesNo);

                    if (dr == DialogResult.Yes)
                    {
                        _businessTask.Remove(_task);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }