using DevExpress.Data.ExpressionEditor;
|
using DevExpress.XtraEditors;
|
using Gs.DevApp.Entity;
|
using Gs.DevApp.ToolBox;
|
using Newtonsoft.Json;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
|
namespace Gs.DevApp.UserControl
|
{
|
public partial class UcDictionaryComBox : DevExpress.XtraEditors.XtraUserControl
|
{
|
|
/// <summary>
|
/// 下拉改变事件
|
/// </summary>
|
public event EventHandler ChangedEvent;
|
|
public UcDictionaryComBox()
|
{
|
InitializeComponent();
|
this.Load += (ss, ee) => {
|
this.txt_qt003.SelectedIndexChanged += Txt_qt003_SelectedIndexChanged;
|
};
|
|
}
|
|
private void Txt_qt003_SelectedIndexChanged(object sender, EventArgs e)
|
{
|
if (ChangedEvent != null)
|
ChangedEvent(this, e);
|
}
|
|
/// <summary>
|
/// 文本框文字
|
/// </summary>
|
public string TextTxt
|
{
|
get { return txt_qt003.Text.Trim(); }
|
set
|
{
|
this.txt_qt003.Text = value;
|
}
|
}
|
/// <summary>
|
/// 文本框的次序 2025-12-12 加上
|
/// </summary>
|
public int SelectedIndex
|
{
|
get { return txt_qt003.SelectedIndex; }
|
set
|
{
|
this.txt_qt003.SelectedIndex = value;
|
}
|
}
|
|
|
|
/// <summary>
|
/// 查询条件
|
/// </summary>
|
///
|
string _WhereTxt;
|
public string WhereTxt
|
{
|
get { return _WhereTxt; }
|
set
|
{
|
this._WhereTxt = value;
|
if (!string.IsNullOrEmpty(value))
|
{
|
getSuppler(value);
|
}
|
}
|
}
|
|
public bool IsReadly
|
{
|
set
|
{
|
this.txt_qt003.ReadOnly = value;
|
this.txt_qt003.Enabled = !value;
|
}
|
}
|
|
/// <summary>
|
/// 读取仓库
|
/// </summary>
|
/// <param name="orgId"></param>
|
/// <param name="_dftVale"></param>
|
public void getSuppler(string strWhere)
|
{
|
txt_qt003.Properties.Items.Clear();
|
string _where = " and 1=1 and " + strWhere;
|
var pgq = new PageQueryModel(1, 999999, "a.defect_code", "asc", "", _where);
|
var json = JsonConvert.SerializeObject(pgq);
|
try
|
{
|
var strReturn = UtilityHelper.HttpPost("", "MesDefectCodeManager/GetListPage", json);
|
var dd = UtilityHelper.ReturnToTablePage(strReturn);
|
var dt = dd.rtnData.list;
|
foreach (DataRow row in dt.Rows)
|
{
|
txt_qt003.Properties.Items.Add(row["defectName"].ToString());
|
}
|
txt_qt003.SelectedIndex = 0;
|
}
|
catch (Exception ex)
|
{
|
MsgHelper.Warning("提示:" + ex.Message);
|
}
|
}
|
}
|
}
|