コード例 #1
0
 private void DeleteTask(int taskId)
 {
     if (IsTextBoxInList("tb" + taskId, _listTbTodo))
     {
         var textBox = FindTextbox("tb" + taskId, _listTbTodo);
         RemoveTextBoxFromListView(textBox, lvToDo, _listTbTodo, ref _pointYTodo);
         if (_dataOptions == DataOptions.SqlServer)
         {
             _bllSql.DeleteTask(taskId);
         }
         else
         {
             _bllFileSystem.DeleteTask(taskId);
         }
     }
     else if (IsTextBoxInList("tb" + taskId, _listTbDoing))
     {
         var textBox = FindTextbox("tb" + taskId, _listTbDoing);
         RemoveTextBoxFromListView(textBox, lvDoing, _listTbDoing, ref _pointYDoing);
         if (_dataOptions == DataOptions.SqlServer)
         {
             _bllSql.DeleteTask(taskId);
         }
         else
         {
             _bllFileSystem.DeleteTask(taskId);
         }
     }
     else if (IsTextBoxInList("tb" + taskId, _listTbDone))
     {
         var textBox = FindTextbox("tb" + taskId, _listTbDone);
         RemoveTextBoxFromListView(textBox, lvDone, _listTbDone, ref _pointYDone);
         if (_dataOptions == DataOptions.SqlServer)
         {
             _bllSql.DeleteTask(taskId);
         }
         else
         {
             _bllFileSystem.DeleteTask(taskId);
         }
     }
 }
コード例 #2
0
 private void DeleteTask(int idTask)
 {
     if (IsInListTbByName("tb" + idTask, _listTbTodo))
     {
         TextBox tb = FindTbByName("tb" + idTask, _listTbTodo);
         RemoveTextBoxFromListView(tb, lvToDo, _listTbTodo, ref _pointYTodo);
         if (_optionData == 0)
         {
             _bllSql.DeleteTask(idTask);
         }
         else
         {
             _bllFileSystem.DeleteTask(idTask);
         }
     }
     else if (IsInListTbByName("tb" + idTask, _listTbDoing))
     {
         TextBox tb = FindTbByName("tb" + idTask, _listTbDoing);
         RemoveTextBoxFromListView(tb, lvDoing, _listTbDoing, ref _pointYDoing);
         if (_optionData == 0)
         {
             _bllSql.DeleteTask(idTask);
         }
         else
         {
             _bllFileSystem.DeleteTask(idTask);
         }
     }
     else if (IsInListTbByName("tb" + idTask, _listTbDone))
     {
         TextBox tb = FindTbByName("tb" + idTask, _listTbDone);
         RemoveTextBoxFromListView(tb, lvDone, _listTbDone, ref _pointYDone);
         if (_optionData == 0)
         {
             _bllSql.DeleteTask(idTask);
         }
         else
         {
             _bllFileSystem.DeleteTask(idTask);
         }
     }
 }