markus / ConvertService / ServiceBase / Markus.Service.ConvertPath / ConvertPath.cs @ master
이력 | 보기 | 이력해설 | 다운로드 (1.12 KB)
1 | a5e5fff6 | taeseongkim | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.IO; |
||
4 | using System.Linq; |
||
5 | using System.Text; |
||
6 | using System.Threading.Tasks; |
||
7 | |||
8 | namespace Markus |
||
9 | { |
||
10 | public static class CreateConvertPath |
||
11 | { |
||
12 | public static string Get(string BaseStoragePath, string ProjectNo, string DocumentID) |
||
13 | { |
||
14 | int outValue = 0; |
||
15 | if (int.TryParse(DocumentID, out outValue)) |
||
16 | { |
||
17 | return GetWhenInt(BaseStoragePath, ProjectNo, DocumentID); |
||
18 | } |
||
19 | else |
||
20 | { |
||
21 | return GetWhenString(BaseStoragePath, ProjectNo, DocumentID); |
||
22 | } |
||
23 | |||
24 | } |
||
25 | |||
26 | private static string GetWhenString(string BaseStoragePath, string ProjectNo, string DocumentID) |
||
27 | { |
||
28 | return Path.Combine(BaseStoragePath, ProjectNo + "_Tile", DocumentID.Substring(0, 5).ToString(), DocumentID); |
||
29 | } |
||
30 | |||
31 | private static string GetWhenInt(string BaseStoragePath, string ProjectNo, string DocumentID) |
||
32 | { |
||
33 | return Path.Combine(BaseStoragePath, ProjectNo + "_Tile", (System.Convert.ToInt64(DocumentID) / 100).ToString(), DocumentID); |
||
34 | } |
||
35 | } |
||
36 | } |