2026821
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
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.Data;
|
||||
using GThinking.N_MISPRO.Utility;
|
||||
using GThinking.N_MISPRO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GThinking.N_XLJC
|
||||
{
|
||||
public partial class XLDZBZList : SingleGridBase
|
||||
{
|
||||
XLDZBZ entity = new XLDZBZ();
|
||||
|
||||
#region Page事件
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.UMID = 101421011;
|
||||
this.UMName = "线缆定制标准";
|
||||
this.ModuleGV = grdXLDZBZ;
|
||||
this.CurMaster = Master;
|
||||
this.CurEntity = entity;
|
||||
this.sURLTarget = "XLDZBZInfo.aspx";
|
||||
this.Master.EnableQueryBtn = false;
|
||||
this.PageHeight = 500;
|
||||
this.PageWidth = 700;
|
||||
base.DataKeyNames = new string[] { "XLBZ_XLBZID" };
|
||||
|
||||
this.Master.EnableNewBtn = false;
|
||||
this.Master.EnableCopyBtn = false;
|
||||
|
||||
base.InitPage();
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Master_OnStandardQuery(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 模板事件继承
|
||||
|
||||
protected override void Master_OnStandardQuery(object sender, EventArgs e)
|
||||
{
|
||||
entity.EntityTable.QuerySelSql = GetSQL();
|
||||
base.Master_OnStandardQuery(sender, e);
|
||||
entity.GridDataBind(grdXLDZBZ, tSession);
|
||||
}
|
||||
|
||||
protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
|
||||
{
|
||||
entity.EntityTable.QuerySelSql = GetSQL();
|
||||
grdXLDZBZ.SelectedIndex = -1;
|
||||
base.moduleGV_PageIndexChanging(sender, e);
|
||||
}
|
||||
|
||||
protected override void moduleGV_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
//Dictionary<string, string> dicXLCPZLID = new Dictionary<string, string>();
|
||||
//int Index_XLCPZLID = grdXLDZBZ.Columns.IndexOf(grdXLDZBZ.FindColumnByFieldName("XLDZBZ_XLCPZLID"));
|
||||
//XLDZBZ.GetXLCPZLID(ref dicXLCPZLID);
|
||||
//if (dicXLCPZLID.ContainsKey(e.Row.Cells[Index_XLCPZLID].Text.Trim()))
|
||||
//{
|
||||
//e.Row.Cells[Index_XLCPZLID].Text = e.Row.Cells[Index_XLCPZLID].Text.Trim() + "|" + dicXLCPZLID[e.Row.Cells[Index_XLCPZLID].Text.Trim()];
|
||||
//}
|
||||
LinkPageParam.AddString("XLBZ_XLBZID", grdXLDZBZ.DataKeys[e.Row.RowIndex]["XLBZ_XLBZID"].ToString().Trim());
|
||||
}
|
||||
base.moduleGV_RowDataBound(sender, e);
|
||||
}
|
||||
|
||||
protected override void BeforeDelete(GThinking.N_MISPRO.Data.TDatabase db, ref bool ActionIsDone)
|
||||
{
|
||||
entity.Param.Add("XLBZ_XLBZID", grdXLDZBZ.DataKeys[grdXLDZBZ.SelectedIndex]["XLBZ_XLBZID"].ToString().Trim());
|
||||
base.BeforeDelete(db, ref ActionIsDone);
|
||||
}
|
||||
|
||||
//同步删除XLDZBZ表
|
||||
protected override void AfterDelete(TDatabase db, ref bool ActionIsDone)
|
||||
{
|
||||
string sXLBZID = grdXLDZBZ.DataKeys[grdXLDZBZ.SelectedIndex]["XLBZ_XLBZID"].ToString().Trim();
|
||||
string sSQL = string.Format("delete from XLDZBZ where XLDZBZ_XLBZID='{0}'", sXLBZID);
|
||||
db.ExecSQL(sSQL);
|
||||
base.AfterDelete(db, ref ActionIsDone);
|
||||
}
|
||||
|
||||
protected override bool Master_AfterDeleteAction(object sender, EventArgs e)
|
||||
{
|
||||
if (!base.Master_AfterDeleteAction(sender, e))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
entity.EntityTable.QuerySelSql = GetSQL();
|
||||
entity.GridDataBind(grdXLDZBZ, tSession);
|
||||
grdXLDZBZ.SelectedIndex = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool Master_BeforeDeleteAction(object sender, EventArgs e)
|
||||
{
|
||||
string sXLBZID = grdXLDZBZ.DataKeys[grdXLDZBZ.SelectedIndex]["XLBZ_XLBZID"].ToString().Trim();
|
||||
if (!sXLBZID.Equals("") && CMISproDataBase.ExistsRecord("DBERP", string.Format(" select top 1 XLXSCLQD_XLBZID from XLXSCLQD where XLXSCLQD_XLBZID ='{0}' ", sXLBZID.Trim())))
|
||||
{
|
||||
ShowMessage("该定制标准已被使用,不允许删除!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.Master_BeforeDeleteAction(sender, e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 自定义事件
|
||||
|
||||
private string GetSQL()
|
||||
{
|
||||
//研发自测:王长江 2025/3/12 11:50:01
|
||||
string sSQL = " select XLBZ_XLBZID,XLBZ_XLBZLXMC,XLBZ_XLBZMS,XLBZ_WHR,XLBZ_WHRID,XLBZ_WHSJ "
|
||||
+ " from XLBZ "
|
||||
+ " where len(XLBZ_XLBZID) = 10 "
|
||||
+ " order by XLBZ_XLBZID ";
|
||||
return sSQL;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 按钮
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user