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.HJGL.CheckManage { public partial class RemakeReasonEdit : PageBase { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string qualityRatingId = Request.Params["qualityRatingId"]; if (!string.IsNullOrEmpty(qualityRatingId)) { Model.HJGL_BO_RemakeReason remakeReason = BLL.HJGL_RemakeReasonService.GetRemakeReasonByQualityRatingId(qualityRatingId); if (remakeReason != null) { if (remakeReason.TypeNum_Error == true) { this.cbkTypeNum_Error.Checked = true; } if (remakeReason.TypeNum_Defect == true) { this.cbkTypeNum_Defect.Checked = true; } if (remakeReason.TypeNum_Position == true) { this.cbkTypeNum_Position.Checked = true; } if (remakeReason.TypeNum_Displacement == true) { this.cbkTypeNum_Displacement.Checked = true; } if (remakeReason.ImageQualityMeter_Error == true) { this.cbkImageQualityMeter_Error.Checked = true; } if (remakeReason.ImageQualityMeter_Defect == true) { this.cbkImageQualityMeter_Defect.Checked = true; } if (remakeReason.RayField_Tilt == true) { this.cbkRayField_Tilt.Checked = true; } if (remakeReason.RayField_Whitehead == true) { this.cbkRayField_Whitehead.Checked = true; } if (remakeReason.RayField_FocalLengthSmall == true) { this.cbkRayField_FocalLengthSmall.Checked = true; } if (remakeReason.Blackness_TooHigh == true) { this.cbkBlackness_TooHigh.Checked = true; } if (remakeReason.Blackness_TooLow == true) { this.cbkBlackness_TooLow.Checked = true; } if (remakeReason.EllipticalOpening_TooMuch == true) { this.cbkEllipticalOpening_TooMuch.Checked = true; } if (remakeReason.EllipticalOpening_TooSmall == true) { this.cbkEllipticalOpening_TooSmall.Checked = true; } if (remakeReason.NegativeOffset == true) { this.cbkNegativeOffset.Checked = true; } if (remakeReason.Ghosting == true) { this.cbkGhosting.Checked = true; } if (remakeReason.LocationIsNot == true) { this.cbkLocationIsNot.Checked = true; } if (remakeReason.PseudoDefects_Obstacles == true) { this.cbkPseudoDefects_Obstacles.Checked = true; } if (remakeReason.PseudoDefects_Mark == true) { this.cbkPseudoDefects_Mark.Checked = true; } if (remakeReason.BackScattering == true) { this.cbkBackScattering.Checked = true; } if (remakeReason.FilmSensitizingScreen == true) { this.cbkFilmSensitizingScreen.Checked = true; } if (remakeReason.WashPiece == true) { this.cbkWashPiece.Checked = true; } } } } } /// /// 保存按钮 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { string qualityRatingId = Request.Params["qualityRatingId"]; string shootMan = Request.Params["shootMan"]; Model.HJGL_BO_QualityRating qualityRating = BLL.HJGL_BO_QualityRatingService.GetQualityRatingById(qualityRatingId); Model.HJGL_BO_RemakeReason remakeReason = new Model.HJGL_BO_RemakeReason(); remakeReason.QualityRatingId = qualityRatingId; remakeReason.CheckMan = shootMan; remakeReason.TypeNum_Error = this.cbkTypeNum_Error.Checked ? true : false; remakeReason.TypeNum_Defect = this.cbkTypeNum_Defect.Checked ? true : false; remakeReason.TypeNum_Position = this.cbkTypeNum_Position.Checked ? true : false; remakeReason.TypeNum_Displacement = this.cbkTypeNum_Displacement.Checked ? true : false; remakeReason.ImageQualityMeter_Error = this.cbkImageQualityMeter_Error.Checked ? true : false; remakeReason.ImageQualityMeter_Defect = this.cbkImageQualityMeter_Defect.Checked ? true : false; remakeReason.RayField_Tilt = this.cbkRayField_Tilt.Checked ? true : false; remakeReason.RayField_Whitehead = this.cbkRayField_Whitehead.Checked ? true : false; remakeReason.RayField_FocalLengthSmall = this.cbkRayField_FocalLengthSmall.Checked ? true : false; remakeReason.Blackness_TooHigh = this.cbkBlackness_TooHigh.Checked ? true : false; remakeReason.Blackness_TooLow = this.cbkBlackness_TooLow.Checked ? true : false; remakeReason.EllipticalOpening_TooMuch = this.cbkEllipticalOpening_TooMuch.Checked ? true : false; remakeReason.EllipticalOpening_TooSmall = this.cbkEllipticalOpening_TooSmall.Checked ? true : false; remakeReason.NegativeOffset = this.cbkNegativeOffset.Checked ? true : false; remakeReason.Ghosting = this.cbkGhosting.Checked ? true : false; remakeReason.LocationIsNot = this.cbkLocationIsNot.Checked ? true : false; remakeReason.PseudoDefects_Obstacles = this.cbkPseudoDefects_Obstacles.Checked ? true : false; remakeReason.PseudoDefects_Mark = this.cbkPseudoDefects_Mark.Checked ? true : false; remakeReason.BackScattering = this.cbkBackScattering.Checked ? true : false; remakeReason.FilmSensitizingScreen = this.cbkFilmSensitizingScreen.Checked ? true : false; remakeReason.WashPiece = this.cbkWashPiece.Checked ? true : false; Model.HJGL_BO_RemakeReason oldR = BLL.HJGL_RemakeReasonService.GetRemakeReasonByQualityRatingId(qualityRatingId); if (oldR != null) { remakeReason.RemakeId = oldR.RemakeId; BLL.HJGL_RemakeReasonService.UpdateRemakeReason(remakeReason); } else { string remakeId = SQLHelper.GetNewID(typeof(Model.HJGL_BO_RemakeReason)); remakeReason.RemakeId = remakeId; BLL.HJGL_RemakeReasonService.AddRemakeReason(remakeReason); } string str = string.Empty; if (remakeReason.TypeNum_Error == true || remakeReason.TypeNum_Defect == true || remakeReason.TypeNum_Position == true || remakeReason.TypeNum_Displacement == true) { str += "签字编号:"; if (remakeReason.TypeNum_Error == true) { str += "错误、"; } if (remakeReason.TypeNum_Defect == true) { str += "缺失、"; } if (remakeReason.TypeNum_Position == true) { str += "位置、"; } if (remakeReason.TypeNum_Displacement == true) { str += "移位、"; } str = str.Substring(0, str.LastIndexOf("、")) + ";"; } if (remakeReason.ImageQualityMeter_Error == true || remakeReason.ImageQualityMeter_Defect == true) { str += "像质计:"; if (remakeReason.ImageQualityMeter_Error == true) { str += "错误、"; } if (remakeReason.ImageQualityMeter_Defect == true) { str += "缺失、"; } str = str.Substring(0, str.LastIndexOf("、")) + ";"; } if (remakeReason.RayField_Tilt == true || remakeReason.RayField_Whitehead == true || remakeReason.RayField_FocalLengthSmall == true) { str += "射线场:"; if (remakeReason.RayField_Tilt == true) { str += "倾斜、"; } if (remakeReason.RayField_Whitehead == true) { str += "白头、"; } if (remakeReason.RayField_FocalLengthSmall == true) { str += "焦距小、"; } str = str.Substring(0, str.LastIndexOf("、")) + ";"; } if (remakeReason.Blackness_TooHigh == true || remakeReason.Blackness_TooLow == true) { str += "黑度:"; if (remakeReason.Blackness_TooHigh == true) { str += "过高、"; } if (remakeReason.Blackness_TooLow == true) { str += "过低、"; } str = str.Substring(0, str.LastIndexOf("、")) + ";"; } if (remakeReason.EllipticalOpening_TooMuch == true || remakeReason.EllipticalOpening_TooSmall == true) { str += "椭圆开口:"; if (remakeReason.EllipticalOpening_TooMuch == true) { str += "过大、"; } if (remakeReason.EllipticalOpening_TooSmall == true) { str += "过小、"; } str = str.Substring(0, str.LastIndexOf("、")) + ";"; } if (remakeReason.PseudoDefects_Obstacles == true || remakeReason.PseudoDefects_Mark == true) { str += "伪缺陷:"; if (remakeReason.PseudoDefects_Obstacles == true) { str += "障碍、"; } if (remakeReason.PseudoDefects_Mark == true) { str += "印痕、"; } str = str.Substring(0, str.LastIndexOf("、")) + ";"; } if (remakeReason.NegativeOffset == true) { str += "底片偏移;"; } if (remakeReason.Ghosting == true) { str += "缺片重影;"; } if (remakeReason.LocationIsNot == true) { str += "位置不符;"; } if (remakeReason.BackScattering == true) { str += "背散射;"; } if (remakeReason.FilmSensitizingScreen == true) { str += "胶片增感屏;"; } if (remakeReason.WashPiece == true) { str += "洗片;"; } str = str.Substring(0,str.LastIndexOf(";")); if (qualityRating != null) { qualityRating.RemakeResult = str; BLL.HJGL_BO_QualityRatingService.UpadteQualityRating(qualityRating); } ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHideReference()); } } }