示例#1
0
        private void TaskEditForm_Load(object sender, EventArgs e)
        {
            MainForm mainForm = this.MdiParent as MainForm;

            _user = mainForm.GetUser();

            if (_taskID > 0)
            {
                _taskBuss = new TaskBusiness(_user);
                _task     = _taskBuss.Get(_taskID);

                lblID.Text          = _taskID.ToString();
                txtDescription.Text = _task.Description;
            }
            FillComboBoxes();
        }
示例#2
0
 private void miDelete_Click(object sender, EventArgs e)
 {
     if (dgvTask.SelectedRows.Count > 0)
     {
         TaskBusiness taskBuss = new TaskBusiness(_user);
         bool         result   = false;
         try
         {
             result = taskBuss.Remove(taskBuss.Get(_taskID));
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
         MessageBox.Show(result ? "İşlem başarılı" : "İşlem başarısız");
     }
 }