public void MasterFiles(JToken master) { JToken accounts = master.SelectToken("GeneralLedgerAccounts.Account"); JToken customers = master.SelectToken("Customer"); JToken suppliers = master.SelectToken("Supplier"); JToken products = master.SelectToken("Product"); if (accounts != null) { string accountsJson = JsonConvert.SerializeObject(JsonConvert.DeserializeObject <List <SaftAccount> >(accounts.ToString())); MongoConnection.AddMany("Accounts" + year, accountsJson); } if (customers != null) { MongoConnection.AddMany("Customers", customers.ToString()); } if (suppliers != null) { MongoConnection.AddMany("Suppliers", suppliers.ToString()); } if (products != null) { MongoConnection.AddMany("Products", products.ToString()); } }
public void GeneralLedgerEntries(JToken ledgerEntries) { JToken journals = ledgerEntries.SelectToken("Journal"); JObject generalInfo = FillInfo(ledgerEntries); if (journals != null) { string journalsJson = JsonConvert.SerializeObject(JsonConvert.DeserializeObject <List <SaftJournal> >(journals.ToString())); MongoConnection.AddMany("Journals", journalsJson); } if (generalInfo != null) { MongoConnection.Add("LedgerEntriesInfo", generalInfo.ToString()); } }