2023-09-25 19:20:08 +08:00
|
|
|
|
using BLL;
|
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Web.UI.WebControls;
|
|
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.PZHGL.InformationProject
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class ProjectConstructionLog : PageBase
|
|
|
|
|
|
{
|
|
|
|
|
|
#region 定义项
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 主键
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string ProjectConstructionLogId
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return (string)ViewState["ProjectConstructionLogId"];
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewState["ProjectConstructionLogId"] = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载表头
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
protected void Page_Init(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 表头
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 表头
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void InitGrid()
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
|
var projectUsers = from x in db.Person_Persons
|
|
|
|
|
|
join y in db.SitePerson_Person
|
|
|
|
|
|
on x.PersonId equals y.PersonId
|
|
|
|
|
|
where y.RoleIds != null && y.RoleIds != string.Empty && y.ProjectId == this.CurrUser.LoginProjectId
|
|
|
|
|
|
select x;
|
|
|
|
|
|
string workPostId = string.Empty, machineId = string.Empty;
|
|
|
|
|
|
foreach (var projectUser in projectUsers)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(projectUser.LogWorkPostId))
|
|
|
|
|
|
{
|
|
|
|
|
|
workPostId += projectUser.LogWorkPostId + ",";
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(projectUser.LogMachineId))
|
|
|
|
|
|
{
|
|
|
|
|
|
machineId += projectUser.LogMachineId + ",";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(workPostId))
|
|
|
|
|
|
{
|
|
|
|
|
|
workPostId = workPostId.Substring(0, workPostId.Length - 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(machineId))
|
|
|
|
|
|
{
|
|
|
|
|
|
machineId = machineId.Substring(0, machineId.Length - 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
this.hdWorkPostId.Text = workPostId;
|
|
|
|
|
|
this.hdMachineId.Text = machineId;
|
|
|
|
|
|
List<string> list = Funs.GetStrListByStr(this.hdWorkPostId.Text, ',');
|
2023-10-11 10:19:12 +08:00
|
|
|
|
list = list.Distinct().ToList();
|
|
|
|
|
|
workPostId = Funs.GetStrListByList(list);
|
|
|
|
|
|
this.hdWorkPostId.Text = workPostId;
|
2023-09-25 19:20:08 +08:00
|
|
|
|
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, ',');
|
2023-10-11 10:19:12 +08:00
|
|
|
|
list2 = list2.Distinct().ToList();
|
|
|
|
|
|
machineId = Funs.GetStrListByList(list2);
|
|
|
|
|
|
this.hdMachineId.Text = machineId;
|
2023-09-25 19:20:08 +08:00
|
|
|
|
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.GetMajorItems();
|
|
|
|
|
|
this.drpProfessional.DataBind();
|
|
|
|
|
|
Funs.FineUIPleaseSelect(this.drpProfessional);
|
|
|
|
|
|
//合同编号
|
|
|
|
|
|
this.drpContractNo.DataTextField = "ContractNum";
|
|
|
|
|
|
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();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#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 = "项目施工日志";
|
|
|
|
|
|
rootNode.NodeID = "0";
|
|
|
|
|
|
rootNode.CommandName = "Project";
|
|
|
|
|
|
rootNode.EnableClickEvent = true;
|
|
|
|
|
|
rootNode.Expanded = true;
|
|
|
|
|
|
this.tvControlItem.Nodes.Add(rootNode);
|
|
|
|
|
|
var logs = from x in Funs.DB.ZHGL_ProjectConstructionLog
|
|
|
|
|
|
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.ProjectConstructionLogId;
|
|
|
|
|
|
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 == "Project")
|
|
|
|
|
|
{
|
|
|
|
|
|
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.ProjectConstructionLogId = this.tvControlItem.SelectedNodeID;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.ProjectConstructionLogId))
|
|
|
|
|
|
{
|
|
|
|
|
|
GetData();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ProjectConstructionLogId = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
private void GetData()
|
|
|
|
|
|
{
|
|
|
|
|
|
var log = BLL.ProjectConstructionLogService.GetProjectConstructionLogById(ProjectConstructionLogId);
|
|
|
|
|
|
if (log != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.hdWorkPostId.Text = log.WorkPostId;
|
|
|
|
|
|
this.hdMachineId.Text = log.MachineId;
|
|
|
|
|
|
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;
|
|
|
|
|
|
drpUnitWork_SelectedIndexChanged(null, null);
|
|
|
|
|
|
var personLogs = from x in Funs.DB.ZHGL_ConstructionLog
|
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileDate == log.CompileDate.Value
|
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
|
select x;
|
|
|
|
|
|
List<Model.ConstructionLogHSE> hses = new List<Model.ConstructionLogHSE>();
|
|
|
|
|
|
List<Model.ConstructionLogCQMS> cqmss = new List<Model.ConstructionLogCQMS>();
|
|
|
|
|
|
if (personLogs.Count() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var personLog in personLogs)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(personLog.HSETodaySummary) || !string.IsNullOrEmpty(personLog.HSETodaySummaryRemark) || !string.IsNullOrEmpty(personLog.HSETomorrowPlan) || !string.IsNullOrEmpty(personLog.HSETomorrowPlanRemark))
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.ConstructionLogHSE hse = new Model.ConstructionLogHSE();
|
|
|
|
|
|
hse.ConstructionLogId = personLog.ConstructionLogId;
|
|
|
|
|
|
hse.HSETodaySummary = personLog.HSETodaySummary;
|
|
|
|
|
|
hse.HSETodaySummaryRemark = personLog.HSETodaySummaryRemark;
|
|
|
|
|
|
hse.HSETomorrowPlan = personLog.HSETomorrowPlan;
|
|
|
|
|
|
hse.HSETomorrowPlanRemark = personLog.HSETomorrowPlanRemark;
|
|
|
|
|
|
hses.Add(hse);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(personLog.CQMSTodaySummary) || !string.IsNullOrEmpty(personLog.CQMSTodaySummaryRemark) || !string.IsNullOrEmpty(personLog.CQMSTomorrowPlan) || !string.IsNullOrEmpty(personLog.CQMSTomorrowPlanRemark))
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.ConstructionLogCQMS cqms = new Model.ConstructionLogCQMS();
|
|
|
|
|
|
cqms.ConstructionLogId = personLog.ConstructionLogId;
|
|
|
|
|
|
cqms.CQMSTodaySummary = personLog.CQMSTodaySummary;
|
|
|
|
|
|
cqms.CQMSTodaySummaryRemark = personLog.CQMSTodaySummaryRemark;
|
|
|
|
|
|
cqms.CQMSTomorrowPlan = personLog.CQMSTomorrowPlan;
|
|
|
|
|
|
cqms.CQMSTomorrowPlanRemark = personLog.CQMSTomorrowPlanRemark;
|
|
|
|
|
|
cqmss.Add(cqms);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.GridHSETodaySummary.DataSource = hses;
|
|
|
|
|
|
this.GridHSETodaySummary.DataBind();
|
|
|
|
|
|
this.GridHSETomorrowPlan.DataSource = hses;
|
|
|
|
|
|
this.GridHSETomorrowPlan.DataBind();
|
|
|
|
|
|
this.GridCQMSTodaySummary.DataSource = cqmss;
|
|
|
|
|
|
this.GridCQMSTodaySummary.DataBind();
|
|
|
|
|
|
this.GridCQMSTomorrowPlan.DataSource = cqmss;
|
|
|
|
|
|
this.GridCQMSTomorrowPlan.DataBind();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#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.ProjectConstructionLogId = 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_ProjectConstructionLog", "FileCode", this.CurrUser.LoginProjectId, prefix);
|
|
|
|
|
|
string prefix = string.Format("{0:yyyyMMdd}", today);
|
|
|
|
|
|
this.txtFileCode.Text = prefix;
|
|
|
|
|
|
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", today);
|
|
|
|
|
|
this.txtWeek.Text = Funs.GetWeekDay(today.DayOfWeek.ToString());
|
|
|
|
|
|
this.txtWeather.Text = string.Empty;
|
|
|
|
|
|
this.txtTemperature.Text = string.Empty;
|
|
|
|
|
|
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 personLogs = from x in Funs.DB.ZHGL_ConstructionLog
|
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileDate == today
|
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
|
select x;
|
|
|
|
|
|
List<Model.ConstructionLogHSE> hses = new List<Model.ConstructionLogHSE>();
|
|
|
|
|
|
List<Model.ConstructionLogCQMS> cqmss = new List<Model.ConstructionLogCQMS>();
|
|
|
|
|
|
this.GridHSETodaySummary.DataSource = null;
|
|
|
|
|
|
this.GridHSETodaySummary.DataBind();
|
|
|
|
|
|
this.GridHSETomorrowPlan.DataSource = null;
|
|
|
|
|
|
this.GridHSETomorrowPlan.DataBind();
|
|
|
|
|
|
this.GridCQMSTodaySummary.DataSource = null;
|
|
|
|
|
|
this.GridCQMSTodaySummary.DataBind();
|
|
|
|
|
|
this.GridCQMSTomorrowPlan.DataSource = null;
|
|
|
|
|
|
this.GridCQMSTomorrowPlan.DataBind();
|
|
|
|
|
|
if (personLogs.Count() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
string contractNo = string.Empty, unitWorks = string.Empty, professional = string.Empty;
|
|
|
|
|
|
foreach (var personLog in personLogs)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(personLog.ContractNo))
|
|
|
|
|
|
{
|
|
|
|
|
|
contractNo += "," + personLog.ContractNo;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(personLog.UnitWorks))
|
|
|
|
|
|
{
|
|
|
|
|
|
unitWorks += "," + personLog.UnitWorks;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(personLog.Professional))
|
|
|
|
|
|
{
|
|
|
|
|
|
professional += "," + personLog.Professional;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(personLog.HSETodaySummary) || !string.IsNullOrEmpty(personLog.HSETodaySummaryRemark) || !string.IsNullOrEmpty(personLog.HSETomorrowPlan) || !string.IsNullOrEmpty(personLog.HSETomorrowPlanRemark))
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.ConstructionLogHSE hse = new Model.ConstructionLogHSE();
|
|
|
|
|
|
hse.ConstructionLogId = personLog.ConstructionLogId;
|
|
|
|
|
|
hse.HSETodaySummary = personLog.HSETodaySummary;
|
|
|
|
|
|
hse.HSETodaySummaryRemark = personLog.HSETodaySummaryRemark;
|
|
|
|
|
|
hse.HSETomorrowPlan = personLog.HSETomorrowPlan;
|
|
|
|
|
|
hse.HSETomorrowPlanRemark = personLog.HSETomorrowPlanRemark;
|
|
|
|
|
|
hses.Add(hse);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(personLog.CQMSTodaySummary) || !string.IsNullOrEmpty(personLog.CQMSTodaySummaryRemark) || !string.IsNullOrEmpty(personLog.CQMSTomorrowPlan) || !string.IsNullOrEmpty(personLog.CQMSTomorrowPlanRemark))
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.ConstructionLogCQMS cqms = new Model.ConstructionLogCQMS();
|
|
|
|
|
|
cqms.ConstructionLogId = personLog.ConstructionLogId;
|
|
|
|
|
|
cqms.CQMSTodaySummary = personLog.CQMSTodaySummary;
|
|
|
|
|
|
cqms.CQMSTodaySummaryRemark = personLog.CQMSTodaySummaryRemark;
|
|
|
|
|
|
cqms.CQMSTomorrowPlan = personLog.CQMSTomorrowPlan;
|
|
|
|
|
|
cqms.CQMSTomorrowPlanRemark = personLog.CQMSTomorrowPlanRemark;
|
|
|
|
|
|
cqmss.Add(cqms);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.GridHSETodaySummary.DataSource = hses;
|
|
|
|
|
|
this.GridHSETodaySummary.DataBind();
|
|
|
|
|
|
this.GridHSETomorrowPlan.DataSource = hses;
|
|
|
|
|
|
this.GridHSETomorrowPlan.DataBind();
|
|
|
|
|
|
this.GridCQMSTodaySummary.DataSource = cqmss;
|
|
|
|
|
|
this.GridCQMSTodaySummary.DataBind();
|
|
|
|
|
|
this.GridCQMSTomorrowPlan.DataSource = cqmss;
|
|
|
|
|
|
this.GridCQMSTomorrowPlan.DataBind();
|
|
|
|
|
|
if (!string.IsNullOrEmpty(contractNo))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (contractNo.Length > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.drpContractNo.SelectedValueArray = contractNo.Split(',');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
drpContractNo_SelectedIndexChanged(null, null);
|
|
|
|
|
|
if (!string.IsNullOrEmpty(unitWorks))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (unitWorks.Length > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.drpUnitWork.SelectedValueArray = unitWorks.Split(',');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(professional))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (professional.Length > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.drpProfessional.SelectedValueArray = professional.Split(',');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.txtRemark.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);
|
2023-10-11 10:19:12 +08:00
|
|
|
|
ChangeText();
|
2023-09-25 19:20:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void TextEmpty()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ProjectConstructionLogId = 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.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();
|
|
|
|
|
|
}
|
|
|
|
|
|
#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.ProjectConstructionLogId = 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)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
#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_ProjectConstructionLog log = new Model.ZHGL_ProjectConstructionLog();
|
|
|
|
|
|
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.WorkPostId = this.hdWorkPostId.Text.Trim();
|
|
|
|
|
|
log.MachineId = this.hdMachineId.Text.Trim();
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.ProjectConstructionLogId))
|
|
|
|
|
|
{
|
|
|
|
|
|
var updatelog = BLL.ProjectConstructionLogService.GetProjectConstructionLogById(this.ProjectConstructionLogId);
|
|
|
|
|
|
if (updatelog != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
log.ProjectConstructionLogId = ProjectConstructionLogId;
|
|
|
|
|
|
BLL.ProjectConstructionLogService.UpdateProjectConstructionLog(log);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var personLog = (from x in Funs.DB.ZHGL_ProjectConstructionLog
|
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId
|
|
|
|
|
|
&& x.CompileDate == Funs.GetNewDateTime(this.txtCompileDate.Text.Trim())
|
|
|
|
|
|
select x).FirstOrDefault();
|
|
|
|
|
|
if (personLog == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
log.ProjectConstructionLogId = SQLHelper.GetNewID(typeof(Model.ZHGL_ProjectConstructionLog));
|
|
|
|
|
|
this.ProjectConstructionLogId = log.ProjectConstructionLogId;
|
|
|
|
|
|
BLL.ProjectConstructionLogService.AddProjectConstructionLog(log);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("当前日期项目施工日志已存在!", MessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
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)
|
|
|
|
|
|
{
|
2023-10-11 10:19:12 +08:00
|
|
|
|
ChangeText();
|
|
|
|
|
|
}
|
2023-09-25 19:20:08 +08:00
|
|
|
|
|
2023-10-11 10:19:12 +08:00
|
|
|
|
private void ChangeText()
|
|
|
|
|
|
{
|
|
|
|
|
|
DateTime today = DateTime.Now.Date;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtCompileDate.Text.Trim()))
|
|
|
|
|
|
{
|
|
|
|
|
|
today = Convert.ToDateTime(this.txtCompileDate.Text.Trim()).Date;
|
|
|
|
|
|
}
|
|
|
|
|
|
var personLogIds = (from x in Funs.DB.ZHGL_ConstructionLog
|
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileDate == today
|
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
|
select x.ConstructionLogId).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
var workEfficiencys = from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiency
|
|
|
|
|
|
where personLogIds.Contains(x.ConstructionLogId)
|
|
|
|
|
|
select x;
|
|
|
|
|
|
if (workEfficiencys.Count() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnWorkEfficiency.Text = "已填报";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnWorkEfficiency.Text = "未填报";
|
|
|
|
|
|
}
|
2023-09-25 19:20:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#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.ProjectConstructionLogId = this.tvControlItem.SelectedNodeID;
|
|
|
|
|
|
var log = BLL.ProjectConstructionLogService.GetProjectConstructionLogById(ProjectConstructionLogId);
|
|
|
|
|
|
if (log != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
BLL.ProjectConstructionLogService.DeleteProjectConstructionLogById(ProjectConstructionLogId);
|
|
|
|
|
|
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 "";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 填报人转换
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name=""></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
protected string ConvertCompileManName(object constructionLogId)
|
|
|
|
|
|
{
|
|
|
|
|
|
string name = string.Empty;
|
|
|
|
|
|
if (constructionLogId != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.ZHGL_ConstructionLog log = BLL.ConstructionLogService.GetConstructionLogById(constructionLogId.ToString());
|
|
|
|
|
|
if (log != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
name = BLL.Person_PersonsService.GetPersonsNameById(log.CompileMan);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return name;
|
|
|
|
|
|
}
|
|
|
|
|
|
#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.ProjectConstructionLogMenuId, 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();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
DateTime today = DateTime.Now.Date;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtCompileDate.Text.Trim()))
|
|
|
|
|
|
{
|
|
|
|
|
|
today = Convert.ToDateTime(this.txtCompileDate.Text.Trim()).Date;
|
|
|
|
|
|
}
|
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
|
var personLogs = from x in db.ZHGL_ConstructionLog
|
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileDate == today
|
|
|
|
|
|
orderby x.CompileDate descending
|
|
|
|
|
|
select x;
|
|
|
|
|
|
var personLogIds = personLogs.Select(x => x.ConstructionLogId);
|
|
|
|
|
|
var allPersons = from x in db.ZHGL_ConstructionLogPerson
|
|
|
|
|
|
where personLogIds.Contains(x.ConstructionLogId)
|
|
|
|
|
|
select x;
|
|
|
|
|
|
var allMachines = from x in db.ZHGL_ConstructionLogMachine
|
|
|
|
|
|
where personLogIds.Contains(x.ConstructionLogId)
|
|
|
|
|
|
select x;
|
|
|
|
|
|
var allManagements = from x in db.ZHGL_ConstructionLogManagement
|
|
|
|
|
|
where personLogIds.Contains(x.ConstructionLogId)
|
|
|
|
|
|
orderby x.UnitWorkId
|
|
|
|
|
|
select x;
|
|
|
|
|
|
var allProblems = from x in db.ZHGL_ConstructionLogProblem
|
|
|
|
|
|
where personLogIds.Contains(x.ConstructionLogId)
|
|
|
|
|
|
orderby x.UnitWorkId
|
|
|
|
|
|
select x;
|
|
|
|
|
|
var allRecords = from x in db.ZHGL_ConstructionLogRecord
|
|
|
|
|
|
where personLogIds.Contains(x.ConstructionLogId)
|
|
|
|
|
|
select x;
|
|
|
|
|
|
List<Model.ConstructionLogPersonItem> personItems = new List<Model.ConstructionLogPersonItem>();
|
|
|
|
|
|
List<string> workPostList = Funs.GetStrListByStr(this.hdWorkPostId.Text, ',');
|
|
|
|
|
|
workPostList.Distinct();
|
|
|
|
|
|
foreach (var item in this.drpUnitWork.SelectedValueArray)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (item != BLL.Const._Null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.ConstructionLogPersonItem personItem = new Model.ConstructionLogPersonItem();
|
|
|
|
|
|
personItem.ConstructionLogPersonId = SQLHelper.GetNewID();
|
|
|
|
|
|
personItem.ConstructionLogId = ProjectConstructionLogId;
|
|
|
|
|
|
personItem.UnitWorkId = item;
|
|
|
|
|
|
int a = 0;
|
|
|
|
|
|
foreach (var workPost in workPostList)
|
|
|
|
|
|
{
|
|
|
|
|
|
int num = 0;
|
|
|
|
|
|
num = allPersons.Where(x => x.UnitWorkId == item && x.WorkPostId == workPost).ToList().Sum(x => x.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();
|
|
|
|
|
|
List<Model.ConstructionLogMachineItem> machineItems = new List<Model.ConstructionLogMachineItem>();
|
|
|
|
|
|
List<string> machineList = Funs.GetStrListByStr(this.hdMachineId.Text, ',');
|
|
|
|
|
|
foreach (var item in this.drpUnitWork.SelectedValueArray)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (item != BLL.Const._Null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.ConstructionLogMachineItem machineItem = new Model.ConstructionLogMachineItem();
|
|
|
|
|
|
machineItem.ConstructionLogMachineId = SQLHelper.GetNewID();
|
|
|
|
|
|
machineItem.ConstructionLogId = ProjectConstructionLogId;
|
|
|
|
|
|
machineItem.UnitWorkId = item;
|
|
|
|
|
|
int a = 0;
|
|
|
|
|
|
foreach (var machine in machineList)
|
|
|
|
|
|
{
|
|
|
|
|
|
int num = 0;
|
|
|
|
|
|
num = allMachines.Where(x => x.UnitWorkId == item && x.MachineId == machine).ToList().Sum(x => x.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();
|
|
|
|
|
|
this.Grid3.DataSource = allManagements;
|
|
|
|
|
|
this.Grid3.DataBind();
|
|
|
|
|
|
foreach (var item in allProblems)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.WorkPackageId = BLL.WorkPackageInitService.GetPackageContentByWorkPackageCode(item.WorkPackageId);
|
|
|
|
|
|
}
|
|
|
|
|
|
this.Grid4.DataSource = allProblems;
|
|
|
|
|
|
this.Grid4.DataBind();
|
|
|
|
|
|
this.Grid5.DataSource = allRecords;
|
|
|
|
|
|
this.Grid5.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.ProjectConstructionLogId;
|
|
|
|
|
|
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/ProjectConstructionLog&menuId={2}",
|
|
|
|
|
|
-1, id, Const.ProjectConstructionLogMenuId)));
|
|
|
|
|
|
}
|
|
|
|
|
|
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.ProjectConstructionLogId;
|
|
|
|
|
|
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>("ProjectConstructionLogRecordId");
|
|
|
|
|
|
newItem.ConstructionLogId = this.ProjectConstructionLogId;
|
|
|
|
|
|
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.ProjectConstructionLogId;
|
|
|
|
|
|
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();
|
|
|
|
|
|
}
|
2023-10-11 10:19:12 +08:00
|
|
|
|
|
|
|
|
|
|
protected void btnWorkEfficiency_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(this.txtCompileDate.Text.Trim()))
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("请选择日期!", MessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
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("ProjectConstructionLogWorkEfficiency.aspx?CompileDate={0}&contractNo={1}&professional={2}&WorkPostId={3}&MachineId={4}", this.txtCompileDate.Text.Trim(), contractNo, professional, hdWorkPostId.Text, hdMachineId.Text, "导入 - ")));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("请选择合同编号和专业工程!", MessageBoxIcon.Warning);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-09-25 19:20:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|