private void Scrapping_Click(object sender, RoutedEventArgs e) { EquipmentClass _Eclass = new EquipmentClass(); var a = this.scrappingGrid.SelectedItem; var b = a as DataRowView; int _Eid = Convert.ToInt32(b.Row[0]); MsgResult r = JXMessageBox.Show(this, "您需要对此设备进修报修?", "提示", MsgButton.Yes_No_Cancel, MsgImage.Question); if (r == MsgResult.OK) { int state = _Eclass.scrapEquipment(_Eid); if (state == BaseRequest.SUCCESS) { DataSet _Scrapping_Set = _Eclass.getWorkEquipment(); this.page.ShowPages(this.scrappingGrid, _Scrapping_Set, BaseRequest.PAGE_SIZE); JXMessageBox.Show(this, "申请报废成功", MsgImage.Success); EquipmentScrapping scrapping = DeviceMigrationsFactory.EquipmentScrapping; DataSet scrappingSet = _Eclass.getScrappingEquipment(); scrapping.page.ShowPages(scrapping.scrapGrid, scrappingSet, BaseRequest.PAGE_SIZE); } else { JXMessageBox.Show(this, "操作失败!系统异常,请联系管理员!", MsgImage.Error); } } }
//报废申请 private void Device_Mains(object sender, RoutedEventArgs e) { if (moveGrid.Children != null) moveGrid.Children.Clear(); EquipmentScrapping _Scrap = DeviceMigrationsFactory.EquipmentScrapping; EquipmentClass _Eclass = new EquipmentClass(); //DataSet _Scrap_Set = _Eclass.getWorkEquipment(); DataSet _Scrap_Set = _Eclass.getScrappingEquipment(); _Scrap.page.ShowPages(_Scrap.scrapGrid, _Scrap_Set, BaseRequest.PAGE_SIZE); moveGrid.Children.Add(_Scrap); _Scrap.SetValue(Grid.RowProperty, 0); _Scrap.SetValue(Grid.ColumnProperty, 0); }