public List <PArcelGroupSumType> GetParcelSums() { List <PArcelGroupSumType> l = new List <PArcelGroupSumType>(); foreach (var dc in DicterType.ParcelGroups()) { PArcelGroupSumType o = new PArcelGroupSumType(); o.Name = dc.ParcelGroupName; l.Add(o); } foreach (var od in l) { foreach (var stop in STOPS) { foreach (var parcel in stop.ParcelList) { foreach (var pg in parcel.PARCEL_GROUP) { if (pg.Name == od.Name) { od.IsTrue += pg.IsTrue; od.isTrueDeliveredOnly += pg.isTrueDeliveredOnly; } } } } } return(l); }
public void GetParcelGroup() { List <ParcelGroupType> l = DicterType.ParcelGroups(); PARCEL_GROUP = new List <PArcelGroupSumType> (); foreach (var od in l) { PArcelGroupSumType o = new PArcelGroupSumType(); o.Name = od.ParcelGroupName; foreach (var prop in typeof(StopFileType).GetProperties()) { if (prop.Name == od.Column) { foreach (var pv in od.Parcelcodes()) { string val = prop.GetValue(this).ToString(); if (pv == val) { o.IsTrue = 1; if (od.TypStawki != StawkaTyp.BRAK) { TypStawki = od.TypStawki; } if (Is_Delivered == true) { o.isTrueDeliveredOnly = 1; } } } } } PARCEL_GROUP.Add(o); } }