public bool contains(NewPartyWithId obj) { if (this.sellers.IndexOf(obj) != -1) { return(true); } return(false); }
public void addSellers(NewPartyWithId node) { if (this.hashSet.Contains(node.userId)) { this.addChild(node.userId, node); } else { this.hashSet.Add(node.userId); this.sellers.Add(node); } }
public void addChild(String uid, NewPartyWithId child) { int totalQtyTillNow = 0; int a = 0, range = 0; foreach (NewPartyWithId item in sellers) { if (item.userId == uid) { totalQtyTillNow += item.qty; item.isChild = true; a = item.a; range = item.range; } } child.totalQtyTillNow += totalQtyTillNow; child.isChild = true; sellers.Add(child); child.a = a; child.range = range; }