public async Task <IEnumerable <AsycudaDocumentItem> > SearchAsycudaDocumentItem(List <string> lst, List <string> includeLst = null)
 {
     using (var ctx = new AsycudaDocumentItemService())
     {
         return(await ctx.GetAsycudaDocumentItemsByExpressionLst(lst, includeLst).ConfigureAwait(false));
     }
 }
Exemple #2
0
        private async Task <xcuda_Item> GetXcudaItems(dynamic itm)
        {
            try
            {
                using (var itmctx = new AsycudaDocumentItemService())
                {
                    var xitm =
                        await itmctx.GetAsycudaDocumentItemsByExpressionLst(new List <string>()
                    {
                        string.Format("ItemNumber == \"{0}\"", itm.Precision_4),
                        string.Format("AsycudaDocument.CNumber == \"{0}\"", itm.CNumber),
                        string.Format("AsycudaDocument.RegistrationDate == \"{0}\"",
                                      itm.RegistrationDate.ToShortDateString())
                    },
                                                                            new List <string>()
                    {
                        "SubItems"
                    }
                                                                            ).ConfigureAwait(false);

                    if (xitm.FirstOrDefault() != null)
                    {
                        using (var dctx = new xcuda_ItemService())
                        {
                            return
                                (await dctx.Getxcuda_ItemByKey(xitm.FirstOrDefault().Item_Id.ToString(), new List <string>() { "SubItems" }).ConfigureAwait(false));
                        }
                    }
                    return(null);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }