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 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 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)); }
//取得選擇題有符合特徵值的問題 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); }
/// <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); }
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 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 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); } }
//返回後仍要判斷職業 老詹 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>"); }
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> /// 儲存一筆資料至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 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(); } }
/// <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); }
/// <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); }
private void ImgB_DeleteExCorrectsentence_Click(object sender, EventArgs e) { clsHintsDB hintsDB = new clsHintsDB(); string strDeleteAudioSQL = "UPDATE Conversation_Question SET cAudioID = '" + null + "' WHERE cQID='" + strQID + "'"; hintsDB.ExecuteNonQuery(strDeleteAudioSQL); CheckAudioID(); }
/// <summary> /// 刪除特定的答案 /// </summary> /// <param name="strQID"></param> /// <param name="strAID"></param> public static void Conversation_Answer_DELETE_AssignedAnswer(string strQID, string strAID) { string strSQLDelete = ""; clsHintsDB HintsDB = new clsHintsDB(); strSQLDelete = "Delete From Conversation_Answer Where cQID = '" + strQID + "' AND cAID = '" + strAID + "'"; HintsDB.ExecuteNonQuery(strSQLDelete); }
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); }
//根據問題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); }
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); }
/// <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 void ItemForConversation_INSERT_CaseQuestion(string CaseID, int ClinicNumber, string SectionName, string cQID, string cAID, string strQuestionGroupID) { clsHintsDB database = new clsHintsDB(); string sql = "INSERT INTO ItemForConversation (cCaseID,sClinicNum,cSectionName,cQID,cAID,cQuestionGroupID) VALUES('" + CaseID + "'," + ClinicNumber + ",'" + SectionName + "','" + cQID + "','" + cAID + "', '" + strQuestionGroupID + "') "; database.ExecuteNonQuery(sql); }
//取得病徵項目 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); }
//取得情境題的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); }
//根據問卷ID與題組問題的順序取得問題的資料 public static DataTable Paper_Content_SELECT(object strPaperID, object sSeq) { DataTable dtPaper_Content = new DataTable(); clsHintsDB HintsDB = new clsHintsDB(); string strSQL_Paper_Content = "SELECT * FROM Paper_Content WHERE cPaperID = '" + strPaperID + "' AND sSeq = '" + sSeq + "' "; dtPaper_Content = HintsDB.getDataSet(strSQL_Paper_Content).Tables[0]; return(dtPaper_Content); }
//取得問答題的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); }
//根據題組ID與題組中相關問題順序取得問題資料 public static DataTable Paper_QuestionSelectionGroupItem_SELECT_QuestionGroupQID(object strQuestionGroupID, object strQuestionGroupSeq) { clsHintsDB HintsDB = new clsHintsDB(); DataTable dtPaper_QuestionSelectionGroupItem = new DataTable(); string strSQL_Paper_QuestionSelectionGroupItem = "SELECT * FROM Paper_QuestionSelectionGroupItem " + "WHERE cGroupID = '" + strQuestionGroupID + "' AND cSequence = '" + strQuestionGroupSeq + "'"; dtPaper_QuestionSelectionGroupItem = HintsDB.getDataSet(strSQL_Paper_QuestionSelectionGroupItem).Tables[0]; return(dtPaper_QuestionSelectionGroupItem); }
//刪除 老詹 2014/11/02 protected void GV_AnswerContent_RowDeleting(object sender, GridViewDeleteEventArgs e) { string sAnswerContent = ((Label)this.GV_AnswerContent.Rows[e.RowIndex].FindControl("LbAns")).Text.Trim(); clsHintsDB myDB = new clsHintsDB(); string strSQL = "DELETE FROM StudentAnsType WHERE cAnswerContent = '" + sAnswerContent + "'"; myDB.ExecuteNonQuery(strSQL); BindData(); }
protected void Btn_back_Click(object sender, EventArgs e) { //刪除q_s_a中的記錄 string strSQL = "DELETE Question_Simulator_ans WHERE cQuestion_simulator_ID LIKE '" + hf_QID.Value + "'"; clsHintsDB MLASDB = new clsHintsDB(); MLASDB.ExecuteNonQuery(strSQL); //go back last step Response.Redirect("Paper_SimulatorQuestionEditor2.aspx?cImg=" + hf_img.Value + "&Title=" + hf_Title.Value + "&QID=" + hf_QID.Value + ""); }