88 lines
2.5 KiB
C#
88 lines
2.5 KiB
C#
using Aspose.Words;
|
|
|
|
using BLL;
|
|
using BLL.Common;
|
|
using NPOI.SS.Formula.Functions;
|
|
using Spire.Pdf;
|
|
using Spire.Pdf.Utilities;
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.OleDb;
|
|
using System.Data.SqlClient;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Web.UI.DataVisualization.Charting;
|
|
|
|
namespace FineUIPro.Web.HJGL.DataIn
|
|
{
|
|
public partial class PipeLineInAuto : PageBase
|
|
{
|
|
#region 加载
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 文件上传
|
|
/// <summary>
|
|
/// 文件上传
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void imgbtnImport_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (this.FileExcel.HasFile == false)
|
|
{
|
|
Response.Write("<script>alert('请您选择pdf文件')</script> ");
|
|
|
|
return;
|
|
}
|
|
string IsXls = Path.GetExtension(FileExcel.FileName).ToString().Trim().ToLower();
|
|
if (IsXls != ".pdf")
|
|
{
|
|
Response.Write("\"<script>alert('请您选择pdf文件')</script> ");
|
|
return;
|
|
}
|
|
string rootPath = Server.MapPath("~/");
|
|
string initFullPath = rootPath + Const.ExcelUrl;
|
|
if (!Directory.Exists(initFullPath))
|
|
{
|
|
Directory.CreateDirectory(initFullPath);
|
|
}
|
|
string fileUrl = initFullPath + BLL.Funs.GetNewFileName() + IsXls;
|
|
this.FileExcel.PostedFile.SaveAs(fileUrl);
|
|
if (ckbSkipFirst.Checked)
|
|
{
|
|
RegionPanel1.IFrameUrl = "./PipelineGrid.aspx?ckbSkipFirst=" + 1 + "&&fileUrl=" + fileUrl;
|
|
}
|
|
else
|
|
{
|
|
RegionPanel1.IFrameUrl = "./PipelineGrid.aspx?ckbSkipFirst=" + 0 + "&&fileUrl=" + fileUrl;
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ShowNotify(ex.Message, MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
} |