using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace FineUIPro.Web.HJGL.WeldingManage { public partial class DetectionPoint : PageBase { /// /// 批明细表主键 /// private string BatchDetailId { get { return (string)ViewState["BatchDetailId"]; } set { ViewState["BatchDetailId"] = value; } } /// /// 加载页面 /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.BindCheckBoxList(); this.BatchDetailId = Request.Params["BatchDetailId"]; if (!string.IsNullOrEmpty(this.BatchDetailId)) { Model.HJGL_BO_BatchDetail batchDetail = BLL.HJGL_BO_BatchDetailService.GetBatchDetailById(this.BatchDetailId); if (batchDetail != null) { if (!string.IsNullOrEmpty(batchDetail.JOT_ID)) { var jot = BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(batchDetail.JOT_ID); if (jot != null) { this.lblJot_JointNo.Text = jot.JOT_JointNo; } } if (!string.IsNullOrEmpty(batchDetail.NDT)) { List ndts = batchDetail.NDT.Split(',').ToList(); foreach (var ndt in ndts) { for (int i = 0; i < this.ckbNDTType.Items.Count; i++) { if (this.ckbNDTType.Items[i].Value == ndt) { this.ckbNDTType.Items[i].Selected = true; } } } } } } } } /// /// 绑定CheckBoxList /// private void BindCheckBoxList() { this.ckbNDTType.DataTextField = "NDT_Code"; this.ckbNDTType.DataValueField = "NDT_ID"; this.ckbNDTType.DataSource = BLL.HJGL_TestingService.GetNDTTypeNameList(); this.ckbNDTType.DataBind(); } protected void btnSave_Click(object sender, EventArgs e) { string ndts = string.Empty; var batchDetail = BLL.HJGL_BO_BatchDetailService.GetBatchDetailById(this.BatchDetailId); if (batchDetail!=null) { foreach (var item in this.ckbNDTType.SelectedValueArray) { ndts += item + ","; } batchDetail.NDT = ndts; batchDetail.PointDate = DateTime.Now; batchDetail.PointType = "1"; batchDetail.BatchDetailId = this.BatchDetailId; BLL.HJGL_BO_BatchDetailService.UpdateBatchDetail(batchDetail); BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "探伤点口!"); Alert.ShowInTop("提交成功!", MessageBoxIcon.Success); } PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } } }