2571 lines
124 KiB
C#
2571 lines
124 KiB
C#
using BLL;
|
||
using Newtonsoft.Json.Linq;
|
||
using NPOI.SS.Util;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.IO;
|
||
using System.Linq;
|
||
using System.Web.UI.WebControls;
|
||
|
||
namespace FineUIPro.Web.PZHGL.InformationProject
|
||
{
|
||
public partial class ConstructionLog : PageBase
|
||
{
|
||
#region 定义项
|
||
/// <summary>
|
||
/// 主键
|
||
/// </summary>
|
||
public string ConstructionLogId
|
||
{
|
||
get
|
||
{
|
||
return (string)ViewState["ConstructionLogId"];
|
||
}
|
||
set
|
||
{
|
||
ViewState["ConstructionLogId"] = value;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// 加载表头
|
||
/// </summary>
|
||
protected void Page_Init(object sender, EventArgs e)
|
||
{
|
||
InitGrid();
|
||
}
|
||
|
||
#region 表头
|
||
/// <summary>
|
||
/// 表头
|
||
/// </summary>
|
||
private void InitGrid()
|
||
{
|
||
this.hdWorkPostId.Text = this.CurrUser.LogWorkPostId;
|
||
this.hdMachineId.Text = this.CurrUser.LogMachineId;
|
||
List<string> list = Funs.GetStrListByStr(this.hdWorkPostId.Text, ',');
|
||
for (int i = 0; i < list.Count; i++)
|
||
{
|
||
RenderField rdPlan = new RenderField();
|
||
rdPlan.ColumnID = "Num" + i.ToString();
|
||
rdPlan.Width = Unit.Pixel(100);
|
||
rdPlan.DataField = "Num" + i.ToString();
|
||
rdPlan.FieldType = FieldType.Int;
|
||
rdPlan.HeaderText = BLL.WorkPostService.getWorkPostNameById(list[i]);
|
||
rdPlan.HeaderTextAlign = TextAlign.Center;
|
||
NumberBox numPlan = new NumberBox();
|
||
numPlan.NoNegative = true;
|
||
numPlan.NoDecimal = true;
|
||
rdPlan.Editor.Add(numPlan);
|
||
Grid1.Columns.Add(rdPlan);
|
||
}
|
||
List<string> list2 = Funs.GetStrListByStr(this.hdMachineId.Text, ',');
|
||
for (int i = 0; i < list2.Count; i++)
|
||
{
|
||
RenderField rdPlan = new RenderField();
|
||
rdPlan.ColumnID = "Num" + i.ToString();
|
||
rdPlan.Width = Unit.Pixel(100);
|
||
rdPlan.DataField = "Num" + i.ToString();
|
||
rdPlan.FieldType = FieldType.Int;
|
||
rdPlan.HeaderText = BLL.SpecialEquipmentService.GetSpecialEquipmentNameById(list2[i]);
|
||
rdPlan.HeaderTextAlign = TextAlign.Center;
|
||
NumberBox numPlan = new NumberBox();
|
||
numPlan.NoNegative = true;
|
||
numPlan.NoDecimal = true;
|
||
rdPlan.Editor.Add(numPlan);
|
||
Grid2.Columns.Add(rdPlan);
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 加载
|
||
/// <summary>
|
||
/// 加载页面
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void Page_Load(object sender, EventArgs e)
|
||
{
|
||
if (!IsPostBack)
|
||
{
|
||
var projectUser = SitePerson_PersonService.GetSitePersonByProjectIdIdentityCard(this.CurrUser.LoginProjectId, this.CurrUser.IdentityCard);
|
||
if (projectUser != null && projectUser.WorkPostId == BLL.Const.WorkPost_ConstructionManager)
|
||
{
|
||
this.row1.Hidden = true;
|
||
this.row2.Hidden = true;
|
||
this.row3.Hidden = true;
|
||
this.Grid1.Hidden = true;
|
||
this.Grid2.Hidden = true;
|
||
this.Grid3.Hidden = true;
|
||
this.Grid4.Hidden = true;
|
||
}
|
||
else
|
||
{
|
||
if (string.IsNullOrEmpty(this.hdWorkPostId.Text.Trim()))
|
||
{
|
||
Alert.ShowInTop("请先在个人信息中设置施工日志工种!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
if (string.IsNullOrEmpty(this.hdMachineId.Text.Trim()))
|
||
{
|
||
Alert.ShowInTop("请先在个人信息中设置施工日志机械!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
this.Grid5.Hidden = true;
|
||
}
|
||
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true);
|
||
this.drpProfessional.DataTextField = "Value";
|
||
this.drpProfessional.DataValueField = "Text";
|
||
this.drpProfessional.DataSource = BLL.PHTGL_QuantityService.GetMajorItems2();
|
||
this.drpProfessional.DataBind();
|
||
Funs.FineUIPleaseSelect(this.drpProfessional);
|
||
//合同编号
|
||
this.drpContractNo.DataTextField = "ContractName";
|
||
this.drpContractNo.DataValueField = "ContractId";
|
||
this.drpContractNo.DataSource = BLL.PHTGL_ContractReviewService.GetContractReview_CompleteData(this.CurrUser.LoginProjectId);
|
||
this.drpContractNo.DataBind();
|
||
Funs.FineUIPleaseSelect(this.drpContractNo);
|
||
//所属WBS
|
||
BLL.WorkPackageInitService.InitDownList(this.drpWorkPackage, false);
|
||
this.txtReportDate.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
|
||
this.InitTreeMenu();
|
||
}
|
||
else
|
||
{
|
||
if (GetRequestEventArgument() == "UPDATE_SUMMARY")
|
||
{
|
||
// 页面要求重新计算合计行的值
|
||
OutputSummaryData();
|
||
}
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
private void OutputSummaryData()
|
||
{
|
||
List<string> list = Funs.GetStrListByStr(this.hdWorkPostId.Text, ',');
|
||
int[] sum1 = new int[list.Count];
|
||
foreach (JObject mergedRow in Grid1.GetMergedData())
|
||
{
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
for (int i = 0; i < list.Count; i++)
|
||
{
|
||
sum1[i] += Funs.GetNewIntOrZero(values.Value<string>("Num" + i.ToString()));
|
||
}
|
||
}
|
||
JObject summary1 = new JObject();
|
||
summary1.Add("UnitWorkName", "合计");
|
||
for (int i = 0; i < list.Count; i++)
|
||
{
|
||
summary1.Add("Num" + i.ToString(), sum1[i]);
|
||
}
|
||
Grid1.SummaryData = summary1;
|
||
|
||
List<string> list2 = Funs.GetStrListByStr(this.hdMachineId.Text, ',');
|
||
int[] sum2 = new int[list2.Count];
|
||
foreach (JObject mergedRow in Grid2.GetMergedData())
|
||
{
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
for (int i = 0; i < list2.Count; i++)
|
||
{
|
||
sum2[i] += Funs.GetNewIntOrZero(values.Value<string>("Num" + i.ToString()));
|
||
}
|
||
}
|
||
JObject summary2 = new JObject();
|
||
summary2.Add("UnitWorkName", "合计");
|
||
for (int i = 0; i < list2.Count; i++)
|
||
{
|
||
summary2.Add("Num" + i.ToString(), sum2[i]);
|
||
}
|
||
Grid2.SummaryData = summary2;
|
||
decimal sumTodayCompleteSize = 0, sumTotalCompleteSize = 0, sumTotalSize = 0, sumTomorrowPlanSize = 0;
|
||
foreach (JObject mergedRow in Grid6.GetMergedData())
|
||
{
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
sumTodayCompleteSize += Funs.GetNewDecimalOrZero(values.Value<string>("TodayCompleteSize"));
|
||
sumTotalCompleteSize += Funs.GetNewDecimalOrZero(values.Value<string>("TotalCompleteSize"));
|
||
sumTotalSize += Funs.GetNewDecimalOrZero(values.Value<string>("TotalSize"));
|
||
sumTomorrowPlanSize += Funs.GetNewDecimalOrZero(values.Value<string>("TomorrowPlanSize"));
|
||
}
|
||
string sumRate = "/";
|
||
if (sumTotalSize > 0)
|
||
{
|
||
sumRate = decimal.Round(sumTotalCompleteSize / sumTotalSize * 100, 2) + "%";
|
||
}
|
||
JObject summary3 = new JObject();
|
||
summary3.Add("UnitWorkName", "合计");
|
||
summary3.Add("TodayCompleteSize", sumTodayCompleteSize);
|
||
summary3.Add("TotalCompleteSize", sumTotalCompleteSize);
|
||
summary3.Add("TotalSize", sumTotalSize);
|
||
summary3.Add("TotalRate", sumRate);
|
||
summary3.Add("TomorrowPlanSize", sumTomorrowPlanSize);
|
||
Grid6.SummaryData = summary3;
|
||
}
|
||
|
||
#region 加载树装置-单位-工作区
|
||
/// <summary>
|
||
/// 加载树
|
||
/// </summary>
|
||
private void InitTreeMenu()
|
||
{
|
||
if (!string.IsNullOrEmpty(this.txtReportDate.Text.Trim()))
|
||
{
|
||
DateTime? startTime = Funs.GetNewDateTime(this.txtReportDate.Text.Trim());
|
||
DateTime? endTime = startTime.HasValue ? startTime.Value.AddMonths(1) : System.DateTime.Now;
|
||
|
||
this.tvControlItem.Nodes.Clear();
|
||
TreeNode rootNode = new TreeNode();
|
||
rootNode.Text = this.CurrUser.PersonName;
|
||
rootNode.NodeID = "0";
|
||
rootNode.CommandName = "Person";
|
||
rootNode.EnableClickEvent = true;
|
||
rootNode.Expanded = true;
|
||
this.tvControlItem.Nodes.Add(rootNode);
|
||
var logs = from x in Funs.DB.ZHGL_ConstructionLog
|
||
where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileMan == this.CurrUser.PersonId && x.CompileDate >= startTime && x.CompileDate < endTime
|
||
select x;
|
||
foreach (var item in logs)
|
||
{
|
||
TreeNode rootUnitNode = new TreeNode();//定义根节点
|
||
rootUnitNode.Text = item.FileCode;
|
||
rootUnitNode.NodeID = item.ConstructionLogId;
|
||
rootUnitNode.CommandName = "Log";
|
||
rootUnitNode.Expanded = true;
|
||
rootUnitNode.EnableClickEvent = true;
|
||
rootUnitNode.ToolTip = "施工日志";
|
||
rootNode.Nodes.Add(rootUnitNode);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("请选择月份!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 查询Tree
|
||
protected void Tree_TextChanged(object sender, EventArgs e)
|
||
{
|
||
this.InitTreeMenu();
|
||
}
|
||
#endregion
|
||
|
||
#region 点击树节点
|
||
/// <summary>
|
||
/// 点击树节点
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
||
{
|
||
if (this.tvControlItem.SelectedNode.CommandName == "Person")
|
||
{
|
||
if (this.GetButtonPower(BLL.Const.BtnAdd))
|
||
{
|
||
this.btnMenuAdd.Hidden = false;
|
||
this.btnMenuEdit.Hidden = true;
|
||
this.btnMenuDown.Hidden = true;
|
||
this.btnMenuDelete.Hidden = true;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if (this.GetButtonPower(BLL.Const.BtnModify))
|
||
{
|
||
this.btnMenuAdd.Hidden = true;
|
||
this.btnMenuEdit.Hidden = false;
|
||
this.btnMenuDown.Hidden = false;
|
||
this.btnMenuDelete.Hidden = false;
|
||
}
|
||
}
|
||
this.ConstructionLogId = this.tvControlItem.SelectedNodeID;
|
||
if (!string.IsNullOrEmpty(this.ConstructionLogId))
|
||
{
|
||
GetData();
|
||
}
|
||
else
|
||
{
|
||
this.ConstructionLogId = string.Empty;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
private void GetData()
|
||
{
|
||
var log = BLL.ConstructionLogService.GetConstructionLogById(ConstructionLogId);
|
||
if (log != null)
|
||
{
|
||
this.hdWorkPostId.Text = log.WorkPostId;
|
||
this.hdMachineId.Text = log.MachineId;
|
||
this.hdConstructionLogId.Text = log.ConstructionLogId;
|
||
this.txtFileCode.Text = log.FileCode;
|
||
if (log.CompileDate != null)
|
||
{
|
||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", log.CompileDate.Value);
|
||
this.txtWeek.Text = Funs.GetWeekDay(log.CompileDate.Value.DayOfWeek.ToString());
|
||
}
|
||
this.txtWeather.Text = log.Weather;
|
||
this.txtTemperature.Text = log.Temperature;
|
||
this.txtCompileMan.Text = BLL.Person_PersonsService.GetPersonsNameById(log.CompileMan);
|
||
if (!string.IsNullOrEmpty(log.ContractNo))
|
||
{
|
||
if (log.ContractNo.Length > 0)
|
||
{
|
||
this.drpContractNo.SelectedValueArray = log.ContractNo.Split(',');
|
||
}
|
||
}
|
||
drpContractNo_SelectedIndexChanged(null, null);
|
||
if (!string.IsNullOrEmpty(log.UnitWorks))
|
||
{
|
||
if (log.UnitWorks.Length > 0)
|
||
{
|
||
this.drpUnitWork.SelectedValueArray = log.UnitWorks.Split(',');
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(log.Professional))
|
||
{
|
||
if (log.Professional.Length > 0)
|
||
{
|
||
this.drpProfessional.SelectedValueArray = log.Professional.Split(',');
|
||
}
|
||
}
|
||
this.txtRemark.Text = log.Remark;
|
||
this.txtHSETodaySummary.Text = log.HSETodaySummary;
|
||
this.txtHSETodaySummaryRemark.Text = log.HSETodaySummaryRemark;
|
||
this.txtHSETomorrowPlan.Text = log.HSETomorrowPlan;
|
||
this.txtHSETomorrowPlanRemark.Text = log.HSETomorrowPlanRemark;
|
||
this.txtCQMSTodaySummary.Text = log.CQMSTodaySummary;
|
||
this.txtCQMSTodaySummaryRemark.Text = log.CQMSTodaySummaryRemark;
|
||
this.txtCQMSTomorrowPlan.Text = log.CQMSTomorrowPlan;
|
||
this.txtCQMSTomorrowPlanRemark.Text = log.CQMSTomorrowPlanRemark;
|
||
var persons = BLL.ConstructionLogPersonService.GetConstructionLogPersonsByConstructionLogId(ConstructionLogId);
|
||
List<string> unitWorkList = Funs.GetStrListByStr(log.UnitWorks, ',');
|
||
List<Model.ConstructionLogPersonItem> personItems = new List<Model.ConstructionLogPersonItem>();
|
||
if (persons.Count > 0)
|
||
{
|
||
List<string> workPostList = Funs.GetStrListByStr(this.hdWorkPostId.Text, ',');
|
||
foreach (var unitWork in unitWorkList)
|
||
{
|
||
Model.ConstructionLogPersonItem personItem = new Model.ConstructionLogPersonItem();
|
||
personItem.ConstructionLogPersonId = SQLHelper.GetNewID();
|
||
personItem.ConstructionLogId = ConstructionLogId;
|
||
personItem.UnitWorkId = unitWork;
|
||
int a = 0;
|
||
foreach (var workPost in workPostList)
|
||
{
|
||
int num = 0;
|
||
var p = persons.FirstOrDefault(x => x.UnitWorkId == unitWork && x.WorkPostId == workPost);
|
||
if (p != null)
|
||
{
|
||
num = p.Num ?? 0;
|
||
}
|
||
if (a == 0)
|
||
{
|
||
personItem.Num0 = num;
|
||
}
|
||
else if (a == 1)
|
||
{
|
||
personItem.Num1 = num;
|
||
}
|
||
else if (a == 2)
|
||
{
|
||
personItem.Num2 = num;
|
||
}
|
||
else if (a == 3)
|
||
{
|
||
personItem.Num3 = num;
|
||
}
|
||
else if (a == 4)
|
||
{
|
||
personItem.Num4 = num;
|
||
}
|
||
else if (a == 5)
|
||
{
|
||
personItem.Num5 = num;
|
||
}
|
||
else if (a == 6)
|
||
{
|
||
personItem.Num6 = num;
|
||
}
|
||
else if (a == 7)
|
||
{
|
||
personItem.Num7 = num;
|
||
}
|
||
else if (a == 8)
|
||
{
|
||
personItem.Num8 = num;
|
||
}
|
||
else if (a == 9)
|
||
{
|
||
personItem.Num9 = num;
|
||
}
|
||
else if (a == 10)
|
||
{
|
||
personItem.Num10 = num;
|
||
}
|
||
else if (a == 11)
|
||
{
|
||
personItem.Num11 = num;
|
||
}
|
||
else if (a == 12)
|
||
{
|
||
personItem.Num12 = num;
|
||
}
|
||
else if (a == 13)
|
||
{
|
||
personItem.Num13 = num;
|
||
}
|
||
else if (a == 14)
|
||
{
|
||
personItem.Num14 = num;
|
||
}
|
||
else if (a == 15)
|
||
{
|
||
personItem.Num15 = num;
|
||
}
|
||
else if (a == 16)
|
||
{
|
||
personItem.Num16 = num;
|
||
}
|
||
else if (a == 17)
|
||
{
|
||
personItem.Num17 = num;
|
||
}
|
||
else if (a == 18)
|
||
{
|
||
personItem.Num18 = num;
|
||
}
|
||
else if (a == 19)
|
||
{
|
||
personItem.Num19 = num;
|
||
}
|
||
else if (a == 20)
|
||
{
|
||
personItem.Num20 = num;
|
||
}
|
||
a++;
|
||
}
|
||
personItems.Add(personItem);
|
||
}
|
||
this.Grid1.DataSource = personItems;
|
||
this.Grid1.DataBind();
|
||
}
|
||
var machines = BLL.ConstructionLogMachineService.GetConstructionLogMachinesByConstructionLogId(ConstructionLogId);
|
||
List<Model.ConstructionLogMachineItem> machineItems = new List<Model.ConstructionLogMachineItem>();
|
||
if (machines.Count > 0)
|
||
{
|
||
List<string> machineList = Funs.GetStrListByStr(this.hdMachineId.Text, ',');
|
||
foreach (var unitWork in unitWorkList)
|
||
{
|
||
Model.ConstructionLogMachineItem machineItem = new Model.ConstructionLogMachineItem();
|
||
machineItem.ConstructionLogMachineId = SQLHelper.GetNewID();
|
||
machineItem.ConstructionLogId = ConstructionLogId;
|
||
machineItem.UnitWorkId = unitWork;
|
||
int a = 0;
|
||
foreach (var machine in machineList)
|
||
{
|
||
int num = 0;
|
||
var p = machines.FirstOrDefault(x => x.UnitWorkId == unitWork && x.MachineId == machine);
|
||
if (p != null)
|
||
{
|
||
num = p.Num ?? 0;
|
||
}
|
||
if (a == 0)
|
||
{
|
||
machineItem.Num0 = num;
|
||
}
|
||
else if (a == 1)
|
||
{
|
||
machineItem.Num1 = num;
|
||
}
|
||
else if (a == 2)
|
||
{
|
||
machineItem.Num2 = num;
|
||
}
|
||
else if (a == 3)
|
||
{
|
||
machineItem.Num3 = num;
|
||
}
|
||
else if (a == 4)
|
||
{
|
||
machineItem.Num4 = num;
|
||
}
|
||
else if (a == 5)
|
||
{
|
||
machineItem.Num5 = num;
|
||
}
|
||
else if (a == 6)
|
||
{
|
||
machineItem.Num6 = num;
|
||
}
|
||
else if (a == 7)
|
||
{
|
||
machineItem.Num7 = num;
|
||
}
|
||
else if (a == 8)
|
||
{
|
||
machineItem.Num8 = num;
|
||
}
|
||
else if (a == 9)
|
||
{
|
||
machineItem.Num9 = num;
|
||
}
|
||
else if (a == 10)
|
||
{
|
||
machineItem.Num10 = num;
|
||
}
|
||
else if (a == 11)
|
||
{
|
||
machineItem.Num11 = num;
|
||
}
|
||
else if (a == 12)
|
||
{
|
||
machineItem.Num12 = num;
|
||
}
|
||
else if (a == 13)
|
||
{
|
||
machineItem.Num13 = num;
|
||
}
|
||
else if (a == 14)
|
||
{
|
||
machineItem.Num14 = num;
|
||
}
|
||
else if (a == 15)
|
||
{
|
||
machineItem.Num15 = num;
|
||
}
|
||
else if (a == 16)
|
||
{
|
||
machineItem.Num16 = num;
|
||
}
|
||
else if (a == 17)
|
||
{
|
||
machineItem.Num17 = num;
|
||
}
|
||
else if (a == 18)
|
||
{
|
||
machineItem.Num18 = num;
|
||
}
|
||
else if (a == 19)
|
||
{
|
||
machineItem.Num19 = num;
|
||
}
|
||
else if (a == 20)
|
||
{
|
||
machineItem.Num20 = num;
|
||
}
|
||
a++;
|
||
}
|
||
machineItems.Add(machineItem);
|
||
}
|
||
this.Grid2.DataSource = machineItems;
|
||
this.Grid2.DataBind();
|
||
}
|
||
var managements = BLL.ConstructionLogManagementService.GetConstructionLogManagementsByConstructionLogId(ConstructionLogId);
|
||
if (managements.Count > 0)
|
||
{
|
||
this.Grid3.DataSource = managements;
|
||
this.Grid3.DataBind();
|
||
}
|
||
var problems = BLL.ConstructionLogProblemService.GetConstructionLogProblemsByConstructionLogId(ConstructionLogId);
|
||
if (problems.Count > 0)
|
||
{
|
||
foreach (var item in problems)
|
||
{
|
||
item.WorkPackageId = BLL.WorkPackageInitService.GetPackageContentByWorkPackageCode(item.WorkPackageId);
|
||
}
|
||
this.Grid4.DataSource = problems;
|
||
this.Grid4.DataBind();
|
||
}
|
||
var records = BLL.ConstructionLogRecordService.GetConstructionLogRecordsByConstructionLogId(ConstructionLogId);
|
||
if (records.Count > 0)
|
||
{
|
||
this.Grid5.DataSource = records;
|
||
this.Grid5.DataBind();
|
||
}
|
||
var hjgls = BLL.ConstructionLogHJGLService.GetConstructionLogHJGLsByConstructionLogId(ConstructionLogId);
|
||
if (hjgls.Count > 0)
|
||
{
|
||
this.Grid6.DataSource = hjgls;
|
||
this.Grid6.DataBind();
|
||
}
|
||
else
|
||
{
|
||
this.Grid6.DataSource = null;
|
||
this.Grid6.DataBind();
|
||
}
|
||
ChangeText();
|
||
OutputSummaryData();
|
||
}
|
||
}
|
||
|
||
#region 增加
|
||
/// <summary>
|
||
/// 增加按钮
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void btnMenuAdd_Click(object sender, EventArgs e)
|
||
{
|
||
if (this.GetButtonPower(BLL.Const.BtnAdd))
|
||
{
|
||
TextNew();
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||
}
|
||
}
|
||
|
||
private void TextNew()
|
||
{
|
||
this.ConstructionLogId = string.Empty;
|
||
this.hdConstructionLogId.Text = string.Empty;
|
||
DateTime today = DateTime.Now.Date;
|
||
if (!string.IsNullOrEmpty(this.txtCompileDate.Text.Trim()))
|
||
{
|
||
today = Convert.ToDateTime(this.txtCompileDate.Text.Trim()).Date;
|
||
}
|
||
string prefix = string.Format("{0:yyyyMMdd}", today) + "-";
|
||
this.txtFileCode.Text = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "ZHGL_ConstructionLog", "FileCode", this.CurrUser.LoginProjectId, prefix);
|
||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", today);
|
||
this.txtWeek.Text = Funs.GetWeekDay(today.DayOfWeek.ToString());
|
||
var getW = WeatherService.GetWeather(this.CurrUser.LoginProjectId);
|
||
if (getW != null)
|
||
{
|
||
this.txtWeather.Text = getW.WeatherRef;
|
||
this.txtTemperature.Text = getW.AllTem;
|
||
}
|
||
//var log = (from x in Funs.DB.ZHGL_ConstructionLog
|
||
// where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileDate == today
|
||
// select x).FirstOrDefault();
|
||
//if (log != null)
|
||
//{
|
||
// this.txtWeather.Text = log.Weather;
|
||
// this.txtTemperature.Text = log.Temperature;
|
||
//}
|
||
this.txtCompileMan.Text = this.CurrUser.PersonName;
|
||
this.drpContractNo.SelectedIndex = 0;
|
||
this.drpUnitWork.SelectedIndex = 0;
|
||
this.drpProfessional.SelectedIndex = 0;
|
||
var personLog = (from x in Funs.DB.ZHGL_ConstructionLog
|
||
where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileMan == this.CurrUser.PersonId
|
||
orderby x.CompileDate descending
|
||
select x).FirstOrDefault();
|
||
if (personLog != null)
|
||
{
|
||
if (!string.IsNullOrEmpty(personLog.ContractNo))
|
||
{
|
||
if (personLog.ContractNo.Length > 0)
|
||
{
|
||
this.drpContractNo.SelectedValueArray = personLog.ContractNo.Split(',');
|
||
}
|
||
}
|
||
drpContractNo_SelectedIndexChanged(null, null);
|
||
if (!string.IsNullOrEmpty(personLog.UnitWorks))
|
||
{
|
||
if (personLog.UnitWorks.Length > 0)
|
||
{
|
||
this.drpUnitWork.SelectedValueArray = personLog.UnitWorks.Split(',');
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(personLog.Professional))
|
||
{
|
||
if (personLog.Professional.Length > 0)
|
||
{
|
||
this.drpProfessional.SelectedValueArray = personLog.Professional.Split(',');
|
||
}
|
||
}
|
||
}
|
||
this.txtRemark.Text = string.Empty;
|
||
this.txtHSETodaySummary.Text = "安全事故:次;安全检查:次;安全检查累计问题项:项,已整改:项。";
|
||
this.txtHSETodaySummaryRemark.Text = string.Empty;
|
||
this.txtHSETomorrowPlan.Text = string.Empty;
|
||
this.txtHSETomorrowPlanRemark.Text = string.Empty;
|
||
this.txtCQMSTodaySummary.Text = "质量事故:次;质量检查:次;质量验收:项;质量检查问题累计:项,已整改:项。";
|
||
this.txtCQMSTodaySummaryRemark.Text = string.Empty;
|
||
this.txtCQMSTomorrowPlan.Text = string.Empty;
|
||
this.txtCQMSTomorrowPlanRemark.Text = string.Empty;
|
||
this.Grid1.DataSource = null;
|
||
this.Grid1.DataBind();
|
||
this.Grid2.DataSource = null;
|
||
this.Grid2.DataBind();
|
||
this.Grid3.DataSource = null;
|
||
this.Grid3.DataBind();
|
||
this.Grid4.DataSource = null;
|
||
this.Grid4.DataBind();
|
||
this.Grid5.DataSource = null;
|
||
this.Grid5.DataBind();
|
||
drpUnitWork_SelectedIndexChanged(null, null);
|
||
ChangeText();
|
||
OutputSummaryData();
|
||
}
|
||
|
||
private void TextEmpty()
|
||
{
|
||
this.ConstructionLogId = string.Empty;
|
||
this.txtFileCode.Text = string.Empty;
|
||
this.txtCompileDate.Text = string.Empty;
|
||
this.txtWeek.Text = string.Empty;
|
||
this.txtWeather.Text = string.Empty;
|
||
this.txtTemperature.Text = string.Empty;
|
||
this.txtCompileMan.Text = string.Empty;
|
||
this.drpContractNo.SelectedIndex = 0;
|
||
this.drpUnitWork.SelectedIndex = 0;
|
||
this.drpProfessional.SelectedIndex = 0;
|
||
this.txtRemark.Text = string.Empty;
|
||
this.txtHSETodaySummary.Text = string.Empty;
|
||
this.txtHSETodaySummaryRemark.Text = string.Empty;
|
||
this.txtHSETomorrowPlan.Text = string.Empty;
|
||
this.txtHSETomorrowPlanRemark.Text = string.Empty;
|
||
this.txtCQMSTodaySummary.Text = string.Empty;
|
||
this.txtCQMSTodaySummaryRemark.Text = string.Empty;
|
||
this.txtCQMSTomorrowPlan.Text = string.Empty;
|
||
this.txtCQMSTomorrowPlanRemark.Text = string.Empty;
|
||
this.Grid1.DataSource = null;
|
||
this.Grid1.DataBind();
|
||
this.Grid2.DataSource = null;
|
||
this.Grid2.DataBind();
|
||
this.Grid3.DataSource = null;
|
||
this.Grid3.DataBind();
|
||
this.Grid4.DataSource = null;
|
||
this.Grid4.DataBind();
|
||
this.Grid5.DataSource = null;
|
||
this.Grid5.DataBind();
|
||
this.Grid6.DataSource = null;
|
||
this.Grid6.DataBind();
|
||
}
|
||
#endregion
|
||
|
||
#region 编辑
|
||
/// <summary>
|
||
/// 编辑按钮
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||
{
|
||
if (this.GetButtonPower(BLL.Const.BtnModify))
|
||
{
|
||
this.ConstructionLogId = this.tvControlItem.SelectedNodeID;
|
||
GetData();
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 导出
|
||
/// <summary>
|
||
/// 导出按钮
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void btnMenuDown_Click(object sender, EventArgs e)
|
||
{
|
||
string rootPath = Server.MapPath("~/");
|
||
string initTemplatePath = string.Empty;
|
||
string uploadfilepath = string.Empty;
|
||
string newUrl = string.Empty;
|
||
string filePath = string.Empty;
|
||
initTemplatePath = Const.ConstructionLogTemplateUrl;
|
||
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;
|
||
Model.ZHGL_ConstructionLog log = BLL.ConstructionLogService.GetConstructionLogById(constructionLogId);
|
||
if (log != null)
|
||
{
|
||
var project = BLL.ProjectService.GetProjectByProjectId(log.ProjectId);
|
||
var compileMan = BLL.Person_PersonsService.GetPersonsNameById(log.CompileMan);
|
||
DateTime date = DateTime.Now;
|
||
if (log.CompileDate != null)
|
||
{
|
||
date = log.CompileDate.Value;
|
||
}
|
||
newUrl = uploadfilepath.Replace(".xlsx", "(" + compileMan + "_" + string.Format("{0:yyyy-MM-dd}", date) + ")" + ".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.ICellStyle cellStyle2 = workbook.CreateCellStyle();
|
||
cellStyle2.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||
cellStyle2.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||
cellStyle2.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||
cellStyle2.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||
cellStyle2.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
|
||
cellStyle2.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
|
||
cellStyle2.WrapText = true;
|
||
var font0 = workbook.CreateFont();
|
||
font0.FontHeightInPoints = 13;
|
||
font0.IsBold = false;
|
||
cellStyle2.SetFont(font0);
|
||
NPOI.SS.UserModel.ICellStyle cellStyle3 = workbook.CreateCellStyle();
|
||
cellStyle3.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||
cellStyle3.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||
cellStyle3.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||
cellStyle3.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||
cellStyle3.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
|
||
cellStyle3.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
|
||
cellStyle3.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.Grey25Percent.Index;
|
||
cellStyle3.FillPattern = NPOI.SS.UserModel.FillPattern.SolidForeground;
|
||
cellStyle3.WrapText = true;
|
||
var font3 = workbook.CreateFont();
|
||
font3.FontHeightInPoints = 11;
|
||
font3.IsBold = true;
|
||
cellStyle3.SetFont(font3);
|
||
// 第二步:创建新数据行
|
||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||
NPOI.SS.UserModel.IRow row1 = sheet.GetRow(0);
|
||
NPOI.SS.UserModel.ICell cell3;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle2;
|
||
cell3.SetCellValue(project.ProjectName + "施工日志");
|
||
row1 = sheet.GetRow(1);
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.FileCode);
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(project.ProjectAddress);
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(project.ProjectName);
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(compileMan);
|
||
row1 = sheet.GetRow(2);
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(project.ProjectRealCode);
|
||
row1 = sheet.GetRow(3);
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(string.Format("{0:yyyy-MM-dd}", date));
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.Weather);
|
||
row1 = sheet.GetRow(4);
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(Funs.GetWeekDay(date.DayOfWeek.ToString()));
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.Temperature);
|
||
var p = BLL.Person_PersonsService.GetPerson_PersonsById(log.CompileMan);
|
||
var projectUser = SitePerson_PersonService.GetSitePersonByProjectIdIdentityCard(this.CurrUser.LoginProjectId, p.IdentityCard);
|
||
if (projectUser != null && projectUser.WorkPostId == BLL.Const.WorkPost_ConstructionManager)
|
||
{
|
||
row1 = sheet.GetRow(5);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3.SetCellValue("施工经理相关记录");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(5, 5, 0, 13));
|
||
row1 = sheet.GetRow(6);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("序号");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("相关记录");
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(6, 6, 1, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("备注");
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(6, 6, 12, 13));
|
||
var records = (from x in db.ZHGL_ConstructionLogRecord
|
||
where x.ConstructionLogId == constructionLogId
|
||
select x).ToList();
|
||
for (int i = 0; i < records.Count; i++)
|
||
{
|
||
row1 = sheet.GetRow(7 + i);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue((i + 1).ToString());
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(records[i].Record);
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(7 + i, 7 + i, 1, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(records[i].Remark);
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(7 + i, 7 + i, 12, 13));
|
||
}
|
||
}
|
||
else
|
||
{
|
||
row1 = sheet.GetRow(5);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3.SetCellValue("人工机械消耗数据");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(5, 5, 0, 13));
|
||
row1 = sheet.GetRow(6);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("合同名称");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle3;
|
||
sheet.AddMergedRegion(new CellRangeAddress(6, 6, 0, 2));
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("单位工程");
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle3;
|
||
sheet.AddMergedRegion(new CellRangeAddress(6, 6, 3, 5));
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("专业工程");
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle3;
|
||
sheet.AddMergedRegion(new CellRangeAddress(6, 6, 6, 8));
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("填报状态");
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("备注");
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(6, 6, 10, 13));
|
||
row1 = sheet.GetRow(7);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.ContractService.GetContractName(log.ContractNo));
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(7, 7, 0, 2));
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.UnitWorkService.GetUnitWorkName(log.UnitWorks));
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(7, 7, 3, 5));
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.PHTGL_QuantityService.GetMajorName(log.Professional));
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(7, 7, 6, 8));
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
string workEfficiency = "未填报";
|
||
if (workEfficiencys.Count() > 0)
|
||
{
|
||
workEfficiency = "已填报";
|
||
}
|
||
cell3.SetCellValue(workEfficiency);
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.Remark);
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(7, 7, 10, 13));
|
||
row1 = sheet.GetRow(8);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3.SetCellValue("作业人员人数");
|
||
row1 = sheet.GetRow(9);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("序号");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("单位工程");
|
||
List<string> list = Funs.GetStrListByStr(this.hdWorkPostId.Text, ',');
|
||
for (int i = 0; i < list.Count; i++)
|
||
{
|
||
cell3 = row1.CreateCell(i + 2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.WorkPostService.getWorkPostNameById(list[i]));
|
||
}
|
||
row1 = sheet.GetRow(8);
|
||
cell3 = row1.CreateCell(1 + list.Count);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(8, 8, 0, 1 + list.Count));
|
||
int rowCount = 10;
|
||
List<string> unitWorklist = Funs.GetStrListByStr(log.UnitWorks, ',');
|
||
int[] sum1 = new int[list.Count];
|
||
for (int i = 0; i < unitWorklist.Count; i++)
|
||
{
|
||
row1 = sheet.GetRow(rowCount + i);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue((i + 1).ToString());
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.UnitWorkService.GetUnitWorkName(unitWorklist[i]));
|
||
for (int j = 0; j < list.Count; j++)
|
||
{
|
||
cell3 = row1.CreateCell(j + 2);
|
||
cell3.CellStyle = cellStyle0;
|
||
var person = persons.FirstOrDefault(x => x.UnitWorkId == unitWorklist[i] && x.WorkPostId == list[j]);
|
||
if (person != null && person.Num != null)
|
||
{
|
||
cell3.SetCellValue(person.Num.ToString());
|
||
sum1[j] += Funs.GetNewIntOrZero(person.Num.ToString());
|
||
}
|
||
}
|
||
}
|
||
rowCount += unitWorklist.Count;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("合计");
|
||
for (int i = 0; i < sum1.Length; i++)
|
||
{
|
||
cell3 = row1.CreateCell(i + 2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(sum1[i].ToString());
|
||
}
|
||
rowCount++;
|
||
int rowMachineTitle = rowCount;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3.SetCellValue("机械数量");
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("序号");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("单位工程");
|
||
List<string> list2 = Funs.GetStrListByStr(this.hdMachineId.Text, ',');
|
||
for (int i = 0; i < list2.Count; i++)
|
||
{
|
||
cell3 = row1.CreateCell(i + 2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.SpecialEquipmentService.GetSpecialEquipmentNameById(list2[i]));
|
||
}
|
||
row1 = sheet.GetRow(rowMachineTitle);
|
||
cell3 = row1.CreateCell(1 + list2.Count);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowMachineTitle, rowMachineTitle, 0, 1 + list2.Count));
|
||
rowCount++;
|
||
int[] sum2 = new int[list2.Count];
|
||
for (int i = 0; i < unitWorklist.Count; i++)
|
||
{
|
||
row1 = sheet.GetRow(rowCount + i);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue((i + 1).ToString());
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.UnitWorkService.GetUnitWorkName(unitWorklist[i]));
|
||
for (int j = 0; j < list2.Count; j++)
|
||
{
|
||
cell3 = row1.CreateCell(j + 2);
|
||
cell3.CellStyle = cellStyle0;
|
||
var machine = machines.FirstOrDefault(x => x.UnitWorkId == unitWorklist[i] && x.MachineId == list2[j]);
|
||
if (machine != null && machine.Num != null)
|
||
{
|
||
cell3.SetCellValue(machine.Num.ToString());
|
||
sum2[j] += Funs.GetNewIntOrZero(machine.Num.ToString());
|
||
}
|
||
}
|
||
}
|
||
rowCount += unitWorklist.Count;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("合计");
|
||
for (int i = 0; i < sum2.Length; i++)
|
||
{
|
||
cell3 = row1.CreateCell(i + 2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(sum2[i].ToString());
|
||
}
|
||
rowCount++;
|
||
int rowHJGLTitle = rowCount;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3.SetCellValue("焊接数据");
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("序号");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("单位工程");
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("今日完成(DIN)");
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("累计完成(DIN)");
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("总量(DIN)");
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("累计完成百分比");
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("明日计划(DIN)");
|
||
row1 = sheet.GetRow(rowHJGLTitle);
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowHJGLTitle, rowHJGLTitle, 0, 6));
|
||
rowCount++;
|
||
var hjgls = (from x in db.ZHGL_ConstructionLogHJGL
|
||
where x.ConstructionLogId == constructionLogId
|
||
orderby x.UnitWorkId
|
||
select x).ToList();
|
||
if (hjgls.Count > 0)
|
||
{
|
||
decimal sumTodayCompleteSize = 0, sumTotalCompleteSize = 0, sumTotalSize = 0, sumTomorrowPlanSize = 0;
|
||
for (int i = 0; i < hjgls.Count; i++)
|
||
{
|
||
row1 = sheet.GetRow(rowCount + i);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue((i + 1).ToString());
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.UnitWorkService.GetUnitWorkName(hjgls[i].UnitWorkId));
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(hjgls[i].TodayCompleteSize.Value.ToString("0.###"));
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(hjgls[i].TotalCompleteSize.Value.ToString("0.###"));
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(hjgls[i].TotalSize.Value.ToString("0.###"));
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(hjgls[i].TotalRate);
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(hjgls[i].TomorrowPlanSize.Value.ToString("0.###"));
|
||
sumTodayCompleteSize += hjgls[i].TodayCompleteSize.Value;
|
||
sumTotalCompleteSize += hjgls[i].TotalCompleteSize.Value;
|
||
sumTotalSize += hjgls[i].TotalSize.Value;
|
||
sumTomorrowPlanSize += hjgls[i].TomorrowPlanSize.Value;
|
||
}
|
||
rowCount += hjgls.Count;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("合计");
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(sumTodayCompleteSize.ToString("0.###"));
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(sumTotalCompleteSize.ToString("0.###"));
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(sumTotalSize.ToString("0.###"));
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
string sumRate = "/";
|
||
if (sumTotalSize > 0)
|
||
{
|
||
sumRate = decimal.Round(sumTotalCompleteSize / sumTotalSize * 100, 2) + "%";
|
||
}
|
||
cell3.SetCellValue(sumRate);
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(sumTomorrowPlanSize.ToString("0.###"));
|
||
rowCount++;
|
||
}
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3.SetCellValue("专业管理");
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("序号");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("单位工程");
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("今日完成工作");
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle3;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 2, 6));
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("明日计划工作");
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle3;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 7, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("备注");
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle3;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 12, 13));
|
||
rowCount++;
|
||
var managements = (from x in db.ZHGL_ConstructionLogManagement
|
||
where x.ConstructionLogId == constructionLogId
|
||
orderby x.UnitWorkId
|
||
select x).ToList();
|
||
for (int i = 0; i < managements.Count; i++)
|
||
{
|
||
row1 = sheet.GetRow(rowCount + i);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue((i + 1).ToString());
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.UnitWorkService.GetUnitWorkName(managements[i].UnitWorkId));
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(managements[i].TodayWork);
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount + i, rowCount + i, 2, 6));
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(managements[i].TomorrowWork);
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount + i, rowCount + i, 7, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(managements[i].Remark);
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount + i, rowCount + i, 12, 13));
|
||
}
|
||
rowCount += managements.Count;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3.SetCellValue("安全管理");
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("当日小结");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("备注");
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 12, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.HSETodaySummary);
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.HSETodaySummaryRemark);
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 12, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("明日计划");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("备注");
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 12, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.HSETomorrowPlan);
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.HSETomorrowPlanRemark);
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 12, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3.SetCellValue("质量管理");
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("当日小结");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("备注");
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 12, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.CQMSTodaySummary);
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.CQMSTodaySummaryRemark);
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 12, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("明日计划");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("备注");
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 12, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.CQMSTomorrowPlan);
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 11));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(log.CQMSTomorrowPlanRemark);
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 12, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle3;
|
||
cell3.SetCellValue("需要协调解决的问题");
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 0, 13));
|
||
rowCount++;
|
||
row1 = sheet.GetRow(rowCount);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("序号");
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("单位工程");
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("主要问题");
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle3;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 2, 6));
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("处理措施");
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle3;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 7, 10));
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("所属WBS");
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 11, 12));
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue("备注");
|
||
var problems = (from x in db.ZHGL_ConstructionLogProblem
|
||
where x.ConstructionLogId == constructionLogId
|
||
orderby x.UnitWorkId
|
||
select x).ToList();
|
||
rowCount++;
|
||
for (int i = 0; i < problems.Count; i++)
|
||
{
|
||
row1 = sheet.GetRow(rowCount + i);
|
||
cell3 = row1.CreateCell(0);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue((i + 1).ToString());
|
||
cell3 = row1.CreateCell(1);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.UnitWorkService.GetUnitWorkName(problems[i].UnitWorkId));
|
||
cell3 = row1.CreateCell(2);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(problems[i].MainProblem);
|
||
cell3 = row1.CreateCell(3);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(4);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(5);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(6);
|
||
cell3.CellStyle = cellStyle3;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount + i, rowCount + i, 2, 6));
|
||
cell3 = row1.CreateCell(7);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(problems[i].HandlingMeasures);
|
||
cell3 = row1.CreateCell(8);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(9);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3 = row1.CreateCell(10);
|
||
cell3.CellStyle = cellStyle3;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount + i, rowCount + i, 7, 10));
|
||
cell3 = row1.CreateCell(11);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(BLL.WorkPackageInitService.GetPackageContentByWorkPackageCode(problems[i].WorkPackageId));
|
||
cell3 = row1.CreateCell(12);
|
||
cell3.CellStyle = cellStyle0;
|
||
sheet.AddMergedRegion(new CellRangeAddress(rowCount + i, rowCount + i, 11, 12));
|
||
cell3 = row1.CreateCell(13);
|
||
cell3.CellStyle = cellStyle0;
|
||
cell3.SetCellValue(problems[i].ImportanceLevel);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
// 第三步:写入文件流
|
||
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);
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 删除明细
|
||
/// <summary>
|
||
/// 删除明细按钮
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void btnMenuDelete2_Click(object sender, EventArgs e)
|
||
{
|
||
}
|
||
#endregion
|
||
|
||
#region 保存
|
||
/// <summary>
|
||
/// 保存按钮
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void btnSave_Click(object sender, EventArgs e)
|
||
{
|
||
if (this.GetButtonPower(BLL.Const.BtnSave))
|
||
{
|
||
if (this.Grid5.Hidden == true)
|
||
{
|
||
if (this.drpContractNo.SelectedValue == BLL.Const._Null && this.drpContractNo.SelectedItemArray.Length == 1)
|
||
{
|
||
Alert.ShowInTop("请选择合同编号!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
if (this.drpUnitWork.SelectedValue == BLL.Const._Null && this.drpUnitWork.SelectedItemArray.Length == 1)
|
||
{
|
||
Alert.ShowInTop("请选择单位工程!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
if (this.drpProfessional.SelectedValue == BLL.Const._Null && this.drpProfessional.SelectedItemArray.Length == 1)
|
||
{
|
||
Alert.ShowInTop("请选择专业工程!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
}
|
||
Model.ZHGL_ConstructionLog log = new Model.ZHGL_ConstructionLog();
|
||
log.ProjectId = this.CurrUser.LoginProjectId;
|
||
log.FileCode = this.txtFileCode.Text.Trim();
|
||
log.CompileDate = Funs.GetNewDateTimeOrNow(this.txtCompileDate.Text.Trim());
|
||
log.Weather = this.txtWeather.Text.Trim();
|
||
log.Temperature = this.txtTemperature.Text.Trim();
|
||
log.CompileMan = this.CurrUser.PersonId;
|
||
string contractNo = string.Empty;
|
||
foreach (var item in this.drpContractNo.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
contractNo += item + ",";
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(contractNo))
|
||
{
|
||
contractNo = contractNo.Substring(0, contractNo.Length - 1);
|
||
}
|
||
log.ContractNo = contractNo;
|
||
string unitWork = string.Empty;
|
||
foreach (var item in this.drpUnitWork.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
unitWork += item + ",";
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(unitWork))
|
||
{
|
||
unitWork = unitWork.Substring(0, unitWork.Length - 1);
|
||
}
|
||
log.UnitWorks = unitWork;
|
||
string professional = string.Empty;
|
||
foreach (var item in this.drpProfessional.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
professional += item + ",";
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(professional))
|
||
{
|
||
professional = professional.Substring(0, professional.Length - 1);
|
||
}
|
||
log.Professional = professional;
|
||
log.State = "1"; //已填报
|
||
log.Remark = this.txtRemark.Text.Trim();
|
||
log.HSETodaySummary = this.txtHSETodaySummary.Text.Trim();
|
||
log.HSETodaySummaryRemark = this.txtHSETodaySummaryRemark.Text.Trim();
|
||
log.HSETomorrowPlan = this.txtHSETomorrowPlan.Text.Trim();
|
||
log.HSETomorrowPlanRemark = this.txtHSETomorrowPlanRemark.Text.Trim();
|
||
log.CQMSTodaySummary = this.txtCQMSTodaySummary.Text.Trim();
|
||
log.CQMSTodaySummaryRemark = this.txtCQMSTodaySummaryRemark.Text.Trim();
|
||
log.CQMSTomorrowPlan = this.txtCQMSTomorrowPlan.Text.Trim();
|
||
log.CQMSTomorrowPlanRemark = this.txtCQMSTomorrowPlanRemark.Text.Trim();
|
||
log.WorkPostId = this.hdWorkPostId.Text.Trim();
|
||
log.MachineId = this.hdMachineId.Text.Trim();
|
||
if (!string.IsNullOrEmpty(this.ConstructionLogId))
|
||
{
|
||
var updatelog = BLL.ConstructionLogService.GetConstructionLogById(this.ConstructionLogId);
|
||
if (updatelog != null)
|
||
{
|
||
log.ConstructionLogId = ConstructionLogId;
|
||
BLL.ConstructionLogService.UpdateConstructionLog(log);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
var personLog = (from x in Funs.DB.ZHGL_ConstructionLog
|
||
where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileMan == this.CurrUser.PersonId
|
||
&& x.CompileDate == Funs.GetNewDateTime(this.txtCompileDate.Text.Trim())
|
||
select x).FirstOrDefault();
|
||
if (personLog == null)
|
||
{
|
||
if (!string.IsNullOrEmpty(hdConstructionLogId.Text))
|
||
{
|
||
log.ConstructionLogId = hdConstructionLogId.Text;
|
||
}
|
||
else
|
||
{
|
||
log.ConstructionLogId = SQLHelper.GetNewID(typeof(Model.ZHGL_ConstructionLog));
|
||
}
|
||
this.ConstructionLogId = log.ConstructionLogId;
|
||
BLL.ConstructionLogService.AddConstructionLog(log);
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("当前日期施工日志已存在!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
}
|
||
BLL.ConstructionLogPersonService.DeleteConstructionLogPersonsByConstructionLogId(this.ConstructionLogId);
|
||
List<string> list = Funs.GetStrListByStr(this.hdWorkPostId.Text, ',');
|
||
foreach (JObject mergedRow in Grid1.GetMergedData()) //作业人员人数
|
||
{
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
for (int i = 0; i < list.Count; i++)
|
||
{
|
||
Model.ZHGL_ConstructionLogPerson newItem = new Model.ZHGL_ConstructionLogPerson();
|
||
newItem.ConstructionLogPersonId = SQLHelper.GetNewID();
|
||
newItem.ConstructionLogId = this.ConstructionLogId;
|
||
newItem.UnitWorkId = values.Value<string>("UnitWorkId");
|
||
newItem.WorkPostId = list[i];
|
||
newItem.Num = Funs.GetNewIntOrZero(values.Value<string>("Num" + i.ToString()));
|
||
ConstructionLogPersonService.AddConstructionLogPerson(newItem);
|
||
}
|
||
}
|
||
BLL.ConstructionLogMachineService.DeleteConstructionLogMachinesByConstructionLogId(this.ConstructionLogId);
|
||
List<string> list2 = Funs.GetStrListByStr(this.hdMachineId.Text, ',');
|
||
foreach (JObject mergedRow in Grid2.GetMergedData()) //机械数量
|
||
{
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
for (int i = 0; i < list2.Count; i++)
|
||
{
|
||
Model.ZHGL_ConstructionLogMachine newItem = new Model.ZHGL_ConstructionLogMachine();
|
||
newItem.ConstructionLogMachineId = SQLHelper.GetNewID();
|
||
newItem.ConstructionLogId = this.ConstructionLogId;
|
||
newItem.UnitWorkId = values.Value<string>("UnitWorkId");
|
||
newItem.MachineId = list2[i];
|
||
newItem.Num = Funs.GetNewIntOrZero(values.Value<string>("Num" + i.ToString()));
|
||
ConstructionLogMachineService.AddConstructionLogMachine(newItem);
|
||
}
|
||
}
|
||
BLL.ConstructionLogManagementService.DeleteConstructionLogManagementsByConstructionLogId(this.ConstructionLogId);
|
||
foreach (JObject mergedRow in Grid3.GetMergedData()) //专业管理
|
||
{
|
||
Model.ZHGL_ConstructionLogManagement newItem = new Model.ZHGL_ConstructionLogManagement();
|
||
int i = mergedRow.Value<int>("index");
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
newItem.ConstructionLogManagementId = SQLHelper.GetNewID();
|
||
newItem.ConstructionLogId = this.ConstructionLogId;
|
||
newItem.UnitWorkId = values.Value<string>("UnitWorkId");
|
||
newItem.TodayWork = values.Value<string>("TodayWork");
|
||
newItem.TomorrowWork = values.Value<string>("TomorrowWork");
|
||
newItem.Remark = values.Value<string>("Remark");
|
||
ConstructionLogManagementService.AddConstructionLogManagement(newItem);
|
||
}
|
||
BLL.ConstructionLogProblemService.DeleteConstructionLogProblemsByConstructionLogId(this.ConstructionLogId);
|
||
foreach (JObject mergedRow in Grid4.GetMergedData()) //需要协调解决的问题
|
||
{
|
||
Model.ZHGL_ConstructionLogProblem newItem = new Model.ZHGL_ConstructionLogProblem();
|
||
int i = mergedRow.Value<int>("index");
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
newItem.ConstructionLogProblemId = values.Value<string>("ConstructionLogProblemId");
|
||
newItem.ConstructionLogId = this.ConstructionLogId;
|
||
newItem.UnitWorkId = values.Value<string>("UnitWorkId");
|
||
newItem.MainProblem = values.Value<string>("MainProblem");
|
||
newItem.HandlingMeasures = values.Value<string>("HandlingMeasures");
|
||
newItem.WorkPackageId = BLL.WorkPackageInitService.GetWorkPackageCodeByPackageContent(values.Value<string>("WorkPackageId"));
|
||
newItem.ImportanceLevel = values.Value<string>("ImportanceLevel");
|
||
ConstructionLogProblemService.AddConstructionLogProblem(newItem);
|
||
}
|
||
BLL.ConstructionLogRecordService.DeleteConstructionLogRecordsByConstructionLogId(this.ConstructionLogId);
|
||
foreach (JObject mergedRow in Grid5.GetMergedData()) //需要协调解决的问题
|
||
{
|
||
Model.ZHGL_ConstructionLogRecord newItem = new Model.ZHGL_ConstructionLogRecord();
|
||
int i = mergedRow.Value<int>("index");
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
newItem.ConstructionLogRecordId = SQLHelper.GetNewID();
|
||
newItem.ConstructionLogId = this.ConstructionLogId;
|
||
newItem.Record = values.Value<string>("Record");
|
||
newItem.Remark = values.Value<string>("Remark");
|
||
ConstructionLogRecordService.AddConstructionLogRecord(newItem);
|
||
}
|
||
BLL.ConstructionLogHJGLService.DeleteConstructionLogHJGLsByConstructionLogId(this.ConstructionLogId);
|
||
foreach (JObject mergedRow in Grid6.GetMergedData()) //需要协调解决的问题
|
||
{
|
||
Model.ZHGL_ConstructionLogHJGL newItem = new Model.ZHGL_ConstructionLogHJGL();
|
||
int i = mergedRow.Value<int>("index");
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
newItem.ConstructionLogHJGLId = SQLHelper.GetNewID();
|
||
newItem.ConstructionLogId = this.ConstructionLogId;
|
||
newItem.UnitWorkId = values.Value<string>("UnitWorkId");
|
||
newItem.TodayCompleteSize = Funs.GetNewDecimalOrZero(values.Value<string>("TodayCompleteSize"));
|
||
newItem.TotalCompleteSize = Funs.GetNewDecimalOrZero(values.Value<string>("TotalCompleteSize"));
|
||
newItem.TotalSize = Funs.GetNewDecimalOrZero(values.Value<string>("TotalSize"));
|
||
newItem.TotalRate = values.Value<string>("TotalRate");
|
||
newItem.TomorrowPlanSize = Funs.GetNewDecimalOrZero(values.Value<string>("TomorrowPlanSize"));
|
||
ConstructionLogHJGLService.AddConstructionLogHJGL(newItem);
|
||
}
|
||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||
InitTreeMenu();
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 关闭弹出窗体
|
||
/// <summary>
|
||
/// 关闭弹出窗体
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||
{
|
||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||
ChangeText();
|
||
}
|
||
#endregion
|
||
|
||
private void ChangeText()
|
||
{
|
||
var workEfficiencys = from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiency
|
||
where x.ConstructionLogId == this.hdConstructionLogId.Text
|
||
select x;
|
||
if (workEfficiencys.Count() > 0)
|
||
{
|
||
this.btnWorkEfficiency.Text = "已填报";
|
||
}
|
||
else
|
||
{
|
||
this.btnWorkEfficiency.Text = "未填报";
|
||
}
|
||
}
|
||
|
||
#region 右键删除焊口
|
||
/// <summary>
|
||
/// 右键删除焊口
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||
{
|
||
if (this.GetButtonPower(BLL.Const.BtnDelete))
|
||
{
|
||
this.ConstructionLogId = this.tvControlItem.SelectedNodeID;
|
||
var log = BLL.ConstructionLogService.GetConstructionLogById(ConstructionLogId);
|
||
if (log != null)
|
||
{
|
||
BLL.ConstructionLogWorkEfficiencyService.DeleteConstructionLogWorkEfficiencysByConstructionLogId(ConstructionLogId);
|
||
BLL.ConstructionLogPersonService.DeleteConstructionLogPersonsByConstructionLogId(ConstructionLogId);
|
||
BLL.ConstructionLogMachineService.DeleteConstructionLogMachinesByConstructionLogId(ConstructionLogId);
|
||
BLL.ConstructionLogHJGLService.DeleteConstructionLogHJGLsByConstructionLogId(ConstructionLogId);
|
||
BLL.ConstructionLogManagementService.DeleteConstructionLogManagementsByConstructionLogId(ConstructionLogId);
|
||
BLL.ConstructionLogProblemService.DeleteConstructionLogProblemsByConstructionLogId(ConstructionLogId);
|
||
BLL.ConstructionLogRecordService.DeleteConstructionLogRecordsByConstructionLogId(ConstructionLogId);
|
||
BLL.ConstructionLogService.DeleteConstructionLogById(ConstructionLogId);
|
||
ShowNotify("删除成功!", MessageBoxIcon.Success);
|
||
TextEmpty();
|
||
InitTreeMenu();
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("请选择要删除的记录!", MessageBoxIcon.Warning);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 单位工程转换
|
||
/// <summary>
|
||
/// 单位工程转换
|
||
/// </summary>
|
||
/// <param name=""></param>
|
||
/// <returns></returns>
|
||
protected string ConvertUnitWorkName(object unitWorkId)
|
||
{
|
||
if (unitWorkId != null)
|
||
{
|
||
return BLL.UnitWorkService.GetUnitWorkName(unitWorkId.ToString());
|
||
}
|
||
else
|
||
{
|
||
return "";
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 获取按钮权限
|
||
/// <summary>
|
||
/// 获取按钮权限
|
||
/// </summary>
|
||
/// <param name="button"></param>
|
||
/// <returns></returns>
|
||
private bool GetButtonPower(string button)
|
||
{
|
||
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.ConstructionLogMenuId, button);
|
||
}
|
||
|
||
#endregion
|
||
|
||
protected void drpContractNo_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
List<string> contractNos = new List<string>();
|
||
foreach (var item in this.drpContractNo.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
contractNos.Add(item);
|
||
}
|
||
}
|
||
UnitWorkService.InitContractUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, contractNos, true);
|
||
}
|
||
|
||
protected void drpUnitWork_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (this.drpUnitWork.SelectedValue == BLL.Const._Null && this.drpUnitWork.SelectedItemArray.Length == 1)
|
||
{
|
||
this.Grid1.DataSource = null;
|
||
this.Grid1.DataBind();
|
||
this.Grid2.DataSource = null;
|
||
this.Grid2.DataBind();
|
||
this.Grid3.DataSource = null;
|
||
this.Grid3.DataBind();
|
||
this.Grid4.DataSource = null;
|
||
this.Grid4.DataBind();
|
||
this.Grid6.DataSource = null;
|
||
this.Grid6.DataBind();
|
||
}
|
||
else
|
||
{
|
||
List<Model.ZHGL_ConstructionLogPerson> persons = new List<Model.ZHGL_ConstructionLogPerson>();
|
||
foreach (var item in this.drpUnitWork.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
Model.ZHGL_ConstructionLogPerson person = new Model.ZHGL_ConstructionLogPerson();
|
||
person.ConstructionLogPersonId = SQLHelper.GetNewID();
|
||
person.UnitWorkId = item;
|
||
persons.Add(person);
|
||
}
|
||
}
|
||
this.Grid1.DataSource = persons;
|
||
this.Grid1.DataBind();
|
||
List<Model.ZHGL_ConstructionLogMachine> machines = new List<Model.ZHGL_ConstructionLogMachine>();
|
||
foreach (var item in this.drpUnitWork.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
Model.ZHGL_ConstructionLogMachine machine = new Model.ZHGL_ConstructionLogMachine();
|
||
machine.ConstructionLogMachineId = SQLHelper.GetNewID();
|
||
machine.UnitWorkId = item;
|
||
machines.Add(machine);
|
||
}
|
||
}
|
||
this.Grid2.DataSource = machines;
|
||
this.Grid2.DataBind();
|
||
DateTime today = DateTime.Now.Date;
|
||
if (!string.IsNullOrEmpty(this.txtCompileDate.Text.Trim()))
|
||
{
|
||
today = Convert.ToDateTime(this.txtCompileDate.Text.Trim()).Date;
|
||
}
|
||
today = today.AddDays(-1);
|
||
Model.SGGLDB db = Funs.DB;
|
||
var allWeldJoints = from x in db.View_HJGL_WeldJoint
|
||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||
select new
|
||
{
|
||
x.UnitWorkId,
|
||
x.WeldJointId,
|
||
Size = x.Size ?? 0,
|
||
x.WeldingDateD,
|
||
};
|
||
List<Model.ZHGL_ConstructionLogHJGL> hjgls = new List<Model.ZHGL_ConstructionLogHJGL>();
|
||
foreach (var item in this.drpUnitWork.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
Model.ZHGL_ConstructionLogHJGL hjgl = new Model.ZHGL_ConstructionLogHJGL();
|
||
hjgl.ConstructionLogHJGLId = SQLHelper.GetNewID();
|
||
hjgl.UnitWorkId = item;
|
||
hjgl.TodayCompleteSize = allWeldJoints.Where(x => x.UnitWorkId == item && x.WeldingDateD == today).ToList().Sum(x => x.Size);
|
||
decimal totalCompleteSize = allWeldJoints.Where(x => x.UnitWorkId == item && x.WeldingDateD <= today).ToList().Sum(x => x.Size);
|
||
hjgl.TotalCompleteSize = totalCompleteSize;
|
||
decimal totalSize = allWeldJoints.Where(x => x.UnitWorkId == item).ToList().Sum(x => x.Size);
|
||
hjgl.TotalSize = totalSize;
|
||
if (totalSize > 0)
|
||
{
|
||
hjgl.TotalRate = decimal.Round(totalCompleteSize / totalSize * 100, 2) + "%";
|
||
}
|
||
else
|
||
{
|
||
hjgl.TotalRate = "/";
|
||
}
|
||
hjgls.Add(hjgl);
|
||
}
|
||
}
|
||
this.Grid6.DataSource = hjgls;
|
||
this.Grid6.DataBind();
|
||
List<Model.ZHGL_ConstructionLogManagement> managements = new List<Model.ZHGL_ConstructionLogManagement>();
|
||
foreach (var item in this.drpUnitWork.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
Model.ZHGL_ConstructionLogManagement management = new Model.ZHGL_ConstructionLogManagement();
|
||
management.ConstructionLogManagementId = SQLHelper.GetNewID();
|
||
management.UnitWorkId = item;
|
||
managements.Add(management);
|
||
}
|
||
}
|
||
this.Grid3.DataSource = managements;
|
||
this.Grid3.DataBind();
|
||
List<Model.ZHGL_ConstructionLogProblem> problems = new List<Model.ZHGL_ConstructionLogProblem>();
|
||
foreach (var item in this.drpUnitWork.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
Model.ZHGL_ConstructionLogProblem problem = new Model.ZHGL_ConstructionLogProblem();
|
||
problem.ConstructionLogProblemId = SQLHelper.GetNewID();
|
||
problem.UnitWorkId = item;
|
||
problems.Add(problem);
|
||
}
|
||
}
|
||
this.Grid4.DataSource = problems;
|
||
this.Grid4.DataBind();
|
||
}
|
||
}
|
||
|
||
#region Grid行点击事件
|
||
/// <summary>
|
||
/// Grid行点击事件
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void Grid3_RowCommand(object sender, GridCommandEventArgs e)
|
||
{
|
||
string id = this.Grid3.SelectedRow.RowID;
|
||
string unitWorkId = this.Grid3.SelectedRow.DataKeys[1].ToString();
|
||
//保存页面数据
|
||
List<Model.ZHGL_ConstructionLogManagement> items = new List<Model.ZHGL_ConstructionLogManagement>();
|
||
foreach (JObject mergedRow in Grid3.GetMergedData()) //专业管理
|
||
{
|
||
Model.ZHGL_ConstructionLogManagement newItem = new Model.ZHGL_ConstructionLogManagement();
|
||
int i = mergedRow.Value<int>("index");
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
newItem.ConstructionLogManagementId = values.Value<string>("ConstructionLogManagementId");
|
||
newItem.ConstructionLogId = this.ConstructionLogId;
|
||
newItem.UnitWorkId = values.Value<string>("UnitWorkId");
|
||
newItem.TodayWork = values.Value<string>("TodayWork");
|
||
newItem.TomorrowWork = values.Value<string>("TomorrowWork");
|
||
newItem.Remark = values.Value<string>("Remark");
|
||
items.Add(newItem);
|
||
}
|
||
if (e.CommandName == "add")//增加
|
||
{
|
||
Model.ZHGL_ConstructionLogManagement newItem = new Model.ZHGL_ConstructionLogManagement();
|
||
newItem.ConstructionLogManagementId = SQLHelper.GetNewID();
|
||
newItem.UnitWorkId = unitWorkId;
|
||
items.Add(newItem);
|
||
items = items.OrderBy(x => x.UnitWorkId).ToList();
|
||
this.Grid3.DataSource = items;
|
||
this.Grid3.DataBind();
|
||
}
|
||
if (e.CommandName == "del")//删除
|
||
{
|
||
var w = items.FirstOrDefault(x => x.ConstructionLogManagementId == id);
|
||
if (w != null)
|
||
{
|
||
items.Remove(w);
|
||
}
|
||
items = items.OrderBy(x => x.UnitWorkId).ToList();
|
||
this.Grid3.DataSource = items;
|
||
this.Grid3.DataBind();
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Grid行点击事件
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void Grid4_RowCommand(object sender, GridCommandEventArgs e)
|
||
{
|
||
string id = this.Grid4.SelectedRow.RowID;
|
||
string unitWorkId = this.Grid4.SelectedRow.DataKeys[1].ToString();
|
||
if (e.CommandName == "download")
|
||
{
|
||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
|
||
String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/ConstructionLog&menuId={2}",
|
||
0, id, Const.ConstructionLogMenuId)));
|
||
}
|
||
else
|
||
{
|
||
//保存页面数据
|
||
List<Model.ZHGL_ConstructionLogProblem> items = new List<Model.ZHGL_ConstructionLogProblem>();
|
||
foreach (JObject mergedRow in Grid4.GetMergedData()) //专业管理
|
||
{
|
||
Model.ZHGL_ConstructionLogProblem newItem = new Model.ZHGL_ConstructionLogProblem();
|
||
int i = mergedRow.Value<int>("index");
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
newItem.ConstructionLogProblemId = values.Value<string>("ConstructionLogProblemId");
|
||
newItem.ConstructionLogId = this.ConstructionLogId;
|
||
newItem.UnitWorkId = values.Value<string>("UnitWorkId");
|
||
newItem.MainProblem = values.Value<string>("MainProblem");
|
||
newItem.HandlingMeasures = values.Value<string>("HandlingMeasures");
|
||
newItem.WorkPackageId = BLL.WorkPackageInitService.GetWorkPackageCodeByPackageContent(values.Value<string>("WorkPackageId"));
|
||
newItem.ImportanceLevel = values.Value<string>("ImportanceLevel");
|
||
items.Add(newItem);
|
||
}
|
||
if (e.CommandName == "add")//增加
|
||
{
|
||
Model.ZHGL_ConstructionLogProblem newItem = new Model.ZHGL_ConstructionLogProblem();
|
||
newItem.ConstructionLogProblemId = SQLHelper.GetNewID();
|
||
newItem.UnitWorkId = unitWorkId;
|
||
items.Add(newItem);
|
||
items = items.OrderBy(x => x.UnitWorkId).ToList();
|
||
|
||
}
|
||
if (e.CommandName == "del")//删除
|
||
{
|
||
var w = items.FirstOrDefault(x => x.ConstructionLogProblemId == id);
|
||
if (w != null)
|
||
{
|
||
items.Remove(w);
|
||
}
|
||
items = items.OrderBy(x => x.UnitWorkId).ToList();
|
||
}
|
||
foreach (var item in items)
|
||
{
|
||
item.WorkPackageId = BLL.WorkPackageInitService.GetPackageContentByWorkPackageCode(item.WorkPackageId);
|
||
}
|
||
this.Grid4.DataSource = items;
|
||
this.Grid4.DataBind();
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Grid行点击事件
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void Grid5_RowCommand(object sender, GridCommandEventArgs e)
|
||
{
|
||
string id = this.Grid5.SelectedRow.RowID;
|
||
//保存页面数据
|
||
List<Model.ZHGL_ConstructionLogRecord> items = new List<Model.ZHGL_ConstructionLogRecord>();
|
||
foreach (JObject mergedRow in Grid5.GetMergedData()) //专业管理
|
||
{
|
||
Model.ZHGL_ConstructionLogRecord newItem = new Model.ZHGL_ConstructionLogRecord();
|
||
int i = mergedRow.Value<int>("index");
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
newItem.ConstructionLogRecordId = values.Value<string>("ConstructionLogRecordId");
|
||
newItem.ConstructionLogId = this.ConstructionLogId;
|
||
newItem.Record = values.Value<string>("Record");
|
||
newItem.Remark = values.Value<string>("Remark");
|
||
items.Add(newItem);
|
||
}
|
||
if (e.CommandName == "del")//删除
|
||
{
|
||
var w = items.FirstOrDefault(x => x.ConstructionLogRecordId == id);
|
||
if (w != null)
|
||
{
|
||
items.Remove(w);
|
||
}
|
||
}
|
||
this.Grid5.DataSource = items;
|
||
this.Grid5.DataBind();
|
||
}
|
||
#endregion
|
||
|
||
protected void btnAdd_Click(object sender, EventArgs e)
|
||
{
|
||
//保存页面数据
|
||
List<Model.ZHGL_ConstructionLogRecord> items = new List<Model.ZHGL_ConstructionLogRecord>();
|
||
foreach (JObject mergedRow in Grid5.GetMergedData()) //专业管理
|
||
{
|
||
Model.ZHGL_ConstructionLogRecord item = new Model.ZHGL_ConstructionLogRecord();
|
||
int i = mergedRow.Value<int>("index");
|
||
JObject values = mergedRow.Value<JObject>("values");
|
||
item.ConstructionLogRecordId = values.Value<string>("ConstructionLogRecordId");
|
||
item.ConstructionLogId = this.ConstructionLogId;
|
||
item.Record = values.Value<string>("Record");
|
||
item.Remark = values.Value<string>("Remark");
|
||
items.Add(item);
|
||
}
|
||
Model.ZHGL_ConstructionLogRecord newItem = new Model.ZHGL_ConstructionLogRecord();
|
||
newItem.ConstructionLogRecordId = SQLHelper.GetNewID();
|
||
items.Add(newItem);
|
||
this.Grid5.DataSource = items;
|
||
this.Grid5.DataBind();
|
||
}
|
||
|
||
protected void txtCompileDate_TextChanged(object sender, EventArgs e)
|
||
{
|
||
TextNew();
|
||
}
|
||
|
||
protected void btnWorkEfficiency_Click(object sender, EventArgs e)
|
||
{
|
||
if (string.IsNullOrEmpty(hdConstructionLogId.Text)) //新增记录
|
||
{
|
||
hdConstructionLogId.Text = SQLHelper.GetNewID();
|
||
}
|
||
string contractNo = string.Empty;
|
||
foreach (var item in this.drpContractNo.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
contractNo += item + ",";
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(contractNo))
|
||
{
|
||
contractNo = contractNo.Substring(0, contractNo.Length - 1);
|
||
}
|
||
string professional = string.Empty;
|
||
foreach (var item in this.drpProfessional.SelectedValueArray)
|
||
{
|
||
if (item != BLL.Const._Null)
|
||
{
|
||
professional += item + ",";
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(professional))
|
||
{
|
||
professional = professional.Substring(0, professional.Length - 1);
|
||
}
|
||
if (!string.IsNullOrEmpty(contractNo) && !string.IsNullOrEmpty(professional))
|
||
{
|
||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionLogWorkEfficiency.aspx?ConstructionLogId={0}&contractNo={1}&professional={2}&WorkPostId={3}&MachineId={4}", this.hdConstructionLogId.Text, contractNo, professional, hdWorkPostId.Text, hdMachineId.Text, "导入 - ")));
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("请选择合同编号和专业工程!", MessageBoxIcon.Warning);
|
||
}
|
||
}
|
||
|
||
protected void imgBtnFile_Click(object sender, EventArgs e)
|
||
{
|
||
if (string.IsNullOrEmpty(this.hdConstructionLogId.Text)) //新增记录
|
||
{
|
||
this.hdConstructionLogId.Text = SQLHelper.GetNewID();
|
||
}
|
||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/ConstructionLog&menuId={2}", 0, this.hdConstructionLogId.Text, BLL.Const.ConstructionLogMenuId)));
|
||
}
|
||
}
|
||
} |