//用遞迴創樹 protected TreeNode constructLearningPointTree(TreeNode root) { DataTable dtTree = new DataTable(); String SQL = "SELECT * FROM SituationQuestionLearningPointTree WHERE cParentID = '" + root.Value.ToString() + "'"; dtTree = sqldb.getDataSet(SQL).Tables[0]; SQL = "SELECT * FROM SituationQuestionLearningPointTree"; DataTable dt = sqldb.getDataSet(SQL).Tables[0]; if (dtTree.Rows.Count > 0) { for (int i = 0; i < dtTree.Rows.Count; i++) { int a = 0; TreeNode node = new TreeNode(); node.Value = dtTree.Rows[i]["cNodeID"].ToString(); node.Text = dtTree.Rows[i]["content"].ToString(); if (tbcKeyWord.Text == "") { root.ChildNodes.Add(constructLearningPointTree(node)); } else if (tbcKeyWord.Text != "") { a = search(dt, node); if (a == 1) { root.ChildNodes.Add(constructLearningPointTree(node)); } } } } return(root); }
protected void editdiplay() { clsHintsDB sqlDB = new clsHintsDB(); string strSQL = ""; string str_URL = ""; DataTable dtTemp = new DataTable(); if (hf_img.Value.Contains("Internal Medicine|General|1")) { string str_VRID = "Simulator_20100928144239"; strSQL = "SELECT * FROM SimulatorBackground WHERE SimulatorID LIKE '" + str_VRID + "'"; dtTemp = sqlDB.getDataSet(strSQL).Tables[0]; str_URL = dtTemp.Rows[0]["bgUrl"].ToString(); } else if (hf_img.Value.Contains("Internal Medicine|General|2")) { str_URL = "http://140.116.72.123/HintsCase/FileCollection/0101/201108/File20110817120244.JPG"; } else { strSQL = "SELECT * FROM SimulatorBackground WHERE SimulatorID LIKE '" + hf_img.Value + "'"; dtTemp = sqlDB.getDataSet(strSQL).Tables[0]; str_URL = dtTemp.Rows[0]["bgUrl"].ToString(); } //DataTable dtTemp = sqlDB.getDataSet(strSQL).Tables[0]; //DRAW THE IMAGE if (str_URL != "") {//讀圖並控制大小 Img_simulator.ImageUrl = str_URL; if (Img_simulator.Width.Value > 1024) { Img_simulator.Width = 1024; } } }
protected void ConstructQuestionGroupTree() { //先清空原有的題庫樹 tvQuestionGroup.Nodes.Clear(); tvMoveGroup.Nodes.Clear(); strSpanIDPrefix = "display"; //從QuestionList資料表讀取Root的資訊 DataTable dtQuestionRoot = new DataTable(); string strSQL_QuestionRoot = "SELECT * FROM QuestionList WHERE qName='" + ddlSelectQuestion.SelectedItem.ToString() + "'"; dtQuestionRoot = hintsDB.getDataSet(strSQL_QuestionRoot).Tables[0]; tvQuestionGroup.Nodes.Add(getTree(dtQuestionRoot.Rows[0]["qRootName"].ToString(), dtQuestionRoot.Rows[0]["qName"].ToString())); tvQuestionGroup.CollapseAll(); TreeNode tnRoot = new TreeNode(); TreeNode tnNode = new TreeNode(); tnRoot = tvQuestionGroup.Nodes[0]; tnRoot.Expanded = true; for (int nIdx = 0; nIdx < tnRoot.ChildNodes.Count; nIdx++) { tnNode = tvQuestionGroup.Nodes[0].ChildNodes[nIdx]; tnNode.Expand(); } }
protected void set_tittle() { DataTable dbTittle = new DataTable(); strSQL = "SELECT cNodeName FROM FeaturevalueTree WHERE (cNodeID = '" + strNodeID + "') "; dbTittle = hintsDB.getDataSet(strSQL).Tables[0]; lbTittle.Text = dbTittle.Rows[0]["cNodeName"].ToString(); }
//判斷strGroupID是否為空值,在編輯問卷模式下修改考卷,strGroupID會為空值 private void CheckStrGroupID(string strQuestionID) { //若判斷strGroupID為空值,則利用strQID為條件置資料庫搜尋strGroupID if (this.strGroupID == "") { DataTable dbGetStrGroupID = new DataTable(); string strSQLGetStrGroupID = "SELECT cQuestionGroupID FROM QuestionMode WHERE cQID='" + strQuestionID + "'"; dbGetStrGroupID = hintsDB.getDataSet(strSQLGetStrGroupID).Tables[0]; this.strGroupID = dbGetStrGroupID.Rows[0]["cQuestionGroupID"].ToString(); } }
private void SaveQuestionText() { string strQTextContent = txtQuestionEdit.Text; strQTextContent = strQTextContent.Replace("<", "<"); strQTextContent = strQTextContent.Replace(">", ">"); string strVPAnsTitle = txtVPAnsTitle.Text; strVPAnsTitle = strVPAnsTitle.Replace("<", "<"); strVPAnsTitle = strVPAnsTitle.Replace(">", ">"); clsConversation.saveVPAnswer_BasicQuestionList(hfVPAID.Value.ToString(), hfCurrentProType.Value.ToString(), ddl_VPResponseType.SelectedItem.Text.ToString(), strVPAnsTitle, strQTextContent, Request.QueryString["GroupID"].ToString()); clsHintsDB HintsDB = new clsHintsDB(); if (Rbl_AnswerType.SelectedIndex == 0) // 當學生回答模式為Textbox時,須採取的動作 老詹 2014/01/13 { string strSQL = "SELECT * FROM StudentAnsType WHERE cVPAID = '" + hfVPAID.Value.ToString() + "'"; DataTable dtTmp = HintsDB.getDataSet(strSQL).Tables[0]; if (dtTmp.Rows.Count <= 0) { string strInsertSQL = "INSERT INTO StudentAnsType (cVPAID , iAnswerType, cAnswerContent, bIsCorrect) " + "VALUES ('" + hfVPAID.Value.ToString() + "' , '" + (Rbl_AnswerType.SelectedIndex + 1) + "' , '', '0') "; HintsDB.ExecuteNonQuery(strInsertSQL); } else { if (dtTmp.Rows[0]["iAnswerType"].ToString() != "1") { string strDeleteSQL = "DELETE FROM StudentAnsType WHERE cVPAID = '" + hfVPAID.Value.ToString() + "' AND iAnswerType != '1'"; HintsDB.ExecuteNonQuery(strDeleteSQL); string strInsertSQL = "INSERT INTO StudentAnsType (cVPAID , iAnswerType, cAnswerContent, bIsCorrect) " + "VALUES ('" + hfVPAID.Value.ToString() + "' , '" + (Rbl_AnswerType.SelectedIndex + 1) + "' , '', '0') "; HintsDB.ExecuteNonQuery(strInsertSQL); } } } else { //刪除db.StudentAnsType中非教師設定的AnsType選項 string strSQL = "SELECT * FROM StudentAnsType WHERE cVPAID = '" + hfVPAID.Value.ToString() + "' AND iAnswerType != '" + (Rbl_AnswerType.SelectedIndex + 1) + "'"; DataTable dtTmp = HintsDB.getDataSet(strSQL).Tables[0]; if (dtTmp.Rows.Count > 0) { string strDeleteSQL = "DELETE FROM StudentAnsType WHERE cVPAID = '" + hfVPAID.Value.ToString() + "' AND iAnswerType != '" + (Rbl_AnswerType.SelectedIndex + 1) + "'"; HintsDB.ExecuteNonQuery(strDeleteSQL); } } }
/// <summary> /// 儲存一筆資料至Conversation_Answer /// </summary> /// <param name="strQID"></param> /// <param name="strAID"></param> /// <param name="strAnswer"></param> /// <param name="strAnswerType"></param> /// <param name="AnswerContentType"></param> public static void Conversation_Answer_INSERT(int iSerialNum, string strQID, string strAID, string strAnswer, string strAnswerType, string AnswerContentType) { string strSQL = ""; strSQL = "SELECT * FROM Conversation_Answer WHERE cQID = '" + strQID + "' AND cAID = '" + strAID + "' "; clsHintsDB HintsDB = new clsHintsDB(); DataSet dsCheck = HintsDB.getDataSet(strSQL); if (dsCheck.Tables[0].Rows.Count > 0) { //Update strSQL = "UPDATE Conversation_Answer SET cAnswer = @cAnswer, cAnswerContentType = @cAnswerContentType " + "WHERE cQID = '" + strQID + "' AND cAID = '" + strAID + "' "; object[] pList = { strAnswer, AnswerContentType }; HintsDB.ExecuteNonQuery(strSQL, pList); } else { //Insert strSQL = "INSERT INTO Conversation_Answer (iSerialNum, cQID , cAID , cAnswer , cAnswerType , cAnswerContentType) " + "VALUES (@iSerialNum , @cQID , @cAID , @cAnswer , @cAnswerType , @cAnswerContentType ) "; object[] pList = { iSerialNum, strQID, strAID, strAnswer, strAnswerType, AnswerContentType }; HintsDB.ExecuteNonQuery(strSQL, pList); } dsCheck.Dispose(); }
protected void list_order() { //裝資料的表 DataTable dtbackground = new DataTable(); dtbackground.Columns.Add("name", typeof(string)); dtbackground.Columns.Add("order", typeof(string)); SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]); clsHintsDB sqlDB = new clsHintsDB(); string strSQL = ""; //讀出現在的資料表 strSQL = "SELECT * FROM Question_Simulator_ans WHERE cQuestion_simulator_ID LIKE '" + hf_QID.Value + "'"; DataTable dt_data_ans = sqlDB.getDataSet(strSQL).Tables[0]; for (int i = 0; i < dt_data_ans.Rows.Count; i++) { //textbox TextBox BoxBuffer = (TextBox)form1.FindControl("Order_" + i); //Update 更新ORDER strSQL = "UPDATE Question_Simulator_ans SET cOrder=@cOrder WHERE cQuestion_simulator_ID LIKE @cQuestion_simulator_ID AND cName LIKE '" + dt_data_ans.Rows[i]["cName"].ToString() + "'"; //object[] pList = { BoxBuffer.Text.ToString(), hf_QID.Value }; object[] pList = { (i + 1).ToString(), hf_QID.Value }; myDB.ExecuteNonQuery(strSQL, pList); } }
protected void CheckAudioID() { // 判斷是否有已錄好的正確例句 老詹 2014/12/17 clsHintsDB hintsDB = new clsHintsDB(); string strRecordSQL = "SELECT cAudioID FROM Conversation_Question WHERE cQID = '" + strQID + "'"; DataTable dtRecordinfo = hintsDB.getDataSet(strRecordSQL).Tables[0]; if (Request.QueryString["bModify"].ToString() == "True") { if (dtRecordinfo.Rows[0]["cAudioID"].ToString() != "") { flag = true; AudioIframe.InnerHtml = "<iframe id='ifEXPlayer' scrolling='no' runat='server' width='402px' height='42px' src='../../../Learning/InterrogationEnquiry/Voice_Inquiry/AudioPlayFlv.aspx?AudioID=" + dtRecordinfo.Rows[0]["cAudioID"].ToString() + "'></iframe>"; } else { flag = false; ExCorrectsentence.Visible = false; } } else { flag = false; ExCorrectsentence.Visible = false; } }
protected void btn_delete_Click(object sender, EventArgs e) { //裝資料的表 DataTable dtbackground = new DataTable(); dtbackground.Columns.Add("name", typeof(string)); dtbackground.Columns.Add("order", typeof(string)); SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]); clsHintsDB sqlDB = new clsHintsDB(); string strSQL = ""; string DeleteNO = ((Button)sender).CommandArgument; //hfDELETE記錄哪個是被刪掉的 hf_Delte.Value += DeleteNO + "|"; //刪除記錄中的記錄 strSQL = "DELETE Question_Simulator_ans WHERE cQuestion_simulator_ID LIKE '" + hf_QID.Value + "' AND cName LIKE '" + DeleteNO + "'"; clsHintsDB MLASDB = new clsHintsDB(); MLASDB.ExecuteNonQuery(strSQL); ////讀出現在的資料表 //strSQL = "SELECT * FROM Question_Simulator_ans WHERE cQuestion_simulator_ID LIKE '" + hf_QID.Value + "'"; //DataTable dt_data_ans = sqlDB.getDataSet(strSQL).Tables[0]; //for (int i = 0; i < dt_data_ans.Rows.Count; i++) //{ // int strOrder = Convert.ToInt16( dt_data_ans.Rows[i]["cOrder"])-1; // //textbox // TextBox BoxBuffer = (TextBox)form1.FindControl("Order_" + i); // //Update 更新ORDER // strSQL = "UPDATE Question_Simulator_ans SET cOrder=@cOrder WHERE cQuestion_simulator_ID LIKE @cQuestion_simulator_ID AND cName LIKE '" + dt_data_ans.Rows[i]["cName"].ToString() + "'"; // object[] pList = { BoxBuffer.Text.ToString(), hf_QID.Value }; // myDB.ExecuteNonQuery(strSQL, pList); //} //reorder list_order(); //重新讀取資料 strSQL = "SELECT * FROM Question_Simulator_ans WHERE cQuestion_simulator_ID LIKE '" + hf_QID.Value + "' "; DataTable dt_data_temp = sqlDB.getDataSet(strSQL).Tables[0]; for (int n = 0; n < dt_data_temp.Rows.Count; n++) { DataRow dr_in = dtbackground.NewRow(); dr_in["name"] = dt_data_temp.Rows[n]["cName"].ToString(); dr_in["order"] = dt_data_temp.Rows[n]["cOrder"].ToString(); dtbackground.Rows.Add(dr_in); } //re draw PL_table.Controls.Clear(); if (RB1.Checked == true) { table_O_display(dtbackground); } else if (RB2.Checked == true) { noorderdisplay(dtbackground); } }
/// <summary> /// 取得問題的分數 /// </summary> /// <param name="strQID"></param> /// <returns></returns> public static string QuestionLevel_SELECT_Grade(string strQID) { string strQuestionGrade = "0"; clsHintsDB HintsDB = new clsHintsDB(); string strSQL = "SELECT * FROM PaperContent WHERE cQID = '" + strQID + "'"; try { strQuestionGrade = HintsDB.getDataSet(strSQL).Tables[0].Rows[0]["cQuestionScore"].ToString(); } catch { return("-1"); } /* * string strQuestionGrade = "00"; * clsHintsDB HintsDB = new clsHintsDB(); * string strSQL = "SELECT * FROM QuestionLevel WHERE cQID = '" + strQID + "'"; * try * { * strQuestionGrade = HintsDB.getDataSet(strSQL).Tables[0].Rows[0]["cQuestionGrade"].ToString(); * if (strQuestionGrade == "") * strQuestionGrade = "00"; * } * catch * { * return "-1"; * } */ return(strQuestionGrade); }
protected void btn_Order_Click(object sender, EventArgs e) { DataTable dtbackground = new DataTable(); dtbackground.Columns.Add("name", typeof(string)); dtbackground.Columns.Add("order", typeof(string)); SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]); clsHintsDB sqlDB = new clsHintsDB(); string strSQL = ""; list_order(); //重新讀取資料 strSQL = "SELECT * FROM Question_Simulator_ans WHERE cQuestion_simulator_ID LIKE '" + hf_QID.Value + "' "; DataTable dt_data_temp = sqlDB.getDataSet(strSQL).Tables[0]; for (int n = 0; n < dt_data_temp.Rows.Count; n++) { DataRow dr_in = dtbackground.NewRow(); dr_in["name"] = dt_data_temp.Rows[n]["cName"].ToString(); dr_in["order"] = dt_data_temp.Rows[n]["cOrder"].ToString(); dtbackground.Rows.Add(dr_in); } //re draw PL_table.Controls.Clear(); if (RB1.Checked == true) { table_O_display(dtbackground); } else if (RB2.Checked == true) { noorderdisplay(dtbackground); } }
/// <summary> /// 儲存一筆資料至Conversation_Question /// </summary> /// <param name="strQID"></param> /// <param name="strQuestion"></param> public static void saveIntoConversation_Question(string strQID, string strQuestion) { string strSQL = ""; strSQL = "SELECT * FROM Conversation_Question WHERE cQID = '" + strQID + "' "; clsHintsDB HintsDB = new clsHintsDB(); DataSet dsCheck = HintsDB.getDataSet(strSQL); if (dsCheck.Tables[0].Rows.Count > 0) { //Update strSQL = "UPDATE Conversation_Question SET cQuestion = @cQuestion " + "WHERE cQID = '" + strQID + "' "; } else { //Insert strSQL = "INSERT INTO Conversation_Question (cQID , cQuestion) " + "VALUES ('" + strQID + "' , @cQuestion ) "; } dsCheck.Dispose(); object[] pList = { strQuestion }; HintsDB.ExecuteNonQuery(strSQL, pList); }
//返回後仍要判斷職業 老詹 2014/08/26 protected void GobackCareer(object sender, EventArgs e) { //When generating a new 對話題 (if the Opener is Paper_QuestionTypeNew), set Previous page as Paper_QuestionTypeNew,and return to it right away. if (Request.QueryString["Opener"].ToString() == "Paper_QuestionTypeNew") { Response.Redirect(Request.QueryString["Opener"].ToString() + ".aspx?Opener=./QuestionGroupTree/QGroupTreeNew&bModify=False&GroupID=" + strGroupID); } clsHintsDB sqldb = new clsHintsDB(); string strCheckNull = "SELECT * FROM Conversation_Question WHERE cQID='" + strQID + "'"; DataTable dtTemp = sqldb.getDataSet(strCheckNull).Tables[0]; if (dtTemp.Rows.Count > 0) { if (dtTemp.Rows[0]["cQuestion"].ToString() == "" && dtTemp.Rows[0]["cKeyword"].ToString() == "" && dtTemp.Rows[0]["cAudioID"].ToString() == "") { string strDeleteSQL = "DELETE FROM Conversation_Question WHERE cQID='" + strQID + "'"; sqldb.ExecuteNonQuery(strDeleteSQL); } } Session["SynonymsRow"] = null; string strCareer = Request.QueryString["Career"]; RegisterStartupScript("", "<script language='javascript'>goBack('" + strCareer + "', '" + Session["bDisplayQuestionList"].ToString() + "');</script>"); }
/// <summary> /// 儲存一筆資料至QuestionIndex /// </summary> /// <param name="strQID"></param> /// <param name="strQuestion"></param> /// <param name="intLevel"></param> public static void saveIntoQuestionIndex(string strQID, string strQuestion, string strAnswer, int intLevel) { string strSQL = ""; strSQL = "SELECT * FROM QuestionIndex WHERE cQID = '" + strQID + "' "; clsHintsDB HintsDB = new clsHintsDB(); DataSet dsCheck = HintsDB.getDataSet(strSQL); if (dsCheck.Tables[0].Rows.Count > 0) { //Update strSQL = "UPDATE QuestionIndex SET cQuestion = @cQuestion , cAnswer = @cAnswer , sLevel = '" + intLevel.ToString() + "' " + "WHERE cQID = '" + strQID + "' "; } else { //Insert strSQL = "INSERT INTO QuestionIndex (cQID , cQuestion, cAnswer , sLevel) " + "VALUES ('" + strQID + "' , @cQuestion , @cANswer, '" + intLevel.ToString() + "') "; } dsCheck.Dispose(); object[] pList = { strQuestion, strAnswer }; HintsDB.ExecuteNonQuery(strSQL, pList); }
//取得選擇題有符合特徵值的問題 private DataTable QuestionIndex_SELECT_FeatureValue(DataTable dtFeatureItem, string strQuestionType) { DataTable dtQuestionIndex = new DataTable(); //若沒有特徵條件,則不執行搜尋 if (dtFeatureItem.Rows.Count > 0) { clsHintsDB HintsDB = new clsHintsDB(); string strSQL_QuestionIndex = "SELECT * FROM QuestionIndex AS A INNER JOIN QuestionMode AS B ON A.cQID = B.cQID"; for (int i = 0; i < dtFeatureItem.Rows.Count; i++) { if (i == 0) { strSQL_QuestionIndex += " WHERE "; strSQL_QuestionIndex += " ( "; } else { strSQL_QuestionIndex += " OR "; } //比對上一頁搜尋的結果與資料庫所有的選擇題 strSQL_QuestionIndex += "A.cQID = '" + dtFeatureItem.Rows[i][0].ToString() + "' "; } strSQL_QuestionIndex += ")"; strSQL_QuestionIndex += "AND (B.cQuestionType = '1')"; dtQuestionIndex = HintsDB.getDataSet(strSQL_QuestionIndex).Tables[0]; } return(dtQuestionIndex); }
public string GetPaperAnsProcessID(string strPaperID, string strCaseID) { string strAnsProcessID = ""; string strSQL = ""; clsHintsDB HintsDB = new clsHintsDB(); DataTable dt = new DataTable(); strSQL = "SELECT * FROM AnsProcess_Paper WHERE cCaseID = '" + strCaseID + "' AND cPaperID = '" + strPaperID + "'"; dt = HintsDB.getDataSet(strSQL).Tables[0]; if (dt.Rows.Count > 0) { strAnsProcessID = dt.Rows[0]["cAnsProcessID"].ToString(); } else { strAnsProcessID = "AnsProcess" + DateTime.Now.ToString("yyyyMMddHHmmss"); strSQL = "INSERT INTO AnsProcess_Paper (cAnsProcessID, cCaseID, cPaperID) " + " VALUES ('" + strAnsProcessID + "', '" + strCaseID + "', '" + strPaperID + "')"; HintsDB.ExecuteNonQuery(strSQL); } return(strAnsProcessID); dt.Dispose(); }
protected void Page_Load(object sender, EventArgs e) { Ajax.Utility.RegisterTypeForAjax(typeof(AuthoringTool_CaseEditor_Paper_Paper_AnswerTypeEdit)); getParametor(); lbQuestionClassify.Text = DataReceiver.getQuestionGroupNameByQuestionGroupID(strGroupID); if (!IsPostBack) { //設定預設值 clsHintsDB HintsDB = new clsHintsDB(); string strSQL_Conversation_AnswerType = "SELECT * FROM Conversation_AnswerType " + "WHERE cQuestionClassifyID = '" + Convert.ToInt32(hfGroupSerialNum.Value) + "' ORDER BY cAnswerTypeNum DESC"; DataTable dtConversation_AnswerType = HintsDB.getDataSet(strSQL_Conversation_AnswerType).Tables[0]; if (dtConversation_AnswerType.Rows.Count > 0) { int iAnswerType = Convert.ToInt32(dtConversation_AnswerType.Rows[0]["cAnswerTypeNum"].ToString()); ddlAnswerTypeNum.SelectedValue = iAnswerType.ToString(); hfAnswerTypeNum.Value = iAnswerType.ToString(); //SetAnswerTypeName(iAnswerType); } else { hfAnswerTypeNum.Value = "0"; //SetAnswerTypeName(0); } } SetAnswerTypeName(Convert.ToInt32(hfAnswerTypeNum.Value)); }
protected void Page_Load(object sender, EventArgs e) { Ajax.Utility.RegisterTypeForAjax(typeof(AuthoringTool_CaseEditor_Paper_Paper_SimulatorQE_tree)); clsHintsDB MLASDB = new clsHintsDB(); if (!Page.IsPostBack) { //InitTree(); CreateTree(); //getParameter(); templateTable.Visible = false; if (Request.QueryString["QID"] != null) { hf_QID.Value = Request.QueryString["QID"].ToString(); string strSQL = "SELECT * FROM Question_Simulator WHERE cQID LIKE '" + hf_QID.Value + "'"; DataTable dt_firstTime = MLASDB.getDataSet(strSQL).Tables[0]; hf_DMTID.Value = dt_firstTime.Rows[0]["cSimulatorID"].ToString(); templateTable.Visible = true; Session["Simulator"] = hf_DMTID.Value; imyTreeContainer.Attributes.Add("src", "Paper_SimulatorQuestionEditor.aspx"); } //如果hfQID.Value != "" 就讀取圖片 同時寫入Session["Simulator"] = hf_DMTID.Value;hf_DMTID.Value = QID||| //if (Request.QueryString["GroupID"] != null) // GID = Request.QueryString["GroupID"].ToString(); } }
private DataTable GetKeyword(string strQID) { clsHintsDB sqldb = new clsHintsDB(); string strSQL = "Select * From Paper_TextQuestionKeyword Where cQID = '" + strQID + "' "; DataTable dtTemp = sqldb.getDataSet(strSQL).Tables[0]; return(dtTemp); }
//取得病徵項目 private DataTable DiseaseSymptomsTree_SELECT() { clsHintsDB HintsDB = new clsHintsDB(); DataTable dtDiseaseSymptomsTree = new DataTable(); string strSQL_DiseaseSymptomsTree = "SELECT DISTINCT cNodeName FROM DiseaseSymptomsTree WHERE cParentID != 'Diseaseroot' ORDER BY cNodeName ASC"; dtDiseaseSymptomsTree = HintsDB.getDataSet(strSQL_DiseaseSymptomsTree).Tables[0]; return(dtDiseaseSymptomsTree); }
//根據問題ID取得是否為有題組ID public static DataTable Paper_QuestionSelectionGroupID_SELECT_QID(object strQID) { clsHintsDB HintsDB = new clsHintsDB(); string strSQL_Paper_QuestionSelectionGroupID = "SELECT * FROM Paper_QuestionSelectionGroupID WHERE " + " cQID = '" + strQID + "'"; DataTable dtPaper_QuestionSelectionGroupID = HintsDB.getDataSet(strSQL_Paper_QuestionSelectionGroupID).Tables[0]; return(dtPaper_QuestionSelectionGroupID); }
/// <summary> /// 取得難易度對應的value /// </summary> /// <param name="strQuestionLevel"></param> /// <returns></returns> public static int QuestionLevelName_SELECT_QuestionLevel(string strLevelName) { int iQuestionLevel = 0; clsHintsDB HintsDB = new clsHintsDB(); string strSQL = "SELECT cQuestionLevel FROM QuestionLevelName WHERE cLevelName = '" + strLevelName + "'"; iQuestionLevel = Convert.ToInt16(HintsDB.getDataSet(strSQL).Tables[0].Rows[0]["cQuestionLevel"].ToString()); return(iQuestionLevel); }
public static string QuestionLevelName_SELECT_LevelName(int iQuestionLevel) { string strLevelName = ""; clsHintsDB HintsDB = new clsHintsDB(); string strSQL = "SELECT cLevelName FROM QuestionLevelName WHERE cQuestionLevel = '" + iQuestionLevel + "'"; strLevelName = HintsDB.getDataSet(strSQL).Tables[0].Rows[0]["cLevelName"].ToString(); return(strLevelName); }
//初始化ddlQusetionList protected void setddlQusetionList() { //先將ddlQusetionList物件清空 ddlQusetionList.Items.Clear(); //將物件放入ddlSelectQuestion下拉式選單 DataTable dtSelectQuestion = new DataTable(); string strSQL_SelectQuestion = "SELECT * FROM QuestionList"; dtSelectQuestion = hintsDB.getDataSet(strSQL_SelectQuestion).Tables[0]; for (int i = 0; i < dtSelectQuestion.Rows.Count; i++) { ddlQusetionList.Items.Add(new ListItem(dtSelectQuestion.Rows[i]["qName"].ToString(), dtSelectQuestion.Rows[i]["qId"].ToString())); } }
public DataTable getQuestionGroupNode(object cNodeID, object cParentNodeID, object cNodeType) { DataTable dtResult = new DataTable(); strSQL = "SELECT * FROM QuestionGroupTree WHERE cNodeID LIKE '" + cNodeID + "' AND cParentID LIKE '" + cParentNodeID + "' AND cNodeType LIKE '" + cNodeType + "'"; try { dtResult = hintsDB.getDataSet(strSQL).Tables[0]; } catch { dtResult = new DataTable(); } return(dtResult); }
//取得情境題的GroupID與GroupName 老詹 2013/07/30 private DataTable Situation_SELECT(string situationQID) { DataTable dtQuestionMode = new DataTable(); clsHintsDB HintsDB = new clsHintsDB(); string strSQL_QuestionMode = "SELECT * FROM QuestionMode A,QuestionIndex B,Question_Situational C" + " WHERE (A.cQID=B.cQID) AND (B.cQID=C.cQID) AND (A.cQID = '" + situationQID + "')"; dtQuestionMode = HintsDB.getDataSet(strSQL_QuestionMode).Tables[0]; return(dtQuestionMode); }
//取得問答題的AID 老詹 2013/08/15 private DataTable TextQuestion_Answer(string strQID) { DataTable dtQuestionAnswer_Answer = new DataTable(); clsHintsDB HintsDB = new clsHintsDB(); string strSQL_QuestionMode = "SELECT * FROM QuestionMode A,QuestionIndex B,QuestionAnswer_Answer C" + " WHERE (A.cQID=B.cQID) AND (B.cQID=C.cQID) AND (A.cQID = '" + strQID + "')"; dtQuestionAnswer_Answer = HintsDB.getDataSet(strSQL_QuestionMode).Tables[0]; return(dtQuestionAnswer_Answer); }
//取得問答題 KEYWORD有符合Keyword的問題 private DataTable Paper_TextQuestionKeyword_SELECT_Keyword(string strKeyword) { DataTable dtPaper_TextQuestionKeyword = new DataTable(); clsHintsDB HintsDB = new clsHintsDB(); string strSQL_Paper_TextQuestionKeyword = "SELECT * FROM Paper_TextQuestionKeyword " + "WHERE cKeyword LIKE '%" + strKeyword + "%'"; dtPaper_TextQuestionKeyword = HintsDB.getDataSet(strSQL_Paper_TextQuestionKeyword).Tables[0]; return(dtPaper_TextQuestionKeyword); }
//取得對話題 問題有符合Keyword的問題 private DataTable Conversation_Question_SELECT_Keyword(string strKeyword) { DataTable dtConversation_Question = new DataTable(); clsHintsDB HintsDB = new clsHintsDB(); string strSQL_Conversation_Question = "SELECT * FROM Conversation_Question " + "WHERE cQuestion LIKE '%" + strKeyword + "%' "; dtConversation_Question = HintsDB.getDataSet(strSQL_Conversation_Question).Tables[0]; return(dtConversation_Question); }