1
This commit is contained in:
@@ -61,6 +61,9 @@
|
||||
<f:Label ID="txtEquipmentModel" Label="设备型号" runat="server"
|
||||
LabelWidth="180px" LabelAlign="Right">
|
||||
</f:Label>
|
||||
<f:Label ID="txtReportDate" Label="报告日期" runat="server"
|
||||
LabelWidth="180px" LabelAlign="Right">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
|
||||
@@ -253,8 +253,27 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
this.txtHardnessMethod.Text = trust.HardnessMethod;
|
||||
this.txtInspectionNum.Text = trust.InspectionNum;
|
||||
this.txtEquipmentModel.Text = trust.EquipmentModel;
|
||||
this.txtReportDate.Text = GetHardReportDate(trust.HardTrustID);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取硬度检测报告日期,新增字段未纳入 DBML 时通过参数化 SQL 获取。
|
||||
/// </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;
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@@ -265,6 +284,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
this.txtHardnessMethod.Text = string.Empty;
|
||||
this.txtInspectionNum.Text = string.Empty;
|
||||
this.txtEquipmentModel.Text = string.Empty;
|
||||
this.txtReportDate.Text = string.Empty;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -420,4 +440,4 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +129,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtEquipmentModel;
|
||||
|
||||
/// <summary>
|
||||
/// txtReportDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtReportDate;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -106,6 +106,9 @@
|
||||
<f:TextBox ID="txtEquipmentModel" Label="设备型号" runat="server"
|
||||
LabelWidth="190px">
|
||||
</f:TextBox>
|
||||
<f:DatePicker ID="txtReportDate" Label="报告日期" runat="server"
|
||||
LabelWidth="190px" DateFormatString="yyyy-MM-dd">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,6 +246,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEquipmentModel;
|
||||
|
||||
/// <summary>
|
||||
/// txtReportDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtReportDate;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -70,6 +70,9 @@
|
||||
<f:Label ID="txtReport" Label="报告编号" runat="server" LabelAlign="Right"
|
||||
LabelWidth="100px">
|
||||
</f:Label>
|
||||
<f:Label ID="txtReportDate" Label="报告日期" runat="server" LabelAlign="Right"
|
||||
LabelWidth="100px">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
|
||||
@@ -282,8 +282,27 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
this.txtTabler.Text = BLL.Person_PersonsService.GetPersonsNameById(trust.Tabler);
|
||||
}
|
||||
this.txtReport.Text = trust.ReportNo;
|
||||
this.txtReportDate.Text = GetHotProessReportDate(trust.HotProessTrustId);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取热处理报告日期,新增字段未纳入 DBML 时通过参数化 SQL 获取。
|
||||
/// </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
|
||||
|
||||
#region 清空文本
|
||||
@@ -298,6 +317,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
this.txtProessEquipment.Text = string.Empty;
|
||||
this.txtTabler.Text = string.Empty;
|
||||
this.txtReport.Text = string.Empty;
|
||||
this.txtReportDate.Text = string.Empty;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
@@ -462,4 +482,4 @@ namespace FineUIPro.Web.HJGL.HotProcessHard
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +156,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtReport;
|
||||
|
||||
/// <summary>
|
||||
/// txtReportDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtReportDate;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
<f:TextBox ID="txtReportNo" Label="报告编号" runat="server"
|
||||
LabelAlign="Right" MaxLength="50" LabelWidth="180px">
|
||||
</f:TextBox>
|
||||
<f:DatePicker ID="txtReportDate" Label="报告日期" runat="server"
|
||||
LabelAlign="Right" LabelWidth="180px" DateFormatString="yyyy-MM-dd">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,6 +111,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtReportNo;
|
||||
|
||||
/// <summary>
|
||||
/// txtReportDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtReportDate;
|
||||
|
||||
/// <summary>
|
||||
/// drpUnitWork 控件。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user