프로젝트

일반

사용자정보

개정판 707d6bae

ID707d6baea848797e5820d70503ec278bc351084c
상위 2f1edec9
하위 ae94500a, 96e2815b

이지연이(가) 5년 이상 전에 추가함

issue #000: 폴더 위치를 configuration으로 변경중

Change-Id: I5e5d1943d83d038acfaf4789e578a615b712078b

차이점 보기:

FinalService/KCOM_FinalService/KCOM_FinalService/Remoting/RemFinalPDFStation.cs
3 3
using KCOMDataModel.DataModel;
4 4
using System;
5 5
using System.Collections.Generic;
6
using System.IO;
6 7
using System.Linq;
7 8
using System.Runtime.Remoting.Channels.Tcp;
8 9
using System.Threading;
......
219 220
                        var item = _entity.DOCUMENT_ITEM.Where(d => d.DOCUMENT_ID == _item.DOCUMENT_ID).FirstOrDefault();
220 221
                        ///TODO: RESULT FILE 경로 위치를 configuration으로 빼주세요
221 222
                        item.RESULT_FILE = String.Format(Properties.Settings.Default.resultFileFolder, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName);
223
                        sendReqLog("RESULT_FILE_PATH", item.RESULT_FILE);
222 224
                        _entity.SaveChanges();
223 225
                        SetFinalState(_item.ID, FinalStatus.Success);
224 226
                        _Thread.Remove(_T.First());
......
233 235
            }
234 236
        }
235 237

  
238

  
239

  
240
        public static void sendReqLog(string name, string text)
241
        {
242
            try
243
            {
244
                string Msg = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\t" + name + "\t" + text + "\r\n";
245
                string Dir = Path.Combine(@"D:\finalpdf\error");
246

  
247
                if (Directory.Exists(Dir) == false)
248
                {
249
                    Directory.CreateDirectory(Dir);
250
                }
251

  
252
                int min = DateTime.Now.Minute / 1;
253

  
254
                string path = Dir + "/" + "Log_" + DateTime.Now.ToString("yyyy-MM-dd HH-") + min + ".txt";
255
                File.AppendAllText(path, Msg);
256
            }
257
            catch (Exception e)
258
            {
259
                //  Debug.WriteLine(e);
260
            }
261
        }
262

  
263

  
236 264
        private void SetError(string FinalID, string Msg)
237 265
        {
238 266
            FINAL_PDF instanceFinal = null;
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/DrawSet_Symbol.cs
60 60

  
61 61
            var Rect3 = GetPointsToRectX(pointSet);
62 62

  
63

  
64
            sendReqLog("ApprovedImgPath", ApprovedImgPath);
65 63
            Image img = Image.GetInstance(new Uri(ApprovedImgPath));
66 64

  
67
            sendReqLog("img.Width", img.Width.ToString());
68 65
            img.ScaleToFit(Rect3.Width, Rect3.Height);
69 66

  
70 67
            img.SetAbsolutePosition(Rect3.Left + ((Rect3.Width - img.ScaledWidth) / (float)5), Rect3.Bottom + ((Rect3.Height - img.ScaledHeight) / (float)5));
......
81 78
            contentByte.RestoreState();
82 79
        }
83 80

  
84
        public static void sendReqLog(string name, string text)
85
        {
86
            try
87
            {
88
                string Msg = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\t" + name + "\t" + text + "\r\n";
89
                string Dir = Path.Combine(@"D:\finalpdf\error");
90

  
91
                if (Directory.Exists(Dir) == false)
92
                {
93
                    Directory.CreateDirectory(Dir);
94
                }
95

  
96
                int min = DateTime.Now.Minute / 1;
97

  
98
                string path = Dir + "/" + "Log_" + DateTime.Now.ToString("yyyy-MM-dd HH-") + min + ".txt";
99
                File.AppendAllText(path, Msg);
100
            }
101
            catch (Exception e)
102
            {
103
                //  Debug.WriteLine(e);
104
            }
105
        }
106

  
107 81
        public static System.Drawing.Image imageToByteArray(byte[] byteData)
108 82
        {
109 83
            System.IO.MemoryStream streamData = new System.IO.MemoryStream(byteData);
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs
1065 1065
                                                double Opacity = control.Opac;
1066 1066

  
1067 1067
                                                StringBuilder ApprovedImgPath = new StringBuilder(512);
1068
                                                GetPrivateProfileString("ApprovedImgPath", "URL", "(NONE)", ApprovedImgPath, 512, "C:\\ProgramData\\MARKUS\\settings.ini");
1068
                                                GetPrivateProfileString("ApprovedImgPath", "URL", "(NONE)", ApprovedImgPath, 512, Path.Combine(AppDataFolder, "FinalService.ini"));
1069 1069

  
1070 1070
                                                Controls_PDF.HoneyPDFLib_DrawSet_Symbol.DrawApproval(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, ApprovedImgPath.ToString());
1071 1071
                                            }
......
1123 1123
                    //File.Move(FinalPDFPath.FullName, @"\\192.168.0.67\finalpdf\" + FinalPDFPath.Name.Replace(".tmp", ".pdf"));
1124 1124
                    //FinalPDFPath = new FileInfo(@"\\192.168.0.67\finalpdf\" + FinalPDFPath.Name.Replace(".tmp", ".pdf"));
1125 1125
                    StringBuilder PDFMovePath = new StringBuilder(255);
1126
                    GetPrivateProfileString("PDFMovePath", "URL", "(NONE)", PDFMovePath, 32, "C:\\ProgramData\\MARKUS\\settings.ini");
1126
                    GetPrivateProfileString("PDFMovePath", "URL", "(NONE)", PDFMovePath, 32, Path.Combine(AppDataFolder, "FinalService.ini"));
1127 1127
                    File.Move(FinalPDFPath.FullName, PDFMovePath.ToString() + FinalPDFPath.Name.Replace(".tmp", ".pdf"));
1128 1128
                    FinalPDFPath = new FileInfo(PDFMovePath.ToString() + FinalPDFPath.Name.Replace(".tmp", ".pdf"));
1129 1129

  
......
1155 1155
        }
1156 1156

  
1157 1157
        [DllImport("kernel32")]
1158
        private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal,
1159
                                                        int size, string filePath);
1158
        private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
1159

  
1160
        public static string AppDataFolder
1161
        {
1162
            get
1163
            {
1164
                return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MARKUS");
1165
            }
1166
        }
1160 1167

  
1161 1168
        #endregion
1162 1169
    }

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)