Exemplo n.º 1
0
        private bool IsExisting(DocTypeEnum docType, DocStatusView stt)
        {
            bool result = true;

            switch (docType)
            {
            case DocTypeEnum.Agreement:
                result = stt.Agreement ?? false;
                break;

            case DocTypeEnum.Appraisal:
                result = stt.Appraisal ?? false;
                break;

            case DocTypeEnum.SiteMap:
                result = stt.SiteMap ?? false;
                break;

            case DocTypeEnum.Resume:
                result = stt.Resume ?? false;
                break;

            case DocTypeEnum.Paperwork:
                result = stt.Paperwork ?? false;
                break;
            }

            return(result);
        }
Exemplo n.º 2
0
        internal string ByteArrayToFile(byte[] byteArray, DocTypeEnum type)
        {
            try
            {
                var root = string.Empty;
                switch (type)
                {
                case DocTypeEnum.ATTO:
                    root = AppSettingsConfiguration.CartellaDocumentiAtti;
                    break;

                case DocTypeEnum.EM:
                    root = AppSettingsConfiguration.CartellaAllegatiEM;
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(type), type, null);
                }
                if (!Directory.Exists(root))
                {
                    Directory.CreateDirectory(root);
                }
                var fileName = DateTime.Now.Ticks + ".pdf";
                var path     = Path.Combine(root, fileName);

                using var fs = new FileStream(path, FileMode.Create, FileAccess.Write);
                fs.Write(byteArray, 0, byteArray.Length);
                return(fileName);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception caught in process: {0}", ex);
                return(string.Empty);
            }
        }
Exemplo n.º 3
0
        private DocTypeEnum GetDocType(string docType)
        {
            if (String.IsNullOrEmpty(docType))
            {
                throw new Exception("The x-doctype custom header cannot be null or empty.");
            }

            DocTypeEnum DocType = DocTypeEval.Get(docType);

            if (DocType == DocTypeEnum.Unknown)
            {
                throw new Exception("Could not map x-doxtype to allowed doc type values");
            }
            else
            {
                return(DocType);
            }
        }
Exemplo n.º 4
0
        public static DocTypeEnum Get(string docType)
        {
            DocTypeEnum docTypeEnum = DocTypeEnum.AssetQualifier;

            docType = docType.ToLower().Trim();

            switch (docType)
            {
            case "assetqualifier":
            case "assetqualifierpremier":
                docTypeEnum = DocTypeEnum.AssetQualifier;
                break;

            case "bankstatements":
                docTypeEnum = DocTypeEnum.BankStatements;
                break;

            case "debtcovgratio":
            case "debtcovgratiopremier":
                docTypeEnum = DocTypeEnum.DebtCovgRatio;
                break;

            case "bankstatementspremier":
                docTypeEnum = DocTypeEnum.BankStatementsPremier;
                break;

            case "fulldocumentation":
            case "agencypluspremier":
                docTypeEnum = DocTypeEnum.FullDocumentation;
                break;

            default:
                docTypeEnum = DocTypeEnum.Unknown;
                break;
            }

            return(docTypeEnum);
        }
Exemplo n.º 5
0
 /// <summary>
 ///     Инициализация объекта Тип документа по типу
 /// </summary>
 /// <param name="DocType">тип документа из перечисления</param>
 public DocType(DocTypeEnum DocType)
     : base(Convert.ToString((int)DocType))
 {
     Load();
 }
Exemplo n.º 6
0
        /// <summary>
        ///     Проверка является ли данный элемент подчиненным для данного элемента
        /// </summary>
        public bool ChildOf(DocTypeEnum type)
        {
            var typeInt = (int)type;

            return(ChildOf(typeInt.ToString()));
        }