Beispiel #1
0
        /// <summary>
        /// 获取某业务类型下的某张单的附件存放路径.
        /// <param name="businessType"></param>
        /// <param name="businessNumber"></param>
        /// </summary>
        public string GetByBusinessTypeAndId(Constants.AttachmentBusinessType businessType, string businessNumber)
        {
            string        returnPath  = string.Empty;
            StringBuilder pathBuilder = new StringBuilder();

            switch (businessType)
            {
            case Constants.AttachmentBusinessType.联络单:
                pathBuilder.Append(WebUtils.GetSettingsValue("AttachmentPathContact"));
                break;

            case Constants.AttachmentBusinessType.维修单:
                pathBuilder.Append(WebUtils.GetSettingsValue("AttachmentInstrumentRepair"));
                break;

            case Constants.AttachmentBusinessType.设备档案:
                pathBuilder.Append(WebUtils.GetSettingsValue("InstrumentAttachmentFilePath"));
                break;

            case Constants.AttachmentBusinessType.仪器照片:
                pathBuilder.Append(WebUtils.GetSettingsValue("InstrumentPicFilePath"));
                break;

            case Constants.AttachmentBusinessType.内部核查:
                pathBuilder.Append(WebUtils.GetSettingsValue("InnerCheckAttachmentFilePath"));
                break;

            case Constants.AttachmentBusinessType.期间核查:
                pathBuilder.Append(WebUtils.GetSettingsValue("PeriodcheckAttachmentFilePath"));
                break;

            case Constants.AttachmentBusinessType.本地知识库:
                pathBuilder.Append(WebUtils.GetSettingsValue("KnowledgeOtherFilesPath"));
                break;

            default:
                break;
            }
            if (businessNumber.Length >= 13)
            {
                returnPath = UtilsHelper.CreateDir(pathBuilder.ToString() + "/", businessNumber.Replace("H", ""));
            }
            else
            {
                returnPath = pathBuilder.Append("/").ToString();
            }

            //log.InfoFormat("BusinessType:{0}; BusinessNumber:{1}; SavePath:{2}", businessType, businessNumber, returnPath);

            return(returnPath);
        }