/
JDSearch.cs
74 lines (70 loc) · 2.32 KB
/
JDSearch.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
73
74
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using SelectDemo.Layouts;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace SelectDemo.Forms
{
partial class JDSearch : Smobiler.Core.Controls.MobileForm
{
public JDSearch() : base()
{
//This call is required by the SmobilerForm.
InitializeComponent();
}
private DBClass dBClass=new DBClass();
private void imageButton1_Press(object sender, EventArgs e)
{
this.Close();
}
private void JDSearch_Load(object sender, EventArgs e)
{
}
/// <summary>
/// 搜索框点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void panel2_Press(object sender, EventArgs e)
{
ShowJDLayout();
}
private void ShowJDLayout()
{
//筛选项数据
SelectData d1 = new SelectData()
{
title = "搜索历史",
items = new String[] { "苹果", "香瓜", "玻璃", "红酒", "锁" },
ishow = true
};
SelectData d2 = new SelectData()
{
title = "搜索发现",
items = new String[] { "智利干露", "自行车", "进口红酒", "纸巾小包", "笔记本电脑包" },
ishow = false
};
List<SelectData> sds = new List<SelectData>();
sds.Add(d1);
sds.Add(d2);
//弹出JDLayout
JDLayout uc = new JDLayout (sds,keyLab.Text);
DialogOptions footerDialogOptions;
footerDialogOptions = new DialogOptions(LayoutJustifyAlign.FlexStart, System.Drawing.Color.Transparent, Smobiler.Core.Controls.Padding.Empty, true);
ShowDialog(uc, footerDialogOptions,(obj,args)=>
{
if (uc.ShowResult == ShowResult.Yes)
{
keyLab.Text = uc.currentkey;
DataTable dt = dBClass.DbConnectAndQuert(uc.querystr);
listView1.Rows.Clear();
listView1.DataSource = dt;
listView1.DataBind();
}
});
}
}
}