private bool ParseTifFileOnlyName(FileInfo fi, DbModule.SendRequestMasterInfo p_reqInfo_mstr, DbModule.SendRequestDetailInfo p_reqInfo_dtl)
        {
            string strSID            = "";
            string strFacsimileFaxNo = "";
            string strDestFaxNo      = "";
            string strTitle          = "";
            string strReqUserName    = "";

            string onlyFileName = fi.Name.Substring(0, fi.Name.LastIndexOf(fi.Extension));

            /// 가변 길이 형식 처리
            if (Config.FILE_IsFixOrVariable == "V")
            {
                string[] s = onlyFileName.Split(Convert.ToChar(Config.FILE_DELIMITER));

                /// 파일 이름 유효성 검사
                if (s.Length == 0)
                {
                    FileMoveToException(m_ProcessPath, fi.Name);
                    return(false);
                }

                /// 파일 이름과 Tif 파일 이름 포맷 유효성 검사
                if (s.Length != Config.FileTifFileFormatInfo.Count)
                {
                    FileMoveToException(m_ProcessPath, fi.Name);
                    return(false);
                }

                try
                {
                    for (int i = 0; i < s.Length; i++)
                    {
                        if (Config.FileTifFileFormatInfo[i].key == "@SID")
                        {
                            strSID = s[i].ToString().Trim();
                        }
                        else if (Config.FileTifFileFormatInfo[i].key == "@FMFN")
                        {
                            strFacsimileFaxNo = s[i].ToString().Trim();
                        }
                        else if (Config.FileTifFileFormatInfo[i].key == "@DSFN")
                        {
                            strDestFaxNo = s[i].ToString().Trim();
                        }
                        else if (Config.FileTifFileFormatInfo[i].key == "@TITL")
                        {
                            strTitle = s[i].ToString().Trim();
                        }
                        else if (Config.FileTifFileFormatInfo[i].key == "@RQUN")
                        {
                            strReqUserName = s[i].ToString().Trim();
                        }
                    }
                }
                catch (Exception ex)
                {
                    FileMoveToException(m_ProcessPath, fi.Name);
                    throw ex;
                }
            }
            /// 고정 길이 형식 처리
            else if (Config.FILE_IsFixOrVariable == "F")
            {
                /// 글자수 확인
                if (fi.Name.Length != Config.FILE_TIF_FILE_REAL_FORMAT.Length)
                {
                    FileMoveToException(m_ProcessPath, fi.Name);
                    return(false);
                }

                try
                {
                    foreach (FileCheckInfo info in Config.FileTifFileFormatInfo)
                    {
                        string item = onlyFileName.Substring(info.startPosition, info.length).Trim();

                        if (info.key == "@SID")
                        {
                            strSID = item;
                        }
                        else if (info.key == "@FMFN")
                        {
                            strFacsimileFaxNo = item;
                        }
                        else if (info.key == "@DSFN")
                        {
                            strDestFaxNo = item;
                        }
                        else if (info.key == "@TITL")
                        {
                            strTitle = item;
                        }
                        else if (info.key == "@RQUN")
                        {
                            strReqUserName = item;
                        }
                    }
                }
                catch (Exception ex)
                {
                    FileMoveToException(m_ProcessPath, fi.Name);
                    throw ex;
                }
            }

            /// 분석된 항목 설정
            p_reqInfo_mstr.DataSetting(strSID, strFacsimileFaxNo, strReqUserName, strTitle);
            //p_reqInfo_dtl.DataSetting(strDestFaxNo, strTitle, string.Format("{0}{1}.{2}", m_RelativePath, onlyFileName, Config.FILE_IMAGE_FILE_EXT));
            p_reqInfo_dtl.DataSetting(strDestFaxNo, strTitle, m_RelativePath);

            return(true);
        }
        private bool ParseTifFileWithInfoFile(FileInfo fi, DbModule.SendRequestMasterInfo p_reqInfo_mstr, DbModule.SendRequestDetailInfo p_reqInfo_dtl)
        {
            string strSID            = "";
            string strFacsimileFaxNo = "";
            string strDestFaxNo      = "";
            string strTitle          = "";
            string strReqUserName    = "";
            string content           = "";

            string onlyFileName = fi.Name.Substring(0, fi.Name.LastIndexOf(fi.Extension));
            string datFile      = string.Format("{0}{1}", m_ProcessPath, fi.Name);

            /// 포맷 파일 읽기
            try
            {
                content = File.ReadAllText(datFile, Encoding.Default);
            }
            catch (Exception ex)
            {
                /// 에러 파일 -> Exception 폴더로 이동
                FileMoveToException(fi.DirectoryName, fi.Name);

                AppLog.ExceptionLog(ex, string.Format("{0}을 읽는 중 오류가 발생하였습니다.", fi.Name));
                throw ex;
            }

            /// 포맷 파일 분석
            Regex           r       = new Regex(@"(?<key>[\w]+)[%s]*=[%s]*(?<value>[\w\d]+)");
            MatchCollection matches = r.Matches(content);

            string key   = "";
            string value = "";

            foreach (Match m in matches)
            {
                key   = m.Groups["key"].Value;
                value = m.Groups["value"].Value;

                if (key == "DEVICE_ID")
                {
                    strSID = value;
                }
                else if (key == "FACSIMILE_FAXNO")
                {
                    strFacsimileFaxNo = value;
                }
                else if (key == "DEST_FAXNO")
                {
                    strDestFaxNo = value;
                }
                else if (key == "TITLE")
                {
                    strTitle = value;
                }
                else if (key == "REQ_USER_NAME")
                {
                    strReqUserName = value;
                }
            }

            /// 분석된 항목 유효성 검사
            /// 최소 보낼 팩스 번호는 있어야 함.
            if (string.IsNullOrEmpty(strDestFaxNo) == true)
            {
                /// 에러 파일 -> Exception 폴더로 이동
                FileMoveToException(fi.DirectoryName, fi.Name);

                return(false);
            }

            /// 분석된 항목 설정
            p_reqInfo_mstr.DataSetting(strSID, strFacsimileFaxNo, strReqUserName, strTitle);
            //p_reqInfo_dtl.DataSetting(strDestFaxNo, strTitle, string.Format("{0}{1}.{2}", m_RelativePath, onlyFileName, Config.FILE_IMAGE_FILE_EXT));
            p_reqInfo_dtl.DataSetting(strDestFaxNo, strTitle, m_RelativePath);

            return(true);
        }
        private bool ParseEmailTitle(string emailTitle, ref DbModule.SendRequestMasterInfo p_reqInfo_mstr, ref DbModule.SendRequestDetailInfo p_reqInfo_dtl)
        {
            string strSID            = "";
            string strFacsimileFaxNo = "";
            string strDestFaxNo      = "";
            string strTitle          = "";
            string strReqUserName    = "";

            /// 가변 길이 형식 처리
            if (Config.EMAIL_IsFixOrVariable == "V")
            {
                string[] s = emailTitle.Split(Convert.ToChar(Config.FILE_DELIMITER));

                /// 파일 이름 유효성 검사
                if (s.Length == 0)
                {
                    return(false);
                }

                /// 파일 이름과 Tif 파일 이름 포맷 유효성 검사
                if (s.Length != Config.EmailTitleFormatInfo.Count)
                {
                    return(false);
                }

                try
                {
                    for (int i = 0; i < s.Length; i++)
                    {
                        if (Config.EmailTitleFormatInfo[i].key == "@SID")
                        {
                            strSID = s[i].ToString().Trim();
                        }
                        else if (Config.EmailTitleFormatInfo[i].key == "@FMFN")
                        {
                            strFacsimileFaxNo = s[i].ToString().Trim();
                        }
                        else if (Config.EmailTitleFormatInfo[i].key == "@DSFN")
                        {
                            strDestFaxNo = s[i].ToString().Trim();
                        }
                        else if (Config.EmailTitleFormatInfo[i].key == "@TITL")
                        {
                            strTitle = s[i].ToString().Trim();
                        }
                        else if (Config.EmailTitleFormatInfo[i].key == "@RQUN")
                        {
                            strReqUserName = s[i].ToString().Trim();
                        }
                    }
                }
                catch (Exception ex)
                {
                    AppLog.ExceptionLog(ex, "");
                    return(false);
                }
            }
            /// 고정 길이 형식 처리
            else if (Config.EMAIL_IsFixOrVariable == "F")
            {
                /// 글자수 확인
                if (emailTitle.Length != Config.EMAIL_TITLE_REAL_FORMAT.Length)
                {
                    return(false);
                }

                try
                {
                    foreach (FileCheckInfo info in Config.EmailTitleFormatInfo)
                    {
                        string item = emailTitle.Substring(info.startPosition, info.length).Trim();

                        if (info.key == "@SID")
                        {
                            strSID = item;
                        }
                        else if (info.key == "@FMFN")
                        {
                            strFacsimileFaxNo = item;
                        }
                        else if (info.key == "@DSFN")
                        {
                            strDestFaxNo = item;
                        }
                        else if (info.key == "@TITL")
                        {
                            strTitle = item;
                        }
                        else if (info.key == "@RQUN")
                        {
                            strReqUserName = item;
                        }
                    }
                }
                catch (Exception ex)
                {
                    AppLog.ExceptionLog(ex, "");
                    return(false);
                }
            }

            /// 분석된 항목 설정
            p_reqInfo_mstr.DataSetting(strSID, strFacsimileFaxNo, strReqUserName, strTitle);
            //p_reqInfo_dtl.DataSetting(strDestFaxNo, strTitle, attachFile.Length > 0 ? string.Format("{0}{1}", m_RelativePath, attachFile) : "");
            p_reqInfo_dtl.DataSetting(strDestFaxNo, strTitle, p_reqInfo_dtl.TIF_FILE);

            return(true);
        }