Ejemplo n.º 1
0
        /// <summary>
        /// Get all Tasks
        /// </summary>
        /// <returns>A TasksTD</returns>
        public static DataSet GetTasks()
        {
            TasksTD           td = new TasksTD();
            TasksTableAdapter ta = new TasksTableAdapter();

            ta.Fill(td.Tasks);
            ta.Dispose();
            return(td);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns true or false if a Tasks exists
        /// </summary>
        /// <param name="taskId">The TaskId to check existance</param>
        /// <returns>true if Tasks exists, false if not</returns>
        public static bool IsExistingTask(int taskId)
        {
            if (taskId == 0)
            {
                throw new Exception("The TaskId cannot be zero.");
            }

            TasksTableAdapter ta = new TasksTableAdapter();
            bool isExistingTask  = (ta.IsExistingTask(taskId) == 1 ? true : false);

            ta.Dispose();
            return(isExistingTask);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get Task row by TaskId
        /// </summary>
        /// <returns>A TasksDataTable with one row if TaskId exists</returns>
        public static DataTable GetTask(int taskId)
        {
            if (taskId == 0)
            {
                throw new Exception("The TaskId is zero.");
            }

            TasksTableAdapter ta = new TasksTableAdapter();
            TasksDataTable    tt = ta.GetDataByTaskId(taskId);

            ta.Dispose();
            return(tt);
        }