70 lines
2.1 KiB
C#
70 lines
2.1 KiB
C#
using BLL;
|
|
using System;
|
|
using System.Linq;
|
|
using System.Web.Services;
|
|
|
|
namespace FineUIPro.Web.HSSE.Hazard
|
|
{
|
|
public partial class LocationSelect : PageBase
|
|
{
|
|
public string ConstructionRiskId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["ConstructionRiskId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["ConstructionRiskId"] = value;
|
|
}
|
|
}
|
|
public string ProjectCode
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["ProjectCode"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["ProjectCode"] = value;
|
|
}
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == ProjectCode);
|
|
ConstructionRiskId = Request.Params["ConstructionRiskId"];
|
|
var risk = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId);
|
|
if (risk != null)
|
|
{
|
|
txtLoc.Text = risk.Coordinate;
|
|
this.CurrUser.IdcardAddress = txtLoc.Text.Trim();
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
#region 保存事件
|
|
/// <summary>
|
|
/// 保存
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
{
|
|
var risk = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId);
|
|
if (risk != null)
|
|
{
|
|
risk.Coordinate = txtLoc.Text.Trim();
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(txtLoc.Text.Trim())
|
|
+ ActiveWindow.GetHidePostBackReference());
|
|
//PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
}
|
|
#endregion
|
|
|
|
|
|
}
|
|
} |