static public MaterialCommoditiesList Process(JournalEntry je, MaterialCommoditiesList oldml, SQLiteConnectionUser conn, bool clearzeromaterials, bool clearzerocommodities) { MaterialCommoditiesList newmc = (oldml == null) ? new MaterialCommoditiesList() : oldml; if (je is IMaterialCommodityJournalEntry) { IMaterialCommodityJournalEntry e = je as IMaterialCommodityJournalEntry; newmc = newmc.Clone(clearzeromaterials, clearzerocommodities); // so we need a new one, makes a new list, but copies the items.. e.MaterialList(newmc, conn); // newmc.Dump(); // debug } return(newmc); }
static public MaterialCommoditiesList Process(JournalEntry je, MaterialCommoditiesList oldml) { MaterialCommoditiesList newmc = (oldml == null) ? new MaterialCommoditiesList() : oldml; if (je is ICommodityJournalEntry || je is IMaterialJournalEntry) // could be both { newmc = newmc.Clone(); // so we need a new one, makes a new list, but copies the items.. if (je is ICommodityJournalEntry) { ICommodityJournalEntry e = je as ICommodityJournalEntry; e.UpdateCommodities(newmc); } if (je is IMaterialJournalEntry) { IMaterialJournalEntry e = je as IMaterialJournalEntry; e.UpdateMaterials(newmc); } } return(newmc); }