-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajax-user.aspx.cs
72 lines (69 loc) · 3.22 KB
/
ajax-user.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Data.SqlClient;
public partial class ajax_user : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if( Request.QueryString["id"] != null )
{
String temp = "";
string id = Request.QueryString["id"].ToString();
string val = Request.Form["keyword"].ToString();
//List<string> PARAM = new List<string>();
//List<string> PARAM_VAL = new List<string>();
//PARAM.Add("@stm"); PARAM_VAL.Add(id);
//PARAM.Add("@val"); PARAM_VAL.Add(val);
//DataSet ds = boDBUtilities.ReturnDataSetByProcedure("SP_SEL_SEARCH", PARAM, PARAM_VAL, dbcls.conc);
string Q = string.Empty;
if(id=="1")
Q = "SELECT TOP 10 appName FROM applicant WHERE appName like '%" + Request.Form["keyword"].ToString() + "%'";
if (id == "2")
{
Q = "SELECT TOP 10 appName from applicant where appId IN(SELECT appId FROM guest WHERE guestName like '%" + Request.Form["keyword"].ToString() + "%')";
}
if(id=="3")
Q = "SELECT TOP 10 org FROM applicant WHERE org like '%" + Request.Form["keyword"].ToString() + "%'";
if(id=="4")
Q = "SELECT TOP 10 contact FROM applicant WHERE contact like '%" + Request.Form["keyword"].ToString() + "%'";
if(id=="5")
Q = "SELECT TOP 10 email FROM applicant WHERE email like '%" + Request.Form["keyword"].ToString() + "%'";
SqlCommand com = new SqlCommand(Q, dbcls.CONN());
SqlDataAdapter ada = new SqlDataAdapter(com);
DataSet ds = new DataSet();
ada.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
{
Response.Write("<li onclick=\"set_item('" + ds.Tables[0].Rows[i][0].ToString() + "');\">" + ds.Tables[0].Rows[i][0].ToString() + "</li>");
}
}
}
//else
//{
// DataSet ds = boDBUtilities.GENERAL_ReturnDataset("SELECT TOP 10 ROLE_NAME FROM MSTR_ROLE WHERE ROLE_NAME like '%" + Request.Form["keyword"].ToString() + "%'", dbcls.conc);
// if (ds.Tables[0].Rows.Count > 0)
// {
// for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
// {
// Response.Write("<li onclick=\"set_item('" + ds.Tables[0].Rows[i][0].ToString() + "');\">" + ds.Tables[0].Rows[i][0].ToString() + "</li>");
// }
// }
//}
}
}
}