2026821
This commit is contained in:
@@ -0,0 +1,131 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using GThinking.N_MODEL.Page;
|
||||
using GThinking.N_PUBLIC;
|
||||
using GThinking.N_MISPRO.Utility;
|
||||
using GThinking.N_MISPRO.Data;
|
||||
|
||||
namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
public partial class XLXSBJCLQuery : SingleQueryBase
|
||||
{
|
||||
XLXSBJCL_M qryEntity = new XLXSBJCL_M();
|
||||
|
||||
#region 页面初始化
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.UMID = 100860012;
|
||||
this.UMName = "线缆销售报价材料";
|
||||
this.CurMaster = Master;
|
||||
this.CurQueryTable = QueryTable;
|
||||
this.CurQueryEntity = qryEntity;
|
||||
|
||||
base.InitPage();
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InitControls();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 模板事件
|
||||
protected override bool QueryLogicValid()
|
||||
{
|
||||
return base.QueryLogicValid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 私有函数
|
||||
|
||||
private void InitControls()
|
||||
{
|
||||
txtBJCL_OnTextChanged(null, null);
|
||||
|
||||
cbxJGCZBLMUsed.ClearItems();
|
||||
cbxJGCZBLMUsed.Items.Add(new ListItem("", ""));
|
||||
cbxJGCZBLMUsed.Items.Add(new ListItem("已关联", "Y"));
|
||||
cbxJGCZBLMUsed.Items.Add(new ListItem("未关联", "N"));
|
||||
|
||||
cbxPXFS.ClearItems();
|
||||
cbxPXFS.Items.Add(new ListItem("材料编码", "0"));
|
||||
cbxPXFS.Items.Add(new ListItem("材料名称", "1"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 控件事件
|
||||
protected void txtBJCL_OnTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL SQL = new TSQL(dberp);
|
||||
string sBJCLID = txtBJCLID.Text.Trim();
|
||||
string sBJCLMC = txtBJCLMC.Text.Trim();
|
||||
|
||||
string sBJCL = cbxBJCL.SelectedValue.Trim();
|
||||
int flag = 0;
|
||||
if (!sBJCLID.Equals("") || !sBJCLMC.Equals(""))
|
||||
{
|
||||
|
||||
cbxBJCL.ClearItems();
|
||||
SQL.Clear();
|
||||
SQL.Add(" select XLXSBJCL_BJCLID, rtrim(XLXSBJCL_BJCLID)||'|'||XLXSBJCL_BJCLMC as BJCLMC from XLXSBJCL ");
|
||||
SQL.Add(" where 1 = 1 and isnull(XLXSBJCL_BJCLMC,' ')<>' ' ");
|
||||
if (!sBJCLID.Equals(""))
|
||||
{
|
||||
SQL.Add(" and XLXSBJCL_BJCLID like :pBJCLID");
|
||||
SQL.ParamByName("pBJCLID").Value = "%" + sBJCLID + "%";
|
||||
}
|
||||
if (!sBJCLMC.Equals(""))
|
||||
{
|
||||
SQL.Add(" and XLXSBJCL_BJCLMC like :pBJCLMC");
|
||||
SQL.ParamByName("pBJCLMC").Value = "%" + sBJCLMC + "%";
|
||||
}
|
||||
SQL.Add(" order by XLXSBJCL_BJCLID");
|
||||
DataSet ds = dberp.OpenDataSet(SQL);
|
||||
cbxBJCL.Items.Add(new ListItem("", ""));
|
||||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||||
{
|
||||
cbxBJCL.Items.Add(new ListItem((ds.Tables[0].Rows[i][1].ToString().Trim()), (ds.Tables[0].Rows[i][0].ToString().Trim())));
|
||||
if (ds.Tables[0].Rows[i][0].ToString().Trim().Equals(sBJCL))
|
||||
{
|
||||
flag = 1;
|
||||
}
|
||||
}
|
||||
if (1 == flag)
|
||||
{
|
||||
cbxBJCL.SelectedValue = sBJCL;
|
||||
}
|
||||
cbxBJCL.ShowValue = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
cbxBJCL.ClearItems();
|
||||
SQL.Clear();
|
||||
SQL.Add(" select XLXSBJCL_BJCLID, ");
|
||||
SQL.Add(" rtrim(XLXSBJCL_BJCLID)||'|'||rtrim(XLXSBJCL_BJCLMC) as Name");
|
||||
SQL.Add(" from XLXSBJCL where isnull(XLXSBJCL_BJCLMC,' ')<>' ' ");
|
||||
SQL.Add(" order by XLXSBJCL_BJCLID");
|
||||
DataSet ds = dberp.OpenDataSet(SQL);
|
||||
cbxBJCL.Items.Add(new ListItem("", ""));
|
||||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||||
{
|
||||
cbxBJCL.Items.Add(new ListItem((ds.Tables[0].Rows[i][1].ToString().Trim()), (ds.Tables[0].Rows[i][0].ToString().Trim())));
|
||||
}
|
||||
cbxBJCL.ShowValue = false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user