Exemple #1
0
 private void tsmi_Update_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.listView1.SelectedItems.Count > 0)
         {
             TaskEntity entity = (TaskEntity)this.listView1.SelectedItems[0].Tag;
             if (entity != null)
             {
                 FrmTaskEdit frm = new FrmTaskEdit(entity, _Bll);
                 frm.ShowDialog();
                 if (frm.DialogResult == DialogResult.OK)
                 {
                     _Bll.UpdateTask(entity);
                     this.InitTaskList();
                 }
                 frm.Dispose();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #2
0
 private void tsmi_Add_Click(object sender, EventArgs e)
 {
     try
     {
         FrmTaskEdit frm = new FrmTaskEdit(_Bll);
         frm.ShowDialog();
         if (frm.DialogResult == DialogResult.OK)
         {
             if (frm.Task != null)
             {
                 _Bll.AddTask(frm.Task);
                 this.InitTaskList();
             }
         }
         frm.Dispose();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }