private void StartGetSignal() //start getting signal without click { timerDrawSignal.Start(); //start timer Graph1D.f_ClearAllPix(); Graph1D.f_reXY(); Graph1D.f_LoadOnePix(ref x1, ref y1, Color.Red, 2); }
protected Graph1D SelectDataGrapg1D(string id, string readable, string rich, string timely, string url, string name) { Graph1D sel; sel = new Graph1D(); if (CheckBoxList1.Items[0].Selected == true) { sel.id = int.Parse(id); sel.x = float.Parse(readable); } else if (CheckBoxList1.Items[1].Selected == true) { sel.id = int.Parse(id); sel.x = float.Parse(rich); } else if (CheckBoxList1.Items[2].Selected == true) { sel.id = int.Parse(id); sel.x = float.Parse(timely); } sel.y = 0.02F; sel.url = url; sel.name = name.Replace("\"", " "); return(sel); }
private const double baseLine = 1.4; //loop baseline voltage=1.4v private void timerDrawSignal_Tick(object sender, EventArgs e) //start timer and draw { double analogDataIn = analogIn1() + baseLine; txtAnalogIn.Text = analogDataIn.ToString();//display in textbox x1.Add(DrawSingalIndex); y1.Add((float)analogDataIn); DrawSingalIndex = (float)(DrawSingalIndex + 0.25); //for each count the x add 0.1 Graph1D.f_Refresh(); //sampling }
/*******************************************************************************************************************/ private void StartGetSignal() //start getting signal without click { timerDrawSignal.Start(); //start timer Graph1D.f_ClearAllPix(); Graph1D.f_reXY(); Graph1D.f_LoadOnePix(ref x1, ref y1, Color.Red, 2); if (heartcuttingNumber > 0) { Graph1D.f_AddPix(ref x4, ref y4, Color.Blue, 2); } }
private void StartGetSignal() //start getting signal without click { timerDraw.Start(); //start timer Graph1D.f_ClearAllPix(); TempGraph.f_ClearAllPix(); Graph1D.f_reXY(); TempGraph.f_reXY(); Graph1D.f_LoadOnePix(ref x1, ref y1, Color.Red, 2); TempGraph.f_LoadOnePix(ref x2, ref y2, Color.Red, 2); TempGraph.f_AddPix(ref x3, ref y3, Color.Blue, 2); }
/*******************************************************************************************************************/ private void btnGetAnalogIn_Click(object sender, EventArgs e) //start the timer when click the button { timerDraw.Start(); //start timer Graph1D.f_ClearAllPix(); TempGraph.f_ClearAllPix(); Graph1D.f_reXY(); TempGraph.f_reXY(); Graph1D.f_LoadOnePix(ref x1, ref y1, Color.Red, 2); TempGraph.f_LoadOnePix(ref x2, ref y2, Color.Red, 2); TempGraph.f_AddPix(ref x3, ref y3, Color.Blue, 2); }
private const double baseLine = 1.4; //loop baseline voltage=1.4v private void timerDraw_Tick(object sender, EventArgs e) //start timer and draw { double analogDataIn = analogIn1() + baseLine; //double setTemp = tempFunction(25, 10, 10, 10); double setTemp = 0; double actualTemp = analogIn2() * 175000 / 7 + 35000; //thermal couple:25C voltage=0mv, 200C voltage=7mv txtAnalogIn.Text = analogDataIn.ToString(); //display in textbox x1.Add(timerDrawI); y1.Add((float)analogDataIn); x2.Add(timerDrawI); y2.Add((float)setTemp); x3.Add(timerDrawI); y3.Add((float)actualTemp); timerDrawI = (float)(timerDrawI + 0.25); //for each count the x add 0.1 Graph1D.f_Refresh(); //sampling TempGraph.f_Refresh(); }
private const double baseLine = 1.4; //loop baseline voltage=1.4v private void timerDrawSignal_Tick(object sender, EventArgs e) //start timer and draw { double analogDataIn = analogIn1() + baseLine; double analogDataIn2 = analogIn3() + baseLine; x1.Add(DrawSingalIndex); y1.Add((float)analogDataIn); if (heartcuttingNumber > 0) { x4.Add(DrawSingalIndex); y4.Add((float)analogDataIn2); //file.WriteLine(DrawSingalIndex.ToString() + " " + analogDataIn.ToString() + " " + analogDataIn2.ToString()); } else { //file.WriteLine(DrawSingalIndex.ToString() + " " + analogDataIn.ToString()); } DrawSingalIndex = (float)(DrawSingalIndex + 0.25); //for each count the x add 0.1 Graph1D.f_Refresh(); //sampling }
private void overallStart_Click(object sender, EventArgs e) { x1.Clear(); x2.Clear(); x3.Clear(); x4.Clear(); y1.Clear(); y2.Clear(); y3.Clear(); y4.Clear(); initial_set_Ports_Low(); DrawSingalIndex = 0; DrawTempIndex = 0; SignalOnFlag = 0; heartcuttingNumber = 0; heartcuttingflag = 0; Graph1D.f_ClearAllPix(); TempGraph.f_ClearAllPix(); Graph1D.f_reXY(); TempGraph.f_reXY(); timerMenu.Start(); StartGetTemp(); startTime = System.DateTime.Now; //ports control pumpingTvalue = float.Parse(pumpingTime.Text); //s waitingTvalue = float.Parse(waitingTime.Text); //s preconHighTvalue = float.Parse(preconHighTime.Text); //s preconLowTvalue = float.Parse(preconLowTime.Text); //s lowestTempvalue = float.Parse(lowestTemp.Text); //C lowestTvalue = float.Parse(lowestHold.Text) * 60; //s HighestTempvalue = float.Parse(highestTemp.Text); //C HighestTvalue = float.Parse(highestHold.Text) * 60; //s RampSpeedvalue = float.Parse(rampSpeed.Text) / 60; //c/s analysisTotalT = lowestTvalue + HighestTvalue + (HighestTempvalue - lowestTempvalue) / RampSpeedvalue; //s cleaningPvalue = float.Parse(cleaningPreconTime.Text); //s cleaningTvalue = float.Parse(cleaningTotalTime.Text) * 60; //s if (Start1.Text != "" && End1.Text != "") { if (float.Parse(Start1.Text) > float.Parse(End1.Text)) { EndBeforeStartError(); } else { heartcuttingStartList[1] = float.Parse(Start1.Text); //s heartcuttingEndList[1] = float.Parse(End1.Text); //s heartcuttingNumber++; } } if (Start2.Text != "" && End2.Text != "") { if (float.Parse(Start2.Text) > float.Parse(End2.Text)) { EndBeforeStartError(); } else if (heartcuttingNumber != 1) { EmptyBetweenError(); } else if (float.Parse(Start2.Text) < heartcuttingEndList[1] + preconHighTvalue + preconLowTvalue) { TooCloseError(); } else { heartcuttingStartList[2] = float.Parse(Start2.Text); //s heartcuttingEndList[2] = float.Parse(End2.Text); //s heartcuttingNumber++; } } if (Start3.Text != "" && End3.Text != "") { if (float.Parse(Start3.Text) > float.Parse(End3.Text)) { EndBeforeStartError(); } else if (heartcuttingNumber != 2) { EmptyBetweenError(); } else if (float.Parse(Start3.Text) < heartcuttingEndList[2] + preconHighTvalue + preconLowTvalue) { TooCloseError(); } else { heartcuttingStartList[3] = float.Parse(Start3.Text); //s heartcuttingEndList[3] = float.Parse(End3.Text); //s heartcuttingNumber++; } } if (Start4.Text != "" && End4.Text != "") { if (float.Parse(Start4.Text) > float.Parse(End4.Text)) { EndBeforeStartError(); } else if (heartcuttingNumber != 3) { EmptyBetweenError(); } else if (float.Parse(Start4.Text) < heartcuttingEndList[3] + preconHighTvalue + preconLowTvalue) { TooCloseError(); } else { heartcuttingStartList[4] = float.Parse(Start4.Text); //s heartcuttingEndList[4] = float.Parse(End4.Text); //s heartcuttingNumber++; } } if (Start5.Text != "" && End5.Text != "") { if (float.Parse(Start5.Text) > float.Parse(End5.Text)) { EndBeforeStartError(); } else if (heartcuttingNumber != 4) { EmptyBetweenError(); } else if (float.Parse(Start5.Text) < heartcuttingEndList[4] + preconHighTvalue + preconLowTvalue) { TooCloseError(); } else { heartcuttingStartList[5] = float.Parse(Start5.Text); //s heartcuttingEndList[5] = float.Parse(End5.Text); //s heartcuttingNumber++; } } if (ExperienceName.Text == "") { timerMenu.Stop(); timerDrawSignal.Stop(); timerDrawTemp.Stop(); MessageBox.Show("Experience Name cannot be empty.", "Heartcutting Input Error"); } else { ExperienceNamevalue = ExperienceName.Text; file = new System.IO.StreamWriter(@"C:\Users\Nanova\Documents\Software\GC\c#\TestOutputs\" + ExperienceNamevalue + ".dat"); } }
/*******************************************************************************************************************/ private void overallStart_Click(object sender, EventArgs e) { x1.Clear(); x2.Clear(); x3.Clear(); y1.Clear(); y2.Clear(); y3.Clear(); initial_set_Ports_Low(); DrawSingalIndex = 0; DrawTempIndex = 0; SignalOnFlag = 0; heartcuttingNumber = 0; Graph1D.f_ClearAllPix(); TempGraph.f_ClearAllPix(); Graph1D.f_reXY(); TempGraph.f_reXY(); timerMenu.Start(); StartGetTemp(); startTime = System.DateTime.Now; //ports control pumpingTvalue = float.Parse(pumpingTime.Text); //s waitingTvalue = float.Parse(waitingTime.Text); //s preconHighTvalue = float.Parse(preconHighTime.Text); //s preconLowTvalue = float.Parse(preconLowTime.Text); //s lowestTempvalue = float.Parse(lowestTemp.Text); //C lowestTvalue = float.Parse(lowestHold.Text) * 60; //s HighestTempvalue = float.Parse(highestTemp.Text); //C HighestTvalue = float.Parse(highestHold.Text) * 60; //s RampSpeedvalue = float.Parse(rampSpeed.Text) / 60; //c/s analysisTotalT = lowestTvalue + HighestTvalue + (HighestTempvalue - lowestTempvalue) / RampSpeedvalue; //s cleaningPvalue = float.Parse(cleaningPreconTime.Text); //s cleaningTvalue = float.Parse(cleaningTotalTime.Text) * 60; //s if (Start1.Text != "" && float.Parse(Start1.Text) < float.Parse(End1.Text)) { heartcuttingStartList[1] = float.Parse(Start1.Text); //s heartcuttingEndList[1] = float.Parse(End1.Text); //s heartcuttingNumber++; } if (Start2.Text != "" && float.Parse(Start2.Text) > heartcuttingEndList[1] && float.Parse(Start2.Text) < float.Parse(End2.Text)) { heartcuttingStartList[2] = float.Parse(Start2.Text); //s heartcuttingEndList[2] = float.Parse(End2.Text); //s heartcuttingNumber++; } if (Start3.Text != "" && float.Parse(Start3.Text) > heartcuttingEndList[2] && float.Parse(Start3.Text) < float.Parse(End3.Text)) { heartcuttingStartList[3] = float.Parse(Start3.Text); //s heartcuttingEndList[3] = float.Parse(End3.Text); //s heartcuttingNumber++; } if (Start4.Text != "" && float.Parse(Start4.Text) > heartcuttingEndList[3] && float.Parse(Start4.Text) < float.Parse(End4.Text)) { heartcuttingStartList[4] = float.Parse(Start4.Text); //s heartcuttingEndList[4] = float.Parse(End4.Text); //s heartcuttingNumber++; } if (Start5.Text != "" && float.Parse(Start5.Text) > heartcuttingEndList[4] && float.Parse(Start5.Text) < float.Parse(End5.Text)) { heartcuttingStartList[5] = float.Parse(Start5.Text); //s heartcuttingEndList[5] = float.Parse(End5.Text); //s heartcuttingNumber++; } }
protected void Button1_Click(object sender, EventArgs e) { if (CheckBox1.Checked == true) { if (DropDownList1.SelectedIndex == 0) { Response.Write("<script language=javascript>alert('請選擇年分');</" + "script>"); } else if (DropDownList2.SelectedIndex == 0) { Response.Write("<script language=javascript>alert('請選擇月分');</" + "script>"); } } string ser = TextBox1.Text; string xv = "", yv = "", zv = ""; int count = 0; if (ser != "") { for (int i = 0; i < 3; i++) { if (CheckBoxList1.Items[i].Selected == true) { count++; } else { a = i; } } string dbhost = "203.64.84.94"; string dbuser = "******"; string dbpass = "******"; string dbtable = "project105"; string connstr = "server=" + dbhost + ";uid=" + dbuser + ";pwd=" + dbpass + ";database=" + dbtable; MySqlConnection conn = new MySqlConnection(connstr); MySqlCommand comm = conn.CreateCommand(); String cmdText = "SELECT id,readable,rich,timely,name,url,date FROM disease_t WHERE Name LIKE '%" + ser + "%'"; if (count == 1) { if (CheckBoxList1.Items[0].Selected == true) { xv = "可讀度"; } else if (CheckBoxList1.Items[1].Selected == true) { xv = "豐富度"; } else if (CheckBoxList1.Items[2].Selected == true) { xv = "即時度"; } Graph1D sel; List <Graph1D> tem = new List <Graph1D>(); //String cmdText = "SELECT ID,Readable,Trust,Rich,Timly,Name,Url FROM diseaseheart_t WHERE Name LIKE '%" + ser + "%'"; conn.Open(); MySqlCommand cmd = new MySqlCommand(cmdText, conn); MySqlDataReader reader = cmd.ExecuteReader(); int a1 = 0; if (reader.HasRows) { while (reader.Read()) { a1 = 0; if (CheckBox1.Checked == true) { if (DropDownList1.SelectedIndex != 0) { if (DropDownList2.SelectedIndex != 0) { if (search_time(reader.GetString(6))) { if (CheckBox2.Checked == true && a1 == 0) { if (search_school(reader.GetString(5))) { sel = SelectDataGrapg1D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox3.Checked == true && a1 == 0) { if (search_hostpital(reader.GetString(5))) { sel = SelectDataGrapg1D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox4.Checked == true && a1 == 0) { if (search_research(reader.GetString(5))) { sel = SelectDataGrapg1D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox2.Checked == false && CheckBox3.Checked == false && CheckBox4.Checked == false && a1 == 0) { sel = SelectDataGrapg1D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } } } } if (CheckBox1.Checked == false && CheckBox2.Checked == true && a1 == 0) { if (search_school(reader.GetString(5))) { sel = SelectDataGrapg1D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox1.Checked == false && CheckBox3.Checked == true && a1 == 0) { if (search_hostpital(reader.GetString(5))) { sel = SelectDataGrapg1D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox1.Checked == false && CheckBox4.Checked == true && a1 == 0) { if (search_research(reader.GetString(5))) { sel = SelectDataGrapg1D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox1.Checked == false && CheckBox2.Checked == false && CheckBox3.Checked == false && CheckBox4.Checked == false && a1 == 0) { sel = SelectDataGrapg1D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } sel = new Graph1D(); //if (CheckBoxList1.Items[0].Selected == true) //{ // xv = "可讀度"; //} //else if (CheckBoxList1.Items[1].Selected == true) //{ // xv = "豐富度"; //} //else if (CheckBoxList1.Items[2].Selected == true) //{ // xv = "即時度"; //} } reader.Close(); conn.Close(); if (tem.Count != 0) { ScriptManager.RegisterStartupScript(this, GetType(), "graph1", "graph1('" + xv + "','" + yv + "','" + JsonConvert.SerializeObject(tem) + "')", true); } } else { divProgress.Style["display"] = "inline"; cr_google(ser); divProgress.Style["display"] = "none"; Button1_Click(sender, e); } } else if (count == 2) { int a1 = 0; Graph2D sel; List <Graph2D> tem = new List <Graph2D>(); int num = 0; conn.Open(); MySqlCommand cmd = new MySqlCommand(cmdText, conn); MySqlDataReader reader = cmd.ExecuteReader(); if (a == 0) { xv = "豐富度"; yv = "即時度"; } else if (a == 1) { xv = "可讀度"; yv = "即時度"; } else if (a == 2) { xv = "可讀度"; yv = "豐富度"; } if (reader.HasRows) { while (reader.Read()) { a1 = 0; num++; //if (num > 55) //{ // break; //} if (CheckBox1.Checked == true) { if (DropDownList1.SelectedIndex != 0) { if (DropDownList2.SelectedIndex != 0) { if (search_time(reader.GetString(6))) { if (CheckBox2.Checked == true && a1 == 0) { if (search_school(reader.GetString(5))) { sel = SelectDataGrapg2D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox3.Checked == true && a1 == 0) { if (search_hostpital(reader.GetString(5))) { sel = SelectDataGrapg2D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox4.Checked == true && a1 == 0) { if (search_research(reader.GetString(5))) { sel = SelectDataGrapg2D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox2.Checked == false && CheckBox3.Checked == false && CheckBox4.Checked == false && a1 == 0) { sel = SelectDataGrapg2D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } } } } if (CheckBox1.Checked == false && CheckBox2.Checked == true && a1 == 0) { if (search_school(reader.GetString(5))) { sel = SelectDataGrapg2D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox1.Checked == false && CheckBox3.Checked == true && a1 == 0) { if (search_hostpital(reader.GetString(5))) { sel = SelectDataGrapg2D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox1.Checked == false && CheckBox4.Checked == true && a1 == 0) { if (search_research(reader.GetString(5))) { sel = SelectDataGrapg2D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox1.Checked == false && CheckBox2.Checked == false && CheckBox3.Checked == false && CheckBox4.Checked == false && a1 == 0) { sel = SelectDataGrapg2D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } reader.Close(); conn.Close(); if (tem.Count != 0) { ScriptManager.RegisterStartupScript(this, GetType(), "graph2", "graph2('" + xv + "','" + yv + "',' " + JsonConvert.SerializeObject(tem) + "')", true); } } else { divProgress.Style["display"] = "inline"; cr_google(ser); divProgress.Style["display"] = "none"; Button1_Click(sender, e); } } else if (count == 3) { xv = "可讀度"; yv = "豐富度"; zv = "即時度"; int serchco = 0; Graph3D sel; List <Graph3D> tem = new List <Graph3D>(); conn.Open(); MySqlCommand cmd = new MySqlCommand(cmdText, conn); MySqlDataReader reader = cmd.ExecuteReader(); int a1 = 0; if (reader.HasRows) { while (reader.Read()) { a1 = 0; serchco++; //if (serchco > 50) //{ // break; //} if (CheckBox1.Checked == true && a1 == 0) { if (DropDownList1.SelectedIndex != 0) { if (search_time(reader.GetString(6))) { if (CheckBox2.Checked == true && a1 == 0) { if (search_school(reader.GetString(5))) { sel = SelectDataGrapg3D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox3.Checked == true && a1 == 0) { if (search_hostpital(reader.GetString(5))) { sel = SelectDataGrapg3D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox4.Checked == true && a1 == 0) { if (search_research(reader.GetString(5))) { sel = SelectDataGrapg3D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox2.Checked == false && CheckBox3.Checked == false && CheckBox4.Checked == false && a1 == 0) { sel = SelectDataGrapg3D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } } } if (CheckBox1.Checked == false && CheckBox2.Checked == true && a1 == 0) { if (search_school(reader.GetString(5))) { sel = SelectDataGrapg3D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox1.Checked == false && CheckBox3.Checked == true && a1 == 0) { if (search_hostpital(reader.GetString(5))) { sel = SelectDataGrapg3D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox1.Checked == false && CheckBox4.Checked == true && a1 == 0) { if (search_research(reader.GetString(5))) { sel = SelectDataGrapg3D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } if (CheckBox1.Checked == false && CheckBox2.Checked == false && CheckBox3.Checked == false && CheckBox4.Checked == false && a1 == 0) { sel = SelectDataGrapg3D(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(5), reader.GetString(4)); tem.Add(sel); a1 = 1; } } reader.Close(); conn.Close(); if (tem.Count != 0) { ScriptManager.RegisterStartupScript(this, GetType(), "graph3", "graph3('" + xv + "','" + yv + "',' " + zv + "','" + JsonConvert.SerializeObject(tem) + "')", true); } } else { divProgress.Style["display"] = "block"; cr_google(ser); divProgress.Style["display"] = "none"; Button1_Click(sender, e); } } else { string str = "請選擇一個"; ScriptManager.RegisterStartupScript(this, GetType(), "alertshow", "alertshow('" + str + "')", true); } } else { string str = "請輸入關鍵字"; ScriptManager.RegisterStartupScript(this, GetType(), "alertshow", "alertshow('" + str + "')", true); } }