189 lines
9.4 KiB
C#
189 lines
9.4 KiB
C#
namespace FineUIPro.Web.HJGL.WeldingManage
|
|
{
|
|
using System;
|
|
using System.IO;
|
|
using System.Web.UI;
|
|
using BLL;
|
|
|
|
public partial class ShowProduceReport : PageBase
|
|
{
|
|
#region 定义项
|
|
/// <summary>
|
|
/// 焊接工艺评定id
|
|
/// </summary>
|
|
public string WeldingProcedureId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["WeldingProcedureId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["WeldingProcedureId"] = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 加载页面
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
this.WeldingProcedureId = Request.Params["weldingProcedureId"];
|
|
///焊接方法
|
|
this.drpImage.DataTextField = "ImageContent";
|
|
this.drpImage.DataValueField = "ImageId";
|
|
this.drpImage.DataSource = BLL.HJGL_ProcedureImageService.GetImageContentList();
|
|
this.drpImage.DataBind();
|
|
Funs.FineUIPleaseSelect(this.drpImage);
|
|
|
|
if (!string.IsNullOrEmpty(WeldingProcedureId))
|
|
{
|
|
var procedure = BLL.HJGL_WeldingProcedureService.GetWeldingProcedureByWeldingProcedureId(WeldingProcedureId);
|
|
this.txtProcedureCode.Text = procedure.WeldingProcedureCode;
|
|
if (procedure.ProcedureDate.HasValue)
|
|
{
|
|
this.txtProcedureDate.Text = string.Format("{0:yyyy-MM-dd}", procedure.ProcedureDate);
|
|
}
|
|
this.txtWeldedJoints.Text = procedure.WeldedJoints;
|
|
this.txtGrooveForm.Text = procedure.GrooveForm;
|
|
this.txtMaterialCode.Text = procedure.MaterialCode;
|
|
this.txtThicknessRange.Text = procedure.ThicknessRange;
|
|
this.txtMaterialStandard.Text = procedure.MaterialStandard;
|
|
this.txtMaterialType.Text = procedure.MaterialType;
|
|
this.txtMaterialModel.Text = procedure.MaterialModel;
|
|
this.txtMaterialSpecification.Text = procedure.MaterialSpecification;
|
|
this.txtWeldingPosition.Text = procedure.WeldingPosition;
|
|
this.txtHotTemperatures.Text = procedure.HotTemperatures;
|
|
this.txtHoldingDate.Text = procedure.HoldingTime;
|
|
this.txtPreheatingTemperature.Text = procedure.PreheatingTemperature;
|
|
this.txtHeatingMode.Text = procedure.HeatingMode;
|
|
this.txtGasComponent.Text = procedure.GasComponent;
|
|
this.txtGasFlow.Text = procedure.GasFlow;
|
|
this.txtPolarDiameter.Text = procedure.PolarDiameter;
|
|
this.txtNozzleDiameter.Text = procedure.NozzleDiameter;
|
|
this.txtWeldLayer.Text = procedure.WeldLayer;
|
|
this.txtWeldMethod.Text = procedure.WeldMethod;
|
|
this.txtCardNum.Text = procedure.CardNum;
|
|
this.txtDiameter.Text = procedure.Diameter;
|
|
this.txtPolarity.Text = procedure.Polarity;
|
|
this.txtElectricCurrent.Text = procedure.ElectricCurrent;
|
|
this.txtVoltage.Text = procedure.Voltage;
|
|
this.txtSpeed.Text = procedure.Speed;
|
|
this.txtLineCapacity.Text = procedure.LineCapacity;
|
|
this.txtTestingRT.Text = procedure.TestingRT;
|
|
this.txtTestingPT.Text = procedure.TestingPT;
|
|
this.txtTestingMT.Text = procedure.TestingMT;
|
|
this.txtTestingUT.Text = procedure.TestingUT;
|
|
this.txtTestingOther.Text = procedure.TestingOther;
|
|
this.txtTechnicalMeasures.Text = procedure.TechnicalMeasures;
|
|
this.txtDescription.Text = procedure.Description;
|
|
|
|
if (!string.IsNullOrEmpty(procedure.ImageId))
|
|
{
|
|
this.drpImage.SelectedValue = procedure.ImageId;
|
|
var image = BLL.HJGL_ProcedureImageService.GetImageById(procedure.ImageId);
|
|
if (image != null)
|
|
{
|
|
string temporarySavePath = image.AttachUrl;
|
|
this.imgURL.ImageUrl = "~/" + temporarySavePath;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 工艺图片内容
|
|
/// <summary>
|
|
/// 工艺图片内容
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void drpImage_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
this.imgURL.ImageUrl = null;
|
|
if (this.drpImage.SelectedValue != BLL.Const._Null)
|
|
{
|
|
string imageId = this.drpImage.SelectedValue;
|
|
var image = BLL.HJGL_ProcedureImageService.GetImageById(imageId);
|
|
if (image != null)
|
|
{
|
|
string temporarySavePath = image.AttachUrl;
|
|
this.imgURL.ImageUrl = "~/" + temporarySavePath;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// 提交按钮
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
{
|
|
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_WeldingProcedureSearchMenuId, Const.BtnSave))
|
|
{
|
|
var procedure = BLL.HJGL_WeldingProcedureService.GetWeldingProcedureByWeldingProcedureId(this.WeldingProcedureId);
|
|
procedure.ProcedureDate = Funs.GetNewDateTime(this.txtProcedureDate.Text);
|
|
procedure.WeldedJoints = this.txtWeldedJoints.Text.Trim();
|
|
procedure.GrooveForm = this.txtGrooveForm.Text.Trim();
|
|
procedure.MaterialCode = this.txtMaterialCode.Text.Trim();
|
|
procedure.ThicknessRange = this.txtThicknessRange.Text.Trim();
|
|
procedure.MaterialStandard = this.txtMaterialStandard.Text.Trim();
|
|
procedure.MaterialType = this.txtMaterialType.Text.Trim();
|
|
procedure.MaterialModel = this.txtMaterialModel.Text.Trim();
|
|
procedure.MaterialSpecification = this.txtMaterialSpecification.Text.Trim();
|
|
procedure.WeldingPosition = this.txtWeldingPosition.Text.Trim();
|
|
procedure.HotTemperatures = this.txtHotTemperatures.Text.Trim();
|
|
procedure.HoldingTime = this.txtHoldingDate.Text.Trim();
|
|
procedure.PreheatingTemperature = this.txtPreheatingTemperature.Text.Trim();
|
|
procedure.HeatingMode = this.txtHeatingMode.Text.Trim();
|
|
procedure.GasComponent = this.txtGasComponent.Text.Trim();
|
|
procedure.GasFlow = this.txtGasFlow.Text.Trim();
|
|
procedure.PolarDiameter = this.txtPolarDiameter.Text.Trim();
|
|
procedure.NozzleDiameter = this.txtNozzleDiameter.Text.Trim();
|
|
procedure.WeldLayer = this.txtWeldLayer.Text.Trim();
|
|
procedure.WeldMethod = this.txtWeldMethod.Text.Trim();
|
|
procedure.CardNum = this.txtCardNum.Text.Trim();
|
|
procedure.Diameter = this.txtDiameter.Text.Trim();
|
|
procedure.Polarity = this.txtPolarity.Text.Trim();
|
|
procedure.ElectricCurrent = this.txtElectricCurrent.Text.Trim();
|
|
procedure.Voltage = this.txtVoltage.Text.Trim();
|
|
procedure.Speed = this.txtSpeed.Text.Trim();
|
|
procedure.LineCapacity = this.txtLineCapacity.Text.Trim();
|
|
procedure.TestingRT = this.txtTestingRT.Text.Trim();
|
|
procedure.TestingPT = this.txtTestingPT.Text.Trim();
|
|
procedure.TestingMT = this.txtTestingMT.Text.Trim();
|
|
procedure.TestingUT = this.txtTestingUT.Text.Trim();
|
|
procedure.TestingOther = this.txtTestingOther.Text.Trim();
|
|
procedure.TechnicalMeasures = this.txtTechnicalMeasures.Text.Trim();
|
|
procedure.Description = this.txtDescription.Text.Trim();
|
|
if (this.drpImage.SelectedValue != BLL.Const._Null)
|
|
{
|
|
procedure.ImageId = this.drpImage.SelectedValue;
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(WeldingProcedureId))
|
|
{
|
|
procedure.WeldingProcedureId = WeldingProcedureId;
|
|
BLL.HJGL_WeldingProcedureService.UpdateWeldProcedure(procedure);
|
|
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "修改焊接工艺!");
|
|
Alert.ShowInTop("提交成功!", MessageBoxIcon.Success);
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
} |