コード例 #1
0
    protected void btn_Submit_Click(object sender, EventArgs e)
    {
        //測試用
        //txt_Sentence.Text = "我相信已有不少台中市民反應過這個問題。";

        string sentence = txt_Sentence.Text;
        string DM_ID    = hid_DM_ID.Value;
        string now_date = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");

        if (!string.IsNullOrEmpty(sentence))
        {
            dialogHelper.Get_Dialog_Detail(DM_ID, sentence, now_date);
        }

        JiebaExecute jiebaExecute = new JiebaExecute();

        jiebaExecute.Get_Dialog_Detail_to_Jieba(DM_ID);

        DataTable dt = SQLFunc.Get_DIALOG_MAIN(DM_ID);

        Page_Bind(dt);

        txt_Sentence.Text = "";
        lv_Dialog.DataBind();
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable    dt           = SQLFunc.Get_FB_Message_List("0");
        JiebaExecute jiebaExecute = new JiebaExecute();

        string DM_ID    = "1";
        string now_date = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            string sentence = jiebaExecute.MakePlainText(dt.Rows[i]["Message"].ToString());
            string id       = dt.Rows[i]["id"].ToString();

            dialogHelper.Get_Dialog_Detail(DM_ID, sentence, now_date);

            jiebaExecute.Get_Dialog_Detail_to_Jieba(DM_ID);

            SQLFunc.Update_FB_Message_Dialog_Chk(id);
        }
    }