// Created by James Hibbard /// <summary> /// Returns all resposnes for a given WorkID /// </summary> /// <param name="WorkID">The WorkID to get the responses for</param> /// <returns>A list of the responses, and their question</returns> public static List<TakeFiveResponseInfo> getWorkResponses(int WorkID) { if (!Work.WorkExists(WorkID)) { throw new ArgumentException("Work ID wasn't valid"); } List<TakeFiveResponseInfo> result = new List<TakeFiveResponseInfo>(); TakeFiveResponseTableAdapter responseAdapter = new TakeFiveResponseTableAdapter(); NuRacingDataSet.TakeFiveResponseDataTable responseTable = responseAdapter.GetDataByWorkID(WorkID); foreach (NuRacingDataSet.TakeFiveResponseRow responseRow in responseTable.Rows) { result.Add(new TakeFiveResponseInfo(responseRow)); } return result; }
// Created by James Hibbard /// <summary> /// Returns all resposnes for a given WorkID /// </summary> /// <param name="WorkID">The WorkID to get the responses for</param> /// <returns>A list of the responses, and their question</returns> public static List <TakeFiveResponseInfo> getWorkResponses(int WorkID) { if (!Work.WorkExists(WorkID)) { throw new ArgumentException("Work ID wasn't valid"); } List <TakeFiveResponseInfo> result = new List <TakeFiveResponseInfo>(); TakeFiveResponseTableAdapter responseAdapter = new TakeFiveResponseTableAdapter(); NuRacingDataSet.TakeFiveResponseDataTable responseTable = responseAdapter.GetDataByWorkID(WorkID); foreach (NuRacingDataSet.TakeFiveResponseRow responseRow in responseTable.Rows) { result.Add(new TakeFiveResponseInfo(responseRow)); } return(result); }
private static void StoreTakeFivesTaken(TakeFiveResponse[] responses, int WorkID) { TakeFiveResponseTableAdapter responseAdapter = new TakeFiveResponseTableAdapter(); NuRacingDataSet.TakeFiveResponseDataTable responseTable = responseAdapter.GetData(); foreach (TakeFiveResponse response in responses) { NuRacingDataSet.TakeFiveResponseRow responseRow = responseTable.NewTakeFiveResponseRow(); responseRow.Work_UID = WorkID; responseRow.TakeFive_UID = response.TakeFiveID; responseRow.TakeFiveResponse_Reason = response.Response; responseTable.AddTakeFiveResponseRow(responseRow); } responseAdapter.Update(responseTable); }