2023-09-07
This commit is contained in:
@@ -355,13 +355,68 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
}
|
||||
protected void btnPrint_Click(object sender, EventArgs e)
|
||||
{
|
||||
Print(tvControlItem.SelectedNodeID,"");
|
||||
Print(tvControlItem.SelectedNodeID, Grid1.SelectedRowIDArray);
|
||||
}
|
||||
private void Print(string PipelineId ,string PipelineComponentId)
|
||||
private void Print(string PipelineId ,string[] PipelineComponentId)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
BLL.FastReportService.ResetData();
|
||||
|
||||
string strSql = @" SELECT com.PipelineComponentId,com.PipelineComponentCode,com.BoxNumber,unitwork.UnitWorkName,
|
||||
var query =
|
||||
from com in db.HJGL_Pipeline_Component
|
||||
join mat in db.HJGL_PipeLineMat on com.PipeLineMatId equals mat.PipeLineMatId into matJoin
|
||||
from mat in matJoin.DefaultIfEmpty()
|
||||
join pipe in db.HJGL_Pipeline on com.PipelineId equals pipe.PipelineId into pipeJoin
|
||||
from pipe in pipeJoin.DefaultIfEmpty()
|
||||
join punit in db.Base_Unit on com.PreUnit equals punit.UnitId into punitJoin
|
||||
from punit in punitJoin.DefaultIfEmpty()
|
||||
join aunit in db.Base_Unit on com.AssembleUnit equals aunit.UnitId into aunitJoin
|
||||
from aunit in aunitJoin.DefaultIfEmpty()
|
||||
join unitwork in db.WBS_UnitWork on pipe.UnitWorkId equals unitwork.UnitWorkId into unitworkJoin
|
||||
from unitwork in unitworkJoin.DefaultIfEmpty()
|
||||
join mater in db.Base_Material on pipe.MaterialId equals mater.MaterialId into materJoin
|
||||
from mater in materJoin.DefaultIfEmpty()
|
||||
where com.QRCode != "" & com.PipelineId == PipelineId
|
||||
select new
|
||||
{
|
||||
com.PipelineComponentId,
|
||||
com.PipelineComponentCode,
|
||||
com.BoxNumber,
|
||||
UnitWorkName = unitwork.UnitWorkName,
|
||||
com.PipelineId,
|
||||
PreUnit = punit.UnitName,
|
||||
AssembleUnit = aunit.UnitName,
|
||||
mat.PrefabricatedComponents,
|
||||
com.QRCode,
|
||||
com.State,
|
||||
PlanStartDate = string.Format("yyyy-MM-dd", pipe.PlanStartDate),
|
||||
pipe.PipelineCode,
|
||||
pipe.FlowingSection,
|
||||
QRCode2 = "PrePipeline$" + com.PipelineComponentId,
|
||||
mater.MaterialCode
|
||||
};
|
||||
|
||||
var result = query.ToList();
|
||||
if (PipelineComponentId.Length>0)
|
||||
{
|
||||
result = result.Where(x => PipelineComponentId.Contains(x.PipelineComponentId)).ToList();
|
||||
}
|
||||
var tb = LINQToDataTable(result);
|
||||
if (tb != null)
|
||||
{
|
||||
tb.TableName = "Table1";
|
||||
}
|
||||
BLL.FastReportService.AddFastreportTable(tb);
|
||||
string initTemplatePath = "";
|
||||
string rootPath = Server.MapPath("~/");
|
||||
initTemplatePath = "File\\Fastreport\\组件打印.frx";
|
||||
|
||||
if (File.Exists(rootPath + initTemplatePath))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
|
||||
|
||||
}
|
||||
/*string strSql = @" SELECT com.PipelineComponentId,com.PipelineComponentCode,com.BoxNumber,unitwork.UnitWorkName,
|
||||
com.PipelineId, punit.UnitName AS PreUnit,aunit.UnitName AS AssembleUnit,mat.PrefabricatedComponents,
|
||||
com.QRCode,com.State,CONVERT(varchar(100), pipe.PlanStartDate, 23) as PlanStartDate,pipe.PipelineCode,pipe.FlowingSection,
|
||||
('PrePipeline$'+com.PipelineComponentId )as QRCode2,mater.*
|
||||
@@ -377,11 +432,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
|
||||
strSql += " AND com.PipelineId =@PipelineId";
|
||||
listStr.Add(new SqlParameter("@PipelineId", PipelineId));
|
||||
if (PipelineComponentId!="")
|
||||
{
|
||||
strSql += " AND com.PipelineComponentId =@PipelineComponentId";
|
||||
listStr.Add(new SqlParameter("@PipelineComponentId", PipelineComponentId));
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
if (tb != null)
|
||||
@@ -397,8 +448,9 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
|
||||
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加焊口信息
|
||||
/// </summary>
|
||||
@@ -500,11 +552,6 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.CommandName == "cmd_print")
|
||||
{
|
||||
string Id = this.Grid1.SelectedRowID;
|
||||
Print(tvControlItem.SelectedNodeID, Id);
|
||||
}
|
||||
|
||||
}
|
||||
protected void btnSearch_Click(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user