-
Notifications
You must be signed in to change notification settings - Fork 0
/
SearchInfo.aspx.cs
46 lines (44 loc) · 2.77 KB
/
SearchInfo.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class SearchInfo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
gvEditInfo.DataSource = DB.ExecuteReader("select PersonID,Name AS [نام],Family AS [نام خانوادگی],CaseNumber AS [شماره پرونده],PersonelNumber AS [شماره کارمندی], MelliCode AS [کد ملی] from Person order by family");
gvEditInfo.DataBind();
}
protected void btnSearch_Click(object sender, EventArgs e)
{
if (txtSearch.Text != "")
{
string State = ddlSearch.SelectedValue;
Dictionary<string, object> param = new Dictionary<string, object>();
param.Add("@entry", txtSearch.Text);
switch (State)
{
case "1": gvEditInfo.DataSource = DB.ExecuteReader("select PersonID,Name AS [نام],Family AS [نام خانوادگی],CaseNumber AS [شماره پرونده],PersonelNumber AS [شماره کارمندی], MelliCode AS [کد ملی] from Person where CaseNumber=@entry", param); break;
case "2": gvEditInfo.DataSource = DB.ExecuteReader("select PersonID,Name AS [نام],Family AS [نام خانوادگی],CaseNumber AS [شماره پرونده],PersonelNumber AS [شماره کارمندی], MelliCode AS [کد ملی] from Person where PersonelNumber=@entry", param); break;
case "3": gvEditInfo.DataSource = DB.ExecuteReader("select PersonID,Name AS [نام],Family AS [نام خانوادگی],CaseNumber AS [شماره پرونده],PersonelNumber AS [شماره کارمندی], MelliCode AS [کد ملی] from Person where MelliCode=@entry", param); break;
case "4": gvEditInfo.DataSource = DB.ExecuteReader("select PersonID,Name AS [نام],Family AS [نام خانوادگی],CaseNumber AS [شماره پرونده],PersonelNumber AS [شماره کارمندی], MelliCode AS [کد ملی] from Person where Family Like @entry", param); break;
}
gvEditInfo.DataBind();
}
else
{
gvEditInfo.DataSource = DB.ExecuteReader("select PersonID,Name AS [نام],Family AS [نام خانوادگی],CaseNumber AS [شماره پرونده],PersonelNumber AS [شماره کارمندی], MelliCode AS [کد ملی] from Person order by family");
gvEditInfo.DataBind();
}
}
protected void imgbExit_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Home.aspx");
}
protected void imgbHome_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Home.aspx");
}
}