Пример #1
0
 private void ExportBody(ExportFileParameters parameters, QueryPageCountResult result,ExportIndex index)
 {
     object[] data = GetData(parameters.IsPL,index);
    
     string continuousFileName = GetFileName(parameters.QueryInfo.FilePath, index, result.PageCount);
   
     using (FileStream fs = new FileStream(continuousFileName, FileMode.Create, FileAccess.Write))
     {
         int startFileIndex = index.RecordIndex * 150 + 1;
         if (parameters.IsPL)
         {
             PLExportCenter.Default.Process((PLData[])data, startFileIndex,fs);
         }
         else
         {
             FlexInterface.Helper.FlexPersistence.PersiteDesposit((DepositData[])data, fs,startFileIndex , parameters.QueryInfo.Type);
         }
         
         this._ErrorHandler.WhenExportPerPageSendMsgToUI(parameters.IsPL, index, result.PageCount);
         index.FileIndex++;
         index.PageIndex++;
         index.RecordIndex++;
        
     }
 }
Пример #2
0
 public ExportFileParameters GetExportFileParameters(QueryObject data)
 {
     ExportFileParameters parameters = new ExportFileParameters();
     parameters.QueryInfo = data;
     parameters.IsPL = (int)data.Type > (int)BusinessTypeEnum.Transfer;
     return parameters;
 }
Пример #3
0
        public void HandGenerateInterfaceFile(ExportFileParameters parameters)
        {
            BackgroundWorker worker = new BackgroundWorker();
            worker.DoWork += (o, e) =>
            {
                Common.SynchronizationContext.Send(m =>
                {
                    Messenger.Default.Send(new LoadingMsg());
                }, null);

                if (parameters.IsPL)
                {
                    e.Result = Common.Service.GetPLDataRecordCount(Common.SessionId, parameters.QueryInfo);
                }
                else
                {
                    e.Result = Common.Service.GetDepositRecordCount(Common.SessionId, parameters.QueryInfo);
                }
            };

            worker.RunWorkerCompleted += (o, e) =>
            {
                Common.SynchronizationContext.Send(m =>
                {
                    Messenger.Default.Send(new LoadingMsg());
                }, null);
                TaskUtil.TaskHelper.Create(Export, GetContinueAction(parameters), parameters);
            };

            worker.RunWorkerAsync();
        }
Пример #4
0
        public Action<Task> GetContinueAction(ExportFileParameters parameters)
        {
            return ant =>
            {
                Messenger.Default.Send(new ShowProgressMsg(false));
                string msg;
                if (ant.Exception != null)
                {
                    if (parameters.IsPL)
                    {
                        msg = StringLibrary.PLFailedTxtMsg;
                    }
                    else
                    {
                        msg = StringLibrary.DepositFailedTxtMsg;
                    }
                    _Log.Error(ant.Exception);
                    Messenger.Default.Send(new UpdateWarnInfoMsg(msg));
                    return;
                }
                if (parameters.IsPL)
                {
                    msg = StringLibrary.PLEndTxtMsg;
                }
                else
                {
                    msg = StringLibrary.DepositEndTxtMsg;
                }
                Messenger.Default.Send(new UpdateWarnInfoMsg(msg));
            };

        }