개정판 a6e5055d
Markus.Service.StationController DataBaseView 추가
Change-Id: I16b9c78a690e2ae8f804bf35c8787a9c97fea157
ConvertService/ServiceBase/Markus.Service.StationController/Extensions/ConvertItemChangeValue.cs | ||
---|---|---|
9 | 9 |
{ |
10 | 10 |
public static class ConvertItemEx |
11 | 11 |
{ |
12 |
public static void ChangeValues(object changeitem, object newitem) |
|
12 |
public static void ChangeValues(object changeitem, object newitem)//그리드에 있는 컬렉션, 디비에 있는 컬렉션
|
|
13 | 13 |
{ |
14 |
var changeProp = changeitem.GetType().GetProperties(); |
|
15 |
var newProp = newitem.GetType().GetProperties(); |
|
14 |
var changeProp = changeitem.GetType().GetProperties();//그리드
|
|
15 |
var newProp = newitem.GetType().GetProperties();//디비
|
|
16 | 16 |
|
17 |
foreach (var item in changeProp) |
|
17 |
foreach (var item in changeProp)//그리드 포문
|
|
18 | 18 |
{ |
19 | 19 |
|
20 |
var newinfo = newProp.Where(x => x.Name == item.Name); |
|
20 |
var newinfo = newProp.Where(x => x.Name == item.Name);//그리드와 디비 조건에 맞는 오브젝트
|
|
21 | 21 |
|
22 | 22 |
if(newinfo.Count() > 0) |
23 | 23 |
{ |
24 |
item.SetValue(changeitem, newinfo.First().GetValue(newitem)); |
|
24 |
if (item.GetValue(changeitem) != newinfo.First().GetValue(newitem)) |
|
25 |
{ |
|
26 |
item.SetValue(changeitem, newinfo.First().GetValue(newitem)); |
|
27 |
} |
|
25 | 28 |
} |
26 | 29 |
} |
27 | 30 |
} |
31 |
|
|
28 | 32 |
} |
29 | 33 |
} |
내보내기 Unified diff