示例#1
0
 //Search Entities
 public async Task <IEnumerable <AsycudaDocument> > SearchAsycudaDocument(List <string> lst, List <string> includeLst = null)
 {
     using (var ctx = new AsycudaDocumentService())
     {
         return(await ctx.GetAsycudaDocumentByExpressionLst(lst, includeLst).ConfigureAwait(false));
     }
 }
        //public static void Send2Excel(IEnumerable<SaleReportLine> slst)
        //{
        //    if (slst == null) return;
        //    var s = new ExportToExcel<SaleReportLine, List<SaleReportLine>>();
        //    s.dataToPrint = slst.ToList();
        //    s.GenerateReport();
        //}



        public async Task <IEnumerable <AsycudaDocument> > GetSalesDocuments(int docSetId)
        {
            List <int> doclst;

            using (var ctx = new DocumentDSContext())
            {
                doclst =
                    ctx.xcuda_ASYCUDA_ExtendedProperties.Where(x => x.AsycudaDocumentSetId == docSetId)
                    .Select(x => x.ASYCUDA_Id).ToList();
            }
            foreach (var d in doclst)
            {
                await AsycudaEntrySummaryListModel.ReorderDocumentItems(d).ConfigureAwait(false);
            }


            using (var ctx = new AsycudaDocumentService())
            {
                var lst =

                    (await
                     ctx.GetAsycudaDocumentsByExpression(
                         string.Format("AsycudaDocumentSetId == {0} && DoNotAllocate != true && (DocumentType.Contains(\"EX\") || DocumentType == \"IM4\")", docSetId),
                         null
                         ).ConfigureAwait(false));



                return(lst);
            }
        }
示例#3
0
 public async Task SaveAsycudaDocument(AsycudaDocument i)
 {
     if (i == null)
     {
         return;
     }
     using (var ctx = new AsycudaDocumentService())
     {
         await ctx.UpdateAsycudaDocument(i).ConfigureAwait(false);
     }
 }