개정판 8c7fbec1
issue #0000
document 저장
- document 저장 시 transaction log 작성
- markus document 저장 시 transactin의 insert 된 document 증분만 저장되도록 수정
- document delete 시 filter clear 되지 않도록 수정
- 저장 시 화면의 document 중복체크 추가
Change-Id: I9506d6ece52bcea901f3e108b7fa38343f33462e
ID2.Manager/ID2.Manager.Dapper/Repository/DocumentRepository.cs | ||
---|---|---|
1295 | 1295 |
select RefProjectCode, DocumentNo |
1296 | 1296 |
from dbo.Documents |
1297 | 1297 |
where RefProjectCode in (select Code from dbo.Projects where ParentID=@ProjectGroupID) |
1298 |
and RegisteredDate > @CreatedDate and RegisteredDate <= @EndDate";
|
|
1298 |
and RegisteredDate between @CreatedDate and @EndDate";
|
|
1299 | 1299 |
|
1300 | 1300 |
if (parameters.Count > 0) |
1301 | 1301 |
{ |
ID2.Manager/ID2.Manager/Classes/DocumentsWorker.cs | ||
---|---|---|
154 | 154 |
//var test = this.OrgList.Except(this.DocList, new DocumentsAttFileComparer()); |
155 | 155 |
*/ |
156 | 156 |
|
157 |
//Get Transaction Key |
|
158 |
bool isTran = false; |
|
159 |
int trKey = new DocumentController().GetTranKey(informations.ActiveUser.ID, informations.ActiveProject.ProjectID); |
|
160 |
|
|
157 | 161 |
//수정리스트 |
158 | 162 |
this.DocList.Where(x => !this.OrgList.Any(y => y.Equals(x))).ForAll(x => this.SetList.Add(x)); |
159 | 163 |
|
... | ... | |
184 | 188 |
//삭제리스트 |
185 | 189 |
this.DelList.AddRange(this.OrgList.Except(this.DocList, new DocumentsKeyComparer())); |
186 | 190 |
|
187 |
e.Result = new DocumentController().SetDocumentData(informations.ActiveProject.ProjectID, SetList, DelList, informations.ActiveUser.ID); |
|
191 |
//e.Result = new DocumentController().SetDocumentData(informations.ActiveProject.ProjectID, SetList, DelList, informations.ActiveUser.ID); |
|
192 |
|
|
193 |
bool result = false; |
|
194 |
bool markusPrjResult = false; |
|
195 |
bool markusDataResult = false; |
|
196 |
bool markusUserResult = false; |
|
197 |
|
|
198 |
if (trKey > 0) |
|
199 |
{ |
|
200 |
isTran = new DocumentController().SetTran(trKey, true, true, SetList.Count + DelList.Count, 0); |
|
201 |
|
|
202 |
if (isTran) |
|
203 |
{ |
|
204 |
result = new DocumentController().SetDocumentData(informations.ActiveProject.ProjectID, SetList, DelList, informations.ActiveUser.ID); |
|
205 |
} |
|
206 |
} |
|
207 |
|
|
208 |
if (result) |
|
209 |
{ |
|
210 |
isTran = new DocumentController().SetTran(trKey, true, false, 0, 0); |
|
211 |
|
|
212 |
List<Documents> docs = new DocumentController().GetTrDocuments(trKey).ToList(); |
|
213 |
|
|
214 |
isTran = new DocumentController().SetTran(trKey, false, true, 0, docs.Count); |
|
215 |
|
|
216 |
if (docs.Any()) |
|
217 |
{ |
|
218 |
if (isTran) |
|
219 |
{ |
|
220 |
markusPrjResult = new MarkusInfoController().SetProperties(informations.ProjectList.Where(x => x.Level == 2).Select(x => x.Name)); |
|
221 |
markusDataResult = new MarkusInfoController().SetMarkusInfo(docs); |
|
222 |
markusUserResult = new MarkusInfoController().SetMembers(informations.UserList); |
|
223 |
|
|
224 |
if (markusDataResult) |
|
225 |
{ |
|
226 |
isTran = new DocumentController().SetTran(trKey, false, false, 0, 0); |
|
227 |
} |
|
228 |
} |
|
229 |
} |
|
230 |
else |
|
231 |
{ |
|
232 |
markusPrjResult = true; |
|
233 |
markusDataResult = true; |
|
234 |
markusUserResult = true; |
|
235 |
|
|
236 |
isTran = new DocumentController().SetTran(trKey, false, false, 0, 0); |
|
237 |
} |
|
238 |
} |
|
239 |
|
|
240 |
e.Result = this.GetDwgResult(result, markusPrjResult, markusDataResult, markusUserResult); |
|
241 |
} |
|
242 |
|
|
243 |
private (bool isDwg, bool isMarkusPrj, bool isMarkusDwg, bool isMarkusUser) GetDwgResult(bool result, bool markusPrjResult, bool markusDataResult, bool markusUserResult) |
|
244 |
{ |
|
245 |
return (result, markusPrjResult, markusDataResult, markusUserResult); |
|
188 | 246 |
} |
189 | 247 |
|
190 | 248 |
protected override void WorkCompleted(RunWorkerCompletedEventArgs e) |
ID2.Manager/ID2.Manager/Main.cs | ||
---|---|---|
1186 | 1186 |
|
1187 | 1187 |
public void DocumentListBinding() |
1188 | 1188 |
{ |
1189 |
this.DocumentListBinding(true); |
|
1190 |
} |
|
1191 |
|
|
1192 |
public void DocumentListBinding(bool isFilterClear) |
|
1193 |
{ |
|
1189 | 1194 |
try |
1190 | 1195 |
{ |
1191 | 1196 |
GridViewComboBoxColumn ColProjects = this.radGridViewDocuments.Columns["RefProjectCode"] as GridViewComboBoxColumn; |
... | ... | |
1259 | 1264 |
}; |
1260 | 1265 |
*/ |
1261 | 1266 |
|
1262 |
this.radGridViewDocuments.FilterDescriptors.Clear(); |
|
1267 |
if (isFilterClear) |
|
1268 |
this.radGridViewDocuments.FilterDescriptors.Clear(); |
|
1263 | 1269 |
this.radGridViewDocuments.DataSource = new BindingList<Documents>(this.documents); |
1264 | 1270 |
this.lbSelectAndTotal.Text = $"{this.radGridViewDocuments.MasterTemplate.DataView.Count} / {this.TotalCount} (Selected / Total)"; |
1265 | 1271 |
|
... | ... | |
2104 | 2110 |
delData.ForAll(x => { grid.Rows.Remove(delData[nLoop]); nLoop++; }); |
2105 | 2111 |
grid.EndUpdate(); |
2106 | 2112 |
|
2107 |
RadMessageBox.Show("Delete is complete", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info); |
|
2113 |
//RadMessageBox.Show("Delete is complete", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
|
|
2108 | 2114 |
|
2109 |
this.DocumentListBinding(); |
|
2115 |
this.DocumentListBinding(false);
|
|
2110 | 2116 |
} |
2111 | 2117 |
} |
2112 | 2118 |
} |
... | ... | |
2160 | 2166 |
#endregion |
2161 | 2167 |
|
2162 | 2168 |
#region document no 중복 유효성 체크 |
2163 |
//this.documents.GroupBy(g => new { g.RefProjectCode, g.DocumentNo }) |
|
2164 |
// .Where(x => x.Count() > 1).Select(x => x.Key).ToList(); |
|
2169 |
int dupDwgNoCount = 0; |
|
2170 |
dupDwgNoCount = this.documents.GroupBy(g => new { g.RefProjectCode, g.DocumentNo }) |
|
2171 |
.Where(x => x.Count() > 1) |
|
2172 |
.Select(x => x.Key).ToList().Count; |
|
2173 |
|
|
2174 |
if (dupDwgNoCount > 0) |
|
2175 |
{ |
|
2176 |
RadMessageBox.Show($"Duplicate Dwg No exists.({dupDwgNoCount})", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info); |
|
2177 |
return; |
|
2178 |
} |
|
2165 | 2179 |
|
2166 |
//int dupDwgNoCount = 0; |
|
2167 | 2180 |
//List<string> newDwgNos = this.documents.Where(x => string.IsNullOrEmpty(x.DocID)).Select(x => x.DocumentNo).ToList(); |
2168 | 2181 |
//if (newDwgNos.Count > 0) |
2169 | 2182 |
//{ |
... | ... | |
2180 | 2193 |
var worker = new SetDocumentsWorker(this.documents, this.orgDocuments, this.radGridViewDocuments); |
2181 | 2194 |
worker.OnWorkCompletedHandler += (e) => |
2182 | 2195 |
{ |
2196 |
bool isDwg = false; |
|
2197 |
bool isMarkusPrj = false; |
|
2198 |
bool isMarkusDwg = false; |
|
2199 |
bool isMarkusUser = false; |
|
2200 |
|
|
2201 |
(isDwg, isMarkusPrj, isMarkusDwg, isMarkusUser) = ((bool, bool, bool, bool ))e.Result; |
|
2202 |
|
|
2203 |
if (!isDwg) |
|
2204 |
{ |
|
2205 |
RadMessageBox.Show("Save is not complete.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Error); |
|
2206 |
} |
|
2207 |
else if (!isMarkusPrj) |
|
2208 |
{ |
|
2209 |
RadMessageBox.Show("Markus Projects Save is not complete.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Error); |
|
2210 |
} |
|
2211 |
else if (!isMarkusDwg) |
|
2212 |
{ |
|
2213 |
RadMessageBox.Show("Markus Data Save is not complete.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Error); |
|
2214 |
} |
|
2215 |
else if (!isMarkusUser) |
|
2216 |
{ |
|
2217 |
RadMessageBox.Show("Markus Members Save is not complete.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Error); |
|
2218 |
} |
|
2219 |
else |
|
2220 |
{ |
|
2221 |
RadMessageBox.Show("Save is complete", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info); |
|
2222 |
this.GetDocList(); |
|
2223 |
} |
|
2224 |
|
|
2225 |
//isDwg = result.isDwg; |
|
2226 |
//isMarkusPrj = result.isDwg; |
|
2227 |
//isMarkusDwg = result.isDwg; |
|
2228 |
//isMarkusUser = result.isDwg; |
|
2229 |
|
|
2230 |
//string test = ""; |
|
2231 |
|
|
2232 |
//(isDwg, isMarkusPrj, isMarkusDwg, isMarkusUser) = (isDwg, isMarkusPrj, isMarkusDwg, isMarkusUser)e.Result; |
|
2233 |
|
|
2234 |
|
|
2235 |
/* |
|
2183 | 2236 |
bool result = false; |
2184 | 2237 |
bool markusResult = false; |
2185 | 2238 |
bool markusMembersResult = false; |
... | ... | |
2211 | 2264 |
{ |
2212 | 2265 |
RadMessageBox.Show("Markus Members Save is not complete", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Error); |
2213 | 2266 |
} |
2267 |
*/ |
|
2214 | 2268 |
}; |
2215 | 2269 |
worker.StartWork(); |
2216 | 2270 |
} |
내보내기 Unified diff