113 lines
4.7 KiB
C#
113 lines
4.7 KiB
C#
using Api.Framework;
|
|
using Api.Framework.Enums;
|
|
using Api.Framework.Tools;
|
|
using DevExpress.XtraEditors;
|
|
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace FLSystem.Forms
|
|
{
|
|
public partial class item_query_hist_control : DevExpress.XtraEditors.XtraUserControl
|
|
{
|
|
class view_item_query_hist
|
|
{
|
|
public long id { get; set; }
|
|
public string username { get; set; }
|
|
public string usernick { get; set; }
|
|
|
|
public CpsType cps_type { get; set; }
|
|
|
|
public string item_id { get; set; }
|
|
|
|
public string title { get; set; }
|
|
|
|
public string adzoneid { get; set; }
|
|
|
|
public DateTime crt_time { get; set; }
|
|
|
|
public string groupid { get; set; }
|
|
|
|
}
|
|
public item_query_hist_control()
|
|
{
|
|
InitializeComponent();
|
|
this.dateTimePicker1.Text = DateTime.Now.ToString("yyyy-MM-dd 00:00:00");
|
|
this.dateTimePicker2.Text = DateTime.Now.ToString();
|
|
}
|
|
|
|
private void simpleButton1_Click(object sender, EventArgs e)
|
|
{
|
|
this.pageControl1.Go(sender, e);
|
|
}
|
|
|
|
private void item_query_hist_control_Load(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.pageControl1.Bind(delegate (int page, int pagesize)
|
|
{
|
|
var session = ApiClient.GetSession();
|
|
var map = session.NewParamMap();
|
|
string where = string.Empty;
|
|
if (!string.IsNullOrEmpty(this.textEdit1.Text))
|
|
{
|
|
switch (this.comboBoxEdit1.Text)
|
|
{
|
|
case "商品编号":
|
|
where = " and q.itemid = @itemid";
|
|
map.setParameter("itemid", this.textEdit1.Text);
|
|
break;
|
|
case "商品标题":
|
|
where = " and q.title like @title";
|
|
map.setParameter("title", "%" + this.textEdit1.Text + "%");
|
|
break;
|
|
case "客户编号":
|
|
where = " and u.id=@id";
|
|
map.setParameter("id", this.textEdit1.Text);
|
|
break;
|
|
case "客户昵称":
|
|
where = " and u.usernick like @usernick";
|
|
map.setParameter("usernick", "%" + this.textEdit1.Text + "%");
|
|
break;
|
|
case "客户账号":
|
|
where = " and u.username like @username";
|
|
map.setParameter("username", "%" + this.textEdit1.Text + "%");
|
|
break;
|
|
case "群号":
|
|
where = " and q.groupid like @groupid";
|
|
map.setParameter("groupid", "%" + this.textEdit1.Text + "%");
|
|
break;
|
|
case "推广位ID":
|
|
where = " and q.adzoneid like @adzoneid";
|
|
map.setParameter("adzoneid", "%" + this.textEdit1.Text + "%");
|
|
break;
|
|
}
|
|
}
|
|
map.setOrderFields("q.crt_time", true);
|
|
map.setPageParamters(page, pagesize);
|
|
map.setParameter("crt_time", this.dateTimePicker1.Text);
|
|
map.setParameter("end_time", this.dateTimePicker2.Text);
|
|
var result = session.FindPage<view_item_query_hist>("select q.id,u.username,u.usernick,q.type cps_type,q.groupid,q.itemid item_id,q.title,q.crt_time,q.adzoneid from fl_query_hist q left join fl_member_info u on q.userid=u.id where q.crt_time > @crt_time and q.crt_time<@end_time " + where, map);
|
|
return new UI.Framework.Controls.PageControl.SerchResult() { Result = result.DataList, Total = result.Total };
|
|
|
|
}, this.gridControl1, 40, true, true);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
XtraMessageBox.Show($"{ex.Message} - {ex.StackTrace}", "温馨提示", MessageBoxButtons.OK);
|
|
|
|
}
|
|
}
|
|
|
|
private void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
if (comboBoxEdit1.SelectedIndex == 0)
|
|
{
|
|
this.textEdit1.Enabled = false;
|
|
this.textEdit1.Text = "";
|
|
}
|
|
else this.textEdit1.Enabled = true;
|
|
}
|
|
}
|
|
}
|