예제 #1
0
        public FileMessage2 DownloadFile2(FileInfo2 msg)
        {
            try
            {
                SecurityCheckThrow(msg.s1, msg.s2);
                RecordCallHistory("DownloadFile");

                DataAccess da    = new DataAccess();
                var        vinfo = da.SelectVoucherInfo(msg.CountryId, msg.VoucherId);

                ZipFileAccess zipda           = new ZipFileAccess();
                var           voucherFolder   = zipda.CreateDirectoryHerarchy(Strings.FILESERVERFOLDER, msg.CountryId, vinfo.branch_id, msg.VoucherId);
                var           sessionFileName = voucherFolder.CombineFileName(vinfo.session_Id);

                FileMessage2 download = new FileMessage2(msg);

                if (sessionFileName.Exists)
                {
                    Stream fileStream = new FileStream(sessionFileName.FullName, FileMode.Open);
                    download.FileByteStream = fileStream;
                }
                return(download);
            }
            catch (Exception ex)
            {
                throw new FaultException <MyApplicationFault>(new MyApplicationFault(), ex.Message);
            }
        }
예제 #2
0
 public FileMessage2(FileInfo2 info)
 {
     CountryId = info.CountryId;
     VoucherId = info.VoucherId;
 }