From c7af604a39a9ab2ad511212ee5e0263d1793d6bd Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期五, 11 四月 2025 22:19:59 +0800 Subject: [PATCH] 打印 --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 55 insertions(+), 4 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index c2e9c93..65c3af7 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -1691,7 +1691,7 @@ /// <param name="fileName">瀛楁</param> /// <param name="icoName">鍥炬爣璺緞</param> /// <param name="action"></param> - public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null, DevExpress.Utils.ToolTipController tips = null,bool isSearch=true) + public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null, DevExpress.Utils.ToolTipController tips = null, bool isSearch = true) { gridView1.PopupMenuShowing += (s, e) => { @@ -1714,7 +1714,8 @@ }; gridView1.OptionsView.ColumnAutoWidth = false;//鑷姩璋冩暣鍒楀 - if (isSearch == true) { + if (isSearch == true) + { gridView1.OptionsView.ShowGroupPanel = false; gridView1.OptionsCustomization.AllowGroup = false; gridView1.OptionsFilter.AllowAutoFilterConditionChange = DevExpress.Utils.DefaultBoolean.False; @@ -1752,7 +1753,7 @@ column.OptionsFilter.AllowAutoFilter = false; } } - + gridView1.IndicatorWidth = 50; gridView1.CustomDrawRowIndicator += (s, e) => { @@ -1884,7 +1885,7 @@ column.Width = 500; } } - + /// <summary> /// 璁剧疆閫夐」鍗� /// </summary> @@ -2031,6 +2032,56 @@ bool isNumeric = decimal.TryParse(input, out number); return isNumeric; } + + public static void PrintJiSuan(Form fm, DevExpress.XtraEditors.TextEdit box1, DevExpress.XtraEditors.TextEdit box2, string sum, DevExpress.XtraEditors.RadioGroup rd) + { + if (rd.SelectedIndex == 2) + return; + try + { + if (fm.ActiveControl is DevExpress.XtraEditors.TextEdit textBox) + { + if (textBox.Name != box1.Name) + return; + } + string t1 = box1.Text.Trim(); + string t2 = box2.Text.Trim(); + if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric2(t1)) + 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; // 浣欐暟 + + box2.Text = quotient.ToString(); + + if (rd.SelectedIndex == 0) + rd.Properties.Items[0].Description = "鍏ㄨ嚜鍔ㄣ��" + remainder.ToString() + "銆�"; + } + catch (Exception ex) + { + + Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); + } + + } + + public static decimal PrintYuLiang(DevExpress.XtraEditors.RadioGroup rd) + { + decimal dc = 0; + if (rd.SelectedIndex != 0) + return 0; + string txt = rd.Properties.Items[0].Description;// = "鍏ㄨ嚜鍔ㄣ��" + remainder.ToString() + "銆�"; + txt = txt.Trim().Replace("鍏ㄨ嚜鍔ㄣ��", ""); + txt = txt.Replace("銆�", ""); + if (string.IsNullOrEmpty(txt)) + return 0; + return decimal.Parse(txt); + } } /// <summary> -- Gitblit v1.9.3