Files
N_XLXSBJ----MX/JGCZBCFCPList.aspx.cs
T
2026-08-21 17:03:02 +08:00

134 lines
5.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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_MISPRO.Data;
using GThinking.N_MISPRO;
using GThinking.N_MISPRO.Utility;
using System.Text;
using GThinking.N_CONTROL;
namespace GThinking.N_XLXSBJ
{
public partial class JGCZBCFCPList : SingleGridBase
{
JGCZBCFCP entity = new JGCZBCFCP();
protected void Page_Load(object sender, EventArgs e)
{
this.UMID = 100860020;
this.UMName = "线缆销售报价结构尺重表";
this.CurMaster = Master;
this.ModuleGV = grdGRID;
this.CurEntity = entity;
this.PageHeight = 600;
this.PageWidth = 750;
//base.DataKeyNames = new string[] { "XLXSJGBPZJGB_CLHQZH", "XLXSJGBPZJGB_JGBID", "XLXSJGBPZJGB_JGBMC" };
Master.EnableQueryBtn = false;
Master.EnableNewBtn = false;
Master.EnableCopyBtn = false;
Master.EnableEditBtn = false;
Master.EnableViewBtn = false;
Master.EnableDeleteBtn = false;
base.InitPage();
this.ModuleGV.OnClientDblClick = "return false;";
if (!IsPostBack)
{
Master_OnStandardQuery(null, null);
}
}
#region 模板事件
protected override void Master_OnStandardQuery(object sender, EventArgs e)
{
entity.EntityTable.QuerySelSql = GetSql();
base.Master_OnStandardQuery(sender, e);
entity.GridDataBind(grdGRID, tSession);
}
protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
entity.EntityTable.QuerySelSql = GetSql();
base.moduleGV_PageIndexChanging(sender, e);
grdGRID.SelectedIndex = -1;
}
#endregion
#region 自定义函数
private string GetSql()
{
string sXLJGU007 = GetOption(100860020, "XLJGU007");
StringBuilder SQL = new StringBuilder();
SQL.AppendLine(" select rtrim(XLJGCZBNR_JGCZBID)||'|'||rtrim(XLJGCZBNR_JGCZBBBID) as DPSCZB , ");
SQL.AppendLine("XLXHJGCZBML_JGCZBXH,XLJGCZBNR_DRHH AS DPSHH,");
SQL.AppendLine("XLXHJGCZBML_XLXHID AS XLXHID, ");
if (sXLJGU007.Equals("A"))
SQL.AppendLine(" REPLACE(REPLACE(REPLACE(XLJGCZBNR_LMNR02,'x','X'),'X','*'),'*','×') as XLGGID, ");
else if (sXLJGU007.Equals("B"))
SQL.AppendLine(" REPLACE(REPLACE(REPLACE(XLJGCZBNR_LMNR02,'x','X'),'X','*'),'×','*') as XLGGID,");
SQL.AppendLine("rtrim(XLXHJGCZBML_XLBZID)||'|'|| rtrim(XLBZ_XLBZLXMC) AS XLBZID,XLXHJGCZBML_DYDJID AS DYDJID, ");
SQL.AppendLine("rtrim(XLXSCLQD_JGCZBID)||'|'||rtrim(XLXSCLQD_JGCZBBBID) as YPSCZB, ");
SQL.AppendLine("XLXSCLQD_JGCZBXH,XLXSCLQD_DRHH AS YPSHH");
SQL.AppendLine("from XLXSCLQD,XLJGCZBNR");
SQL.AppendLine(" left join XLXHJGCZBML on XLXHJGCZBML_JGCZBID=XLJGCZBNR_JGCZBID and XLXHJGCZBML_XLXHID=XLJGCZBNR_LMNR01");
SQL.AppendLine(" and XLXHJGCZBML_DYDJID=XLJGCZBNR_LMNR04 and XLXHJGCZBML_XLBZID=XLJGCZBNR_LMNR03");
SQL.AppendLine("left join XLBZ ON XLBZ_XLBZID=XLXHJGCZBML_XLBZID ");
SQL.AppendLine(string.Format("where rtrim(XLJGCZBNR_JGCZBID)||'|'||rtrim(XLJGCZBNR_JGCZBBBID) in (rtrim('{0}')||'|'||rtrim('{1}'))", PageParam.GetRTrimString("JGCZBID"), PageParam.GetRTrimString("JGCZBBBID")));
SQL.AppendLine(string.Format(" and rtrim(XLXSCLQD_JGCZBID)||'|'||rtrim(XLXSCLQD_JGCZBBBID) not in (rtrim('{0}')||'|'||rtrim('{1}')) ", PageParam.GetRTrimString("JGCZBID"), PageParam.GetRTrimString("JGCZBBBID")));
SQL.AppendLine(" and XLJGCZBNR_LMNR01=XLXSCLQD_XLXHID ");
if (sXLJGU007.Equals("A"))
SQL.AppendLine(" and REPLACE(REPLACE(REPLACE(XLJGCZBNR_LMNR02,'x','X'),'X','*'),'*','×') =XLXSCLQD_XLGGID ");
else if (sXLJGU007.Equals("B"))
SQL.AppendLine("and REPLACE(REPLACE(REPLACE(XLJGCZBNR_LMNR02,'x','X'),'X','*'),'×','*') =XLXSCLQD_XLGGID ");
SQL.AppendLine(" and XLJGCZBNR_LMNR03=XLXSCLQD_XLBZID ");
SQL.AppendLine(" and XLJGCZBNR_LMNR04=XLXSCLQD_DYDJID ");
SQL.AppendLine(" and isnull(XLXSCLQD_WPID,'ZZZZ')='ZZZZ' ");
SQL.AppendLine(" order by XLJGCZBNR_JGCZBID,XLJGCZBNR_JGCZBBBID,XLJGCZBNR_DRHH");
return SQL.ToString();
}
#endregion
#region 按钮事件
protected void btnFGCFCP_Click(object sender, EventArgs e)
{
DialogOperationScript dos = new DialogOperationScript(this);
if (PageParam.ContainsKey("txtFGBZ"))
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtFGBZ"), "Y");
if (PageParam.ContainsKey("btnCRCLQD"))
dos.ClickOwnerButton(PageParam.GetRTrimString("btnCRCLQD"));
dos.CloseSelf();
dos.Execute();
}
protected void btnTGCFCP_Click(object sender, EventArgs e)
{
DialogOperationScript dos = new DialogOperationScript(this);
if (PageParam.ContainsKey("txtFGBZ"))
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtFGBZ"), "N");
if (PageParam.ContainsKey("btnCRCLQD"))
dos.ClickOwnerButton(PageParam.GetRTrimString("btnCRCLQD"));
dos.CloseSelf();
dos.Execute();
}
#endregion
}
}