From 6b2f223d8fe4dd12aa64780b0dc742f5fc9bbf5e Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期四, 08 五月 2025 11:00:14 +0800 Subject: [PATCH] fqc --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index 4102f34..0efbe39 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -2123,25 +2123,22 @@ string t2 = box2.Text.Trim(); if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric2(t1)) return; + if (Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(t1) <= 0) + return; decimal? dc = Gs.DevApp.ToolBox.UtilityHelper.GetDecimal(sum); decimal? dc1 = Gs.DevApp.ToolBox.UtilityHelper.GetDecimal(t1); - - int dividend = int.Parse(sum); // 琚櫎鏁� - int divisor = int.Parse(t1); // 闄ゆ暟 - - int quotient = dividend / divisor; // 鏁存暟閮ㄥ垎 - int remainder = dividend % divisor; // 浣欐暟 - + decimal dividend = decimal.Parse(sum); // 琚櫎鏁� + decimal divisor = decimal.Parse(t1); // 闄ゆ暟 + decimal quotient = dividend / divisor; // 鏁存暟閮ㄥ垎 + decimal remainder = dividend % divisor; // 浣欐暟 box2.Text = quotient.ToString(); - if (rd.SelectedIndex == 0) txt_yuliang.Text = remainder.ToString(); } catch (Exception ex) { - Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); + Gs.DevApp.ToolBox.MsgHelper.ShowError("杈撳叆鏁版嵁閿欒:"+ex.Message); } - } public static void PrintAuto(DevExpress.XtraEditors.TextEdit txt_psnQty_1, DevExpress.XtraEditors.TextEdit txt_iCount_1, DevExpress.XtraEditors.RadioGroup radOut, DevExpress.XtraEditors.TextEdit txt_yuliang = null) { -- Gitblit v1.9.3