using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BLL; namespace FineUIPro.Web.WeldingProcess.TrustManage { public partial class CancelTrust : PageBase { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadData(); string trustBatchItemId = Request.Params["trustBatchItemId"]; if (!string.IsNullOrEmpty(trustBatchItemId)) { var trustItem = BLL.Batch_BatchTrustItemService.GetBatchTrustItemById(trustBatchItemId); if (trustItem != null) { if (trustItem.IsCancelTrust == true) { this.ckbCancelTrust.Checked = true; } this.txtRemark.Text = trustItem.Remark; this.txtCancelReason.Text = trustItem.CancelReason; } var ndeItem = BLL.Batch_NDEItemService.GetNDEItemByTrustItemId(trustBatchItemId); if (ndeItem == null) { this.ckbCancelTrust.Enabled = true; this.txtCancelReason.Enabled = true; } else { this.ckbCancelTrust.Enabled = false; this.txtCancelReason.Enabled = false; } } } } protected void btnSave_Click(object sender, EventArgs e) { string trustBatchItemId = Request.Params["trustBatchItemId"]; var trustItem = BLL.Batch_BatchTrustItemService.GetBatchTrustItemById(trustBatchItemId); if (trustItem != null) { bool? isCancel = null; if (ckbCancelTrust.Checked) { isCancel = true; } BLL.Batch_BatchTrustItemService.UpdateIsCancelTrust(trustBatchItemId, isCancel, txtCancelReason.Text.Trim(), txtRemark.Text.Trim()); BLL.Sys_LogService.AddLog(Const.System_1, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_BatchTrustMenuId, Const.BtnCancelTrust, trustBatchItemId); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } } private void LoadData() { btnClose.OnClientClick = ActiveWindow.GetHideReference(); } } }