示例#1
0
        public int UpdateTaskById(UserTasks t)
        {
            string editString = "UPDATE UserTasks SET Description = @Description, DueDate = @DueDate ";

            editString += "WHERE TaskId = @TaskId";
            return(conn.Execute(editString, t));
        }
示例#2
0
        public int CreateTask(UserTasks t)
        {
            t.Complete = 1; //always create status=1

            string addQuery = "INSERT INTO UserTasks (OwnerId, Description, DueDate, Complete) ";

            addQuery += "VALUES (@OwnerId, @Description, @DueDate, @Complete)";

            return(conn.Execute(addQuery, t));
        }
示例#3
0
        public int MarkComplete(UserTasks t)
        {
            string markcomplete = "Update UserTasks SET Complete = '0' WHERE TaskId = @TaskId";

            return(conn.Execute(markcomplete, t));
        }
示例#4
0
        public IEnumerable <UserTasks> SortByDateDesc(UserTasks t)
        {
            string queryString = "SELECT * FROM UserTasks ORDER BY DueDate DESC";

            return(conn.Query <UserTasks>(queryString));
        }
示例#5
0
        public int DeleteTask(UserTasks t)
        {
            string markcomplete = "DELETE FROM UserTasks WHERE TaskId = @TaskId";

            return(conn.Execute(markcomplete, t));
        }