Exemple #1
0
        private void btnAasignment_Click(object sender, EventArgs e)
        {
            int empId = (int)dgwTest.CurrentRow.Cells["DeveloperID"].Value;

            _employeeTask.TaskId = (int)dgwTest.CurrentRow.Cells["Taskid"].Value;
            if (empId == 0)
            {
                try
                {
                    _employeeTask.EmployeeId = (int)cmbEmployeeName.SelectedValue;
                }
                catch (Exception)
                {
                    MessageBox.Show("Geliştirici seçiniz");
                }
                MessageBox.Show(_employeeTaskBusiness.Add(_employeeTask) ? "Atama başarılı" : "Atama başarısız ! ");
            }
            else
            {
                _employeeTask.EmployeeId = empId;
                MessageBox.Show(_employeeTaskBusiness.Add(_employeeTask) ? "Atama başarılı" : "Atama başarısız ! ");
            }
        }
        private void btnAssignment_Click(object sender, EventArgs e)
        {
            _employeeTasks.EmployeeId = (int)cmbEmployeeName.SelectedValue;

            int taskid = (int)cmbTaskAssignment.SelectedValue;

            _employeeTasks.TaskId = taskid;
            _tasks         = _taskBusiness.Get(taskid);
            _tasks.StateId = 3;
            bool updateIsSuccess = _taskBusiness.Update(_tasks);
            bool addIsSuccess    = _employeeTaskBusiness.Add(_employeeTasks);

            MessageBox.Show(addIsSuccess ? "Atama işlemi başarılı" : "Atama işlemi gerçekleştirilemedi!");
            _tasks         = _taskBusiness.Get(taskid);
            _tasks.StateId = 3;
        }