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

167 lines
6.4 KiB
C#

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_MISPRO;
using GThinking.N_MODEL.Page;
using GThinking.N_MISPRO.Data;
using System.Drawing;
using GThinking.N_MODEL.Dialog;
using GThinking.N_PUBLIC;
using GThinking.N_MISPRO.Utility;
using GThinking.N_MISPRO.MISPROAS;
using GThinking.N_WORKFLOW;
using System.Text;
using GThinking.N_PUBLIC2;
namespace GThinking.N_XLXSBJ
{
public partial class XLJGB_ACZBTDList : SingleGridBase
{
XLJGB_ACZBTD entity = new XLJGB_ACZBTD();
protected void Page_Load(object sender, EventArgs e)
{
this.UMID = 100860001;
this.UMName = "线缆销售报价价格表";
this.CurMaster = Master;
this.ModuleGV = grdContentGrid;
this.CurEntity = entity;
this.PageHeight = 600;
this.PageWidth = 750;
base.DataKeyNames = new string[] { "JGCZBID", "JGCZBBBID" };
this.Master.EnableNewBtn = false;
this.Master.EnableDeleteBtn = false;
this.Master.EnableViewBtn = false;
this.Master.EnableAttachBtn = false;
this.Master.EnableCopyBtn = false;
this.Master.EnableEditBtn = false;
this.Master.EnableQueryBtn = false;
this.Master.EnablePrintBtn = 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 = QuerySql();
base.Master_OnStandardQuery(sender, e);
entity.GridDataBind(grdContentGrid, tSession);
}
protected override void moduleGV_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
}
base.moduleGV_RowDataBound(sender, e);
}
protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
entity.EntityTable.QuerySelSql = QuerySql();
grdContentGrid.SelectedIndex = -1;
base.moduleGV_PageIndexChanging(sender, e);
}
#endregion
#region 自定义函数
private string QuerySql()
{
StringBuilder strSQL = new StringBuilder();
strSQL.AppendLine(" select JGCZBID,JGCZBBBID,XLJGCZBML_JGCZBMC as JGCZBMC,BJZJWHSJ ");
strSQL.AppendLine(" from ( ");
strSQL.AppendLine(" select XLXSCLQD_JGCZBID as JGCZBID,XLXSCLQD_JGCZBBBID as JGCZBBBID,max(XLXSJGBMX_WHSJ) as BJZJWHSJ ");
strSQL.AppendLine(" from XLXSJGBMX ");
strSQL.AppendLine(" left join XLXSCLQD on XLXSCLQD_XLXHID = XLXSJGBMX_XLXHID and XLXSCLQD_XLGGID = XLXSJGBMX_XLGGID ");
strSQL.AppendLine(" and XLXSCLQD_XLBZID = XLXSJGBMX_XLBZID and XLXSCLQD_DYDJID = isnull(XLXSJGBMX_DYDJID,' ') ");
strSQL.AppendLine(" where XLXSJGBMX_JGBID = :pJGBID ");
strSQL.AppendLine(" and XLXSCLQD_WPID ='ZZZZ' ");
strSQL.AppendLine(" and isnull(XLXSCLQD_JGCZBID,' ')<>' ' ");
strSQL.AppendLine(" group by XLXSCLQD_JGCZBID,XLXSCLQD_JGCZBBBID ");
strSQL.AppendLine(" ) a ");
strSQL.AppendLine(" left join XLJGCZBML on XLJGCZBML_JGCZBID=JGCZBID ");
strSQL.AppendLine(" where 1 =1 ");
strSQL.AppendLine(" order by JGCZBID,JGCZBBBID ");
entity.Param.Add("pJGBID", PageParam.GetRTrimString("JGBID"));
return strSQL.ToString();
}
#endregion
#region 回填报价单
//确认
protected void btnCZBTB_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(grdContentGrid.CheckedRowIndexs))
{
ShowMessage("请勾选需要同步的记录!");
return;
}
int iXSWS = string.IsNullOrEmpty(GetOption("BJU002")) ? 5 : CMISproConvert.StrToInt(GetOption("BJU002"));
if (iXSWS < 0)
iXSWS = 0;
else if (iXSWS > 8)
iXSWS = 8;
string sJGBID = PageParam.GetRTrimString("JGBID");
string sMXBH = PageParam.GetRTrimString("MXBH");
string sJJLY = PageParam.GetRTrimString("JJLY");
string sBJU003 = GetOption(100860000, "BJU003");
string sJGCZBID = "";
string sJGCZBBBID = "";
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
if (this.grdContentGrid.CheckBox && !String.IsNullOrEmpty(this.grdContentGrid.CheckedRowIndexs))
{
string[] RowsArry = this.grdContentGrid.CheckedRowIndexs.Split(new char[] { ',' });
try
{
if (sJJLY.Equals("D"))
{
XLJGB_CLJGTZList.DoCPJJ(dberp, sMXBH, sJGBID, false,
iXSWS, PageParam.GetRTrimString("JSBLFS"), tSession.UserId, tSession.UserName, sBJU003);
}
else
{
foreach (string sRowIndex in RowsArry)
{
int iRowIndex = CMISproConvert.StrToInt(sRowIndex.Trim());
sJGCZBID = grdContentGrid.DataKeys[iRowIndex]["JGCZBID"].ToString().Trim();
sJGCZBBBID = grdContentGrid.DataKeys[iRowIndex]["JGCZBBBID"].ToString().Trim();
XLJGB_CLJGTZList.DoCLCB(dberp, sMXBH, sJGBID, tSession.UserId, tSession.UserName, sJGCZBID, sJGCZBBBID, iXSWS, PageParam.GetRTrimString("JSBLFS"), sBJU003);
}
}
}
catch (Exception ex)
{
ShowMessage("同步出现异常,请联系系统管理员。原因:" + ex.Message);
return;
}
}
ShowMessage("同步完成!");
moduleGV_PageIndexChanging(null, null);
}
#endregion
}
}