CNCEC_SUBQHSE_WUHUAN/SGGL/FineUIPro.Web/CQMS/ProcessControl/InspectionNotice.aspx.cs

861 lines
40 KiB
C#
Raw Normal View History

2023-07-24 17:41:50 +08:00
using Aspose.Words;
using Aspose.Words.Tables;
using BLL;
2021-04-30 10:28:37 +08:00
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
2023-07-24 17:41:50 +08:00
using System.IO;
2021-04-30 10:28:37 +08:00
using System.Linq;
2021-05-20 17:16:01 +08:00
using System.Text;
2021-04-30 10:28:37 +08:00
namespace FineUIPro.Web.CQMS.ProcessControl
{
public partial class InspectionNotice : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetButtonPower();
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessional, true);//专业
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true);
BindGrid();
}
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindGrid()
{
string strSql = @"SELECT distinct P.InspectionId,
P.ProjectId,
P.UnitId,
P.CNProfessionalId,
P.UnitWorkId,
U.UnitName,
C.ProfessionalName,
P.NoticeCode,
UnitWork.UnitWorkName,
DP.DivisionName AS Branch,
BP.BreakdownName AS ControlPointType,
BP.Class,
P.AcceptanceSite,
P.AcceptanceCheckMan"
+ @" FROM ProcessControl_InspectionManagementDetail AS D"
+ @" LEFT JOIN ProcessControl_InspectionManagement AS P on P.InspectionId=D.InspectionId"
+ @" LEFT JOIN Base_Unit AS U ON U.UnitId = P.UnitId"
+ @" LEFT JOIN Base_CNProfessional C ON C.CNProfessionalId = P.CNProfessionalId"
+ @" LEFT JOIN WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId = P.UnitWorkId"
+ @" LEFT JOIN WBS_DivisionProject AS DP ON DP.DivisionProjectId = P.Branch"
+ @" LEFT JOIN WBS_BreakdownProject AS BP ON BP.BreakdownProjectId = P.ControlPointType"
+ @" WHERE P.ProjectId=@ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (drpUnitWork.SelectedValue != BLL.Const._Null)
{
strSql += " AND D.UnitWorkId=@UnitWorkId";
listStr.Add(new SqlParameter("@UnitWorkId", drpUnitWork.SelectedValue));
}
if (drpCNProfessional.SelectedValue != BLL.Const._Null)
{
strSql += " AND P.CNProfessionalId=@CNProfessionalId";
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessional.SelectedValue));
}
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
{
strSql += " AND P.InspectionDate >= @InspectionDate";
listStr.Add(new SqlParameter("@InspectionDate", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
}
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
{
strSql += " AND P.InspectionDate <= @InspectionDate";
listStr.Add(new SqlParameter("@InspectionDate", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
/// <summary>
/// 分页下拉
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 分页索引事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 关闭弹出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 新增按钮事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionNoticeEdit.aspx", "编辑 - ")));
}
#endregion
#region
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
btnMenuModify_Click(null, null);
}
/// <summary>
///右键编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuModify_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
return;
}
2023-08-15 15:11:57 +08:00
//合格的情况下不允许修改
var model = Funs.DB.ProcessControl_InspectionManagement.FirstOrDefault(x => x.InspectionId == Grid1.SelectedRowID);
if (model.IsOnceQualified==true)
{
Alert.ShowInTop("该共检通知单已合格,不允许修改!", MessageBoxIcon.Warning);
return;
}
2021-04-30 10:28:37 +08:00
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionNoticeEdit.aspx?InspectionId={0}", Grid1.SelectedRowID, "编辑 - ")));
}
#endregion
#region
/// <summary>
/// 右键删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDel_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var InspectionEquipment = BLL.InspectionManagementService.GetInspectionManagementById(rowID);
if (InspectionEquipment != null)
{
BLL.InspectionManagementDetailService.DeleteAllInspectionDetail(rowID);
BLL.InspectionManagementService.DeleteInspectionManagement(rowID);
}
}
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.InspectionNoticeMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuModify.Hidden = false;
this.Grid1.EnableRowDoubleClickEvent = true;
}
else
{
this.Grid1.EnableRowDoubleClickEvent = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDel.Hidden = false;
}
}
}
#endregion
2021-05-20 17:16:01 +08:00
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("共检通知单" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = Encoding.UTF8;
this.Grid1.PageSize = Grid1.RecordCount;
this.BindGrid();
Response.Write(GetGridTableHtml2(Grid1));
Response.End();
}
#endregion
2023-07-24 17:41:50 +08:00
#region
protected void btnPrinter_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string Id = Grid1.SelectedRowID;
try
{
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.InspectionTemplateUrl;
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace(".doc", "(" + Funs.GetNewFileName() + ")" + ".doc");
if (File.Exists(newUrl))
{
File.Delete(newUrl);
}
File.Copy(uploadfilepath, newUrl);
//更新书签内容
Document doc = new Aspose.Words.Document(newUrl);
DocumentBuilder builder = new DocumentBuilder(doc);
#region
//业主单位
Bookmark bookmarkUnitName = doc.Range.Bookmarks["unitName"];
if (bookmarkUnitName != null)
{
var units = (from x in db.Base_Unit
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
2023-08-15 15:11:57 +08:00
where y.ProjectId==this.CurrUser.LoginProjectId && y.UnitType== BLL.Const.ProjectUnitType_4
2023-07-24 17:41:50 +08:00
orderby x.UnitName
select x).FirstOrDefault();
2023-08-15 15:11:57 +08:00
if (units!=null)
2023-07-24 17:41:50 +08:00
{
bookmarkUnitName.Text = units.UnitName;
}
}
var projectModel = db.Base_Project.Where(x => x.ProjectId == this.CurrUser.LoginProjectId).FirstOrDefault();
var inspectionModel = db.ProcessControl_InspectionManagement.Where(x => x.InspectionId == Id).FirstOrDefault();
2023-08-15 15:11:57 +08:00
2023-07-24 17:41:50 +08:00
//项目编号
Bookmark bookmarkProjectCode = doc.Range.Bookmarks["projectCode"];
if (bookmarkProjectCode != null)
{
if (projectModel != null)
{
bookmarkProjectCode.Text = projectModel.ProjectCode;
}
}
//项目名称
Bookmark bookmarkProjectName = doc.Range.Bookmarks["projectName"];
if (bookmarkProjectName != null)
{
if (projectModel != null)
{
bookmarkProjectName.Text = projectModel.ProjectName;
}
}
//共检编号
Bookmark bookmarkInspectionCode = doc.Range.Bookmarks["inspectionCode"];
if (bookmarkInspectionCode != null)
{
2023-07-24 19:40:26 +08:00
if (inspectionModel != null && !string.IsNullOrEmpty(inspectionModel.NoticeCode))
2023-07-24 17:41:50 +08:00
{
2023-07-24 19:40:26 +08:00
bookmarkInspectionCode.Text = inspectionModel.NoticeCode;
2023-07-24 17:41:50 +08:00
}
}
//施工分包商名称
Bookmark bookmarkunitNamefbs = doc.Range.Bookmarks["unitNamefbs"];
if (bookmarkunitNamefbs != null)
{
var valModel = db.Base_Unit.Where(x => x.UnitId == inspectionModel.UnitId).FirstOrDefault();
if (inspectionModel != null && valModel != null)
{
bookmarkunitNamefbs.Text = valModel.UnitName;
}
}
//编制人
Bookmark bookmarkcompileMan = doc.Range.Bookmarks["compileMan"];
if (bookmarkcompileMan != null)
{
var valModel = db.Sys_User.Where(x => x.UserId == inspectionModel.CompileMan).FirstOrDefault();
if (inspectionModel != null && valModel != null)
{
2023-08-15 15:11:57 +08:00
bookmarkcompileMan.Text = valModel.UserName;
2023-07-24 17:41:50 +08:00
}
}
//总承包商名称
Bookmark bookmarkunitNamezcb = doc.Range.Bookmarks["unitNamezcb"];
if (bookmarkunitNamezcb != null)
{
var units = (from x in db.Base_Unit
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
where y.ProjectId == this.CurrUser.LoginProjectId && y.UnitType == BLL.Const.ProjectUnitType_1
orderby x.UnitName
select x).FirstOrDefault();
if (units != null)
{
bookmarkunitNamezcb.Text = units.UnitName;
}
}
//共检时间
Bookmark bookmarkinspectionDate = doc.Range.Bookmarks["inspectionDate"];
if (bookmarkinspectionDate != null)
{
if (inspectionModel != null)
{
2023-08-15 15:11:57 +08:00
bookmarkinspectionDate.Text = inspectionModel.InspectionDate.ToString().Replace("/", "-");
2023-07-24 17:41:50 +08:00
}
}
//共检地点
Bookmark bookmarkacceptanceSite = doc.Range.Bookmarks["acceptanceSite"];
if (bookmarkacceptanceSite != null)
{
if (inspectionModel != null)
{
bookmarkacceptanceSite.Text = inspectionModel.AcceptanceSite;
}
}
//涉及的单位/分部
Bookmark bookmarkmanagementDetail = doc.Range.Bookmarks["managementDetail"];
if (bookmarkmanagementDetail != null)
{
//查询子表数据
var managementDetailval = "";
var valModelList = db.ProcessControl_InspectionManagementDetail.Where(x => x.InspectionId == Id).ToList();
if (valModelList != null)
{
int i = 0;
List<WorkBranchList> vlist = new List<WorkBranchList>();
foreach (var item in valModelList)
{
WorkBranchList modelWorkBranch = new WorkBranchList();
if (i > 0)
{
vlist.Select(x => x.Branch == item.Branch && x.UnitWorkId == item.UnitWorkId).ToList();
if (vlist.Count == 0)
{
//没有相同数据
modelWorkBranch.Branch = item.Branch;
modelWorkBranch.UnitWorkId = item.UnitWorkId;
vlist.Add(modelWorkBranch);
managementDetailval += ConvertUnitWork(item.UnitWorkId) + "/" + ConvertBranch(item.Branch) + ",";
}
}
else
{
modelWorkBranch.Branch = item.Branch;
modelWorkBranch.UnitWorkId = item.UnitWorkId;
vlist.Add(modelWorkBranch);
managementDetailval += ConvertUnitWork(item.UnitWorkId) + "/" + ConvertBranch(item.Branch) + ",";
}
i += 1;
}
managementDetailval = managementDetailval.Substring(0, managementDetailval.Length - 1);
}
bookmarkmanagementDetail.Text = managementDetailval;
}
#endregion
#region
//项目总体施工进度情况
builder.MoveToBookmark("tab");
builder.StartTable();
builder.CellFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single;
builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
2023-08-15 15:11:57 +08:00
2023-07-24 17:41:50 +08:00
builder.Bold = false;
builder.RowFormat.Height = 20;
builder.Font.Size = 10;
var ManagementDetaillList = db.ProcessControl_InspectionManagementDetail.Where(x => x.InspectionId == Id).ToList();
if (ManagementDetaillList != null)
{
int i = 1;
foreach (var item in ManagementDetaillList)
{
//质量检查内容
builder.InsertCell();
if (ManagementDetaillList.Count <= 9)
{
builder.RowFormat.Height = 200 / ManagementDetaillList.Count;
}
2023-08-15 15:11:57 +08:00
else {
2023-07-24 17:41:50 +08:00
builder.RowFormat.Height = 20;
}
builder.CellFormat.Borders.Left.LineWidth = 1;
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 156;
builder.Write(ConvertControlPointType(item.ControlPointType));
builder.CellFormat.Borders.Left.LineWidth = 0;
2023-08-15 15:11:57 +08:00
// 控制点等级
2023-07-24 17:41:50 +08:00
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 106;
var ControlPointType = ConvertClass(item.ControlPointType);
#region
2023-08-15 15:11:57 +08:00
if (ControlPointType.Contains("A") )
2023-07-24 17:41:50 +08:00
{
builder.Write("■A ");
}
2023-08-15 15:11:57 +08:00
else {
2023-07-24 17:41:50 +08:00
builder.Write("□A ");
}
if (ControlPointType.Contains("B"))
{
builder.Write("■B ");
}
else
{
builder.Write("□B ");
}
if (ControlPointType.Contains("C"))
{
builder.Write("■C ");
}
else
{
builder.Write("□C ");
}
#endregion
//质量检查依据
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 113.5;
2023-08-15 15:11:57 +08:00
var ControlBasis = ConvertBasis(item.ControlPointType);
builder.Write(ControlBasis);
2023-07-24 17:41:50 +08:00
//合并单元格
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.Previous;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Top;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;//水平居中对齐
builder.CellFormat.Width = 112;
builder.Write("\r总承包商\r □ H □ W\r");
builder.Write("监理:\r □ H □ W\r");
builder.Write("业主:\r □ H □ W\r");
builder.Write("质量监督:\r □ H □ W\r");
i += 1;
builder.EndRow();
}
}
builder.RowFormat.Height = 20;
#endregion
#region
//签收单位 总承包商 监理单位 业主 质量监督
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.ParagraphFormat.LineSpacing = 12; //设置1倍行距 12就是一倍行距
builder.CellFormat.Width = 75.1;
builder.Write("签收单位");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("总承包商");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("监理单位");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("业主");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("质量监督");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 112;
builder.Write("");
builder.EndRow();
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("签收人");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 112;
builder.Write("");
builder.EndRow();
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("签收日期");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 75.1;
builder.Write("");
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 112;
builder.Write("");
builder.EndRow();
builder.InsertCell();
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Top;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;//水平居中对齐
builder.CellFormat.Width = 487.5;
builder.ParagraphFormat.LineSpacing = 16; //设置1倍行距 12就是一倍行距
2023-08-15 15:11:57 +08:00
builder.Write("备注:\r\r验收意见\r总承包商意见 □合格 □不合格\r监理意见 □合格 □不合格\r业主意见 □合格 □不合格\r ");
2023-07-24 17:41:50 +08:00
#region
2023-07-24 19:40:26 +08:00
2023-07-24 17:41:50 +08:00
string imageUrl = Funs.RootPath + CreateQRCodeService.CreateCode_Simple("InspectionNotice$" + Id);
2023-07-24 19:40:26 +08:00
if (File.Exists(imageUrl))
2023-07-24 17:41:50 +08:00
{
builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;//水平居中对齐
2023-07-24 19:40:26 +08:00
builder.InsertImage(imageUrl, 100, 100);
2023-07-24 17:41:50 +08:00
}
#endregion
2023-08-15 15:11:57 +08:00
builder.EndRow();
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;//水平居中对齐
builder.Write("注:如果业主有规定,执行业主的规定。 ");
#endregion
doc.Save(newUrl);
2023-07-24 17:41:50 +08:00
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);
}
catch (Exception ex)
{
Alert.ShowInTop(ex.Message, MessageBoxIcon.Warning);
return;
}
}
2023-08-15 15:11:57 +08:00
public class WorkBranchList {
2023-07-24 17:41:50 +08:00
public string UnitWorkId { get; set; }
public string Branch { get; set; }
}
#region
/// <summary>
/// 获取单位工程
/// </summary>
/// <param name="UnitWorkId"></param>
/// <returns></returns>
protected string ConvertUnitWork(object UnitWorkId)
{
string name = string.Empty;
if (UnitWorkId != null)
{
Model.WBS_UnitWork unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(UnitWorkId.ToString());
if (unitWork != null)
{
name = unitWork.UnitWorkName;
}
}
return name;
}
/// <summary>
/// 获取分部
/// </summary>
/// <param name="Branch"></param>
/// <returns></returns>
protected string ConvertBranch(object Branch)
{
string name = string.Empty;
if (Branch != null)
{
var branch = BLL.DivisionProjectService.GetDivisionProjectById(Branch.ToString());
if (branch != null)
{
name = branch.DivisionName;
}
}
return name;
}
/// <summary>
/// 获取控制点内容
/// </summary>
/// <param name="ControlPointType"></param>
/// <returns></returns>
protected string ConvertControlPointType(object ControlPointType)
{
string name = string.Empty;
if (ControlPointType != null)
{
var controlPointType = BLL.BreakdownProjectService.GetBreakdownProjectById(ControlPointType.ToString());
if (controlPointType != null)
{
name = controlPointType.BreakdownName;
}
}
return name;
}
/// <summary>
/// 获取控制点等级
/// </summary>
/// <param name="ControlPointType"></param>
/// <returns></returns>
protected string ConvertClass(object ControlPointType)
{
string name = string.Empty;
if (ControlPointType != null)
{
var controlPointType = BLL.BreakdownProjectService.GetBreakdownProjectById(ControlPointType.ToString());
if (controlPointType != null)
{
name = controlPointType.Class;
}
}
return name;
}
2023-08-15 15:11:57 +08:00
/// <summary>
/// 获取执行依据
/// </summary>
/// <param name="ControlPointType"></param>
/// <returns></returns>
protected string ConvertBasis(object ControlPointType)
{
string name = string.Empty;
if (ControlPointType != null)
{
var controlPointType = BLL.BreakdownProjectService.GetBreakdownProjectById(ControlPointType.ToString());
if (controlPointType != null)
{
name = controlPointType.Basis;
}
}
return name;
}
/// <summary>
/// 获取检查人名称
/// </summary>
/// <param name="CarryUnitIds"></param>
/// <returns></returns>
protected string ConvertCheckMan(object CarryUnitIds)
{
var uname = BLL.UserService.getUserNamesUserIds(CarryUnitIds);
if (string.IsNullOrEmpty(uname))
{
uname = CarryUnitIds.ToString();
}
return uname;
}
2023-07-24 17:41:50 +08:00
#endregion
#endregion
2021-04-30 10:28:37 +08:00
}
}