/// <summary> /// 刪除測驗資料 /// </summary> /// <param name="QuizName"></param> public void DeleteQuizData(UDT_QuizDef QuizData) { AccessHelper accHelper = new AccessHelper(); QuizData.Deleted = true; List<UDT_QuizDef> delList = new List<UDT_QuizDef>(); delList.Add(QuizData); accHelper.DeletedValues(delList.ToArray()); }
/// <summary> /// 新增測驗資料 /// </summary> /// <param name="QuizData"></param> public void InsertQuizData(UDT_QuizDef QuizData) { AccessHelper accHelper = new AccessHelper(); List<UDT_QuizDef> insertList = new List<UDT_QuizDef>(); insertList.Add(QuizData); accHelper.InsertValues(insertList.ToArray()); }
/// <summary> /// 更新測驗資料 /// </summary> /// <param name="QuizData"></param> public void UpdateQuizData(UDT_QuizDef QuizData) { AccessHelper accHelper = new AccessHelper(); List<UDT_QuizDef> UpdateList = new List<UDT_QuizDef>(); UpdateList.Add(QuizData); accHelper.UpdateValues(UpdateList.ToArray()); }
/// <summary> /// 測過測驗ID取得測驗 /// </summary> /// <returns></returns> public UDT_QuizDef GetQuizDataByID(string UID) { AccessHelper accHelper = new AccessHelper(); UDT_QuizDef retVal= new UDT_QuizDef(); if (string.IsNullOrEmpty(UID)) return retVal; string qry = "UID='" + UID + "'"; List<UDT_QuizDef> retValList = accHelper.Select<UDT_QuizDef>(qry); if (retValList.Count > 0) retVal = retValList[0]; return retVal; }