128 lines
4.6 KiB
C#
128 lines
4.6 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.Text;
|
|
using GThinking.N_MISPRO.Utility;
|
|
|
|
namespace GThinking.N_XLXSBJ
|
|
{
|
|
public partial class BJYFJJQJList : SingleGridBase
|
|
{
|
|
BJYFJJQJ entity = new BJYFJJQJ();
|
|
//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 = "BJYFJJQJInfo.aspx";
|
|
//this.sQueryURLTarget = "BJYFJZQJQuery.aspx";
|
|
this.PageHeight = 400;
|
|
this.PageWidth = 500;
|
|
Master.EnableQueryBtn = false;
|
|
base.DataKeyNames = new string[] { "XLXSBJYFJJQJ_YFJJQH" };
|
|
|
|
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)
|
|
{
|
|
entity.Param.Add("XLXSBJYFJJQJ_YFJJQH", this.grdContentGrid.SelectedDataKey["XLXSBJYFJJQJ_YFJJQH"].ToString().Trim());
|
|
base.BeforeDelete(db, ref ActionIsDone);
|
|
}
|
|
|
|
protected override bool Master_BeforeDeleteAction(object sender, EventArgs e)
|
|
{
|
|
bool bReturn = base.Master_BeforeDeleteAction(sender, e);
|
|
if (CMISproDataBase.ExistsRecord("DBERP", string.Format("select 1 from XLXSBJDQYFB4 where XLXSBJDQYFB4_YFJJQH='{0}'", grdContentGrid.SelectedDataKey["XLXSBJYFJJQJ_YFJJQH"].ToString().Trim())))
|
|
{
|
|
ShowMessage("计件区间已维护运率,不允许删除!");
|
|
return false;
|
|
}
|
|
return bReturn;
|
|
}
|
|
|
|
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("XLXSBJYFJJQJ_YFJJQH", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSBJYFJJQJ_YFJJQH"].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 XLXSBJYFJJQJ_YFJJQH,XLXSBJYFJJQJ_YFJJQJMC,XLXSBJYFJJQJ_PJWJSX,");
|
|
sSQL.AppendLine(" case XLXSBJYFJJQJ_PJCZ when 'TMP' then '铁木盘' when 'QTP' then '全铁盘' when 'QMP' then '全木盘' when 'CKTMP' then '出口铁木盘' ");
|
|
sSQL.AppendLine(" when 'JGTMP' then '加固铁木盘' when 'JGCKTMP' then '加固出口铁木盘' else '' end as XLXSBJYFJJQJ_PJCZ,");
|
|
sSQL.AppendLine(" XLXSBJYFJJQJ_PJWJXX,XLXSBJYFJJQJ_YFJSGS,XLXSBJYFJJQJ_WHR,XLXSBJYFJJQJ_WHRID,XLXSBJYFJJQJ_WHSJ ");
|
|
sSQL.AppendLine("from XLXSBJYFJJQJ ");
|
|
sSQL.AppendLine("where 1=1 ");
|
|
sSQL.AppendLine("order by XLXSBJYFJJQJ_YFJJQH");
|
|
return sSQL.ToString();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|