| | |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.Data; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Newtonsoft.Json; |
| | |
| | | { |
| | | public partial class SelectCgMx : XtraForm |
| | | { |
| | | |
| | | private readonly string _webServiceName = "MesInvItemArnManager/"; |
| | | private string suppId = ""; |
| | | private string receiveOrgId = ""; |
| | |
| | | public SelectCgMx(string _suppId, string _receiveOrgId) |
| | | { |
| | | InitializeComponent(); |
| | | #region MyRegion |
| | | gridView1.Columns["purchaseQty"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Custom; |
| | | gridView1.Columns["yssl"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Custom; |
| | | gridView1.Columns["wssl"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Custom; |
| | | gridView1.CustomSummaryCalculate += (sender, e) => |
| | | { |
| | | GridView view = sender as GridView; |
| | | object obj = e.FieldValue; |
| | | if (e.SummaryProcess == CustomSummaryProcess.Start) |
| | | { |
| | | // 初始化汇总值 |
| | | e.TotalValue = 0; |
| | | } |
| | | else if (e.SummaryProcess == CustomSummaryProcess.Calculate) |
| | | { |
| | | // 检查当前行的Status字段是否为1 |
| | | int status = Convert.ToInt32(view.GetListSourceRowCellValue(e.RowHandle, "chkInt")); |
| | | if (status == 1) |
| | | { |
| | | string _colCaption = e.Item.ToString(); |
| | | if (_colCaption.Contains("采购")) |
| | | { |
| | | decimal amount = Convert.ToDecimal(view.GetListSourceRowCellValue(e.RowHandle, "purchaseQty")); |
| | | e.TotalValue = Convert.ToDecimal(e.TotalValue) + amount; |
| | | } |
| | | else |
| | | { |
| | | if (_colCaption.Contains("已收")) |
| | | { |
| | | decimal amount2 = Convert.ToDecimal(view.GetListSourceRowCellValue(e.RowHandle, "yssl")); |
| | | e.TotalValue = Convert.ToDecimal(e.TotalValue) + amount2; |
| | | } |
| | | else |
| | | { |
| | | if (_colCaption.Contains("未收")) |
| | | { |
| | | decimal amount3 = Convert.ToDecimal(view.GetListSourceRowCellValue(e.RowHandle, "wssl")); |
| | | e.TotalValue = Convert.ToDecimal(e.TotalValue) + amount3; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (e.SummaryProcess == CustomSummaryProcess.Finalize) |
| | | { |
| | | // 设置最终汇总值 |
| | | e.TotalValue = e.TotalValue; |
| | | } |
| | | }; |
| | | #endregion |
| | | this.gridView1.CustomDrawColumnHeader += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomDrawColumnHeader(s, e); }; |
| | | this.gridView1.MouseUp += (s, e) => { Gs.DevApp.ToolBox.UtilityHelper.CustomMouseUp(s, e, gcMain, gridView1); }; |
| | | this.colChkInt.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | #region SRM的列表和选择事件 |
| | | /// <summary> |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |