835 lines
36 KiB
C#
835 lines
36 KiB
C#
using BLL;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace FineUIPro.Web.CQMS.ConstructionLog
|
|
{
|
|
public partial class ConstructionLogView : PageBase
|
|
{
|
|
/// <summary>
|
|
/// 主键
|
|
/// </summary>
|
|
public string ConstructionLogId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["ConstructionLogId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["ConstructionLogId"] = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 办理类型
|
|
/// </summary>
|
|
public string State
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["State"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["State"] = value;
|
|
}
|
|
}
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
ConstructionLogId = Request.Params["ConstructionLogId"];
|
|
plApprove2.Hidden = true;
|
|
var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
|
|
if (project != null)
|
|
{
|
|
this.txtProjectName.Text = project.ProjectName;
|
|
this.txtProjectCode.Text = project.ProjectCode;
|
|
}
|
|
UnitService.InitUnitByProjectIdUnitTypeDropDownList2(drpUnit, this.CurrUser.LoginProjectId, true);
|
|
if (!string.IsNullOrEmpty(ConstructionLogId))
|
|
{
|
|
plApprove2.Hidden = false;
|
|
var dt = CQMSConstructionLogApproveService.getListData(ConstructionLogId);
|
|
gvApprove.DataSource = dt;
|
|
gvApprove.DataBind();
|
|
hdConstructionLogId.Text = ConstructionLogId;
|
|
Model.CQMS_ConstructionLog constructionLog = BLL.CQMSConstructionLogService.GetConstructionLogById(ConstructionLogId);
|
|
if (constructionLog.LogDate != null)
|
|
{
|
|
this.txtLogDate.Text = string.Format("{0:yyyy-MM-dd}", constructionLog.LogDate);
|
|
}
|
|
this.txtWeather.Text = constructionLog.Weather;
|
|
this.txtDayTemperature.Text = constructionLog.DayTemperature;
|
|
this.txtNightTemperature.Text = constructionLog.NightTemperature;
|
|
this.txtWeatherRemark.Text = constructionLog.WeatherRemark;
|
|
var item = (from x in Funs.DB.CQMS_ConstructionLogItem where x.ConstructionLogId == ConstructionLogId select x).FirstOrDefault();
|
|
if (item != null)
|
|
{
|
|
if (!string.IsNullOrEmpty(item.UnitId))
|
|
{
|
|
this.drpUnit.SelectedValue = item.UnitId;
|
|
}
|
|
this.txtConstructionManager.Text = item.ConstructionManager;
|
|
this.txtSafetyGuardian.Text = item.SafetyGuardian;
|
|
this.txtConstructionWorker.Text = item.ConstructionWorker;
|
|
if (item.MechanicNum != null)
|
|
{
|
|
this.txtMechanicNum.Text = item.MechanicNum.ToString();
|
|
}
|
|
if (item.MechanicNum1 != null)
|
|
{
|
|
this.txtMechanicNum1.Text = item.MechanicNum1.ToString();
|
|
}
|
|
if (item.MechanicNum2 != null)
|
|
{
|
|
this.txtMechanicNum2.Text = item.MechanicNum2.ToString();
|
|
}
|
|
if (item.MechanicNum3 != null)
|
|
{
|
|
this.txtMechanicNum3.Text = item.MechanicNum3.ToString();
|
|
}
|
|
if (item.MechanicNum4 != null)
|
|
{
|
|
this.txtMechanicNum4.Text = item.MechanicNum4.ToString();
|
|
}
|
|
if (item.MechanicNum5 != null)
|
|
{
|
|
this.txtMechanicNum5.Text = item.MechanicNum5.ToString();
|
|
}
|
|
if (item.MechanicNum6 != null)
|
|
{
|
|
this.txtMechanicNum6.Text = item.MechanicNum6.ToString();
|
|
}
|
|
if (item.MechanicNum7 != null)
|
|
{
|
|
this.txtMechanicNum7.Text = item.MechanicNum7.ToString();
|
|
}
|
|
if (item.MechanicNum8 != null)
|
|
{
|
|
this.txtMechanicNum8.Text = item.MechanicNum8.ToString();
|
|
}
|
|
if (item.MechanicNum9 != null)
|
|
{
|
|
this.txtMechanicNum9.Text = item.MechanicNum9.ToString();
|
|
}
|
|
if (item.MechanicNum10 != null)
|
|
{
|
|
this.txtMechanicNum10.Text = item.MechanicNum10.ToString();
|
|
}
|
|
if (item.MechanicNum11 != null)
|
|
{
|
|
this.txtMechanicNum11.Text = item.MechanicNum11.ToString();
|
|
}
|
|
if (item.MechanicNum12 != null)
|
|
{
|
|
this.txtMechanicNum12.Text = item.MechanicNum12.ToString();
|
|
}
|
|
if (item.MechanicNum13 != null)
|
|
{
|
|
this.txtMechanicNum13.Text = item.MechanicNum13.ToString();
|
|
}
|
|
if (item.MechanicNum14 != null)
|
|
{
|
|
this.txtMechanicNum14.Text = item.MechanicNum14.ToString();
|
|
}
|
|
if (item.MechanicNum15 != null)
|
|
{
|
|
this.txtMechanicNum15.Text = item.MechanicNum15.ToString();
|
|
}
|
|
if (item.MechanicNum16 != null)
|
|
{
|
|
this.txtMechanicNum16.Text = item.MechanicNum16.ToString();
|
|
}
|
|
if (item.MechanicNum17 != null)
|
|
{
|
|
this.txtMechanicNum17.Text = item.MechanicNum17.ToString();
|
|
}
|
|
if (item.LabourNum != null)
|
|
{
|
|
this.txtLabourNum.Text = item.LabourNum.ToString();
|
|
}
|
|
this.txtMainConstructionMachine.Text = item.MainConstructionMachine;
|
|
this.txtConstructionContent.Text = item.ConstructionContent;
|
|
this.txtConstructionEnvironment.Text = item.ConstructionEnvironment;
|
|
this.txtSafetyWorkSituation.Text = item.SafetyWorkSituation;
|
|
if (!string.IsNullOrEmpty(item.SafetyAndQualityMeasures))
|
|
{
|
|
string[] strs = item.SafetyAndQualityMeasures.Split(',');
|
|
this.cblSafetyAndQualityMeasures.SelectedValueArray = strs;
|
|
}
|
|
if (!string.IsNullOrEmpty(item.HabituaViolations))
|
|
{
|
|
string[] strs = item.HabituaViolations.Split(',');
|
|
this.cblHabituaViolations.SelectedValueArray = strs;
|
|
}
|
|
if (!string.IsNullOrEmpty(item.SafetyStandardization))
|
|
{
|
|
string[] strs = item.SafetyStandardization.Split(',');
|
|
this.cblSafetyStandardization.SelectedValueArray = strs;
|
|
}
|
|
this.txtCivilizedConstruction.Text = item.CivilizedConstruction;
|
|
this.txtEquipment1.Text = item.Equipment1;
|
|
this.txtEquipment2.Text = item.Equipment2;
|
|
this.txtEquipment3.Text = item.Equipment3;
|
|
this.txtEquipment4.Text = item.Equipment4;
|
|
this.txtEquipment5.Text = item.Equipment5;
|
|
this.txtEquipment6.Text = item.Equipment6;
|
|
this.txtEquipment7.Text = item.Equipment7;
|
|
this.txtProcessHandover.Text = item.ProcessHandover;
|
|
this.txtWorkArrangement.Text = item.WorkArrangement;
|
|
this.txtMeetingSituation.Text = item.MeetingSituation;
|
|
this.txtVisaRecords.Text = item.VisaRecords;
|
|
this.txtUnresolvedIssues.Text = item.UnresolvedIssues;
|
|
this.txtFileProcessing.Text = item.FileProcessing;
|
|
this.txtRectificationOfIssues.Text = item.RectificationOfIssues;
|
|
this.txtImportantEvents.Text = item.ImportantEvents;
|
|
this.txtProblemAndCauseAnalysis.Text = item.ProblemAndCauseAnalysis;
|
|
var list = BLL.CQMSConstructionLogImageProgressService.GetConstructionLogImageProgressByConstructionLogIdAndUnitId(ConstructionLogId, item.UnitId);
|
|
if (list.Count > 0)
|
|
{
|
|
this.Grid5.DataSource = list;
|
|
this.Grid5.DataBind();
|
|
}
|
|
}
|
|
if (!string.IsNullOrEmpty(constructionLog.State))
|
|
{
|
|
State = constructionLog.State;
|
|
}
|
|
else
|
|
{
|
|
State = BLL.Const.ConstructionLog_Compile;
|
|
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.txtLogDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
|
State = Const.ConstructionLog_Compile;
|
|
}
|
|
DateTime date = Convert.ToDateTime(this.txtLogDate.Text.Trim());
|
|
this.txtWeek.Text = Funs.GetWeekDay(date.DayOfWeek.ToString());
|
|
BindGrid1();
|
|
BindGrid2();
|
|
}
|
|
}
|
|
|
|
private void BindGrid1()
|
|
{
|
|
string strSql = @"SELECT chec.CheckControlCode,chec.CheckSite,chec.ProjectId,chec.unitId,cNProfessional.ProfessionalName,"
|
|
+ @" QualityQuestionType.QualityQuestionType as QuestionType,"
|
|
+ @" chec.checkman,chec.CheckDate,chec.DocCode,chec.submitman,chec.state,chec.CNProfessionalCode,"
|
|
+ @" unit.UnitName,unitWork.UnitWorkName,u.userName "
|
|
+ @" FROM Check_CheckControl chec"
|
|
+ @" left join Base_Unit unit on unit.unitId=chec.unitId"
|
|
+ @" left join Base_CNProfessional cNProfessional on cNProfessional.CNProfessionalId=chec.CNProfessionalCode"
|
|
+ @" left join WBS_UnitWork unitWork on unitWork.UnitWorkId = chec.UnitWorkId"
|
|
+ @" left join Base_QualityQuestionType QualityQuestionType on QualityQuestionType.QualityQuestionTypeId = chec.QuestionType"
|
|
+ @" left join sys_User u on u.userId = chec.CheckMan"
|
|
+ @" where chec.ProjectId=@ProjectId";
|
|
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
|
strSql += " AND chec.CheckDate=@checkTime ";
|
|
listStr.Add(new SqlParameter("@checkTime", txtLogDate.Text.Trim()));
|
|
if (drpUnit.SelectedValue != BLL.Const._Null)
|
|
{
|
|
strSql += " AND chec.unitId=@unitId";
|
|
listStr.Add(new SqlParameter("@unitId", drpUnit.SelectedValue));
|
|
}
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
Grid1.RecordCount = tb.Rows.Count;
|
|
tb = GetFilteredTable(Grid1.FilteredData, tb);
|
|
var table = GetPagedDataTable(Grid1, tb);
|
|
Grid1.DataSource = table;
|
|
Grid1.DataBind();
|
|
Grid3.DataSource = table;
|
|
Grid3.DataBind();
|
|
}
|
|
|
|
private void BindGrid2()
|
|
{
|
|
DateTime date = Funs.GetNewDateTimeOrNow(txtLogDate.Text.Trim());
|
|
var inspectionManagement = (from x in Funs.DB.ProcessControl_InspectionManagement
|
|
where x.InspectionDate.Value.Date == date && x.UnitId == this.drpUnit.SelectedValue
|
|
select x).FirstOrDefault();
|
|
if (inspectionManagement != null)
|
|
{
|
|
this.Grid2.DataSource = BLL.InspectionManagementDetailService.GetInspectionDetails(inspectionManagement.InspectionId);
|
|
this.Grid2.DataBind();
|
|
this.Grid4.DataSource = BLL.InspectionManagementDetailService.GetInspectionDetails(inspectionManagement.InspectionId);
|
|
this.Grid4.DataBind();
|
|
}
|
|
else
|
|
{
|
|
this.Grid2.DataSource = null;
|
|
this.Grid2.DataBind();
|
|
this.Grid4.DataSource = null;
|
|
this.Grid4.DataBind();
|
|
}
|
|
}
|
|
|
|
private void BindGrid5()
|
|
{
|
|
DateTime date = Funs.GetNewDateTimeOrNow(txtLogDate.Text.Trim());
|
|
var list = BLL.CQMSConstructionLogImageProgressService.GetConstructionLogImageProgressByConstructionLogIdAndUnitId(this.hdConstructionLogId.Text, this.drpUnit.SelectedValue);
|
|
if (list.Count > 0)
|
|
{
|
|
this.Grid5.DataSource = list;
|
|
this.Grid5.DataBind();
|
|
}
|
|
else
|
|
{
|
|
this.Grid5.DataSource = null;
|
|
this.Grid5.DataBind();
|
|
}
|
|
}
|
|
|
|
protected void txtLogDate_TextChanged(object sender, EventArgs e)
|
|
{
|
|
DateTime today = DateTime.Now.Date;
|
|
if (!string.IsNullOrEmpty(this.txtLogDate.Text.Trim()))
|
|
{
|
|
today = Convert.ToDateTime(this.txtLogDate.Text.Trim()).Date;
|
|
}
|
|
this.txtWeek.Text = Funs.GetWeekDay(today.DayOfWeek.ToString());
|
|
BindGrid1();
|
|
BindGrid2();
|
|
}
|
|
|
|
protected void imgBtnFile_Click(object sender, EventArgs e)
|
|
{
|
|
if (string.IsNullOrEmpty(this.hdConstructionLogId.Text)) //新增记录
|
|
{
|
|
this.hdConstructionLogId.Text = SQLHelper.GetNewID(typeof(Model.CQMS_ConstructionLog));
|
|
}
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/ConstructionLog&menuId={1}", this.hdConstructionLogId.Text, BLL.Const.CQMSConstructionLogMenuId)));
|
|
}
|
|
|
|
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
protected string ConvertImageUrlByImage(object registrationId)
|
|
{
|
|
string url = string.Empty;
|
|
if (registrationId != null)
|
|
{
|
|
IList<Model.AttachFile> sourlist = AttachFileService.GetBeforeFileList(registrationId.ToString(), BLL.Const.CheckListMenuId);
|
|
|
|
if (sourlist != null && sourlist.Count > 0)
|
|
{
|
|
string AttachUrl = "";
|
|
foreach (var item in sourlist)
|
|
{
|
|
if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
|
|
AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
|
|
}
|
|
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["CEMS_IMG_URL"], AttachUrl.TrimEnd(','));
|
|
}
|
|
}
|
|
return url;
|
|
}
|
|
protected string ConvertImgUrlByImage(object registrationId)
|
|
{
|
|
string url = string.Empty;
|
|
if (registrationId != null)
|
|
{
|
|
IList<Model.AttachFile> sourlist = AttachFileService.Getfilelist(registrationId.ToString() + "r", BLL.Const.CheckListMenuId);
|
|
|
|
if (sourlist != null && sourlist.Count > 0)
|
|
{
|
|
string AttachUrl = "";
|
|
foreach (var item in sourlist)
|
|
{
|
|
if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
|
|
AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
|
|
}
|
|
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["CEMS_IMG_URL"], AttachUrl.TrimEnd(','));
|
|
}
|
|
}
|
|
return url;
|
|
}
|
|
|
|
public string Convertstatus(Object code)
|
|
{
|
|
Model.Check_CheckControl checkControl = BLL.CheckControlService.GetCheckControl(code.ToString());
|
|
if (checkControl.State.Equals("5") || checkControl.State.Equals("6"))
|
|
{
|
|
return "未确认";
|
|
}
|
|
else if (checkControl.State == Const.CheckControl_Complete)
|
|
{ //闭环
|
|
return "已闭环";
|
|
}
|
|
//else if( checkControl.LimitDate> )
|
|
else if (Convert.ToDateTime(checkControl.LimitDate).AddDays(1) < DateTime.Now) //延期未整改
|
|
{
|
|
return "超期未整改";
|
|
|
|
}
|
|
else //期内未整改
|
|
{
|
|
return "未整改";
|
|
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 把状态转换代号为文字形式
|
|
/// </summary>
|
|
/// <param name="state"></param>
|
|
/// <returns></returns>
|
|
protected string ConvertState(object state)
|
|
{
|
|
if (state != null)
|
|
{
|
|
if (state.ToString() == BLL.Const.CheckControl_ReCompile)
|
|
{
|
|
return "重新编制";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CheckControl_Compile)
|
|
{
|
|
return "编制";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CheckControl_Audit1)
|
|
{
|
|
return "总包负责人审批";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CheckControl_Audit2)
|
|
{
|
|
return "分包专业工程师回复";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CheckControl_Audit3)
|
|
{
|
|
return "分包负责人审批";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CheckControl_Audit4)
|
|
{
|
|
return "总包专业工程师确认";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CheckControl_Audit5)
|
|
{
|
|
return "总包负责人确认";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CheckControl_Complete)
|
|
{
|
|
return "审批完成";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CheckControl_ReCompile2)
|
|
{
|
|
return "分包专业工程师重新回复";
|
|
}
|
|
else
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
//<summary>
|
|
//获取办理人姓名
|
|
//</summary>
|
|
//<param name="state"></param>
|
|
//<returns></returns>
|
|
protected string ConvertMan(object CheckControlCode)
|
|
{
|
|
if (CheckControlCode != null)
|
|
{
|
|
Model.Check_CheckControlApprove a = BLL.CheckControlApproveService.GetCheckControlApproveByCheckControlId(CheckControlCode.ToString());
|
|
if (a != null)
|
|
{
|
|
if (a.ApproveMan != null)
|
|
{
|
|
return BLL.UserService.GetUserByUserId(a.ApproveMan).UserName;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
|
|
protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
ShowItem();
|
|
BindGrid1();
|
|
BindGrid2();
|
|
BindGrid5();
|
|
}
|
|
|
|
private void ShowItem()
|
|
{
|
|
this.txtConstructionManager.Text = string.Empty;
|
|
this.txtSafetyGuardian.Text = string.Empty;
|
|
this.txtConstructionWorker.Text = string.Empty;
|
|
this.txtMechanicNum.Text = string.Empty;
|
|
this.txtMechanicNum1.Text = string.Empty;
|
|
this.txtMechanicNum2.Text = string.Empty;
|
|
this.txtMechanicNum3.Text = string.Empty;
|
|
this.txtMechanicNum4.Text = string.Empty;
|
|
this.txtMechanicNum5.Text = string.Empty;
|
|
this.txtMechanicNum6.Text = string.Empty;
|
|
this.txtMechanicNum7.Text = string.Empty;
|
|
this.txtMechanicNum8.Text = string.Empty;
|
|
this.txtMechanicNum9.Text = string.Empty;
|
|
this.txtMechanicNum10.Text = string.Empty;
|
|
this.txtMechanicNum11.Text = string.Empty;
|
|
this.txtMechanicNum12.Text = string.Empty;
|
|
this.txtMechanicNum13.Text = string.Empty;
|
|
this.txtMechanicNum14.Text = string.Empty;
|
|
this.txtMechanicNum15.Text = string.Empty;
|
|
this.txtMechanicNum16.Text = string.Empty;
|
|
this.txtMechanicNum17.Text = string.Empty;
|
|
this.txtLabourNum.Text = string.Empty;
|
|
this.txtMainConstructionMachine.Text = string.Empty;
|
|
this.txtConstructionContent.Text = string.Empty;
|
|
this.txtConstructionEnvironment.Text = string.Empty;
|
|
this.txtSafetyWorkSituation.Text = string.Empty;
|
|
this.cblSafetyAndQualityMeasures.SelectedValueArray = null;
|
|
this.cblHabituaViolations.SelectedValueArray = null;
|
|
this.cblSafetyStandardization.SelectedValueArray = null;
|
|
this.txtCivilizedConstruction.Text = string.Empty;
|
|
this.txtEquipment1.Text = string.Empty;
|
|
this.txtEquipment2.Text = string.Empty;
|
|
this.txtEquipment3.Text = string.Empty;
|
|
this.txtEquipment4.Text = string.Empty;
|
|
this.txtEquipment5.Text = string.Empty;
|
|
this.txtEquipment6.Text = string.Empty;
|
|
this.txtEquipment7.Text = string.Empty;
|
|
this.txtEquipment8.Text = string.Empty;
|
|
this.txtEquipment9.Text = string.Empty;
|
|
this.txtEquipment10.Text = string.Empty;
|
|
this.txtProcessHandover.Text = string.Empty;
|
|
this.txtWorkArrangement.Text = string.Empty;
|
|
this.txtMeetingSituation.Text = string.Empty;
|
|
this.txtVisaRecords.Text = string.Empty;
|
|
this.txtUnresolvedIssues.Text = string.Empty;
|
|
this.txtFileProcessing.Text = string.Empty;
|
|
this.txtRectificationOfIssues.Text = string.Empty;
|
|
this.txtImportantEvents.Text = string.Empty;
|
|
this.txtProblemAndCauseAnalysis.Text = string.Empty;
|
|
this.Grid1.DataSource = null;
|
|
this.Grid1.DataBind();
|
|
this.Grid2.DataSource = null;
|
|
this.Grid2.DataBind();
|
|
this.Grid5.DataSource = null;
|
|
this.Grid5.DataBind();
|
|
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
|
{
|
|
Model.CQMS_ConstructionLogItem unitItem = BLL.CQMSConstructionLogItemService.GetConstructionLogItemByConstructionLogIdAndUnitId(this.hdConstructionLogId.Text, this.drpUnit.SelectedValue);
|
|
if (unitItem != null)
|
|
{
|
|
this.txtConstructionManager.Text = unitItem.ConstructionManager;
|
|
this.txtSafetyGuardian.Text = unitItem.SafetyGuardian;
|
|
this.txtConstructionWorker.Text = unitItem.ConstructionWorker;
|
|
if (unitItem.MechanicNum != null)
|
|
{
|
|
this.txtMechanicNum.Text = unitItem.MechanicNum.ToString();
|
|
}
|
|
if (unitItem.MechanicNum1 != null)
|
|
{
|
|
this.txtMechanicNum1.Text = unitItem.MechanicNum1.ToString();
|
|
}
|
|
if (unitItem.MechanicNum2 != null)
|
|
{
|
|
this.txtMechanicNum2.Text = unitItem.MechanicNum2.ToString();
|
|
}
|
|
if (unitItem.MechanicNum3 != null)
|
|
{
|
|
this.txtMechanicNum3.Text = unitItem.MechanicNum3.ToString();
|
|
}
|
|
if (unitItem.MechanicNum4 != null)
|
|
{
|
|
this.txtMechanicNum4.Text = unitItem.MechanicNum4.ToString();
|
|
}
|
|
if (unitItem.MechanicNum5 != null)
|
|
{
|
|
this.txtMechanicNum5.Text = unitItem.MechanicNum5.ToString();
|
|
}
|
|
if (unitItem.MechanicNum6 != null)
|
|
{
|
|
this.txtMechanicNum6.Text = unitItem.MechanicNum6.ToString();
|
|
}
|
|
if (unitItem.MechanicNum7 != null)
|
|
{
|
|
this.txtMechanicNum7.Text = unitItem.MechanicNum7.ToString();
|
|
}
|
|
if (unitItem.MechanicNum8 != null)
|
|
{
|
|
this.txtMechanicNum8.Text = unitItem.MechanicNum8.ToString();
|
|
}
|
|
if (unitItem.MechanicNum9 != null)
|
|
{
|
|
this.txtMechanicNum9.Text = unitItem.MechanicNum9.ToString();
|
|
}
|
|
if (unitItem.MechanicNum10 != null)
|
|
{
|
|
this.txtMechanicNum10.Text = unitItem.MechanicNum10.ToString();
|
|
}
|
|
if (unitItem.MechanicNum11 != null)
|
|
{
|
|
this.txtMechanicNum11.Text = unitItem.MechanicNum11.ToString();
|
|
}
|
|
if (unitItem.MechanicNum12 != null)
|
|
{
|
|
this.txtMechanicNum12.Text = unitItem.MechanicNum12.ToString();
|
|
}
|
|
if (unitItem.MechanicNum13 != null)
|
|
{
|
|
this.txtMechanicNum13.Text = unitItem.MechanicNum13.ToString();
|
|
}
|
|
if (unitItem.MechanicNum14 != null)
|
|
{
|
|
this.txtMechanicNum14.Text = unitItem.MechanicNum14.ToString();
|
|
}
|
|
if (unitItem.MechanicNum15 != null)
|
|
{
|
|
this.txtMechanicNum15.Text = unitItem.MechanicNum15.ToString();
|
|
}
|
|
if (unitItem.MechanicNum16 != null)
|
|
{
|
|
this.txtMechanicNum16.Text = unitItem.MechanicNum16.ToString();
|
|
}
|
|
if (unitItem.MechanicNum17 != null)
|
|
{
|
|
this.txtMechanicNum17.Text = unitItem.MechanicNum17.ToString();
|
|
}
|
|
if (unitItem.LabourNum != null)
|
|
{
|
|
this.txtLabourNum.Text = unitItem.LabourNum.ToString();
|
|
}
|
|
this.txtMainConstructionMachine.Text = unitItem.MainConstructionMachine;
|
|
this.txtConstructionContent.Text = unitItem.ConstructionContent;
|
|
this.txtConstructionEnvironment.Text = unitItem.ConstructionEnvironment;
|
|
this.txtSafetyWorkSituation.Text = unitItem.SafetyWorkSituation;
|
|
if (!string.IsNullOrEmpty(unitItem.SafetyAndQualityMeasures))
|
|
{
|
|
string[] strs = unitItem.SafetyAndQualityMeasures.Split(',');
|
|
this.cblSafetyAndQualityMeasures.SelectedValueArray = strs;
|
|
}
|
|
if (!string.IsNullOrEmpty(unitItem.HabituaViolations))
|
|
{
|
|
string[] strs = unitItem.HabituaViolations.Split(',');
|
|
this.cblHabituaViolations.SelectedValueArray = strs;
|
|
}
|
|
if (!string.IsNullOrEmpty(unitItem.SafetyStandardization))
|
|
{
|
|
string[] strs = unitItem.SafetyStandardization.Split(',');
|
|
this.cblSafetyStandardization.SelectedValueArray = strs;
|
|
}
|
|
this.txtCivilizedConstruction.Text = unitItem.CivilizedConstruction;
|
|
this.txtEquipment1.Text = unitItem.Equipment1;
|
|
this.txtEquipment2.Text = unitItem.Equipment2;
|
|
this.txtEquipment3.Text = unitItem.Equipment3;
|
|
this.txtEquipment4.Text = unitItem.Equipment4;
|
|
this.txtEquipment5.Text = unitItem.Equipment5;
|
|
this.txtEquipment6.Text = unitItem.Equipment6;
|
|
this.txtEquipment7.Text = unitItem.Equipment7;
|
|
this.txtProcessHandover.Text = unitItem.ProcessHandover;
|
|
this.txtWorkArrangement.Text = unitItem.WorkArrangement;
|
|
this.txtMeetingSituation.Text = unitItem.MeetingSituation;
|
|
this.txtVisaRecords.Text = unitItem.VisaRecords;
|
|
this.txtUnresolvedIssues.Text = unitItem.UnresolvedIssues;
|
|
this.txtFileProcessing.Text = unitItem.FileProcessing;
|
|
this.txtRectificationOfIssues.Text = unitItem.RectificationOfIssues;
|
|
this.txtImportantEvents.Text = unitItem.ImportantEvents;
|
|
this.txtProblemAndCauseAnalysis.Text = unitItem.ProblemAndCauseAnalysis;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 把状态转换代号为文字形式
|
|
/// </summary>
|
|
/// <param name="state"></param>
|
|
/// <returns></returns>
|
|
protected string ConvertState2(object state)
|
|
{
|
|
if (state != null)
|
|
{
|
|
if (state.ToString() == BLL.Const.ConstructionLog_ReCompile)
|
|
{
|
|
return "重新编制";
|
|
}
|
|
else if (state.ToString() == BLL.Const.ConstructionLog_Compile)
|
|
{
|
|
return "编制";
|
|
}
|
|
else if (state.ToString() == BLL.Const.ConstructionLog_Audit)
|
|
{
|
|
return "审核";
|
|
}
|
|
else if (state.ToString() == BLL.Const.ConstructionLog_Complete)
|
|
{
|
|
return "审批完成";
|
|
}
|
|
else
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
|
|
protected void rblIsAgree_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
protected void drpHandleType_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
//HandleMan();
|
|
}
|
|
|
|
#region 转换字符串
|
|
/// <summary>
|
|
/// 获取单位工程
|
|
/// </summary>
|
|
/// <param name="UnitWorkId"></param>
|
|
/// <returns></returns>
|
|
protected string ConvertUnitWork(object UnitWorkId)
|
|
{
|
|
string name = string.Empty;
|
|
if (UnitWorkId != null)
|
|
{
|
|
Model.WBS_UnitWork unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(UnitWorkId.ToString());
|
|
if (unitWork != null)
|
|
{
|
|
name = unitWork.UnitWorkName;
|
|
}
|
|
}
|
|
return name;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取分部
|
|
/// </summary>
|
|
/// <param name="Branch"></param>
|
|
/// <returns></returns>
|
|
protected string ConvertBranch(object Branch)
|
|
{
|
|
string name = string.Empty;
|
|
if (Branch != null)
|
|
{
|
|
var branch = BLL.DivisionProjectService.GetDivisionProjectById(Branch.ToString());
|
|
if (branch != null)
|
|
{
|
|
name = branch.DivisionName;
|
|
}
|
|
}
|
|
return name;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取控制点内容
|
|
/// </summary>
|
|
/// <param name="ControlPointType"></param>
|
|
/// <returns></returns>
|
|
protected string ConvertControlPointType(object ControlPointType)
|
|
{
|
|
string name = string.Empty;
|
|
if (ControlPointType != null)
|
|
{
|
|
var controlPointType = BLL.BreakdownProjectService.GetBreakdownProjectById(ControlPointType.ToString());
|
|
if (controlPointType != null)
|
|
{
|
|
name = controlPointType.BreakdownName;
|
|
}
|
|
}
|
|
return name;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取控制点等级
|
|
/// </summary>
|
|
/// <param name="ControlPointType"></param>
|
|
/// <returns></returns>
|
|
protected string ConvertClass(object ControlPointType)
|
|
{
|
|
string name = string.Empty;
|
|
if (ControlPointType != null)
|
|
{
|
|
var controlPointType = BLL.BreakdownProjectService.GetBreakdownProjectById(ControlPointType.ToString());
|
|
if (controlPointType != null)
|
|
{
|
|
name = controlPointType.Class;
|
|
}
|
|
}
|
|
return name;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取是否合格
|
|
/// </summary>
|
|
/// <param name="ControlPointType"></param>
|
|
/// <returns></returns>
|
|
protected string ConvertOK(object InspectionId)
|
|
{
|
|
string name = string.Empty;
|
|
if (InspectionId != null)
|
|
{
|
|
var inspection = BLL.InspectionManagementService.GetInspectionManagementById(InspectionId.ToString());
|
|
if (inspection != null)
|
|
{
|
|
if (inspection.IsOnceQualified == true)
|
|
{
|
|
name = "是";
|
|
}
|
|
else
|
|
{
|
|
name = "否";
|
|
}
|
|
}
|
|
}
|
|
return name;
|
|
}
|
|
#endregion
|
|
|
|
protected void btnWeather_Click(object sender, EventArgs e)
|
|
{
|
|
if (!string.IsNullOrEmpty(txtLogDate.Text.Trim()))
|
|
{
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("Weather.aspx?Date={0}", txtLogDate.Text.Trim(), "编辑 - ")));
|
|
}
|
|
else
|
|
{
|
|
Alert.ShowInTop("请选择日期!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
}
|
|
|
|
protected string ConvertImage(object ConstructionLogImageProgressId)
|
|
{
|
|
string url = string.Empty;
|
|
if (ConstructionLogImageProgressId != null)
|
|
{
|
|
IList<Model.AttachFile> sourlist = AttachFileService.Getfilelist(ConstructionLogImageProgressId.ToString(), BLL.Const.CQMSConstructionLogMenuId);
|
|
|
|
if (sourlist != null && sourlist.Count > 0)
|
|
{
|
|
string AttachUrl = "";
|
|
foreach (var item in sourlist)
|
|
{
|
|
if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
|
|
AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
|
|
}
|
|
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["CEMS_IMG_URL"], AttachUrl.TrimEnd(','));
|
|
}
|
|
}
|
|
return url;
|
|
}
|
|
}
|
|
} |