private void btnExport_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string         str             = "Excel (*.xlsx)|*.xlsx";

            saveFileDialog1.Filter = str;
            SaveFileDialog saveFileDialog2 = saveFileDialog1;

            if (saveFileDialog2.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            ZhuiSuResponse zhuisuResponse = LocalApi.ExecuteHistory(new ZhuiSuRequest()
            {
                ProcessDID = this.ProcessDID,
                //PageNumber = this.pager.PageNumber,
                TimeStart  = this.TimeStart,
                TimeEnd    = this.TimeEnd,
                PageNumber = 1,
                PageSize   = int.MaxValue
            });

            if (zhuisuResponse.IsError)
            {
                return;
            }
            PagedData <ZhuiSuItem> rows        = zhuisuResponse.ZhuiSus;
            ExcelExport            excelExport = new ExcelExport();
            DataTable table = ToDataTable(rows.ToList());

            excelExport.sheetName = "易损件数据";

            excelExport.ExcuteExport(saveFileDialog2.FileName, table);
        }
Ejemplo n.º 2
0
        public void RefreshData()
        {
            ZhuiSuResponse zhuiSuResponse = LocalApi.Execute2(new ZhuiSuRequest()
            {
                ProcessDID = this.ProcessDID,
                PageNumber = this.pager.PageNumber,
                PageSize   = 10
            });

            this.pager.Setup(zhuiSuResponse.ZhuiSus);
            this.dataGrid.ItemsSource = zhuiSuResponse.ZhuiSus;
        }
Ejemplo n.º 3
0
        public void RefreshData()
        {
            ZhuiSuResponse zhuisuResponse = LocalApi.ExecuteHistory(new ZhuiSuRequest()
            {
                Keyword    = this.Keyword,
                ProcessDID = this.ProcessDID,
                PageNumber = this.pager.PageNumber,
                //PageNumber = pageNumber.Value,
                TimeStart = this.TimeStart,
                TimeEnd   = this.TimeEnd,
                PageSize  = 10
            });

            this.pager.Setup(zhuisuResponse.ZhuiSus);
            this.dataGrid.ItemsSource = zhuisuResponse.ZhuiSus;
        }