Exemplo n.º 1
0
        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);
                }
            }
        }