示例#1
0
        public void SourceDocuments(JToken documents)
        {
            JToken  salesInvoices = documents.SelectToken("SalesInvoices");
            JObject invoicesInfo  = FillInfo(salesInvoices);
            JToken  invoices      = salesInvoices.SelectToken("Invoice");


            JToken  movementOfGoods = documents.SelectToken("MovementOfGoods");
            JObject goodsInfo       = new JObject();

            AddObj(ref goodsInfo, movementOfGoods, "NumberOfMovementLines");
            AddObj(ref goodsInfo, movementOfGoods, "TotalQuantityIssued");
            JToken stockMovements = movementOfGoods.SelectToken("StockMovement");



            if (invoices != null)
            {
                string invoicesJson = JsonConvert.SerializeObject(JsonConvert.DeserializeObject <List <SaftInvoice> >(invoices.ToString()));
                MongoConnection.AddMany("Invoices", invoicesJson);
            }
            if (invoicesInfo != null)
            {
                MongoConnection.Add("InvoicesInfo", invoicesInfo.ToString());
            }



            if (goodsInfo != null)
            {
                MongoConnection.Add("GoodsInfo", goodsInfo.ToString());
            }
        }
示例#2
0
        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());
            }
        }
示例#3
0
 public void Header(JToken header)
 {
     MongoConnection.Add("Header", header.ToString());
 }