2026821
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
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.Text;
|
||||
using GThinking.N_MISPRO.Utility;
|
||||
|
||||
namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
public partial class BJYFSYCPMLList : SingleGridBase
|
||||
{
|
||||
BJYFSYCPML entity = new BJYFSYCPML();
|
||||
//BJYFJZQJ_M qryEntity = new BJYFJZQJ_M();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.UMID = 100860071;
|
||||
this.UMName = "线缆销售报价单运费";
|
||||
this.CurMaster = Master;
|
||||
this.ModuleGV = grdContentGrid;
|
||||
this.CurEntity = entity;
|
||||
//this.CurQueryEntity = qryEntity;
|
||||
this.sURLTarget = "BJYFSYCPMLInfo.aspx";
|
||||
//this.sQueryURLTarget = "BJYFJZQJQuery.aspx";
|
||||
this.PageHeight = 400;
|
||||
this.PageWidth = 500;
|
||||
Master.EnableQueryBtn = false;
|
||||
base.DataKeyNames = new string[] { "XLXSBJDQYFB4SY1_CPMLID" };
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
//CurQueryEntity.FieldByName("PXFS").Value = "XM";
|
||||
}
|
||||
|
||||
base.InitPage();
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Master_OnStandardQuery(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
#region 模板事件继承
|
||||
protected override void Master_OnStandardQuery(object sender, EventArgs e)
|
||||
{
|
||||
//base.InitEntityByCondition();
|
||||
entity.EntityTable.QuerySelSql = GetSQL();
|
||||
base.Master_OnStandardQuery(sender, e);
|
||||
entity.GridDataBind(grdContentGrid, tSession);
|
||||
}
|
||||
|
||||
protected override void BeforeDelete(TDatabase db, ref bool ActionIsDone)
|
||||
{
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL SQL = new TSQL(dberp);
|
||||
SQL.Add("SELECT XLXSBJDQYFB4SY1_CPMLID FROM XLXSBJDQYFB4SY1 WHERE 1=1");
|
||||
DataSet ds = dberp.OpenDataSet(SQL);
|
||||
if(ds.Tables[0].Rows.Count <= 1 && CMISproDataBase.ExistsRecord("DBERP","SELECT 1 FROM XLXSBJDQYFZB WHERE ',' || XLXSBJDQYFZB_YFJSFS || ',' LIKE '%,4,%'"))
|
||||
{
|
||||
ShowMessage("存在运费计算方式为“4|运距运件”的地区,不允许删除最后一条适用产品目录记录!");
|
||||
return;
|
||||
}
|
||||
entity.Param.Add("XLXSBJDQYFB4SY1_CPMLID", this.grdContentGrid.SelectedDataKey["XLXSBJDQYFB4SY1_CPMLID"].ToString().Trim());
|
||||
base.BeforeDelete(db, ref ActionIsDone);
|
||||
}
|
||||
|
||||
protected override bool Master_AfterDeleteAction(object sender, EventArgs e)
|
||||
{
|
||||
if (!base.Master_AfterDeleteAction(sender, e)) return false;
|
||||
|
||||
//base.InitEntityByCondition();
|
||||
entity.EntityTable.QuerySelSql = GetSQL();
|
||||
entity.GridDataBind(grdContentGrid, tSession);
|
||||
grdContentGrid.SelectedIndex = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void moduleGV_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
LinkPageParam.AddString("XLXSBJDQYFB4SY1_CPMLID", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSBJDQYFB4SY1_CPMLID"].ToString().Trim());
|
||||
}
|
||||
|
||||
base.moduleGV_RowDataBound(sender, e);
|
||||
}
|
||||
|
||||
protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
|
||||
{
|
||||
//base.InitEntityByCondition();
|
||||
entity.EntityTable.QuerySelSql = GetSQL();
|
||||
grdContentGrid.SelectedIndex = -1;
|
||||
|
||||
base.moduleGV_PageIndexChanging(sender, e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 自定义函数
|
||||
|
||||
private string GetSQL()
|
||||
{
|
||||
StringBuilder sSQL = new StringBuilder();
|
||||
sSQL.AppendLine("select XLXSBJDQYFB4SY1_CPMLID,XLXSCPML_CPMLMC AS CPMLMC, XLXSBJDQYFB4SY1_BZ,");
|
||||
sSQL.AppendLine(" XLXSBJDQYFB4SY1_WHR,XLXSBJDQYFB4SY1_WHRID,XLXSBJDQYFB4SY1_WHSJ ");
|
||||
sSQL.AppendLine("from XLXSBJDQYFB4SY1 ");
|
||||
sSQL.AppendLine(" LEFT JOIN XLXSCPML ON XLXSCPML_CPMLID = XLXSBJDQYFB4SY1_CPMLID");
|
||||
sSQL.AppendLine("where 1=1 ");
|
||||
sSQL.AppendLine("order by XLXSBJDQYFB4SY1_CPMLID");
|
||||
return sSQL.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user