98 lines
3.3 KiB
C#
98 lines
3.3 KiB
C#
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
|
|
{
|
|
[TableMap(DB = "DBERP", DbTableName = "XLXSJGBYZZ1", Umid = 100860017, IsWorkFlow = false, IsAttach = false, UseWhr = false)]
|
|
|
|
public class CLQDYZ_XJFY : EntityManager
|
|
{
|
|
}
|
|
|
|
public partial class CLQDYZ_XJFYView : SingleGridBase
|
|
{
|
|
CLQDYZ_XJFY entity = new CLQDYZ_XJFY();
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
this.UMID = 100860017;
|
|
this.UMName = "查看线径费用";
|
|
this.CurMaster = Master;
|
|
this.ModuleGV = ContentGrid;
|
|
this.CurEntity = entity;
|
|
this.PageHeight = 500;
|
|
this.PageWidth = 650;
|
|
this.Master.EnableNewBtn = false;
|
|
this.Master.EnableCopyBtn = false;
|
|
this.Master.EnableViewBtn = false;
|
|
this.Master.EnableEditBtn = false;
|
|
this.Master.EnableDeleteBtn = false;
|
|
this.Master.EnableAttachBtn = false;
|
|
this.Master.EnableQueryBtn = false;
|
|
base.InitPage();
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
Master_OnStandardQuery(null, null);
|
|
}
|
|
this.ModuleGV.OnClientDblClick = "return false;";
|
|
}
|
|
|
|
protected override void Master_OnStandardQuery(object sender, EventArgs e)
|
|
{
|
|
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)
|
|
{
|
|
|
|
entity.EntityTable.QuerySelSql = "select 1 from XLXSJGBYZZ1 where 1<>1";
|
|
base.moduleGV_PageIndexChanging(sender, e);
|
|
DataSet ds = GetExcelData();
|
|
ContentGrid.SelectedIndex = -1;
|
|
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;
|
|
}
|
|
}
|
|
}
|