ChengDa_English/SGGL/FineUIPro.Web/HJGL/PersonManage/WelderScoreEdit.aspx.cs

70 lines
2.9 KiB
C#

using BLL;
using System;
namespace FineUIPro.Web.HJGL.PersonManage
{
public partial class WelderScoreEdit : PageBase
{
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
string welderScoreId = Request.Params["welderScoreId"];
string welderId = Request.Params["welderId"];
if (!string.IsNullOrEmpty(welderScoreId))
{
Model.BS_WelderScore welderScore = BLL.WelderScoreService.GetWelderScoreByWelderScoreId(welderScoreId);
if (welderScore!=null)
{
this.txtProjectName.Text = welderScore.ProjectName;
this.txtUnitName.Text = welderScore.UnitName;
this.txtTotalJot.Text = welderScore.TotalJot.HasValue ? welderScore.TotalJot.ToString() : "";
this.txtQualifiedJot.Text = welderScore.QualifiedJot.HasValue ? welderScore.QualifiedJot.ToString() : "";
this.txtWeldRange.Text = welderScore.WeldRange;
this.txtRemark.Text = welderScore.Remark;
}
}
}
}
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
string welderScoreId = Request.Params["welderScoreId"];
string welderId = Request.Params["welderId"];
Model.BS_WelderScore welderScore = new Model.BS_WelderScore();
welderScore.WED_ID = welderId;
welderScore.ProjectName = this.txtProjectName.Text.Trim();
welderScore.UnitName = this.txtUnitName.Text.Trim();
welderScore.TotalJot = Funs.GetNewInt(this.txtTotalJot.Text.Trim());
welderScore.QualifiedJot = Funs.GetNewInt(this.txtQualifiedJot.Text.Trim());
welderScore.WeldRange = this.txtWeldRange.Text.Trim();
welderScore.Remark = this.txtRemark.Text.Trim();
if (!string.IsNullOrEmpty(welderScoreId))
{
welderScore.WelderScoreId = welderScoreId;
BLL.WelderScoreService.UpdateWelderScore(welderScore);
}
else
{
welderScore.WelderScoreId = SQLHelper.GetNewID(typeof(Model.BS_WelderScore));
BLL.WelderScoreService.AddWelderScore(welderScore);
}
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
}
}