コード例 #1
0
 private void btnDownLoad_Click(object sender, RoutedEventArgs e)
 {
     Button btn = (Button)sender;
     string no = btn.Name.Replace("btn", "");
     for (int i = 0; i <= _entityList.Count - 1; i++)
     {
         if (ExCast.zCLng(no) == _entityList[i]._no)
         {
             string[] prm = new string[4];
             prm[0] = _entityList[i]._upload_file_name1;
             prm[1] = _entityList[i]._upload_file_path1;
             wc = new ExWebClient();
             wc.utlParentFKey = null;
             wc.FileDownLoad(DataReport.geReportKbn.None, CLASS_NM, prm);
         }
     }
 }
コード例 #2
0
        public override void ReportOut(object entity)
        {
            string _msg = "";
            ExWebClient wc = null;

            try
            {
                if (entity != null)
                {
                    EntityReport _entity = (EntityReport)entity;

                    // 失敗
                    if (_entity._message != "" || _entity._ret == false)
                    {
                        reportView.Close();
                        if (this.utlParentFKey != null) this.utlParentFKey.IsEnabled = true;
                        return;
                    }

                    switch (this.rptKbn)
                    {
                        case DataReport.geReportKbn.OutPut:
                            //ExHyperlinkButton link = new ExHyperlinkButton(_entity._downLoadUrl);
                            //link.ClickMe();
                            reportView.reportUrl = _entity._downLoadUrl;
                            reportView.reportFileName = _entity._downLoadFileName;
                            reportView.reportFilePath = _entity._downLoadFilePath;
                            reportView.ViewReport();
                            break;
                        case DataReport.geReportKbn.Download:
                        case DataReport.geReportKbn.Csv:
                            string[] prm = new string[4];
                            prm[0] = _entity._downLoadFileName;
                            prm[1] = _entity._downLoadFilePath;
                            wc = new ExWebClient();
                            wc.utlParentFKey = this.utlParentFKey;
                            webService.ProcessingDlgClose();
                            wc.FileDownLoad(this.rptKbn, pgId, prm);
                            break;
                    }

                    #region 印刷発行済セット

                    switch (pgId)
                    {
                        case DataPgEvidence.PGName.Estimate.EstimatePrint:
                            if (this.updPrintNo != null)
                            {
                                string _no = (string)this.updPrintNo;
                                object[] prm = new object[2];
                                prm[0] = (int)Common.geUpdateType.Update;
                                prm[1] = _no;
                                webService.objPerent = this;
                                webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdateEstimatePrint,
                                                          ExWebService.geDialogDisplayFlg.No,
                                                          ExWebService.geDialogCloseFlg.No,
                                                          prm);
                            }
                            break;
                        case DataPgEvidence.PGName.Order.OrderPrint:
                            if (this.updPrintNo != null)
                            {
                                string _no = (string)this.updPrintNo;
                                object[] prm = new object[2];
                                prm[0] = (int)Common.geUpdateType.Update;
                                prm[1] = _no;
                                webService.objPerent = this;
                                webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdateOrderPrint,
                                                          ExWebService.geDialogDisplayFlg.No,
                                                          ExWebService.geDialogCloseFlg.No,
                                                          prm);
                            }
                            break;
                        case DataPgEvidence.PGName.Sales.SalesPrint:
                            if (this.updPrintNo != null)
                            {
                                string _no = (string)this.updPrintNo;
                                object[] prm = new object[2];
                                prm[0] = (int)Common.geUpdateType.Update;
                                prm[1] = _no;
                                webService.objPerent = this;
                                webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdateSalesPrint,
                                                          ExWebService.geDialogDisplayFlg.No,
                                                          ExWebService.geDialogCloseFlg.No,
                                                          prm);
                            }
                            break;
                        case DataPgEvidence.PGName.Invoice.InvoicePrint:
                            if (this.updPrintNo != null)
                            {
                                ObservableCollection<EntityInvoiceClose> lstPrm = (ObservableCollection<EntityInvoiceClose>)this.updPrintNo;
                                object[] prm = new object[2];
                                prm[0] = (int)Common.geUpdateType.Update;
                                prm[1] = lstPrm;
                                webService.objPerent = this;
                                webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdateInvoicePrint,
                                                          ExWebService.geDialogDisplayFlg.No,
                                                          ExWebService.geDialogCloseFlg.No,
                                                          prm);
                            }
                            break;
                        case DataPgEvidence.PGName.PurchaseOrder.PurchaseOrderPrint:
                            if (this.updPrintNo != null)
                            {
                                string _no = (string)this.updPrintNo;
                                object[] prm = new object[2];
                                prm[0] = (int)Common.geUpdateType.Update;
                                prm[1] = _no;
                                webService.objPerent = this;
                                webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdatePurchaseOrderPrint,
                                                          ExWebService.geDialogDisplayFlg.No,
                                                          ExWebService.geDialogCloseFlg.No,
                                                          prm);
                            }
                            break;
                        case DataPgEvidence.PGName.Payment.PaymentPrint:
                            if (this.updPrintNo != null)
                            {
                                ObservableCollection<EntityPaymentClose> lstPrm = (ObservableCollection<EntityPaymentClose>)this.updPrintNo;
                                object[] prm = new object[2];
                                prm[0] = (int)Common.geUpdateType.Update;
                                prm[1] = lstPrm;
                                webService.objPerent = this;
                                webService.CallWebService(ExWebService.geWebServiceCallKbn.UpdatePaymentPrint,
                                                          ExWebService.geDialogDisplayFlg.No,
                                                          ExWebService.geDialogCloseFlg.No,
                                                          prm);
                            }
                            break;

                    }

                    #endregion

                }
                else
                {
                    // 失敗
                    switch (this.rptKbn)
                    {
                        case DataReport.geReportKbn.OutPut:
                            _msg = "レポート出力";
                            break;
                        case DataReport.geReportKbn.Download:
                            _msg = "レポートダウンロード";
                            break;
                        case DataReport.geReportKbn.Csv:
                            _msg = "CSVダウンロード";
                            break;
                    }
                    if (_msg != "") ExMessageBox.Show(_msg + "で予期せぬエラーが発生しました。");
                    if (this.utlParentFKey != null) this.utlParentFKey.IsEnabled = true;
                    return;
                }
            }
            catch
            {
                webService.ProcessingDlgClose();
                if (this.utlParentFKey != null) this.utlParentFKey.IsEnabled = true;
            }
        }