62 lines
1.9 KiB
C#
62 lines
1.9 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 = "";
|
|||
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (!IsPostBack)
|
|||
|
{
|
|||
|
ProjectCode = BLL.ProjectService.GetProjectCodeByProjectId(this.CurrUser.LoginProjectId);
|
|||
|
ConstructionRiskId = Request.Params["ConstructionRiskId"] ;
|
|||
|
if (!string.IsNullOrEmpty(Request.Params["type"]))
|
|||
|
{
|
|||
|
this.btnSave.Hidden = true;
|
|||
|
}
|
|||
|
var risk = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId);
|
|||
|
if (risk != null)
|
|||
|
{
|
|||
|
txtLoc.Text = risk.Coordinate;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
#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());
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|