개정판 80391351
SelectedItems 수정
Change-Id: I942d91a7d78fbf05b2fb94fd782be9877423ffed
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseItemsModel.cs | ||
---|---|---|
24 | 24 |
using Newtonsoft.Json; |
25 | 25 |
//using Markus.Service.Interface; |
26 | 26 |
using static Markus.Service.StationController.Data.ConvertPDF; |
27 |
using System.Collections.ObjectModel; |
|
27 | 28 |
|
28 | 29 |
namespace Markus.Service.StationController.ViewModel |
29 | 30 |
{ |
... | ... | |
182 | 183 |
private ConvertPDF _SelectFilterConvert; |
183 | 184 |
public ConvertPDF SelectFilterConvert |
184 | 185 |
{ |
185 |
get => _SelectFilterConvert; |
|
186 |
get |
|
187 |
{ |
|
188 |
return _SelectFilterConvert; |
|
189 |
} |
|
186 | 190 |
set |
187 | 191 |
{ |
188 | 192 |
_SelectFilterConvert = value; |
... | ... | |
190 | 194 |
} |
191 | 195 |
} |
192 | 196 |
|
197 |
|
|
198 |
private ObservableCollection<ConvertPDF> _SelectFilterConvertList; |
|
199 |
public ObservableCollection<ConvertPDF> SelectFilterConvertList |
|
200 |
{ |
|
201 |
get |
|
202 |
{ |
|
203 |
if (_SelectFilterConvertList == null) |
|
204 |
{ |
|
205 |
_SelectFilterConvertList = new ObservableCollection<ConvertPDF>(); |
|
206 |
} |
|
207 |
return _SelectFilterConvertList; |
|
208 |
} |
|
209 |
set |
|
210 |
{ |
|
211 |
_SelectFilterConvertList = value; |
|
212 |
OnPropertyChanged(() => SelectFilterConvertList); |
|
213 |
} |
|
214 |
} |
|
215 |
|
|
216 |
|
|
217 |
|
|
193 | 218 |
private ConvertPDF _SelectRealConvert; |
194 | 219 |
public ConvertPDF SelectRealConvert |
195 | 220 |
{ |
... | ... | |
1023 | 1048 |
|
1024 | 1049 |
private void DataConvert(object obj) |
1025 | 1050 |
{ |
1026 |
if (SelectFilterConvert == null && SelectRealConvert == null)
|
|
1051 |
if (SelectFilterConvertList == null)
|
|
1027 | 1052 |
{ |
1028 | 1053 |
MessageBox.Show("왼쪽 버튼 클릭 후 Converter 해주세요!"); |
1029 | 1054 |
} |
... | ... | |
1031 | 1056 |
{ |
1032 | 1057 |
var resultRealConvert = 0; |
1033 | 1058 |
var resultFiltertConvert = 0; |
1034 |
|
|
1035 | 1059 |
if (SelectRealConvert != null) |
1036 | 1060 |
{ |
1037 | 1061 |
resultRealConvert = SetCleanUpItem(SelectRealConvert);//ConvertDataBase |
1038 | 1062 |
} |
1039 |
else if (SelectFilterConvert != null)
|
|
1063 |
if (SelectFilterConvertList != null)
|
|
1040 | 1064 |
{ |
1041 |
resultFiltertConvert = SetCleanUpItem(SelectFilterConvert); |
|
1065 |
foreach (var SelectFilterConvert in SelectFilterConvertList) |
|
1066 |
{ |
|
1067 |
resultFiltertConvert = SetCleanUpItem(SelectFilterConvert); |
|
1068 |
} |
|
1042 | 1069 |
} |
1043 | 1070 |
System.Diagnostics.Debug.WriteLine(resultRealConvert + " " + resultFiltertConvert); |
1044 | 1071 |
|
1045 | 1072 |
using (markusEntities entities = new markusEntities(App.MarkusDataBaseConnecitonString)) |
1046 | 1073 |
{ |
1047 |
|
|
1048 |
var items = entities.SELECT_CONVERT_ITEM(SelectFilterConvert.ConvertID, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null); //프로시저 이용 |
|
1074 |
foreach (var SelectFilterConvert in SelectFilterConvertList) |
|
1075 |
{ |
|
1076 |
var items = entities.SELECT_CONVERT_ITEM(SelectFilterConvert.ConvertID, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null); //프로시저 이용 |
|
1049 | 1077 |
|
1050 | 1078 |
|
1051 |
foreach (var x in items) |
|
1052 |
{ |
|
1053 |
var MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech"); |
|
1079 |
foreach (var x in items)
|
|
1080 |
{
|
|
1081 |
var MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech");
|
|
1054 | 1082 |
|
1055 |
ConvertPDF AddItem = new ConvertPDF(x.SERVICE_ID, x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE, x.TOTAL_PAGE, x.EXCEPTION, x.GROUP_NO, x.CREATE_DATETIME, x.START_DATETIME, x.END_DATETIME |
|
1056 |
, x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER); |
|
1083 |
ConvertPDF AddItem = new ConvertPDF(x.SERVICE_ID, x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE, x.TOTAL_PAGE, x.EXCEPTION, x.GROUP_NO, x.CREATE_DATETIME, x.START_DATETIME, x.END_DATETIME
|
|
1084 |
, x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER);
|
|
1057 | 1085 |
|
1058 |
RealConvertSource.Add(AddItem); |
|
1086 |
RealConvertSource.Add(AddItem);
|
|
1059 | 1087 |
|
1060 |
if (RealConvertSource.Count() == 1) |
|
1061 |
{ |
|
1062 |
ConvertShow = true; |
|
1088 |
if (RealConvertSource.Count() == 1) |
|
1089 |
{ |
|
1090 |
ConvertShow = true; |
|
1091 |
} |
|
1063 | 1092 |
} |
1064 | 1093 |
} |
1065 | 1094 |
|
1066 | 1095 |
} |
1096 |
|
|
1067 | 1097 |
} |
1068 | 1098 |
} |
1069 | 1099 |
|
... | ... | |
1122 | 1152 |
|
1123 | 1153 |
private void DataValidate(object obj) |
1124 | 1154 |
{ |
1125 |
|
|
1126 |
bool result = false; |
|
1127 |
|
|
1128 |
WebRequest webRequest = WebRequest.Create(SelectFilterConvert.OriginfilePath); |
|
1129 |
webRequest.Timeout = 1200; // miliseconds |
|
1130 |
webRequest.Method = "HEAD"; |
|
1131 |
|
|
1132 |
HttpWebResponse response = null; |
|
1133 |
|
|
1134 |
try |
|
1135 |
{ |
|
1136 |
response = (HttpWebResponse)webRequest.GetResponse(); |
|
1137 |
result = true; |
|
1138 |
} |
|
1139 |
catch (WebException webException) |
|
1155 |
if (SelectFilterConvertList.Count() > 1) |
|
1140 | 1156 |
{ |
1141 |
MessageBox.Show(SelectFilterConvert.FileName + " doesn't exist: " + webException.Message); |
|
1142 |
result = true; |
|
1157 |
MessageBox.Show("하나만 클릭해 주세요"); |
|
1143 | 1158 |
} |
1144 |
finally
|
|
1159 |
else
|
|
1145 | 1160 |
{ |
1146 |
if (response != null) |
|
1161 |
bool result = false; |
|
1162 |
WebRequest webRequest = WebRequest.Create(SelectFilterConvertList[0].OriginfilePath); |
|
1163 |
webRequest.Timeout = 1200; // miliseconds |
|
1164 |
webRequest.Method = "HEAD"; |
|
1165 |
|
|
1166 |
HttpWebResponse response = null; |
|
1167 |
|
|
1168 |
try |
|
1147 | 1169 |
{ |
1148 |
response.Close(); |
|
1170 |
response = (HttpWebResponse)webRequest.GetResponse(); |
|
1171 |
result = true; |
|
1172 |
} |
|
1173 |
catch (WebException webException) |
|
1174 |
{ |
|
1175 |
MessageBox.Show(SelectFilterConvert.FileName + " doesn't exist: " + webException.Message); |
|
1176 |
result = true; |
|
1177 |
} |
|
1178 |
finally |
|
1179 |
{ |
|
1180 |
if (response != null) |
|
1181 |
{ |
|
1182 |
response.Close(); |
|
1183 |
} |
|
1184 |
} |
|
1185 |
if (result == true) |
|
1186 |
{ |
|
1187 |
MessageBox.Show("File exists"); |
|
1149 | 1188 |
} |
1150 | 1189 |
} |
1151 |
if (result == true) |
|
1152 |
{ |
|
1153 |
MessageBox.Show("File exists"); |
|
1154 |
} |
|
1190 |
|
|
1155 | 1191 |
} |
1156 | 1192 |
|
1157 | 1193 |
#endregion |
... | ... | |
1168 | 1204 |
|
1169 | 1205 |
#region MarkusLink |
1170 | 1206 |
|
1171 |
private void MarkusLink(object obj)///여기서 부터
|
|
1207 |
private void MarkusLink(object obj) |
|
1172 | 1208 |
{ |
1173 | 1209 |
if (obj is ConvertPDF) |
1174 | 1210 |
{ |
1211 |
|
|
1175 | 1212 |
if (obj != null) |
1176 | 1213 |
{ |
1177 | 1214 |
var convertitem = obj as ConvertPDF; |
1178 | 1215 |
|
1179 |
SelectFilterConvert = convertitem; |
|
1216 |
SelectFilterConvertList[0] = convertitem;
|
|
1180 | 1217 |
|
1181 | 1218 |
SelectRealConvert = convertitem; |
1182 | 1219 |
|
... | ... | |
1186 | 1223 |
|
1187 | 1224 |
Process.Start(startInfo); |
1188 | 1225 |
} |
1226 |
|
|
1189 | 1227 |
} |
1190 | 1228 |
} |
1191 | 1229 |
|
... | ... | |
1195 | 1233 |
|
1196 | 1234 |
private void DataDelete(object obj) |
1197 | 1235 |
{ |
1198 |
RadWindow.Alert("do you want to delete it??", this.OnClosed);
|
|
1236 |
RadWindow.Alert("Do you want to delete it??", this.OnClosed);
|
|
1199 | 1237 |
} |
1200 | 1238 |
|
1201 | 1239 |
private void OnClosed(object sender, WindowClosedEventArgs e) |
... | ... | |
1205 | 1243 |
var result = e.DialogResult; |
1206 | 1244 |
if (result == true) |
1207 | 1245 |
{ |
1208 |
if (SelectRealConvert != null)
|
|
1246 |
if (SelectFilterConvertList.Count() > 1)
|
|
1209 | 1247 |
{ |
1210 |
entities.SELECT_CONVERT_DELETE(SelectRealConvert.ConvertID);
|
|
1248 |
MessageBox.Show("하나만 클릭해 주세요!");
|
|
1211 | 1249 |
} |
1212 |
if (SelectFilterConvert != null)
|
|
1250 |
else
|
|
1213 | 1251 |
{ |
1214 |
entities.SELECT_CONVERT_DELETE(SelectFilterConvert.ConvertID); |
|
1252 |
if (SelectRealConvert != null) |
|
1253 |
{ |
|
1254 |
entities.SELECT_CONVERT_DELETE(SelectRealConvert.ConvertID); |
|
1255 |
} |
|
1256 |
if (SelectFilterConvertList != null) |
|
1257 |
{ |
|
1258 |
entities.SELECT_CONVERT_DELETE(SelectFilterConvertList[0].ConvertID); |
|
1259 |
} |
|
1215 | 1260 |
} |
1216 | 1261 |
} |
1217 | 1262 |
} |
내보내기 Unified diff