예제 #1
0
        // 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;
        }
예제 #2
0
        // 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);
        }
예제 #3
0
파일: Work.cs 프로젝트: BadBoyJH/NURacing
        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);
        }
예제 #4
0
파일: Work.cs 프로젝트: BadBoyJH/NURacing
        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);
        }