ZHJA_HJGL/HJGL_ZH/FineUIPro.Web/WeldMat/UsingSentMat/ModityWeld.aspx.cs

61 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.WeldMat.UsingSentMat
{
public partial class ModityWeld : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string usingMatId = Request.Params["usingMatId"];
if (!string.IsNullOrEmpty(usingMatId))
{
var usingMat = BLL.UsingMatService.GetUsingMatById(usingMatId);
if (usingMat != null)
{
lbOldWeldJoint.Text = usingMat.UsePosition;
}
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
string usingMatId = Request.Params["usingMatId"];
Model.SGGLDB db = BLL.Funs.DB;
Model.Weld_UsingMat usingMat = db.Weld_UsingMat.FirstOrDefault(x => x.UsingMatId == usingMatId);
if (usingMat != null)
{
usingMat.UsePosition = txtWeldJoint.Text.Trim();
Model.Weld_UsingPlan usingPlan = db.Weld_UsingPlan.FirstOrDefault(x => x.UsingPlanId == usingMat.UsingPlanId);
if (usingPlan != null)
{
usingPlan.UsePosition = txtWeldJoint.Text.Trim();
}
Model.Weld_RecycleMat re = db.Weld_RecycleMat.FirstOrDefault(x => x.UsingMatId == usingMatId);
if (re != null)
{
re.UsePosition = txtWeldJoint.Text.Trim();
}
db.SubmitChanges();
BLL.Sys_LogService.AddLog(BLL.Const.System_7, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "修改焊缝号");
ShowNotify("修改成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
}
}
}