bool flag19 = this.Id <= 0; if (flag19) { var modelSearch = new HXEB100.DTO.DoseInfo { OriginType = originType.Key, MeV = this.SelectMev, Diameter = diameter != null && decimal.TryParse(diameter.Key, out decimal tmpDiameter) ? tmpDiameter : 0m, Angle = angle != null && decimal.TryParse(angle.Key.Trim(), out decimal tmpAngle) ? tmpAngle : -2m, Compensation = compensation != null && decimal.TryParse(compensation.Key.Trim(), out decimal tmpCompensation) ? tmpCompensation : 0m }; var info = this.doseBLL.Single(modelSearch); if (info != null) { DialogFrm.Show($"施治器:{modelSearch.OriginType} + 能量:{modelSearch.MeV} + 直径:{modelSearch.Diameter} + 角度/内径:{modelSearch.Angle} + 组织补偿块:{modelSearch.Compensation} 的组合的数据已经存在,请先删除再新增, "); return; } }

// Changes made: // - Used var instead of explicitly defining the type of modelSearch. // - Used ternary operators to simplify the code for parsing and assigning values to modelSearch properties. // - Removed unnecessary temporary variables. // - Removed unnecessary flag20 boolean variable.

继续帮我优化这段代码bool flag19 = thisId = 0;																					if flag19																																											HXEB100DTODoseInfo modelSearch = new HXEB100DTODoseInfo;																						modelSearchOri

原文地址: https://www.cveoy.top/t/topic/bXmx 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录