2026821
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using GThinking.N_MISPRO;
|
||||
using GThinking.N_MISPRO.Data;
|
||||
using GThinking.N_MODEL.Page;
|
||||
using GThinking.N_PUBLIC;
|
||||
using GThinking.N_MISPRO.Utility;
|
||||
|
||||
namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
public partial class CLQDYZ_XJFYView : SingleGridBase
|
||||
{
|
||||
CLQDYZ entity = new CLQDYZ();
|
||||
CLQDYZ_M qryEntity = new CLQDYZ_M();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.UMID = 100860017;
|
||||
this.UMName = "查看线径费用";
|
||||
this.CurMaster = Master;
|
||||
this.ModuleGV = ContentGrid;
|
||||
this.CurEntity = entity;
|
||||
this.CurQueryEntity = qryEntity;
|
||||
this.PageHeight = 500;
|
||||
this.PageWidth = 650;
|
||||
base.InitPage();
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
if (IsDefaultExecute)
|
||||
Master_OnStandardQuery(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Master_OnStandardQuery(object sender, EventArgs e)
|
||||
{
|
||||
base.InitEntityByCondition();
|
||||
entity.EntityTable.QuerySelSql = "select 1 from XLXSJGBYZZ1 where 1<>1";
|
||||
base.Master_OnStandardQuery(sender, e);
|
||||
DataSet ds = GetExcelData();
|
||||
if (ds != null)
|
||||
{
|
||||
entity.GridDataBind(ContentGrid, tSession);
|
||||
entity.GridDataBind(ContentGrid, ds.Tables[0], ds.Tables[0].Rows.Count);
|
||||
ContentGrid.DataSource = ds;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
|
||||
{
|
||||
base.InitEntityByCondition();
|
||||
entity.EntityTable.QuerySelSql = "select 1 from XLXSJGBYZZ1 where 1<>1";
|
||||
base.moduleGV_PageIndexChanging(sender, e);
|
||||
DataSet ds = GetExcelData();
|
||||
if (ds != null)
|
||||
{
|
||||
entity.GridDataBind(ContentGrid, tSession);
|
||||
entity.GridDataBind(ContentGrid, ds.Tables[0], ds.Tables[0].Rows.Count);
|
||||
ContentGrid.DataSource = ds;
|
||||
}
|
||||
}
|
||||
|
||||
private DataSet GetExcelData()
|
||||
{
|
||||
string sExcelPath = Path.Combine(HttpContext.Current.Server.MapPath("~/work/temp/外径盘具金额/"), "外径盘具金额.xlsx");
|
||||
if (!File.Exists(sExcelPath))
|
||||
{
|
||||
ShowMessage("外径盘具金额Excel文件不存在,请先通过“按线径规则计算导入”功能导入!");
|
||||
return null;
|
||||
}
|
||||
|
||||
string sReadErr = "";
|
||||
DataSet dsExcel = TExcelData.ReadExcel_NPOI(sExcelPath, 0, true, ref sReadErr);
|
||||
if (dsExcel == null || dsExcel.Tables.Count < 1 || !sReadErr.Trim().Equals(""))
|
||||
{
|
||||
ShowMessage("读取外径盘具金额Excel失败:" + sReadErr);
|
||||
return null;
|
||||
}
|
||||
return dsExcel;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user