public ProductGroupRule(ProductGroup group) { this.group = group; }
protected override void OnLoadObjectData(DataRow row) { this.group = ProductGroup.Parse((int) row["ProductGroupId"]); this.productTerm = ProductClass.Parse((int) row["ProductTypeId"]); this.productPosition = ProductClass.Parse((int) row["ProductPositionId"]); this.postedBy = Contact.Parse((int) row["PostedById"]); this.status = (GeneralObjectStatus) Convert.ToChar(row["ProductGroupRuleStatus"]); }
public void RemoveChild(ProductGroup child) { ProductGroup readedChild = this.GetChild(child); readedChild.Status = GeneralObjectStatus.Deleted; readedChild.Save(); }
public ProductGroup GetChild(ProductGroup child) { ProductGroup readedChild = this.GetChilds().Find((x) => x.Equals(child)); if (readedChild != null) { return readedChild; } else { throw new ProductManagementException(ProductManagementException.Msg.InvalidChildCategory, child.Id, this.Id); } }
public ProductGroup CreateChild() { ProductGroup child = new ProductGroup(); child.Parent = this; return child; }