namespace Yw.WinFrmUI
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public partial class GeneralSearchAndExportCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public GeneralSearchAndExportCtrl()
|
{
|
InitializeComponent();
|
this.layoutControl1.SetupLayoutControl();
|
}
|
|
/// <summary>
|
/// 搜索
|
/// </summary>
|
public event Action SearchEvent;
|
|
/// <summary>
|
/// 清空
|
/// </summary>
|
public event Action ClearEvent;
|
|
/// <summary>
|
/// 导出
|
/// </summary>
|
public event Action ExportEvent;
|
|
|
|
//搜索 清空
|
private void buttonEditSearch_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
|
{
|
var tag_obj = e.Button.Tag;
|
if (tag_obj is string tag)
|
{
|
SetClickEvent(tag);
|
}
|
|
}
|
|
//设置
|
private void buttonEditSet_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
|
{
|
var tag_obj = e.Button.Tag;
|
if (tag_obj is string tag)
|
{
|
SetClickEvent(tag);
|
}
|
}
|
|
//点击
|
private void SetClickEvent(string tag)
|
{
|
switch (tag)
|
{
|
case "Search":
|
{
|
this.SearchEvent?.Invoke();
|
}
|
break;
|
case "Clear":
|
{
|
this.ClearEvent?.Invoke();
|
}
|
break;
|
case "Export":
|
{
|
this.ExportEvent?.Invoke();
|
}
|
break;
|
default: break;
|
}
|
}
|
|
|
}
|
}
|