duheng
2024-11-19 74706b439194deed9c5fde2d5ed02226fc33fd69
WinFrmUI/HStation.WinFrmUI.Assets.Core/12-package/KitManageMainPage.cs
@@ -68,7 +68,6 @@
                {
                    rhs.ID = id;
                    _allBindingList.Add(new PackageViewModel(await _bll.GetByID(id)));
                    this.kitViewModelBindingSource.ResetBindings(false);
                    foreach (var item in allMappingList)
                    {
                        var model = new Vmo.AssetsPackagePumpMappingVmo();
@@ -79,6 +78,15 @@
                            await _mappingBll.Insert(model);
                        }
                    }
                    for (int i = 0; i < _allBindingList.Count; i++)
                    {
                        if (_allBindingList[i].ID == id)
                        {
                            this.gridView1.FocusedRowHandle = i;
                        }
                    }
                    this.kitViewModelBindingSource.ResetBindings(false);
                    return true;
                }
                return false;
@@ -117,6 +125,7 @@
                           await _mappingBll.Insert(model);
                       }
                   }
                   return true;
               }
               return false;
@@ -141,6 +150,7 @@
                _allBindingList.Remove(currentVm);
                await _mappingBll.DeleteByKitID(currentVm.ID);
                this.kitViewModelBindingSource.ResetBindings(false);
                this.equipmentViewModelBindingSource1.ResetBindings(false);
                TipFormHelper.ShowSucceed("删除成功!");
            }
            else
@@ -162,7 +172,6 @@
            var currentVm = this.gridView1.GetCurrentViewModel(_allBindingList);
            if (currentVm == null)
            {
                MessageBoxHelper.ShowWarning("请选择数据行!");
                return;
            }
            var allList = await new BLL.AssetsPackagePumpMapping().GetByKitID(currentVm.ID);