using BLL; using Newtonsoft.Json.Linq; using System; using System.Data; using System.Data.SqlClient; using System.Collections.Generic; using System.Linq; using System.Web.UI.WebControls; using AspNet = System.Web.UI.WebControls; namespace FineUIPro.Web.HSSE.Solution { public partial class TemporaryElectricityView : PageBase { /// /// 主键 /// public string TemporaryElectricityId { get { return (string)ViewState["TemporaryElectricityId"]; } set { ViewState["TemporaryElectricityId"] = value; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TemporaryElectricityId = Request.Params["TemporaryElectricityId"]; if (!string.IsNullOrEmpty(TemporaryElectricityId)) { hdId.Text = this.TemporaryElectricityId; Model.Solution_TemporaryElectricity TemporaryElectricity = BLL.TemporaryElectricityService.GetTemporaryElectricityByTemporaryElectricityId(TemporaryElectricityId); this.txtCode.Text = TemporaryElectricity.Code; this.txtName.Text = TemporaryElectricity.Name; this.txtContent.Text = TemporaryElectricity.Content; this.txtRemark.Text = TemporaryElectricity.Remark; if (!string.IsNullOrEmpty(TemporaryElectricity.CompileMan)) { this.txtCompileMan.Text = UserService.GetUserNameByUserId(TemporaryElectricity.CompileMan); } if (TemporaryElectricity.CompileDate != null) { txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", TemporaryElectricity.CompileDate); } } else { this.txtCompileMan.Text = this.CurrUser.UserName; txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); } } } protected void Grid1_Sort(object sender, GridSortEventArgs e) { } protected void WindowAtt_Close(object sender, WindowCloseEventArgs e) { } protected void imgBtnFile_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(hdId.Text)) { hdId.Text = SQLHelper.GetNewID(); } PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/TemporaryElectricity&menuId={1}", hdId.Text, BLL.Const.ProjectTemporaryElectricityListMenuId))); } } }