개정판 43e1d368
issue #0000 코드 정리
Change-Id: I7c8ba4ef6d78a7e4f51b72f226507cddac722939
ConvertService/ServiceBase/Markus.Service.DataBase/ConvertDatabase.cs | ||
---|---|---|
5 | 5 |
using System.Collections.Generic; |
6 | 6 |
using System.IO; |
7 | 7 |
using System.Linq; |
8 |
using static Markus.Service.DataBase.ConvertDatabase; |
|
9 | 8 |
using System.Windows; |
10 | 9 |
using System.Linq.Expressions; |
11 | 10 |
using Markus.Service.Interface; |
... | ... | |
118 | 117 |
GROUP_NO = subpet.GROUP_NO, |
119 | 118 |
}; |
120 | 119 |
|
121 |
if (query.Count() > 0)//세미
|
|
120 |
if (query.Count() > 0) |
|
122 | 121 |
{ |
123 | 122 |
foreach (var item in query) |
124 | 123 |
{ |
... | ... | |
649 | 648 |
item.STATUS = (int)StatusCodeType.None; |
650 | 649 |
item.END_DATETIME = null; |
651 | 650 |
|
652 |
result = entities.SaveChanges(); |
|
651 |
|
|
652 |
var waiter = entities.SaveChangesAsync().GetAwaiter(); |
|
653 |
result = waiter.GetResult(); |
|
653 | 654 |
} |
654 | 655 |
|
655 | 656 |
return result; |
... | ... | |
697 | 698 |
item.END_DATETIME = null; |
698 | 699 |
item.STATUS = (int)StatusCodeType.None; |
699 | 700 |
|
700 |
result = entities.SaveChanges(); |
|
701 |
var waiter = entities.SaveChangesAsync().GetAwaiter(); |
|
702 |
result = waiter.GetResult(); |
|
701 | 703 |
} |
702 | 704 |
|
703 | 705 |
return result; |
... | ... | |
710 | 712 |
{ |
711 | 713 |
try |
712 | 714 |
{ |
715 |
|
|
713 | 716 |
return Path.Combine(BaseStorage(ProjectNo), ProjectNo + "_Tile", (System.Convert.ToInt64(DocumentID) / 100).ToString(), DocumentID); |
717 |
return Path.Combine(BaseStorage(ProjectNo), ProjectNo + "_Tile",DocumentID.Substring(0, 5).ToString(), DocumentID); |
|
714 | 718 |
} |
715 | 719 |
catch (Exception) |
716 | 720 |
{ |
... | ... | |
758 | 762 |
FINAL_PDF item = items.First(); |
759 | 763 |
entities.FINAL_PDF.Remove(item); |
760 | 764 |
|
761 |
result = entities.SaveChanges(); |
|
765 |
|
|
766 |
var waiter = entities.SaveChangesAsync().GetAwaiter(); |
|
767 |
result = waiter.GetResult(); |
|
762 | 768 |
} |
763 | 769 |
|
764 | 770 |
return result; |
... | ... | |
775 | 781 |
CONVERTER_DOC item = items.First(); |
776 | 782 |
entities.CONVERTER_DOC.Remove(item); |
777 | 783 |
|
778 |
result = entities.SaveChanges(); |
|
784 |
|
|
785 |
var waiter = entities.SaveChangesAsync().GetAwaiter(); |
|
786 |
result = waiter.GetResult(); |
|
779 | 787 |
} |
780 | 788 |
|
781 | 789 |
return result; |
... | ... | |
929 | 937 |
|
930 | 938 |
entities.CONVERTER_DOC.Add(convert_doc); |
931 | 939 |
|
932 |
if (entities.SaveChanges() == 1) |
|
940 |
|
|
941 |
var waiter = entities.SaveChangesAsync().GetAwaiter(); |
|
942 |
|
|
943 |
if (waiter.GetResult() == 1) |
|
933 | 944 |
{ |
934 | 945 |
result = true; |
935 | 946 |
} |
... | ... | |
970 | 981 |
docinfo.PROJECT_NO = convertDoc.PROJECT_NO; |
971 | 982 |
docinfo.ORIGINAL_FILE = convertDoc.DOCUMENT_URL; |
972 | 983 |
docinfo.PAGE_COUNT = totalPage; |
973 |
docinfo.DOCPAGE = pageinfo; |
|
974 |
entities.SaveChanges(); |
|
975 |
result = true; |
|
984 |
docinfo.DOCPAGE = pageinfo; |
|
985 |
var waiter = entities.SaveChangesAsync().GetAwaiter(); |
|
986 |
|
|
987 |
if(waiter.GetResult() > 0) |
|
988 |
{ |
|
989 |
result = true; |
|
990 |
} |
|
976 | 991 |
} |
977 | 992 |
else |
978 | 993 |
{ |
... | ... | |
987 | 1002 |
}; |
988 | 1003 |
|
989 | 1004 |
entities.DOCINFO.Add(instace); |
990 |
var save = entities.SaveChanges(); |
|
1005 |
var waiter = entities.SaveChangesAsync().GetAwaiter(); |
|
1006 |
|
|
1007 |
var save = waiter.GetResult(); |
|
991 | 1008 |
|
992 | 1009 |
if (save == pageinfo.Count() + 1) |
993 | 1010 |
{ |
... | ... | |
1017 | 1034 |
{ |
1018 | 1035 |
var convertItem = items.First(); |
1019 | 1036 |
|
1020 |
string convertPath = Path.Combine(BaseStorage(convertItem.PROJECT_NO), convertItem.PROJECT_NO + "_Tile", (System.Convert.ToInt64(convertItem.DOCUMENT_ID) / 100).ToString(), convertItem.DOCUMENT_ID); |
|
1037 |
#if XI_C_AND_A |
|
1038 |
string convertPath = GetConvertPath(convertItem.PROJECT_NO, convertItem.DOCUMENT_ID); |
|
1039 |
#else |
|
1021 | 1040 |
|
1041 |
string convertPath = Path.Combine(BaseStorage(convertItem.PROJECT_NO), convertItem.PROJECT_NO + "_Tile", (System.Convert.ToInt64(convertItem.DOCUMENT_ID) / 100).ToString(), convertItem.DOCUMENT_ID); |
|
1042 |
#endif |
|
1022 | 1043 |
result = new Interface.ConvertItem(convertItem.DOCUMENT_ID, convertItem.PROJECT_NO, convertItem.ID, convertItem.DOCUMENT_URL, convertPath); |
1023 | 1044 |
} |
1024 | 1045 |
|
... | ... | |
1036 | 1057 |
if (items.Count() > 0) |
1037 | 1058 |
{ |
1038 | 1059 |
var convertItem = items.First(); |
1039 |
string convertPath = Path.Combine(BaseStorage(convertItem.PROJECT_NO), convertItem.PROJECT_NO + "_Tile", (System.Convert.ToInt64(convertItem.DOCUMENT_ID) / 100).ToString(), convertItem.DOCUMENT_ID); |
|
1040 | 1060 |
|
1061 |
#if XI_C_AND_A |
|
1062 |
string convertPath = GetConvertPath(convertItem.PROJECT_NO, convertItem.DOCUMENT_ID); |
|
1063 |
#else |
|
1064 |
string convertPath = Path.Combine(BaseStorage(convertItem.PROJECT_NO), convertItem.PROJECT_NO + "_Tile", (System.Convert.ToInt64(convertItem.DOCUMENT_ID) / 100).ToString(), convertItem.DOCUMENT_ID); |
|
1065 |
#endif |
|
1041 | 1066 |
if (convertItem.STATUS == (int)StatusCodeType.Completed) |
1042 | 1067 |
{ |
1043 | 1068 |
result = new Interface.ConvertItem(convertItem.DOCUMENT_ID, convertItem.PROJECT_NO, convertItem.ID, convertItem.DOCUMENT_URL, convertPath, |
... | ... | |
1192 | 1217 |
|
1193 | 1218 |
if (items.EXCEPTION.Length < 255) |
1194 | 1219 |
{ |
1220 |
if (items.EXCEPTION.Length > 0 && Error?.Length > 0) |
|
1221 |
{ |
|
1222 |
items.EXCEPTION = items.EXCEPTION + ";" + Environment.NewLine; |
|
1223 |
} |
|
1224 |
|
|
1195 | 1225 |
items.EXCEPTION = items.EXCEPTION + Error; |
1196 | 1226 |
} |
1197 | 1227 |
|
1198 |
entities.SaveChanges(); |
|
1228 |
var waiter = entities.SaveChangesAsync().GetAwaiter(); |
|
1229 |
var save = waiter.GetResult(); |
|
1199 | 1230 |
result = true; |
1200 | 1231 |
} |
1201 | 1232 |
} |
... | ... | |
1243 | 1274 |
return convertItems; |
1244 | 1275 |
} |
1245 | 1276 |
|
1246 |
#endregion
|
|
1277 |
#endregion |
|
1247 | 1278 |
|
1248 | 1279 |
} |
1249 | 1280 |
} |
내보내기 Unified diff