public override List <ITransactionEntity> Import() { StartSession(); IMsgSetRequest request = GetLatestMsgSetRequest(); IItemNonInventoryQuery query = request.AppendItemNonInventoryQueryRq(); query.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ActiveStatus.SetValue(ENActiveStatus.asAll); //IItemQuery query = request.AppendItemQueryRq(); IResponse res = GetResponse(request); //IORItemRetList returnList = res.Detail as IORItemRetList; IItemNonInventoryRetList returnList = res.Detail as IItemNonInventoryRetList; List <MaestroProduct> plist = new List <MaestroProduct>(); List <IItemNonInventoryRet> mapSourceList = new List <IItemNonInventoryRet>(); MaestroUnitType unknowUnitType = new UnitTypeManager(context).GetUnknownItem(); int cnt = returnList.Count; for (int i = 0; i <= cnt - 1; i++) { IItemNonInventoryRet inv = returnList.GetAt(i); if (inv != null) { string parentId = string.Empty; if (inv.ParentRef != null) { parentId = ReadQbId(inv.ParentRef.ListID); } if (string.IsNullOrEmpty(parentId)) { MaestroProduct product = GetMaestroProduct(inv); plist.Add(product); } mapSourceList.Add(inv);//for late processing /* * if (ReadBool(inv.IsActive)) * { * string parentId = string.Empty; * if (inv.ParentRef != null) * parentId = ReadQbId(inv.ParentRef.ListID); * * if (string.IsNullOrEmpty(parentId)) * { * MaestroProduct product = GetMaestroProduct(inv); * plist.Add(product); * } * * mapSourceList.Add(inv);//for late processing * } */ /* * else * { * string parentId = string.Empty; * if (inv.ParentRef != null) * parentId = ReadQbId(inv.ParentRef.ListID); * * if (string.IsNullOrEmpty(parentId)) * { * MaestroProduct product = GetMaestroProduct(inv); * //plist.Add(product); * * } * * * * * }*/ } #region commented //WalkItemNonInventoryRet(inv); //IORItemRet qbc = returnList.GetAt(i); /* * if (qbc.ItemNonInventoryRet != null) * { * WalkItemNonInventoryRet(qbc.ItemNonInventoryRet); * //GetMaestroProduct(qbc.ItemNonInventoryRet); * }*/ #endregion commented } ExecuteBulkInsert(plist); ImportMaps(mapSourceList, plist); QuickBooksProductMapCache.Instance.Reload(true); return(plist.Cast <ITransactionEntity>().ToList()); }