1
This commit is contained in:
@@ -81,11 +81,30 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
this.txtCheckName.Text = trust.CheckName;
|
||||
this.txtAcceptStandard.Text = trust.AcceptStandard;
|
||||
this.txtEquipmentModel.Text = trust.EquipmentModel;
|
||||
this.txtReportDate.Text = GetHardReportDate(trust.HardTrustID);
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取硬度检测报告日期,兼容新增字段未纳入 DBML 的情况。
|
||||
/// </summary>
|
||||
private string GetHardReportDate(string hardTrustID)
|
||||
{
|
||||
if (string.IsNullOrEmpty(hardTrustID))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
string strSql = @"SELECT ReportDate FROM HJGL_Hard_Trust WHERE HardTrustID=@HardTrustID";
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, new SqlParameter("@HardTrustID", hardTrustID));
|
||||
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;
|
||||
}
|
||||
|
||||
#region 数据绑定
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
@@ -180,10 +199,27 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
trust.HardnessMethod = this.txtHardnessMethod.Text;
|
||||
trust.EquipmentModel = this.txtEquipmentModel.Text;
|
||||
BLL.Hard_TrustService.UpdateHardTrust(trust);
|
||||
SaveHardReportDate(trust.HardTrustID);
|
||||
}
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存硬度检测报告日期,和硬度报告编号同表存储。
|
||||
/// </summary>
|
||||
private void SaveHardReportDate(string hardTrustID)
|
||||
{
|
||||
string strSql = @"UPDATE HJGL_Hard_Trust SET ReportDate=@ReportDate WHERE HardTrustID=@HardTrustID";
|
||||
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("@HardTrustID", hardTrustID)
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user