| | |
| | | /// <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) => |
| | | { |
| | |
| | | }; |
| | | 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; |
| | |
| | | column.OptionsFilter.AllowAutoFilter = false; |
| | | } |
| | | } |
| | | |
| | | |
| | | gridView1.IndicatorWidth = 50; |
| | | gridView1.CustomDrawRowIndicator += (s, e) => |
| | | { |
| | |
| | | column.Width = 500; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设置选项卡 |
| | | /// </summary> |
| | |
| | | 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> |