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
|
{
|
public UcDictionaryComBox()
|
{
|
InitializeComponent();
|
}
|
|
/// <summary>
|
/// 文本框文字
|
/// </summary>
|
public string TextTxt
|
{
|
get { return txt_qt003.Text.Trim(); }
|
set
|
{
|
this.txt_qt003.Text = 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_name", "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());
|
}
|
}
|
catch (Exception ex)
|
{
|
MsgHelper.Warning("提示:" + ex.Message);
|
}
|
}
|
}
|
}
|