提交代码
This commit is contained in:
@@ -83,6 +83,9 @@
|
||||
<f:Button ID="btnOut2" runat="server" Text="导出" ToolTip="导出焊口初始数据信息" Hidden="true"
|
||||
Icon="FolderUp" EnableAjax="false" DisableControlBeforePostBack="false" OnClick="btnOut2_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
<f:Button ID="btnPrint" Text="打印" Icon="Printer" runat="server"
|
||||
OnClick="btnPrint_Click">
|
||||
</f:Button>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using BLL;
|
||||
using NPOI.SS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
@@ -839,27 +841,171 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
#endregion
|
||||
|
||||
#region 导出焊口信息
|
||||
/// <summary>
|
||||
/// 导出焊口信息
|
||||
/// 导出按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
//var iso = BLL.Pipeline_PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
|
||||
//var workArea = BLL.Project_WorkAreaService.GetProject_WorkAreaByWorkAreaId(this.tvControlItem.SelectedNodeID);
|
||||
//if (iso != null)
|
||||
//{
|
||||
// PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("JointInfoOut.aspx?PipelineId={0}", this.tvControlItem.SelectedNodeID, "导出 - ")));
|
||||
//}
|
||||
//else if (workArea != null)
|
||||
//{
|
||||
// PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("JointInfoOut.aspx?WorkAreaId={0}", this.tvControlItem.SelectedNodeID, "导出 - ")));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Alert.ShowInTop("请选择"PipelineOrArea, MessageBoxIcon.Warning);
|
||||
//}
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initTemplatePath = string.Empty;
|
||||
string uploadfilepath = string.Empty;
|
||||
string newUrl = string.Empty;
|
||||
string filePath = string.Empty;
|
||||
initTemplatePath = Const.JotTwoDesignTemplateUrl;
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
string constructionLogId = this.tvControlItem.SelectedNodeID;
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency
|
||||
where x.ConstructionLogId == constructionLogId
|
||||
select x;
|
||||
var persons = from x in db.ZHGL_ConstructionLogPerson
|
||||
where x.ConstructionLogId == constructionLogId
|
||||
select x;
|
||||
var machines = from x in db.ZHGL_ConstructionLogMachine
|
||||
where x.ConstructionLogId == constructionLogId
|
||||
select x;
|
||||
if (this.Grid1.Rows.Count > 0)
|
||||
{
|
||||
newUrl = uploadfilepath.Replace(".xlsx", "(" + string.Format("{0:yyyy-MM-dd}", DateTime.Now) + ")" + ".xlsx");
|
||||
File.Copy(uploadfilepath, newUrl);
|
||||
// 第一步:读取文件流
|
||||
NPOI.SS.UserModel.IWorkbook workbook;
|
||||
using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream);
|
||||
}
|
||||
// 创建单元格样式
|
||||
NPOI.SS.UserModel.ICellStyle cellStyle0 = workbook.CreateCellStyle();
|
||||
cellStyle0.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cellStyle0.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cellStyle0.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cellStyle0.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cellStyle0.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
|
||||
cellStyle0.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
|
||||
cellStyle0.WrapText = true;
|
||||
var font = workbook.CreateFont();
|
||||
font.FontHeightInPoints = 11;
|
||||
font.IsBold = false;
|
||||
cellStyle0.SetFont(font);
|
||||
// 第二步:创建新数据行
|
||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||
int rowCount = 2;
|
||||
for (int i = 0; i < this.Grid1.Rows.Count; i++)
|
||||
{
|
||||
NPOI.SS.UserModel.IRow row1 = sheet.CreateRow(rowCount);
|
||||
NPOI.SS.UserModel.ICell cell;
|
||||
cell = row1.CreateCell(0);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue((i+1).ToString());
|
||||
cell = row1.CreateCell(1);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[2].ToString());
|
||||
cell = row1.CreateCell(2);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[3].ToString());
|
||||
cell = row1.CreateCell(3);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[4].ToString());
|
||||
cell = row1.CreateCell(4);
|
||||
cell.CellStyle = cellStyle0;
|
||||
string date1 = this.Grid1.Rows[i].Values[5].ToString();
|
||||
if (!string.IsNullOrEmpty(date1))
|
||||
{
|
||||
date1 = string.Format("{0:yyyy-MM-dd}",Funs.GetNewDateTime(date1));
|
||||
}
|
||||
cell.SetCellValue(date1);
|
||||
cell = row1.CreateCell(5);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[6].ToString());
|
||||
cell = row1.CreateCell(6);
|
||||
cell.CellStyle = cellStyle0;
|
||||
string date2 = this.Grid1.Rows[i].Values[7].ToString();
|
||||
if (!string.IsNullOrEmpty(date2))
|
||||
{
|
||||
date2 = string.Format("{0:yyyy-MM-dd}", Funs.GetNewDateTime(date2));
|
||||
}
|
||||
cell.SetCellValue(date2);
|
||||
cell = row1.CreateCell(7);
|
||||
cell.CellStyle = cellStyle0;
|
||||
string weldJointCode = string.Empty;
|
||||
var weldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(this.Grid1.Rows[i].RowID);
|
||||
if (weldJoint != null)
|
||||
{
|
||||
weldJointCode = weldJoint.WeldJointCode;
|
||||
}
|
||||
cell.SetCellValue(weldJointCode);
|
||||
cell = row1.CreateCell(8);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[10].ToString());
|
||||
cell = row1.CreateCell(9);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[11].ToString());
|
||||
cell = row1.CreateCell(10);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[12].ToString());
|
||||
cell = row1.CreateCell(11);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[13].ToString());
|
||||
cell = row1.CreateCell(12);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[14].ToString());
|
||||
cell = row1.CreateCell(13);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[15].ToString());
|
||||
cell = row1.CreateCell(14);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[16].ToString());
|
||||
cell = row1.CreateCell(15);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[17].ToString());
|
||||
cell = row1.CreateCell(16);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[18].ToString());
|
||||
cell = row1.CreateCell(17);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[20].ToString());
|
||||
cell = row1.CreateCell(18);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[21].ToString());
|
||||
cell = row1.CreateCell(19);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[22].ToString());
|
||||
cell = row1.CreateCell(20);
|
||||
cell.CellStyle = cellStyle0;
|
||||
cell.SetCellValue(this.Grid1.Rows[i].Values[27].ToString());
|
||||
rowCount++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 第三步:写入文件流
|
||||
using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write))
|
||||
{
|
||||
workbook.Write(stream);
|
||||
workbook.Close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -887,47 +1033,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
// Alert.ShowInTop("请选择"PipelinetFirst, MessageBoxIcon.Warning);
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出方法
|
||||
/// </summary>
|
||||
/// <param name="grid"></param>
|
||||
/// <returns></returns>
|
||||
private string GetGridTableHtml(Grid grid)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
||||
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
if (column.HeaderText != "序号")
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
}
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
foreach (GridRow row in grid.Rows)
|
||||
{
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
string html = row.Values[column.ColumnIndex].ToString();
|
||||
if (column.ColumnID != "tfNumber")
|
||||
{
|
||||
//html = (row.FindControl("lblNumber") as AspNet.Label).Text;
|
||||
sb.AppendFormat("<td>{0}</td>", html);
|
||||
}
|
||||
//sb.AppendFormat("<td>{0}</td>", html);
|
||||
}
|
||||
|
||||
sb.Append("</tr>");
|
||||
}
|
||||
|
||||
sb.Append("</table>");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 选择要显示列
|
||||
|
||||
@@ -201,6 +201,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut2;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// btnPrint 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
var table = this.GetPagedDataTable(Grid2, tb);
|
||||
Grid2.DataSource = table;
|
||||
Grid2.DataBind();
|
||||
drpVersion.DataSource = BLL.HJGL_DesignBasisDataImportService.GetListVersionByUnitWorkId(Request.Params["UnitWorkId"], DataClassification);
|
||||
drpVersion.DataSource = BLL.HJGL_DesignBasisDataImportService.GetListVersionByUnitWorkId(Request.Params["UnitWorkId"], DataClassification);
|
||||
drpVersion.DataBind();
|
||||
|
||||
}
|
||||
@@ -164,10 +164,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
try
|
||||
{
|
||||
var ds = MiniExcel.Query(fileName).ToList();
|
||||
var columns = MiniExcel.GetColumns(fileName);
|
||||
var cnt = columns.Count;
|
||||
var reposedata = AddDatasetToSQL(ds, cnt);
|
||||
if (reposedata.code==1)
|
||||
var columns = MiniExcel.GetColumns(fileName);
|
||||
var cnt = columns.Count;
|
||||
var reposedata = AddDatasetToSQL(ds, cnt);
|
||||
if (reposedata.code == 1)
|
||||
{
|
||||
State = (int)ButtonState.Import;
|
||||
ShowNotify("审核完成请点击导入");
|
||||
@@ -192,7 +192,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region 将Dataset的数据导入数据库
|
||||
/// <summary>
|
||||
@@ -204,7 +204,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
private Model.ResponeData AddDatasetToSQL(List<dynamic> pds, int count)
|
||||
{
|
||||
Model.ResponeData responeData = new Model.ResponeData();
|
||||
// string result = string.Empty;
|
||||
// string result = string.Empty;
|
||||
List<string> result = new List<string>();
|
||||
//pds = BLL.Funs.FilterBlankLines(pds);
|
||||
if (count < 28)
|
||||
@@ -245,7 +245,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
string pipeLineId = string.Empty;
|
||||
if (string.IsNullOrEmpty(col0))
|
||||
{
|
||||
result.Add( "第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|");
|
||||
result.Add("第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -265,8 +265,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
var Medium = getMedium.FirstOrDefault(x => x.MediumCode == col3);
|
||||
if (Medium == null)
|
||||
{
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该介质不存在!" + "|";
|
||||
result .Add( col3 + "-该介质不存在!" + "|");
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该介质不存在!" + "|";
|
||||
result.Add(col3 + "-该介质不存在!" + "|");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -284,7 +284,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
var PipeLineClass = getPipeLineClass.FirstOrDefault(x => x.PipingClassCode == col4);
|
||||
if (PipeLineClass == null)
|
||||
{
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该管道等级不存在!" + "|";
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该管道等级不存在!" + "|";
|
||||
result.Add(col4 + "-该管道等级不存在!" + "|");
|
||||
}
|
||||
else
|
||||
@@ -299,7 +299,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
var DetectionRate = getDetectionRate.FirstOrDefault(x => x.DetectionRateValue.ToString() == col5.Replace("%", "") || x.DetectionRateCode == col5);
|
||||
if (DetectionRate == null)
|
||||
{
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该探伤比例不存在!" + "|";
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该探伤比例不存在!" + "|";
|
||||
result.Add(col5 + "-该探伤比例不存在!" + "|");
|
||||
}
|
||||
else
|
||||
@@ -316,26 +316,18 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
string col6 = pds[i].G;
|
||||
if (!string.IsNullOrEmpty(col6))
|
||||
{
|
||||
string[] types = col6.ToString().Split(',');
|
||||
foreach (string t in types)
|
||||
string typeStr = col6.ToString();
|
||||
var type = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == typeStr);
|
||||
if (type == null)
|
||||
{
|
||||
var type = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == t);
|
||||
if (type == null)
|
||||
{
|
||||
//result += "第" + (i + 1).ToString() + "行," + "探伤类型【" + t + "】不存在!" + "|";
|
||||
result.Add("探伤类型【" + t + "】不存在!" + "|");
|
||||
}
|
||||
else
|
||||
{
|
||||
pipeline.DetectionType += type.DetectionTypeId + "|";
|
||||
}
|
||||
//result += "第" + (i + 1).ToString() + "行," + "探伤类型【" + t + "】不存在!" + "|";
|
||||
result.Add("探伤类型【" + typeStr + "】不存在!" + "|");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pipeline.DetectionType))
|
||||
else
|
||||
{
|
||||
pipeline.DetectionType = pipeline.DetectionType.Substring(0, pipeline.DetectionType.Length - 1);
|
||||
pipeline.DetectionType = type.DetectionTypeId;
|
||||
pipeline.DetectionTypeStr = col6;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -378,7 +370,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
var PressurePipingClass = getPressurePipingClass.FirstOrDefault(x => x.PressurePipingClassCode == col11);
|
||||
if (PressurePipingClass == null)
|
||||
{
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该压力管道级别不存在!" + "|";
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该压力管道级别不存在!" + "|";
|
||||
result.Add(col11 + "-该压力管道级别不存在!" + "|");
|
||||
}
|
||||
else
|
||||
@@ -447,7 +439,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col17);
|
||||
if (material == null)
|
||||
{
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该材质不存在!" + "|";
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该材质不存在!" + "|";
|
||||
result.Add(col17 + "-该材质不存在!" + "|");
|
||||
}
|
||||
else
|
||||
@@ -456,7 +448,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
pipeline.PipeMaterialCode = col17;
|
||||
}
|
||||
}
|
||||
pipeline.FlowingSection= Convert.ToString(pds[i].S);
|
||||
pipeline.FlowingSection = Convert.ToString(pds[i].S);
|
||||
pipeline.Remark = Convert.ToString(pds[i].T);
|
||||
|
||||
// 以下是焊口信息
|
||||
@@ -480,17 +472,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
|
||||
string col20 = "";
|
||||
if (pds[i].V!=null)
|
||||
if (pds[i].V != null)
|
||||
{
|
||||
col20 = pds[i].V.ToString();
|
||||
}
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(col20))
|
||||
{
|
||||
var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col20);
|
||||
if (material == null)
|
||||
{
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该材质1不存在!" + "|";
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该材质1不存在!" + "|";
|
||||
result.Add(col20 + "-该材质1不存在!" + "|");
|
||||
}
|
||||
else
|
||||
@@ -505,11 +497,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
|
||||
string col21 = "";
|
||||
if (pds[i].W!=null)
|
||||
if (pds[i].W != null)
|
||||
{
|
||||
col21 = pds[i].W.ToString();
|
||||
}
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(col21))
|
||||
{
|
||||
var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col21);
|
||||
@@ -530,10 +522,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
|
||||
string col22 = Convert.ToString(pds[i].X);
|
||||
string col27 = "";
|
||||
if (pds[i].AC!=null)
|
||||
string col27 = "";
|
||||
if (pds[i].AC != null)
|
||||
{
|
||||
col27= pds[i].AC.ToString();
|
||||
col27 = pds[i].AC.ToString();
|
||||
}
|
||||
if (rbDiaType.SelectedValue == "1")
|
||||
{
|
||||
@@ -576,7 +568,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
|
||||
|
||||
var col23 = Convert.ToString(pds[i].Y);
|
||||
if (col23!=null)
|
||||
if (col23 != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -594,8 +586,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
|
||||
var col24 = Convert.ToString(pds[i].Z);
|
||||
if (col24!=null)
|
||||
{
|
||||
if (col24 != null)
|
||||
{
|
||||
// var Thickness = Convert.ToDecimal(col24);
|
||||
decimal Thickness = 0;
|
||||
string thickness = col24.ToString();
|
||||
@@ -603,12 +595,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
if (rbDiaType.SelectedValue == "1")//外径
|
||||
{
|
||||
Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDia(pipeline.Dia,thickness);
|
||||
Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDia(pipeline.Dia, thickness);
|
||||
pipeline.Thickness = Thickness;
|
||||
}
|
||||
else //DN直径
|
||||
{
|
||||
Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDNDia(int.Parse( pipeline.DNDia.Replace("DN","")), thickness);
|
||||
Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDNDia(int.Parse(pipeline.DNDia.Replace("DN", "")), thickness);
|
||||
pipeline.Thickness = Thickness;
|
||||
}
|
||||
}
|
||||
@@ -635,7 +627,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -658,7 +650,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
var weldType = getWeldType.FirstOrDefault(x => x.WeldTypeCode == col25);
|
||||
if (weldType == null)
|
||||
{
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该焊缝类型不存在!" + "|";
|
||||
// result += "第" + (i + 1).ToString() + "行," + "该焊缝类型不存在!" + "|";
|
||||
result.Add(col25 + "-该焊缝类型不存在!" + "|");
|
||||
}
|
||||
else
|
||||
@@ -746,7 +738,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
pipeline.ProjectId = this.CurrUser.LoginProjectId;
|
||||
PipelineList.Add(pipeline);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
if (result.Count > 0)
|
||||
@@ -840,21 +832,21 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string oldefilePath = rootPath+initPath + this.hdFileName.Text;
|
||||
string oldefilePath = rootPath + initPath + this.hdFileName.Text;
|
||||
string unitworkId = Request.Params["UnitWorkId"];
|
||||
string filePath = rootPath+ Const.DesignBasisDataImportPath + this.hdFileName.Text;
|
||||
string filePath = rootPath + Const.DesignBasisDataImportPath + this.hdFileName.Text;
|
||||
if (oldefilePath != string.Empty && System.IO.File.Exists(oldefilePath))
|
||||
{
|
||||
if (!Directory.Exists(rootPath + Const.DesignBasisDataImportPath))
|
||||
{
|
||||
Directory.CreateDirectory(rootPath + Const.DesignBasisDataImportPath);
|
||||
}
|
||||
File.Move(oldefilePath, filePath);
|
||||
File.Move(oldefilePath, filePath);
|
||||
//System.IO.File.Delete(oldefilePath);//删除上传的XLS文件
|
||||
}
|
||||
string FileName = this.fuAttachUrl.FileName;
|
||||
|
||||
|
||||
|
||||
if (DrpType.SelectedValue == "1")//更新导入
|
||||
{
|
||||
|
||||
@@ -863,8 +855,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
BLL.PipelineService.DeletePipelineByUnitworkId(unitworkId);//删除原有管线
|
||||
AddView_HJGL_WeldJoint(PipelineList);//导入数据
|
||||
|
||||
Model .HJGL_DesignBasisDataImport hJGL_DesignBasisDataImport = new Model .HJGL_DesignBasisDataImport();
|
||||
hJGL_DesignBasisDataImport.DesignBasisDataImportId= SQLHelper.GetNewID();
|
||||
Model.HJGL_DesignBasisDataImport hJGL_DesignBasisDataImport = new Model.HJGL_DesignBasisDataImport();
|
||||
hJGL_DesignBasisDataImport.DesignBasisDataImportId = SQLHelper.GetNewID();
|
||||
hJGL_DesignBasisDataImport.ProjectId = this.CurrUser.LoginProjectId;
|
||||
hJGL_DesignBasisDataImport.UnitWorkId = unitworkId;
|
||||
hJGL_DesignBasisDataImport.ImportType = "1";
|
||||
@@ -872,14 +864,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
hJGL_DesignBasisDataImport.FileName = FileName;
|
||||
hJGL_DesignBasisDataImport.FilePath = filePath.Replace(rootPath, "");
|
||||
hJGL_DesignBasisDataImport.FileType = BLL.HJGL_DesignBasisDataImportService.GetFileType(FileName);
|
||||
hJGL_DesignBasisDataImport.Version = BLL.HJGL_DesignBasisDataImportService.GetNewVersionByUnitWorkId(unitworkId,DataClassification);
|
||||
hJGL_DesignBasisDataImport.Version = BLL.HJGL_DesignBasisDataImportService.GetNewVersionByUnitWorkId(unitworkId, DataClassification);
|
||||
hJGL_DesignBasisDataImport.Remark = txtRemark.Text;
|
||||
hJGL_DesignBasisDataImport.CreateMan = this.CurrUser.PersonId;
|
||||
hJGL_DesignBasisDataImport.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
|
||||
BLL.HJGL_DesignBasisDataImportService.AddHJGL_DesignBasisDataImport(hJGL_DesignBasisDataImport);
|
||||
|
||||
BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, (decimal)hJGL_DesignBasisDataImport.Version, DataClassification);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else //补充导入
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
</f:Button>
|
||||
<f:Button ID="btnUpdateImport" Text="更新导入" ToolTip="更新导入" Icon="PackageIn" runat="server" Hidden="true" OnClick="btnUpdateImport_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnPDMSImport" Text="PDMS导入" ToolTip="PDMS导入" Icon="PackageIn" runat="server" OnClick="btnPDMSImport_Click">
|
||||
<f:Button ID="btnPDMSImport" Text="导入" ToolTip="导入" Icon="PackageIn" runat="server" OnClick="btnPDMSImport_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnMatImport" Text="材料导入" ToolTip="材料导入" Icon="PackageIn" runat="server" OnClick="btnMatImport_Click" Hidden="true">
|
||||
</f:Button>
|
||||
|
||||
@@ -11,6 +11,16 @@
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Form runat="server" ShowBorder="true" ShowHeader="false">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:Button ID="btnAttachUrl" Text="详情" ToolTip="附件上传及查看" Icon="TableCell" runat="server"
|
||||
OnClick="btnAttachUrl_Click" ValidateForms="SimpleForm1">
|
||||
</f:Button>
|
||||
<f:ToolbarFill runat="server"/>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
<f:GroupPanel ID="GroupPanel3" Layout="Anchor" Title="管线数据" runat="server">
|
||||
<Items>
|
||||
@@ -139,6 +149,10 @@
|
||||
|
||||
</Items>
|
||||
</f:Form>
|
||||
<f:Window ID="WindowAtt" Title="附件" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -160,5 +160,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnAttachUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/WeldJoint&menuId={1}&type=-1", Request.Params["WeldJointId"], BLL.Const.HJGL_WeldJointMenuId)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,24 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnAttachUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAttachUrl;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel3 控件。
|
||||
/// </summary>
|
||||
@@ -281,5 +299,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox hdGrooveType;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user