147 lines
5.6 KiB
C#
147 lines
5.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 GThinking.N_PUBLIC;
|
|
using GThinking.N_MISPRO.Utility;
|
|
|
|
namespace GThinking.N_XLXSBJ
|
|
{
|
|
public partial class TZYZBJ_YZZList : SingleGridBase
|
|
{
|
|
TZYZBJ_YZZ entity = new TZYZBJ_YZZ();
|
|
TZYZBJ_YZZ_M queryentity = new TZYZBJ_YZZ_M();
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
this.UMID = 100860005;
|
|
this.UMName = "线缆销售报价报价单调价因子";
|
|
this.CurMaster = Master;
|
|
this.ModuleGV = grdContentGrid;
|
|
this.CurEntity = entity;
|
|
this.CurQueryEntity = queryentity;
|
|
this.sURLTarget = "TZYZBJ_YZZInfo.aspx";
|
|
this.sQueryURLTarget = "TZYZBJ_YZZQuery.aspx";
|
|
this.PageHeight = 600;
|
|
this.PageWidth = 750;
|
|
this.Master.EnableNewBtn = false;
|
|
this.Master.EnableCopyBtn = false;
|
|
this.Master.EnableDeleteBtn = false;
|
|
|
|
base.DataKeyNames = new string[] { "XLXSBJDYZZ_JGBID", "XLXSBJDYZZ_YZID", "XLXSTZYZ_JJFS" };
|
|
|
|
grdContentGrid.FindColumnByFieldName("XLXSBJDYZZ_JGBID").Visible = false;
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
CurQueryEntity.FieldByName("JGBID").Value = PageParam.GetRTrimString("JGBID");
|
|
}
|
|
|
|
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("XLXSBJDYZZ_JGBID", this.grdContentGrid.SelectedDataKey["XLXSBJDYZZ_JGBID"].ToString());
|
|
entity.Param.Add("XLXSBJDYZZ_YZID", this.grdContentGrid.SelectedDataKey["XLXSBJDYZZ_YZID"].ToString());
|
|
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("XLXSBJDYZZ_JGBID", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSBJDYZZ_JGBID"].ToString().Trim());
|
|
LinkPageParam.AddString("XLXSBJDYZZ_YZID", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSBJDYZZ_YZID"].ToString().Trim());
|
|
LinkPageParam.AddString("JJFS", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSTZYZ_JJFS"].ToString().Trim());
|
|
string sJJFS = grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSTZYZ_JJFS"].ToString().Trim();
|
|
int JJFS_INDEX = grdContentGrid.Columns.IndexOf(grdContentGrid.FindColumnByFieldName("XLXSTZYZ_JJFS"));
|
|
int YZZ_INDEX = grdContentGrid.Columns.IndexOf(grdContentGrid.FindColumnByFieldName("XLXSBJDYZZ_YZZ"));
|
|
if (sJJFS.Equals("JJ"))
|
|
{
|
|
grdContentGrid.FindColumnExByFieldName("XLXSBJDYZZ_YZZ").NumberDecimalPlace = 2;
|
|
}
|
|
else if (sJJFS.Equals("MX") || sJJFS.Equals("DX"))
|
|
{
|
|
grdContentGrid.FindColumnExByFieldName("XLXSBJDYZZ_YZZ").NumberDecimalPlace = 4;
|
|
}
|
|
else
|
|
{
|
|
grdContentGrid.FindColumnExByFieldName("XLXSBJDYZZ_YZZ").NumberDecimalPlace = 2;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
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()
|
|
{
|
|
string sSQL = "";
|
|
sSQL = "select XLXSBJDYZZ_JGBID, XLXSBJDYZZ_YZID, XLXSTZYZ_YZMC, XLXSTZYZ_JJFS, XLXSBJDYZZ_YZZ, XLXSBJDYZZ_MINC,XLXSBJDYZZ_MAXC," + "\r\n"
|
|
+ " XLXSBJDYZZ_WHRID, XLXSBJDYZZ_WHR, XLXSBJDYZZ_WHSJ" + "\r\n"
|
|
+ " from XLXSBJDYZZ left join XLXSTZYZ on XLXSTZYZ_YZID=XLXSBJDYZZ_YZID and XLXSTZYZ_MXBH='BJD' " + "\r\n"
|
|
+ " where XLXSTZYZ_TJYS=' ' ";
|
|
if (!CurQueryEntity.FieldByName("JGBID").Value.Trim().Equals(""))
|
|
{
|
|
sSQL += " and XLXSBJDYZZ_JGBID=:pJGBID ";
|
|
entity.Param.Add("pJGBID", CurQueryEntity.FieldByName("JGBID").Value.Trim());
|
|
}
|
|
else
|
|
sSQL += " and 1<>1 ";
|
|
sSQL += " order by XLXSBJDYZZ_JGBID,XLXSBJDYZZ_YZID,XLXSTZYZ_XSXH ";
|
|
return sSQL;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|