This commit is contained in:
2026-06-17 18:37:50 +08:00
parent 2736e8ad89
commit 75d7c48ff2
22 changed files with 286 additions and 10 deletions
@@ -110,8 +110,27 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
}
this.txtRemark.Text = trust.Remark;
this.txtReportNo.Text = trust.ReportNo;
this.txtReportDate.Text = GetHotProessReportDate(trust.HotProessTrustId);
}
}
/// <summary>
/// 读取热处理报告日期,兼容新增字段未纳入 DBML 的情况。
/// </summary>
private string GetHotProessReportDate(string hotProessTrustId)
{
if (string.IsNullOrEmpty(hotProessTrustId))
{
return string.Empty;
}
string strSql = @"SELECT ReportDate FROM HJGL_HotProess_Trust WHERE HotProessTrustId=@HotProessTrustId";
DataTable dt = SQLHelper.GetDataTableRunText(strSql, new SqlParameter("@HotProessTrustId", hotProessTrustId));
if (dt.Rows.Count > 0 && dt.Rows[0]["ReportDate"] != DBNull.Value)
{
return string.Format("{0:yyyy-MM-dd}", dt.Rows[0]["ReportDate"]);
}
return string.Empty;
}
#endregion
#endregion
@@ -164,14 +183,31 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
trust.ProessEquipment = this.txtProessEquipment.Text.Trim();
trust.ReportNo = this.txtReportNo.Text.Trim();
BLL.HotProess_TrustService.UpdateHotProessTrust(trust);
SaveHotProessReportDate(trust.HotProessTrustId);
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
}
/// <summary>
/// 保存热处理报告日期,和热处理报告编号同表存储。
/// </summary>
private void SaveHotProessReportDate(string hotProessTrustId)
{
string strSql = @"UPDATE HJGL_HotProess_Trust SET ReportDate=@ReportDate WHERE HotProessTrustId=@HotProessTrustId";
SqlParameter reportDate = new SqlParameter("@ReportDate", SqlDbType.DateTime);
var newReportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim());
reportDate.Value = newReportDate.HasValue ? (object)newReportDate.Value : DBNull.Value;
SQLHelper.ExecuteCommand(CommandType.Text, strSql, new SqlParameter[]
{
reportDate,
new SqlParameter("@HotProessTrustId", hotProessTrustId)
});
}
protected void txtIsoNo_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
}
}
}
}