using BLL; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace FineUIPro.Web.Customization.ZJ.CQMS.Check { public partial class ActualMeasuredQuantityEdit: PageBase { #region /// /// 主键 /// public string Id { get { return (string)ViewState["Id"]; } set { ViewState["Id"] = value; } } #endregion protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); ////权限按钮方法 this.GetButtonPower(); this.Id = Request.Params["Id"]; if (!string.IsNullOrEmpty(this.Id)) { Model.Check_ActualMeasuredQuantity model = BLL.CheckActualmeasuredquantityService.GetCheck_ActualMeasuredQuantityById(this.Id); if (model != null) { this.txtMeasurementItem.Text = model.MeasurementItem; this.txtMeasurementValue.Text = model.MeasurementValue; this.txtMeasurementDevice.Text = model.MeasurementDevice; this.txtMeasurementPerson.Text = model.MeasurementPerson; } } } } /// /// 保存按钮 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { Model.Check_ActualMeasuredQuantity table = new Model.Check_ActualMeasuredQuantity(); table.Projectid = this.CurrUser.ProjectId; table.MeasurementItem = this.txtMeasurementItem.Text; table.MeasurementValue = this.txtMeasurementValue.Text; table.MeasurementDevice = this.txtMeasurementDevice.Text; table.MeasurementPerson = this.txtMeasurementPerson.Text; table.CompileMan = this.CurrUser.UserId; table.CompileDate = DateTime.Now; if (string.IsNullOrEmpty(this.Id)) { table.Id = SQLHelper.GetNewID(typeof(Model.Check_ActualMeasuredQuantity)); BLL.CheckActualmeasuredquantityService.AddCheck_ActualMeasuredQuantity(table); } else { table.Id = this.Id; BLL.CheckActualmeasuredquantityService.UpdateCheck_ActualMeasuredQuantity(table); } PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } #region 获取按钮权限 /// /// 获取按钮权限 /// /// /// private void GetButtonPower() { var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.Check_ActualMeasuredQuantityMenuId); if (buttonList.Count() > 0) { if (buttonList.Contains(BLL.Const.BtnSave)) { this.btnSave.Hidden = false; } } } #endregion } }