public DownLoadDatasResponse DownloadTxt(DatasQueryResultRequestBase req, string path)
        {
            var resp = new DownLoadDatasResponse();

            try
            {
                var ps = DealWithConditionParameter(req);
                switch (req.TestTypeId)
                {
                case 1:
                    resp.FilePath = _originalDatasDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.BasicSteelArchStrain_Procedure);
                    resp.Succeed  = true;
                    break;

                case 2:
                    resp.FilePath = _originalDatasDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.BasicSteelLatticeStrain_Procedure);
                    resp.Succeed  = true;
                    break;

                case 3:
                    resp.FilePath = _originalDatasDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.BasicConcreteStrain_Procedure);
                    resp.Succeed  = true;
                    break;

                case 4:
                    resp.FilePath = _originalDatasDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.BasicDisplacement_Procedure);
                    resp.Succeed  = true;
                    break;

                case 5:
                    resp.FilePath = _originalDatasDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.BasicCableForce_Procedure);
                    resp.Succeed  = true;
                    break;

                case 6:
                    resp.FilePath = _originalDatasDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.BasicHumidity_Procedure);
                    resp.Succeed  = true;
                    break;

                case 7:
                    resp.FilePath = _originalDatasDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.BasicTemperature_Procedure);
                    resp.Succeed  = true;
                    break;

                case 8:
                    resp.FilePath = _originalDatasDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.BasicWindLoad_Procedure);
                    resp.Succeed  = true;
                    break;

                default:
                    throw new ApplicationException("No TestTypeId");
                }
            }
            catch (Exception ex)
            {
                resp.Message = "无法下载数据";
                Log(ex);
            }
            return(resp);
        }
Ejemplo n.º 2
0
        public DownLoadDatasResponse SaveAs(DatasQueryResultRequestBase req)
        {
            var resp = new DownLoadDatasResponse();
            IList <Func <AnomalousEvent_AnomalousEventTable, bool> > ps = new List <Func <AnomalousEvent_AnomalousEventTable, bool> >();

            try
            {
                DealWithConditions(req, ps);
                resp.FilePath = _fileSystemService.ConvertToDocument(ps);
                resp.Succeed  = true;
            }
            catch (Exception ex)
            {
                resp.Message = "无法下载数据";
                Log(ex);
            }
            return(resp);
        }
        public DownLoadDatasResponse DownloadTxt(DatasQueryResultRequestBase req, string path)
        {
            var resp = new DownLoadDatasResponse();

            switch (req.TestTypeId)
            {
            case 1:
                try
                {
                    var ps = DealWithConditionParameter(req);
                    resp.FilePath = _monitoringDatasEigenvalueDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.SteelArchStrainDatasEigenvalueDownloadProc);
                    resp.Succeed  = true;
                }
                catch (Exception ex)
                {
                    resp.Message = "无法下载数据";
                    Log(ex);
                }
                return(resp);

            case 2:
                try
                {
                    var ps = DealWithConditionParameter(req);
                    resp.FilePath = _monitoringDatasEigenvalueDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.SteelLatticeStrainDatasEigenvalueDownloadProc);
                    resp.Succeed  = true;
                }
                catch (Exception ex)
                {
                    resp.Message = "无法下载数据";
                    Log(ex);
                }
                return(resp);

            case 3:
                try
                {
                    var ps = DealWithConditionParameter(req);
                    resp.FilePath = _monitoringDatasEigenvalueDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.ConcreteStrainDatasEigenvalueDownloadProc);
                    resp.Succeed  = true;
                }
                catch (Exception ex)
                {
                    resp.Message = "无法下载数据";
                    Log(ex);
                }
                return(resp);

            case 4:
                try
                {
                    var ps = DealWithConditionParameter(req);
                    resp.FilePath = _monitoringDatasEigenvalueDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.DisplacementDatasEigenvalueDownloadProc);
                    resp.Succeed  = true;
                }
                catch (Exception ex)
                {
                    resp.Message = "无法下载数据";
                    Log(ex);
                }
                return(resp);

            case 5:
                try
                {
                    var ps = DealWithConditionParameter(req);
                    resp.FilePath = _monitoringDatasEigenvalueDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.CableForceDatasEigenvalueDownloadProc);
                    resp.Succeed  = true;
                }
                catch (Exception ex)
                {
                    resp.Message = "无法下载数据";
                    Log(ex);
                }
                return(resp);

            case 6:
                try
                {
                    var ps = DealWithConditionParameter(req);
                    resp.FilePath = _monitoringDatasEigenvalueDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.HumidityDatasEigenvalueDownloadProc);
                    resp.Succeed  = true;
                }
                catch (Exception ex)
                {
                    resp.Message = "无法下载数据";
                    Log(ex);
                }
                return(resp);

            case 7:
                try
                {
                    var ps = DealWithConditionParameter(req);
                    resp.FilePath = _monitoringDatasEigenvalueDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.TemperatureDatasEigenvalueDownloadProc);
                    resp.Succeed  = true;
                }
                catch (Exception ex)
                {
                    resp.Message = "无法下载数据";
                    Log(ex);
                }
                return(resp);

            case 8:
                try
                {
                    var ps = DealWithConditionParameter(req);
                    resp.FilePath = _monitoringDatasEigenvalueDownloadDAL.DownLoadTxtByExec(ps, path, AppConstants.WindLoadDatasEigenvalueDownloadProc);
                    resp.Succeed  = true;
                }
                catch (Exception ex)
                {
                    resp.Message = "无法下载数据";
                    Log(ex);
                }
                return(resp);

            default:
                throw new ApplicationException("No TestTypeId");
            }
        }