public static Task GetTaskById(string idTask) { TaskTableAdapter localAdapter = new TaskTableAdapter(); if (string.IsNullOrEmpty(idTask)) { return(null); } Task theTask = null; try { TaskDS.TaskDataTable table = localAdapter.GetTaskById(idTask); if (table != null && table.Rows.Count > 0) { TaskDS.TaskRow row = table[0]; theTask = FillTaskRecord(row); } } catch (Exception q) { log.Error("An error was ocurred while geting client data", q); return(null); } return(theTask); }
public static List <Task> GetTasksById(string idTask) { TaskTableAdapter localAdapter = new TaskTableAdapter(); if (string.IsNullOrEmpty(idTask)) { return(null); } List <Task> theList = new List <Task>(); Task theTask = null; try { TaskDS.TaskDataTable theTable = localAdapter.GetTaskById(idTask); if (theTable != null && theTable.Rows.Count > 0) { foreach (TaskDS.TaskRow theRow in theTable.Rows) { theTask = FillTaskRecord(theRow); theList.Add(theTask); } } } catch (Exception q) { log.Error("An error was ocurred while geting client data", q); return(null); } return(theList); }
public static List <Task> GetAllTasks() { TaskTableAdapter localAdapter = new TaskTableAdapter(); List <Task> theList = new List <Task>(); Task theClient = null; try { TaskDS.TaskDataTable theTable = localAdapter.GetAllTasks(); if (theTable != null && theTable.Rows.Count > 0) { foreach (TaskDS.TaskRow theRow in theTable.Rows) { theClient = FillTaskRecord(theRow); theList.Add(theClient); } } } catch (Exception q) { log.Error("OcurriĆ³ un error al obtener la lista de Tasks de la Base de Datos", q); } return(theList); }