2023-05-11 09:58:37 +08:00
using System ;
using System.Collections.Generic ;
using System.Data ;
using System.Data.SqlClient ;
2023-05-17 17:35:00 +08:00
using System.IO ;
2023-05-11 09:58:37 +08:00
using System.Linq ;
using System.Text ;
2023-05-17 17:35:00 +08:00
using Aspose.Words ;
using Aspose.Words.Drawing ;
using Aspose.Words.Drawing.Charts ;
2023-05-11 09:58:37 +08:00
using BLL ;
using AspNet = System . Web . UI . WebControls ;
namespace FineUIPro.Web.JDGL.CostAnalysis
{
public partial class JDReport : PageBase
{
#region 加 载 页 面
protected void Page_Load ( object sender , EventArgs e )
{
if ( ! IsPostBack )
{
this . txtMonths . Text = string . Format ( "{0:yyyy-MM}" , DateTime . Now ) ;
GetValue ( ) ;
}
}
private void SetEmpty ( )
{
this . SimpleForm1 . Title = string . Empty ;
txt5 . Text = string . Empty ;
}
#endregion
#region 获 取 记 录 值
private void GetValue ( )
{
Model . Project_Installation installation = BLL . Project_InstallationService . GetProjectInstallationByProjectId ( this . CurrUser . LoginProjectId ) ;
if ( installation ! = null & & ! string . IsNullOrEmpty ( this . txtMonths . Text . Trim ( ) ) )
{
string id = installation . InstallationId ;
string date = this . txtMonths . Text . Trim ( ) + "-01" ;
string strSql = "select distinct (cast(YEAR(Months) as varchar(4))+'.'+cast(MONTH(Months) as varchar(2))) as 月份,t.Months," +
"ThisRealCost as '本月已完工作实际费用-ACWP',ThisPlanCost as '本月已完工作预算费用-BCWP',ThisPlanValue as '本月计划工作预算费用-BCWS',TotalPlanValue as '累计计划工作预算费用-BCWS',TotalRealCost as '累计已完工作实际费用-ACWP',TotalPlanCost as '累计已完工作预算费用-BCWP' " +
"from dbo.View_WBS_CostControlParentDetail as t where ParentId=@Id and t.Months<=@Months order by t.Months" ;
//string date = DateTime.Now.Year + "-" + DateTime.Now.Month + "-01";
SqlParameter [ ] parameter = new SqlParameter [ ]
{
new SqlParameter ( "@Id" , id ) ,
new SqlParameter ( "@Months" , date ) ,
} ;
DataTable dt = SQLHelper . GetDataTableRunText ( strSql , parameter ) ;
decimal lastbcws = 0 , bcws = 0 , lastacwp = 0 , acwp = 0 , lastbcwp = 0 , bcwp = 0 ;
for ( int i = 0 ; i < dt . Rows . Count ; i + + )
{
dt . Rows [ i ] [ "本月已完工作实际费用-ACWP" ] = Funs . GetNewDecimalOrZero ( dt . Rows [ i ] [ "本月已完工作实际费用-ACWP" ] . ToString ( ) ) / 10000 ;
dt . Rows [ i ] [ "本月已完工作预算费用-BCWP" ] = Funs . GetNewDecimalOrZero ( dt . Rows [ i ] [ "本月已完工作预算费用-BCWP" ] . ToString ( ) ) / 10000 ;
dt . Rows [ i ] [ "本月计划工作预算费用-BCWS" ] = Funs . GetNewDecimalOrZero ( dt . Rows [ i ] [ "本月计划工作预算费用-BCWS" ] . ToString ( ) ) / 10000 ;
bcws = Funs . GetNewDecimalOrZero ( dt . Rows [ i ] [ "累计计划工作预算费用-BCWS" ] . ToString ( ) ) ;
acwp = Funs . GetNewDecimalOrZero ( dt . Rows [ i ] [ "累计已完工作实际费用-ACWP" ] . ToString ( ) ) ;
bcwp = Funs . GetNewDecimalOrZero ( dt . Rows [ i ] [ "累计已完工作预算费用-BCWP" ] . ToString ( ) ) ;
if ( bcws = = lastbcws )
{
if ( Funs . GetNewDateTimeOrNow ( dt . Rows [ i ] [ "Months" ] . ToString ( ) ) > DateTime . Now )
{
dt . Rows [ i ] [ "累计计划工作预算费用-BCWS" ] = DBNull . Value ;
}
else
{
dt . Rows [ i ] [ "累计计划工作预算费用-BCWS" ] = bcws / 10000 ;
}
}
else
{
dt . Rows [ i ] [ "累计计划工作预算费用-BCWS" ] = bcws / 10000 ;
}
if ( acwp = = lastacwp )
{
if ( Funs . GetNewDateTimeOrNow ( dt . Rows [ i ] [ "Months" ] . ToString ( ) ) > DateTime . Now )
{
dt . Rows [ i ] [ "累计已完工作实际费用-ACWP" ] = DBNull . Value ;
}
else
{
dt . Rows [ i ] [ "累计已完工作实际费用-ACWP" ] = acwp / 10000 ;
}
}
else
{
dt . Rows [ i ] [ "累计已完工作实际费用-ACWP" ] = acwp / 10000 ;
}
if ( bcwp = = lastbcwp )
{
if ( Funs . GetNewDateTimeOrNow ( dt . Rows [ i ] [ "Months" ] . ToString ( ) ) > DateTime . Now )
{
dt . Rows [ i ] [ "累计已完工作预算费用-BCWP" ] = DBNull . Value ;
}
else
{
dt . Rows [ i ] [ "累计已完工作预算费用-BCWP" ] = bcwp / 10000 ;
}
}
else
{
dt . Rows [ i ] [ "累计已完工作预算费用-BCWP" ] = bcwp / 10000 ;
}
lastbcws = bcws ;
lastacwp = acwp ;
lastbcwp = bcwp ;
}
this . ChartEV . CreateMaryChart ( dt , 1220 , 420 , null ) ;
decimal BCWP = Funs . GetNewDecimalOrZero ( dt . Rows [ dt . Rows . Count - 1 ] [ "累计已完工作预算费用-BCWP" ] . ToString ( ) ) ;
decimal BCWS = Funs . GetNewDecimalOrZero ( dt . Rows [ dt . Rows . Count - 1 ] [ "累计计划工作预算费用-BCWS" ] . ToString ( ) ) ;
decimal ACWP = Funs . GetNewDecimalOrZero ( dt . Rows [ dt . Rows . Count - 1 ] [ "累计已完工作实际费用-ACWP" ] . ToString ( ) ) ;
2023-05-13 14:38:09 +08:00
decimal mBCWP = Funs . GetNewDecimalOrZero ( dt . Rows [ dt . Rows . Count - 1 ] [ "本月已完工作预算费用-BCWP" ] . ToString ( ) ) ;
decimal mBCWS = Funs . GetNewDecimalOrZero ( dt . Rows [ dt . Rows . Count - 1 ] [ "本月计划工作预算费用-BCWS" ] . ToString ( ) ) ;
decimal mACWP = Funs . GetNewDecimalOrZero ( dt . Rows [ dt . Rows . Count - 1 ] [ "本月已完工作实际费用-ACWP" ] . ToString ( ) ) ;
2023-05-11 09:58:37 +08:00
decimal CV = BCWP - ACWP ;
decimal SV = BCWP - BCWS ;
2023-05-13 14:38:09 +08:00
decimal CPI = 0 ;
if ( ACWP > 0 )
{
CPI = BCWP / ACWP ;
}
decimal SPI = 0 ;
if ( BCWS > 0 )
{
SPI = BCWP / BCWS ;
}
decimal mCV = mBCWP - mACWP ;
decimal mSV = mBCWP - mBCWS ;
decimal mCPI = 0 ;
if ( mACWP > 0 )
{
mCPI = mBCWP / mACWP ;
}
decimal mSPI = 0 ;
if ( mBCWS > 0 )
{
mSPI = mBCWP / mBCWS ;
}
2023-05-17 17:35:00 +08:00
//总体进度
2023-05-13 14:38:09 +08:00
DataTable table2 = new DataTable ( ) ;
2023-05-15 09:59:34 +08:00
table2 . Columns . Add ( new DataColumn ( "Id" , typeof ( String ) ) ) ;
table2 . Columns . Add ( new DataColumn ( "BCWP" , typeof ( String ) ) ) ;
table2 . Columns . Add ( new DataColumn ( "BCWS" , typeof ( String ) ) ) ;
table2 . Columns . Add ( new DataColumn ( "ACWP" , typeof ( String ) ) ) ;
table2 . Columns . Add ( new DataColumn ( "CV" , typeof ( String ) ) ) ;
table2 . Columns . Add ( new DataColumn ( "SV" , typeof ( String ) ) ) ;
table2 . Columns . Add ( new DataColumn ( "CPI" , typeof ( String ) ) ) ;
table2 . Columns . Add ( new DataColumn ( "SPI" , typeof ( String ) ) ) ;
DataRow row2 ;
row2 = table2 . NewRow ( ) ;
row2 [ 0 ] = SQLHelper . GetNewID ( ) ;
row2 [ 1 ] = BCWP . ToString ( "0.####" ) ;
row2 [ 2 ] = BCWS . ToString ( "0.####" ) ;
row2 [ 3 ] = ACWP . ToString ( "0.####" ) ;
row2 [ 4 ] = CV . ToString ( "0.####" ) ;
row2 [ 5 ] = SV . ToString ( "0.####" ) ;
row2 [ 6 ] = CPI . ToString ( "0.####" ) ;
row2 [ 7 ] = SPI . ToString ( "0.####" ) ;
table2 . Rows . Add ( row2 ) ;
this . Grid2 . DataSource = table2 ;
this . Grid2 . DataBind ( ) ;
2023-05-17 17:35:00 +08:00
//本月进度
table2 . Rows . Clear ( ) ;
row2 [ 0 ] = SQLHelper . GetNewID ( ) ;
row2 [ 1 ] = mBCWP . ToString ( "0.####" ) ;
row2 [ 2 ] = mBCWS . ToString ( "0.####" ) ;
row2 [ 3 ] = mACWP . ToString ( "0.####" ) ;
row2 [ 4 ] = mCV . ToString ( "0.####" ) ;
row2 [ 5 ] = mSV . ToString ( "0.####" ) ;
row2 [ 6 ] = mCPI . ToString ( "0.####" ) ;
row2 [ 7 ] = mSPI . ToString ( "0.####" ) ;
table2 . Rows . Add ( row2 ) ;
this . Grid3 . DataSource = table2 ;
this . Grid3 . DataBind ( ) ;
//按专业统计
DataTable table4 = new DataTable ( ) ;
table4 . Columns . Add ( new DataColumn ( "Id" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "Name1" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "Name2" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "mBCWP" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "mBCWS" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "mACWP" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "mCV" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "mSV" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "mCPI" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "mSPI" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "BCWP" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "BCWS" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "ACWP" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "CV" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "SV" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "CPI" , typeof ( String ) ) ) ;
table4 . Columns . Add ( new DataColumn ( "SPI" , typeof ( String ) ) ) ;
Model . SGGLDB db = Funs . DB ;
var cnProfessionInits = from x in db . WBS_CnProfessionInit select x ;
var cnProfessions = from x in db . WBS_CnProfession where x . ProjectId = = this . CurrUser . LoginProjectId select x ;
var unitProjectInits = from x in db . Wbs_UnitProjectInit select x ;
var unitProjects = from x in db . Wbs_UnitProject where x . ProjectId = = this . CurrUser . LoginProjectId select x ;
var details = from x in db . View_WBS_CostControlParentDetail
where x . Months = = Funs . GetNewDateTime ( date )
select x ;
string strSql2 = "select distinct (cast(YEAR(Months) as varchar(4))+'.'+cast(MONTH(Months) as varchar(2))) as 月份,t.Months," +
"ThisRealCost as '本月已完工作实际费用-ACWP',ThisPlanCost as '本月已完工作预算费用-BCWP',ThisPlanValue as '本月计划工作预算费用-BCWS',TotalPlanValue as '累计计划工作预算费用-BCWS',TotalRealCost as '累计已完工作实际费用-ACWP',TotalPlanCost as '累计已完工作预算费用-BCWP' " +
"from dbo.View_WBS_CostControlParentDetail as t where t.Months=@Months" ;
SqlParameter [ ] parameter2 = new SqlParameter [ ]
{
new SqlParameter ( "@Months" , date ) ,
} ;
DataTable dt2 = SQLHelper . GetDataTableRunText ( strSql2 , parameter2 ) ;
DataRow row4 ;
decimal cnACWP , cnBCWP , cnBCWS , cnmACWP , cnmBCWP , cnmBCWS , cnCV , cnSV , cnCPI , cnSPI , cnmCV , cnmSV , cnmCPI , cnmSPI ,
unACWP , unBCWP , unBCWS , unmACWP , unmBCWP , unmBCWS , unCV , unSV , unCPI , unSPI , unmCV , unmSV , unmCPI , unmSPI ;
foreach ( var cn in cnProfessionInits )
{
cnACWP = 0 ;
cnBCWP = 0 ;
cnBCWS = 0 ;
cnmACWP = 0 ;
cnmBCWP = 0 ;
cnmBCWS = 0 ;
cnCV = 0 ;
cnSV = 0 ;
cnCPI = 0 ;
cnSPI = 0 ;
cnmCV = 0 ;
cnmSV = 0 ;
cnmCPI = 0 ;
cnmSPI = 0 ;
row4 = table4 . NewRow ( ) ;
row4 [ 0 ] = SQLHelper . GetNewID ( ) ;
row4 [ 1 ] = cn . CnProfessionName ;
var cnDetails = ( from x in details
join y in cnProfessions on x . ParentId equals y . CnProfessionId
where y . OldId = = cn . CnProfessionId
select x ) . ToList ( ) ;
cnmACWP = Funs . GetNewDecimalOrZero ( cnDetails . Select ( x = > x . ThisRealCost ) . Sum ( ) . ToString ( ) ) / 10000 ;
cnmBCWP = Funs . GetNewDecimalOrZero ( cnDetails . Select ( x = > x . ThisPlanCost ) . Sum ( ) . ToString ( ) ) / 10000 ;
cnmBCWS = Funs . GetNewDecimalOrZero ( cnDetails . Select ( x = > x . ThisPlanValue ) . Sum ( ) . ToString ( ) ) / 10000 ;
cnmCV = cnmBCWP - cnmACWP ;
cnmSV = cnmBCWP - cnmBCWS ;
if ( cnmACWP > 0 )
{
cnmCPI = cnmBCWP / cnmACWP ;
}
if ( cnmBCWS > 0 )
{
cnmSPI = cnmBCWP / cnmBCWS ;
}
row4 [ 3 ] = cnmBCWP . ToString ( "0.####" ) ;
row4 [ 4 ] = cnmBCWS . ToString ( "0.####" ) ;
row4 [ 5 ] = cnmACWP . ToString ( "0.####" ) ;
row4 [ 6 ] = cnmCV . ToString ( "0.####" ) ;
row4 [ 7 ] = cnmSV . ToString ( "0.####" ) ;
row4 [ 8 ] = cnmCPI . ToString ( "0.####" ) ;
row4 [ 9 ] = cnmSPI . ToString ( "0.####" ) ;
cnACWP = Funs . GetNewDecimalOrZero ( cnDetails . Select ( x = > x . TotalRealCost ) . Sum ( ) . ToString ( ) ) / 10000 ;
cnBCWP = Funs . GetNewDecimalOrZero ( cnDetails . Select ( x = > x . TotalPlanCost ) . Sum ( ) . ToString ( ) ) / 10000 ;
cnBCWS = Funs . GetNewDecimalOrZero ( cnDetails . Select ( x = > x . TotalPlanValue ) . Sum ( ) . ToString ( ) ) / 10000 ;
cnCV = cnBCWP - cnACWP ;
cnSV = cnBCWP - cnBCWS ;
if ( cnACWP > 0 )
{
cnCPI = cnBCWP / cnACWP ;
}
if ( cnBCWS > 0 )
{
cnSPI = cnBCWP / cnBCWS ;
}
row4 [ 10 ] = cnBCWP . ToString ( "0.####" ) ;
row4 [ 11 ] = cnBCWS . ToString ( "0.####" ) ;
row4 [ 12 ] = cnACWP . ToString ( "0.####" ) ;
row4 [ 13 ] = cnCV . ToString ( "0.####" ) ;
row4 [ 14 ] = cnSV . ToString ( "0.####" ) ;
row4 [ 15 ] = cnCPI . ToString ( "0.####" ) ;
row4 [ 16 ] = cnSPI . ToString ( "0.####" ) ;
table4 . Rows . Add ( row4 ) ;
var unLists = ( from x in unitProjectInits where x . CnProfessionId = = cn . CnProfessionId orderby x . SortIndex select x ) . ToList ( ) ;
foreach ( var un in unLists )
{
unACWP = 0 ;
unBCWP = 0 ;
unBCWS = 0 ;
unmACWP = 0 ;
unmBCWP = 0 ;
unmBCWS = 0 ;
unCV = 0 ;
unSV = 0 ;
unCPI = 0 ;
unSPI = 0 ;
unmCV = 0 ;
unmSV = 0 ;
unmCPI = 0 ;
unmSPI = 0 ;
row4 = table4 . NewRow ( ) ;
row4 [ 0 ] = SQLHelper . GetNewID ( ) ;
row4 [ 2 ] = un . UnitProjectName ;
var unDetails = from x in details
join y in unitProjects on x . ParentId equals y . UnitProjectId
where y . UnitProjectCode = = un . UnitProjectCode
select x ;
unmACWP = Funs . GetNewDecimalOrZero ( unDetails . Select ( x = > x . ThisRealCost ) . Sum ( ) . ToString ( ) ) / 10000 ;
unmBCWP = Funs . GetNewDecimalOrZero ( unDetails . Select ( x = > x . ThisPlanCost ) . Sum ( ) . ToString ( ) ) / 10000 ;
unmBCWS = Funs . GetNewDecimalOrZero ( unDetails . Select ( x = > x . ThisPlanValue ) . Sum ( ) . ToString ( ) ) / 10000 ;
unmCV = unmBCWP - unmACWP ;
unmSV = unmBCWP - unmBCWS ;
if ( unmACWP > 0 )
{
unmCPI = unmBCWP / unmACWP ;
}
if ( unmBCWS > 0 )
{
unmSPI = unmBCWP / unmBCWS ;
}
row4 [ 3 ] = unmBCWP . ToString ( "0.####" ) ;
row4 [ 4 ] = unmBCWS . ToString ( "0.####" ) ;
row4 [ 5 ] = unmACWP . ToString ( "0.####" ) ;
row4 [ 6 ] = unmCV . ToString ( "0.####" ) ;
row4 [ 7 ] = unmSV . ToString ( "0.####" ) ;
row4 [ 8 ] = unmCPI . ToString ( "0.####" ) ;
row4 [ 9 ] = unmSPI . ToString ( "0.####" ) ;
unACWP = Funs . GetNewDecimalOrZero ( unDetails . Select ( x = > x . TotalRealCost ) . Sum ( ) . ToString ( ) ) / 10000 ;
unBCWP = Funs . GetNewDecimalOrZero ( unDetails . Select ( x = > x . TotalPlanCost ) . Sum ( ) . ToString ( ) ) / 10000 ;
unBCWS = Funs . GetNewDecimalOrZero ( unDetails . Select ( x = > x . TotalPlanValue ) . Sum ( ) . ToString ( ) ) / 10000 ;
unCV = unBCWP - unACWP ;
unSV = unBCWP - unBCWS ;
if ( unACWP > 0 )
{
unCPI = unBCWP / unACWP ;
}
if ( unBCWS > 0 )
{
unSPI = unBCWP / unBCWS ;
}
row4 [ 10 ] = unBCWP . ToString ( "0.####" ) ;
row4 [ 11 ] = unBCWS . ToString ( "0.####" ) ;
row4 [ 12 ] = unACWP . ToString ( "0.####" ) ;
row4 [ 13 ] = unCV . ToString ( "0.####" ) ;
row4 [ 14 ] = unSV . ToString ( "0.####" ) ;
row4 [ 15 ] = unCPI . ToString ( "0.####" ) ;
row4 [ 16 ] = unSPI . ToString ( "0.####" ) ;
table4 . Rows . Add ( row4 ) ;
}
}
this . Grid4 . DataSource = table4 ;
this . Grid4 . DataBind ( ) ;
2023-05-11 09:58:37 +08:00
}
}
#endregion
#region 查 询
/// <summary>
/// 查询按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click ( object sender , EventArgs e )
{
GetValue ( ) ;
}
#endregion
#region 关 闭 弹 出 窗 口
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close ( object sender , WindowCloseEventArgs e )
{
2023-05-17 17:35:00 +08:00
if ( ! string . IsNullOrEmpty ( this . txtMonths . Text . Trim ( ) ) )
{
GetValue ( ) ;
}
else
{
ShowNotify ( "请选择月份" , MessageBoxIcon . Warning ) ;
}
2023-05-11 09:58:37 +08:00
}
#endregion
#region 导 出 按 钮
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click ( object sender , EventArgs e )
{
2023-05-17 17:35:00 +08:00
if ( ! string . IsNullOrEmpty ( this . txtMonths . Text . Trim ( ) ) )
{
string rootPath = Server . MapPath ( "~/" ) ;
string initTemplatePath = string . Empty ;
string uploadfilepath = string . Empty ;
string newUrl = string . Empty ;
string filePath = string . Empty ;
Model . SGGLDB db = Funs . DB ;
initTemplatePath = Const . JDReportTemplateUrl ;
uploadfilepath = rootPath + initTemplatePath ;
newUrl = uploadfilepath . Replace ( ".docx" , "(" + this . txtMonths . Text . Trim ( ) + ")" + ".docx" ) ;
if ( File . Exists ( newUrl ) )
{
File . Delete ( newUrl ) ;
}
File . Copy ( uploadfilepath , newUrl ) ;
//更新书签内容
Document doc = new Aspose . Words . Document ( newUrl ) ;
DocumentBuilder builder = new DocumentBuilder ( doc ) ;
string projectName = string . Empty ;
var project = ProjectService . GetProjectByProjectId ( this . CurrUser . LoginProjectId ) ;
if ( project ! = null )
{
projectName = project . ProjectName ;
}
Bookmark bookmarkProjectName = doc . Range . Bookmarks [ "ProjectName" ] ;
if ( bookmarkProjectName ! = null )
{
bookmarkProjectName . Text = projectName ;
}
Bookmark bookmarkMonths = doc . Range . Bookmarks [ "Months" ] ;
if ( bookmarkMonths ! = null )
{
string [ ] strs = this . txtMonths . Text . Trim ( ) . Split ( '-' ) ;
bookmarkMonths . Text = strs [ 0 ] + "年" + strs [ 1 ] + "月" ;
}
//插入图表
builder . MoveToBookmark ( "Chart" ) ;
Shape shape = builder . InsertChart ( ChartType . Line , 432 , 252 ) ;
Chart chart = shape . Chart ;
chart . Title . Text = "赢得值曲线" ;
ChartSeriesCollection seriesColl = chart . Series ;
seriesColl . Clear ( ) ;
string [ ] categories = new string [ ] { "1月" , "2月" , "3月" , "4月" , "5月" , "6月" , "7月" , "8月" , "9月" , "10月" , "11月" , "12月" } ;
seriesColl . Add ( "自有人员" , categories , new double [ ] { 1 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ) ;
seriesColl . Add ( "施工人员" , categories , new double [ ] { 3 , 4 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ) ;
seriesColl . Add ( "累计安全人工时" , categories , new double [ ] { 5 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ) ;
doc . Save ( newUrl ) ;
string fileName = Path . GetFileName ( newUrl ) ;
FileInfo info = new FileInfo ( newUrl ) ;
long fileSize = info . Length ;
Response . Clear ( ) ;
Response . ContentType = "application/x-zip-compressed" ;
Response . AddHeader ( "Content-Disposition" , "attachment;filename=" + System . Web . HttpUtility . UrlEncode ( fileName , System . Text . Encoding . UTF8 ) ) ;
Response . AddHeader ( "Content-Length" , fileSize . ToString ( ) ) ;
Response . TransmitFile ( newUrl , 0 , fileSize ) ;
Response . Flush ( ) ;
Response . Close ( ) ;
File . Delete ( newUrl ) ;
}
else
{
ShowNotify ( "请选择月份" , MessageBoxIcon . Warning ) ;
}
2023-05-11 09:58:37 +08:00
}
#endregion
}
}