public int UpdateTaskById(UserTasks t) { string editString = "UPDATE UserTasks SET Description = @Description, DueDate = @DueDate "; editString += "WHERE TaskId = @TaskId"; return(conn.Execute(editString, t)); }
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)); }
public int MarkComplete(UserTasks t) { string markcomplete = "Update UserTasks SET Complete = '0' WHERE TaskId = @TaskId"; return(conn.Execute(markcomplete, t)); }
public IEnumerable <UserTasks> SortByDateDesc(UserTasks t) { string queryString = "SELECT * FROM UserTasks ORDER BY DueDate DESC"; return(conn.Query <UserTasks>(queryString)); }
public int DeleteTask(UserTasks t) { string markcomplete = "DELETE FROM UserTasks WHERE TaskId = @TaskId"; return(conn.Execute(markcomplete, t)); }