163 lines
6.0 KiB
C#
163 lines
6.0 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 BJYFJZQJList : SingleGridBase
|
|
{
|
|
BJYFJZQJ entity = new BJYFJZQJ();
|
|
//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 = "BJYFJZQJInfo.aspx";
|
|
//this.sQueryURLTarget = "BJYFJZQJQuery.aspx";
|
|
this.PageHeight = 400;
|
|
this.PageWidth = 500;
|
|
Master.EnableQueryBtn = false;
|
|
base.DataKeyNames = new string[] { "XLXSBJYFJZQJ_YFJZQH" };
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
//CurQueryEntity.FieldByName("PXFS").Value = "XM";
|
|
}
|
|
|
|
base.InitPage();
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
if (GetOption("BJU025").Equals("2"))
|
|
{
|
|
grdContentGrid.Columns[2].HeaderText = ">(吨)";
|
|
grdContentGrid.Columns[3].HeaderText = "<=(吨)";
|
|
}
|
|
|
|
if (PageParam.GetRTrimString("YFJSFS").Equals("6"))
|
|
{
|
|
grdContentGrid.Columns[2].HeaderText = ">(元)";
|
|
grdContentGrid.Columns[3].HeaderText = "<=(元)";
|
|
}
|
|
Master_OnStandardQuery(null, null);
|
|
}
|
|
TPageParams pageParams = new TPageParams();
|
|
pageParams.AddString("YFJSFS", PageParam.GetRTrimString("YFJSFS"));
|
|
SetNewFormParam(pageParams);
|
|
}
|
|
|
|
#region 模板事件继承
|
|
protected override void Master_OnStandardQuery(object sender, EventArgs e)
|
|
{
|
|
//base.InitEntityByCondition();
|
|
InitGridView();
|
|
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("XLXSBJYFJZQJ_YFJZQH", this.grdContentGrid.SelectedDataKey["XLXSBJYFJZQJ_YFJZQH"].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 XLXSBJDQYFB where XLXSBJDQYFB_YFJZQH='{0}'", grdContentGrid.SelectedDataKey["XLXSBJYFJZQJ_YFJZQH"].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();
|
|
InitGridView();
|
|
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("XLXSBJYFJZQJ_YFJZQH", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSBJYFJZQJ_YFJZQH"].ToString().Trim());
|
|
LinkPageParam.AddString("YFJSFS", PageParam.GetRTrimString("YFJSFS"));
|
|
}
|
|
base.moduleGV_RowDataBound(sender, e);
|
|
}
|
|
|
|
protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
|
|
{
|
|
//base.InitEntityByCondition();
|
|
InitGridView();
|
|
entity.EntityTable.QuerySelSql = GetSQL();
|
|
grdContentGrid.SelectedIndex = -1;
|
|
|
|
base.moduleGV_PageIndexChanging(sender, e);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 自定义函数
|
|
|
|
private string GetSQL()
|
|
{
|
|
StringBuilder sSQL = new StringBuilder();
|
|
sSQL.AppendLine("select XLXSBJYFJZQJ_YFJZQH,XLXSBJYFJZQJ_YFJZQJMC,XLXSBJYFJZQJ_YFJZXX,XLXSBJYFJZQJ_YFJZSX,");
|
|
sSQL.AppendLine(" XLXSBJYFJZQJ_YFJSGS,XLXSBJYFJZQJ_YFJSGS3,XLXSBJYFJZQJ_WHR,XLXSBJYFJZQJ_WHRID,XLXSBJYFJZQJ_WHSJ ");
|
|
sSQL.AppendLine("from XLXSBJYFJZQJ ");
|
|
sSQL.AppendLine("where 1=1 ");
|
|
sSQL.AppendLine("order by XLXSBJYFJZQJ_YFJZQH");
|
|
return sSQL.ToString();
|
|
}
|
|
|
|
private void InitGridView()
|
|
{
|
|
if (PageParam.GetRTrimString("YFJSFS").Equals("1"))
|
|
{
|
|
grdContentGrid.FindColumnByFieldName("XLXSBJYFJZQJ_YFJSGS").Visible = true;
|
|
grdContentGrid.FindColumnByFieldName("XLXSBJYFJZQJ_YFJSGS3").Visible = false;
|
|
|
|
}
|
|
else if (PageParam.GetRTrimString("YFJSFS").Equals("3"))
|
|
{
|
|
grdContentGrid.FindColumnByFieldName("XLXSBJYFJZQJ_YFJSGS").Visible = false;
|
|
grdContentGrid.FindColumnByFieldName("XLXSBJYFJZQJ_YFJSGS3").Visible = true;
|
|
}
|
|
else if (PageParam.GetRTrimString("YFJSFS").Equals("6"))
|
|
{
|
|
grdContentGrid.FindColumnByFieldName("XLXSBJYFJZQJ_YFJSGS").Visible = false;
|
|
grdContentGrid.FindColumnByFieldName("XLXSBJYFJZQJ_YFJSGS3").Visible = false;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|