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(); }
protected void Page_Load(object sender, EventArgs e) { //測試用 //DIALOG_USER data_User = SQLFunc.Get_DIALOG_USER("1", "Athena", "192.168.7.127", "2017-03-23 14:29:15.647"); //Session["DIALOG_USER"] = data_User; if (!IsPostBack) { txt_Sentence.Attributes.Add("onkeydown", "if(event.keyCode == 13) {document.getElementById('" + btn_Submit.ClientID + "').click(); return false;}"); } if (Session["DIALOG_USER"] == null) { Response.Redirect("Login.aspx"); } else { MotionClass.DIALOG_USER DIALOG_USER = (MotionClass.DIALOG_USER)Session["DIALOG_USER"]; if (Request["DM_ID"] == null) { Response.Redirect("Login.aspx"); } else { string DM_ID = Request["DM_ID"].ToString(); DataTable dt = SQLFunc.Get_DIALOG_MAIN(DM_ID); Page_Bind(dt); ll_Name.Text = DIALOG_USER.U_Name; } } //ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "scrollTo", "window.scrollTo(0,document.body.scrollHeight);alert('aa');", true); }
protected void btn_Save_Click(object sender, EventArgs e) { MotionClass.DIALOG_USER data = null; string now_date = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); string name = txt_Name.Text; if (string.IsNullOrEmpty(name)) { Alert_msg("交出名字,饒你一命"); } else { if (name == "gis@5200") { data = SQLFunc.Get_DIALOG_USER("", "Manager", lb_IP.Text, now_date); Session["DIALOG_USER"] = data; Response.Redirect("~/Page/Summary.aspx"); } else { if (Session["DIALOG_USER"] == null) { data = SQLFunc.Get_DIALOG_USER("", name, lb_IP.Text, now_date); string U_ID = SQLFunc.Add_DIALOG_USER(data); data = SQLFunc.Get_DIALOG_USER(U_ID, name, lb_IP.Text, now_date); Session["DIALOG_USER"] = data; } MotionClass.DIALOG_USER data_USER = (MotionClass.DIALOG_USER)Session["DIALOG_USER"]; MotionClass.DIALOG_MAIN data_Main = SQLFunc.Get_DIALOG_MAIN(data_USER.U_ID, "0", now_date); string DM_ID = SQLFunc.Add_DIALOG_MAIN(data_Main); //string DM_ID = "1"; Response.Redirect("Page/Dialog.aspx?DM_ID=" + DM_ID); } } }