94 lines
3.2 KiB
C#
94 lines
3.2 KiB
C#
using Api.Framework;
|
|
using Api.Framework.Model;
|
|
using Api.Framework.Tools;
|
|
using DevExpress.XtraEditors;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Windows.Forms;
|
|
using UI.Framework.Forms;
|
|
|
|
namespace FLSystem.Forms
|
|
{
|
|
public partial class MemberForm : BaseForm
|
|
{
|
|
public MemberForm()
|
|
{
|
|
InitializeComponent();
|
|
|
|
#region 增加所有的机器人账号
|
|
this.comboBoxEdit3.Properties.Items.Clear();
|
|
var weixinBases = Chat.Framework.ChatClient.WXClient.Values.ToList();
|
|
var objList = new List<object>() { "全部平台" };
|
|
foreach (var item in weixinBases)
|
|
{
|
|
objList.Add(item.WeixinHao);
|
|
}
|
|
this.comboBoxEdit3.Properties.Items.AddRange(objList);
|
|
#endregion
|
|
|
|
}
|
|
|
|
private void MemberForm_Load(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.pageControl1.Bind(delegate (int page, int pagesize)
|
|
{
|
|
try
|
|
{
|
|
var session = ApiClient.GetSession();
|
|
var map = session.NewParamMap();
|
|
map.setPageParamters(page, pagesize);
|
|
string where = string.Empty;
|
|
if (!string.IsNullOrEmpty(this.textEdit1.Text))
|
|
where = " where (username like '%" + textEdit1.Text.Trim() + "%' or usernick like '%" + textEdit1.Text.Trim() + "%')";
|
|
if (comboBoxEdit3.SelectedIndex != 0)
|
|
where += string.IsNullOrWhiteSpace(where) ? "where robot_name = "+ comboBoxEdit3.Text : " and robot_name = "+ comboBoxEdit3.Text;
|
|
|
|
var rest = session.FindPage<fl_member_info>($"select * from fl_member_info {where} ", map);
|
|
|
|
return new UI.Framework.Controls.PageControl.SerchResult() { Result = rest.DataList, Total = rest.Total };
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
XtraMessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
return new UI.Framework.Controls.PageControl.SerchResult() { Result = null, Total = 0 };
|
|
|
|
}, this.gridControl1, 40, true, true);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ShowError(ex);
|
|
}
|
|
}
|
|
|
|
private void simpleButton1_Click(object sender, EventArgs e)
|
|
{
|
|
pageControl1.Go(sender, e);
|
|
}
|
|
|
|
public fl_member_info member = null;
|
|
|
|
void change_user()
|
|
{
|
|
var rows = this.gridView1.GetSelectedRows();
|
|
if (rows != null && rows.Length > 0)
|
|
{
|
|
member = this.gridView1.GetRow(rows[0]) as fl_member_info;
|
|
this.DialogResult = DialogResult.OK;
|
|
}
|
|
}
|
|
|
|
private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
|
|
{
|
|
change_user();
|
|
}
|
|
|
|
private void gridView1_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
change_user();
|
|
}
|
|
}
|
|
} |