123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667 |
- using ComponentFactory.Krypton.Toolkit;
- using NXWMS.Client.Code.Extends;
- using NXWMS.Client.Model.AppModels.Condition.Balance;
- using NXWMS.Client.Model.AppModels.Condition.Base;
- using NXWMS.Client.Model.AppModels.Result;
- using NXWMS.Client.Model.AppModels.Result.Balance;
- using NXWMS.Client.Model.AppModels.Result.Base;
- using NXWMS.Client.Model.CoreModels;
- using NXWMS.Client.String.Enums;
- using NXWMS.Commons;
- using NXWMS.Forms.Balance.frmBalanceChild;
- using NXWMS.Services;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace NXWMS.Forms.Balance
- {
- public partial class frmBalanceInventory : KryptonForm
- {
- /// <summary>
- /// 客户端字段排序列表
- /// </summary>
- private List<ClientFieldOrderResult> _clientFieldOrderList;
- /// <summary>
- /// 客户端字段排序列表
- /// </summary>
- private List<ClientFieldOrderResult> _clientDTLFieldOrderList;
- /// <summary>
- /// 界面最后执行操作
- /// </summary>
- private EnumOperation _LastOperation;
- /// <summary>
- /// 库区
- /// </summary>
- private List<RegionResult> regionList;
- /// <summary>
- /// 供应商
- /// </summary>
- private List<SupplierResult> supplierList;
- public frmBalanceInventory()
- {
- InitializeComponent();
- this.dataGridView.AutoGenerateColumns = false;
- InitData();
- InitControl();
- }
- /// <summary>
- /// 控件初始化
- /// </summary>
- private void InitControl()
- {
- CheckForIllegalCrossThreadCalls = false;
- dataGridView.AddColumnCheck(0, "Check", "选择");
- //dataGridView.BuildDataGridView(CommonUtil.GetFieldOrderDic(_clientFieldOrderList), false);
- //dataGridView.CellClick += new DataGridViewCellEventHandler(dataGridView_CellClick);
- //dataGridViewDTL.BuildDataGridView(CommonUtil.GetFieldOrderDic(_clientDTLFieldOrderList), false);
- var fieldList = new List<FieldValue>().Add<FieldValue>(new FieldValue { Code = "", Name = "全部" });
- cmbSearchSupplier.DataSource = fieldList.GetFieldValueIdList(supplierList, "SUPPLIER_ID", "SUPPLIER_NAME");
- cmbSearchSupplier.DisplayMember = "Name";
- cmbSearchSupplier.ValueMember = "Id";
- cmbSearchSupplier.SelectedIndex = -1;
- fieldList = new List<FieldValue>().Add<FieldValue>(new FieldValue { Id = "", Name = "全部" });
- cmbSearchType.DataSource = fieldList.GetFieldValueIdList<InventoryType>();
- cmbSearchType.DisplayMember = "Name";
- cmbSearchType.ValueMember = "Id";
- cmbSearchType.SelectedIndex = -1;
- fieldList = new List<FieldValue>().Add<FieldValue>(new FieldValue { Id = "", Name = "全部" });
- cmbSearchInventoryStatus.DataSource = fieldList.GetFieldValueIdList<InventoryStatusEnum>();
- cmbSearchInventoryStatus.DisplayMember = "Name";
- cmbSearchInventoryStatus.ValueMember = "Id";
- cmbSearchInventoryStatus.SelectedIndex = -1;
- fieldList = new List<FieldValue>().Add<FieldValue>(new FieldValue { Id = "", Name = "全部" });
- cmbSearchInventoryMode.DataSource = fieldList.GetFieldValueIdList<InventoryMode>();
- cmbSearchInventoryMode.DisplayMember = "Name";
- cmbSearchInventoryMode.ValueMember = "Id";
- cmbSearchInventoryMode.SelectedValue = -1;
- _pageIndex = 1;
- _pageSize = 20;
- }
- /// <summary>
- /// 数据初始化
- /// </summary>
- private void InitData()
- {
- var regionResult = BaseServices.regionService.GetList(new RegionSearchCondition { IsUsed = true, ItemSQL = "REGION_CODE,REGION_NAME" });
- if (regionResult.Status == OperateStatus.Success)
- {
- regionList = regionResult.Data.RowData.ToList();
- }
- var supplierResult = BaseServices.supplierService.GetList(new SupplierSearchCondition { IsUsed = true, ItemSQL = "SUPPLIER_CODE,SUPPLIER_NAME" });
- if (supplierResult.Status == OperateStatus.Success)
- {
- supplierList = supplierResult.Data.RowData.ToList();
- }
-
-
- //_clientFieldOrderList = new List<ClientFieldOrderResult>();
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "InventoryId", FieldDesc = "序号" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "InventoryNo", FieldDesc = "盘点单号" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "InventoryTypeName", FieldDesc = "单据类型" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "InventoryPercentage", FieldDesc = "随机盘点比例" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "InventoryModeName", FieldDesc = "盘点方式" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "InventoryBeginTime", FieldDesc = "盘点开始时间" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "InventoryEndTime", FieldDesc = "盘点结束时间" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "InventoryStatusName", FieldDesc = "盘点单状态" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "ResultFlagName", FieldDesc = "盘点结果确认标识" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "CreateName", FieldDesc = "创建人" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "CreateTime", FieldDesc = "创建时间" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "UpdateName", FieldDesc = "更新人" });
- //_clientFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "UpdateTime", FieldDesc = "更新时间" });
- _clientDTLFieldOrderList = new List<ClientFieldOrderResult>();
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "MaterielCode", FieldDesc = "物料编码" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "MaterielName", FieldDesc = "物料名称" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "MaterielTypeCode", FieldDesc = "物料类型编码" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "MaterielTypeName", FieldDesc = "物料类型名称" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "SUPPLIER_NAME", FieldDesc = "供应商" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "BatchNo", FieldDesc = "批次号" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "Qty", FieldDesc = "账面数量" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "ActualInventoryQty", FieldDesc = "实际盘点数量" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "InventoryResultQty", FieldDesc = "盘点结果确认数量" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "UnitName", FieldDesc = "单位" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "WarehouseName", FieldDesc = "仓库" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "RegionName", FieldDesc = "库区" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "BinName", FieldDesc = "库位" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "TrayCode", FieldDesc = "组盘码" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "PalletCode", FieldDesc = "托盘号" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "InventoryDetailStatusName", FieldDesc = "明细状态" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "CreateName", FieldDesc = "创建人" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "CreateTime", FieldDesc = "创建时间" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "UpdateName", FieldDesc = "更新人" });
- _clientDTLFieldOrderList.Add(new ClientFieldOrderResult { FieldName = "UpdateTime", FieldDesc = "更新时间" });
- }
- private void btnSearch_Click(object sender, EventArgs e)
- {
- //dataGridView.DataSource = new List<InventoryMainSearchResult>();
- //dataGridViewDTL.DataSource = new List<InventoryDetailSearchResult>();
- //this.clearCkeck();
- _pageIndex = 1;
- var loadfrm = new frmLoading();
- loadfrm.Show();
- var message = loadfrm.EventCalExec(LoadSearch, this.pageTool.PageIndex, this.pageTool.PageSize);
- pageTool.DataCount = _totalCount;
- if (!string.IsNullOrWhiteSpace(message))
- {
- KryptonMessageBox.Show($"查询失败!\r\n{message}", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- private int _pageSize;
- private int _pageIndex;
- private int _totalCount;
- private string LoadSearch(int pageIndex, int pageSize)
- {
- this.dataGridView.SelectionChanged -= this.dataGridView_SelectionChanged;
- var result = BalanceServices.balanceSearchService.GetMainInventoryList(new InventoryMainSearchCondition
- {
- OperationUserId = AppConfig.UserLoginResult.UserInfo.UserId,
- InventoryBeginFinishDate = dtpSearchInventoryBeginFinishDate.GetDateTimeValue(),
- InventoryBeginStartDate = dtpSearchInventoryBeginStartDate.GetDateTimeValue(),
- InventoryEndFinishDate = dtpSearchInventoryEndFinishDate.GetDateTimeValue(),
- InventoryEndStartDate = dtpSearchInventoryEndStartDate.GetDateTimeValue(),
- InventoryMode = cmbSearchInventoryMode.SelectedValue.GetObjectToString(),
- InventoryStatus = cmbSearchInventoryStatus.SelectedValue.GetObjectToInt(),
- InventoryType = cmbSearchType.SelectedValue.GetObjectToString(),
- PalletInfo = txtSearchPallet.Text,
- SupplierCode = cmbSearchSupplier.SelectedValue.GetObjectToString(),
- BatchNo = txtSearchBatch.Text,
- MaterielInfo = txtSearchMateriel.Text,
- PageIndex = pageIndex,
- PageSize = pageSize
- });
- if (result.Status == OperateStatus.Success)
- {
- _totalCount = result.Data.TotalCount;
- _pageIndex = pageIndex;
- _pageSize = pageSize;
- if (result.Data.RowData.Any())
- {
- dataGridView.DataSource = result.Data.RowData.ToList();
- }
- else
- {
- if (dataGridView.DataSource != null)
- {
- dataGridView.DataSource = new List<InventoryMainSearchResult>();
- }
- }
- this.dataGridView.SelectionChanged += this.dataGridView_SelectionChanged;
- this.dataGridView_SelectionChanged(null, null);
- return string.Empty;
- }
- else
- {
- this.dataGridView.SelectionChanged += this.dataGridView_SelectionChanged;
- dataGridViewDTL.DataSource = null;
- return result.Message;
- }
- }
- private string LoadDTLSearch(int id, int pageIndex, int pageSize)
- {
- var result = BalanceServices.balanceSearchService.GetDetailInventoryList(new InventoryDetailSearchCondition
- {
- OperationUserId = AppConfig.UserLoginResult.UserInfo.UserId,
- Id = id,
- });
- if (result.Status == OperateStatus.Success)
- {
- if (result.Data.Any())
- {
- dataGridViewDTL.Columns.Clear();
- dataGridViewDTL.DataSource = result.Data.ToList();
- dataGridViewDTL.BuildDataGridView(CommonUtil.GetFieldOrderDic(_clientDTLFieldOrderList));
- }
- else
- {
- if (dataGridViewDTL.DataSource != null)
- {
- dataGridViewDTL.DataSource = new List<InventoryDetailSearchResult>();
- }
- dataGridViewDTL.BuildDataGridView(CommonUtil.GetFieldOrderDic(_clientDTLFieldOrderList), false);
- }
- return string.Empty;
- }
- else
- {
- return result.Message;
- }
- }
- private void btnSearchExport_Click(object sender, EventArgs e)
- {
- this.dataGridView.DataGridViewExport($"{AppConfig.CurrentMenu.FirstOrDefault().MenuName}列表" + DateTime.Now.ToString("yyyyMMddHH"));
- }
- private void btnAdd_Click(object sender, EventArgs e)
- {
- var form = new frmOperateBalanceInventory();
- form._FunctionType = frmOperateBalanceInventory.EnumFunctionType.Add;
- if (form.ShowDialog() == DialogResult.Yes)
- {
- btnSearch_Click(null, null);
- }
- }
- /// <summary>
- /// 当前页面操作的主键
- /// </summary>
- private string _PrimaryKey = "ColumInventoryId";
- /// <summary>
- /// 当前页面操作单号
- /// </summary>
- private string _PrimaryNo = "InventoryNo";
- private void btnEdit_Click(object sender, EventArgs e)
- {
- //SelectInit();
- if (this.dataGridView.SelectedRows.Count > 0)
- {
- var form = new frmOperateBalanceInventory();
- form._FunctionType = frmOperateBalanceInventory.EnumFunctionType.Edit;
- form._InventoryNo = SelectedNO;
- if (form.ShowDialog() == DialogResult.Yes)
- {
- btnSearch_Click(null, null);
- }
- }
- else
- {
- KryptonMessageBox.Show($"请选择记录!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- /// <summary>
- /// 选择行主键列表
- /// </summary>
- //private List<int> _CheckRowIdList = new List<int>();
- private void clearCkeck()
- {
- for (var n = 0; n < this.dataGridView.Rows.Count; n++)
- {
- if ((bool)this.dataGridView.Rows[n].Cells["Check"].Value)
- {
- this.dataGridView.Rows[n].Cells["Check"].Value = false;
- }
- }
- }
- private IEnumerable<int> _CheckRowIdList
- {
- get
- {
- var result = new List<int>();
- for (var n = 0; n < this.dataGridView.Rows.Count; n++)
- {
- if (Convert.ToBoolean(this.dataGridView.Rows[n].Cells["Check"].Value))
- {
- result.Add(Convert.ToInt32(this.dataGridView.Rows[n].Cells[this._PrimaryKey].Value));
- }
- }
- return result;
- }
- }
- private void btnRemove_Click(object sender, EventArgs e)
- {
- if (_CheckRowIdList.Count() == 0)
- {
- return;
- }
- if (KryptonMessageBox.Show($"确认删除选中数据?", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
- {
- _LastOperation = EnumOperation.Remove;
- var editResult = BalanceServices.balanceOperateService.InventoryStatusChange(new InventoryStatusChangeCondition
- {
- OperationUserId = AppConfig.UserLoginResult.UserInfo.UserId,
- Ids = string.Join(",", _CheckRowIdList),
- InventoryStatus = InventoryStatusEnum.Deleted,
- });
- if (editResult.Status == OperateStatus.Success)
- {
- KryptonMessageBox.Show($"操作成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- btnSearch_Click(null, null);
- }
- else
- {
- KryptonMessageBox.Show($"操作失败!\r\n{editResult.Message}", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- }
- private void btnComplete_Click(object sender, EventArgs e)
- {
- if (this._CheckRowIdList.Count() == 0)
- {
- return;
- }
- if (_CheckRowIdList.Count() == 1)
- {
- if (KryptonMessageBox.Show($"确认强制完成选中盘点单数据吗?", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
- {
- _LastOperation = EnumOperation.Remove;
- var editResult = BalanceServices.balanceOperateService.InventoryStatusChange(new InventoryStatusChangeCondition
- {
- OperationUserId = AppConfig.UserLoginResult.UserInfo.UserId,
- Ids = string.Join(",", _CheckRowIdList),
- InventoryStatus = InventoryStatusEnum.ForceEndInventor,
- InventoryModeMsg = "结束盘点"
- });
- if (editResult.Status == OperateStatus.Success)
- {
- KryptonMessageBox.Show($"操作成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- btnSearch_Click(null, null);
- }
- else
- {
- KryptonMessageBox.Show($"操作失败!\r\n{editResult.Message}", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- }
- else
- {
- KryptonMessageBox.Show($"只能选择一行盘点单数据!");
- }
- }
- private void btnInventoryConfirm_Click(object sender, EventArgs e)
- {
- if (this._CheckRowIdList.Count() == 0)
- {
- return;
- }
- if (_CheckRowIdList.Count() == 1)
- {
- for (int i = 0; i < dataGridView.Rows.Count; i++)
- {
- if (dataGridView.Rows[i].Cells["InventoryStatus"].Value.ToString() == "已确认")
- {
- KryptonMessageBox.Show($"盘点单已进行过盘点结果确认操作!!");
- return;
- }
- }
- var form = new frmOperateBalanceInventory();
- form._FunctionType = frmOperateBalanceInventory.EnumFunctionType.ResultConfirm;
- form._InventoryNo = SelectedNO;
- if (form.ShowDialog() == DialogResult.Yes)
- {
- btnSearch_Click(null, null);
- }
- }
- else
- {
- KryptonMessageBox.Show($"只能选择一行盘点单数据!");
- }
- }
- private void btnBeginInventory_Click(object sender, EventArgs e)
- {
- if (this._CheckRowIdList.Count() == 0)
- {
- return;
- }
- if (_CheckRowIdList.Count() == 1)
- {
- for (int i = 0; i < dataGridView.Rows.Count; i++)
- {
- if (Convert.ToBoolean(this.dataGridView.Rows[i].Cells["Check"].Value))
- {
- //InventoryStatus
- if (Convert.ToInt32(this.dataGridView.Rows[i].Cells["InventoryStatus"].Value) >= 88)
- {
- KryptonMessageBox.Show($"盘点单已经进行过正常盘点操作,不能再次盘点!");
- return;
- }
- }
- }
- FrmInventoryOperate frm = new FrmInventoryOperate();
- frm.InventoryId = _CheckRowIdList.ToList()[0].ToString();
- frm.InventoryModeMsg = "正常盘点";
- if (frm.ShowDialog() == DialogResult.Yes)
- {
- btnSearch_Click(null, null);
- }
- }
- else
- {
- KryptonMessageBox.Show($"只能选择一行盘点单数据!");
- }
- }
- private int SelectedID
- {
- get
- {
- if (this.dataGridView.SelectedRows.Count > 0)
- {
- return Convert.ToInt32(this.dataGridView.SelectedRows[0].Cells[_PrimaryKey].Value);
- }
- else
- {
- return -1;
- }
- }
- }
- private string SelectedNO
- {
- get
- {
- if (this.dataGridView.SelectedRows.Count > 0)
- {
- var no = this.dataGridView.SelectedRows[0].Cells[this._PrimaryNo].Value.ToString();
- return no;
- }
- else
- {
- return "";
- }
- }
- }
- private void btnDifferenceInventory_Click(object sender, EventArgs e)
- {
- if (this._CheckRowIdList.Count() == 0)
- {
- return;
- }
- if (_CheckRowIdList.Count() == 1)
- {
- for (int i = 0; i < dataGridView.Rows.Count; i++)
- {
- if (Convert.ToBoolean(this.dataGridView.Rows[i].Cells["Check"].Value))
- {
- //InventoryStatus
- if (Convert.ToInt32(this.dataGridView.Rows[i].Cells["InventoryStatus"].Value) < 88)
- {
- KryptonMessageBox.Show($"盘点单未进行过正常盘点操作,不能直接进行差异盘点!");
- return;
- }
- //InventoryStatus
- if (Convert.ToInt32(this.dataGridView.Rows[i].Cells["InventoryStatus"].Value) >= 99)
- {
- KryptonMessageBox.Show($"盘点单已经全部完成盘点操作,不能再次差异盘点!");
- return;
- }
- }
- }
- FrmInventoryOperate frm = new FrmInventoryOperate();
- frm.InventoryId = _CheckRowIdList.ToList()[0].ToString();
- frm.InventoryModeMsg = "差异盘点";
- if (frm.ShowDialog() == DialogResult.Yes)
- {
- btnSearch_Click(null, null);
- }
- }
- else
- {
- KryptonMessageBox.Show($"只能选择一行盘点单数据!");
- }
- #region 20210219 孙亚龙舍弃旧代码
- //if (SelectedID >= 0)
- //{
- // var detailResult = BalanceServices.balanceSearchService.GetDetailInventoryList(new InventoryDetailSearchCondition
- // {
- // Id = SelectedID
- // });
- // if (detailResult.Status == OperateStatus.Success)
- // {
- // if (detailResult.Data.Count > 0)
- // {
- // if (KryptonMessageBox.Show($"当前选中记录存在差异数量\r\n是否需要重新盘点?", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
- // {
- // var editResult = BalanceServices.balanceOperateService.InventoryStatusChange(new InventoryStatusChangeCondition
- // {
- // OperationUserId = AppConfig.UserLoginResult.UserInfo.UserId,
- // Ids = string.Join(",", _CheckRowIdList),
- // InventoryStatus = InventoryStatus.BeginInventory,
- // });
- // if (editResult.Status == OperateStatus.Success)
- // {
- // var form = new frmOperateBalanceInventory();
- // form._FunctionType = frmOperateBalanceInventory.EnumFunctionType.InventorySecond;
- // form._InventoryNo = SelectedNO;
- // if (form.ShowDialog() == DialogResult.Yes)
- // {
- // btnSearch_Click(null, null);
- // }
- // // KryptonMessageBox.Show($"操作成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- // //btnSearch_Click(null, null);
- // }
- // else
- // {
- // KryptonMessageBox.Show($"操作失败!\r\n{editResult.Message}", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- // }
- // //var editResult = BalanceServices.balanceOperateService.InventoryStatusChange(new InventoryStatusChangeCondition
- // //{
- // // OperationUserId = AppConfig.UserLoginResult.UserInfo.UserId,
- // // Ids = string.Join(",", _CheckRowIdList),
- // // InventoryStatus = InventoryStatus.BeginInventory,
- // //});
- // //if (editResult.Status == OperateStatus.Success)
- // //{
- // // KryptonMessageBox.Show($"已更新成开始盘点!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- // // btnSearch_Click(null, null);
- // //}
- // //else
- // //{
- // // KryptonMessageBox.Show($"操作失败!\r\n{editResult.Message}", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- // //}
- // }
- // }
- // else
- // {
- // KryptonMessageBox.Show($"当前选中记录不存在差异数量,不需要差异盘点!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- // }
- // }
- // else
- // {
- // KryptonMessageBox.Show($"获取盘点差异失败!\r\n{detailResult.Message}", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- // }
- //}
- //else
- //{
- // KryptonMessageBox.Show($"请选择记录!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- //}
- #endregion
- }
- private void dataGridView_SelectionChanged(object sender, EventArgs e)
- {
- if (dataGridView.SelectedRows.Count > 0)
- {
- //int rowIndec = dgv_WmsInArrival.CurrentCell.RowIndex;
- //int columnIndex = dgv_WmsInArrival.CurrentCell.RowIndex;
- //arrivalId = dgv_WmsInArrival.SelectedRows[0].Cells[1].Value.ToString();
- int mainTableId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value);
- var message = frmLoading.ExecFun(() =>
- {
- return this.LoadDTLSearch(this.SelectedID, 0, 0);
- });
- // var message = loadfrm.EventCalExec(this.LoadDTLSearch,0,0);
- if (!string.IsNullOrWhiteSpace(message))
- {
- KryptonMessageBox.Show($"查询失败!\r\n{message}", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- this.clearCkeck();
- }
- private void frmBalanceInventory_Load(object sender, EventArgs e)
- {
- this.btnSearch_Click(null, null);
- }
- }
- }
|