public async Task <IEnumerable <AsycudaDocumentSet> > SearchAsycudaDocumentSet(List <string> lst, List <string> includeLst = null) { using (var ctx = new AsycudaDocumentSetService()) { return(await ctx.GetAsycudaDocumentSetsByExpressionLst(lst, includeLst).ConfigureAwait(false)); } }
public async Task SaveAsycudaDocument(AsycudaDocumentSet docSet, DocInfo docInfo) { if (docSet != null) { if (docSet.Declarant_Reference_Number == "Search Results") { return; // SaveSearchResults(); } UpdateDocSet(docSet, docInfo); foreach (var cdoc in docSet.Documents.Where(x => x.xcuda_ASYCUDA_ExtendedProperties.AutoUpdate == true)) { cdoc.SetupProperties(); BaseDataModel.Instance.IntCdoc(cdoc, docSet.Document_Type, docSet); } } else { //Create New AsycudaDocumentset docSet = await CreateNewAsycudaDocumentSet().ConfigureAwait(false); } using (var ctx = new AsycudaDocumentSetService()) { await ctx.UpdateAsycudaDocumentSet(docSet).ConfigureAwait(false); } }
public async Task DeleteDocumentSet(int docSetId) { using (var ctx = new AsycudaDocumentSetService()) { await ctx.DeleteAsycudaDocumentSet(docSetId.ToString()).ConfigureAwait(false); } }
public async Task SaveAsycudaDocumentSet(AsycudaDocumentSet i) { if (i == null) { return; } using (var ctx = new AsycudaDocumentSetService()) { await ctx.UpdateAsycudaDocumentSet(i).ConfigureAwait(false); } }
public async Task SaveAsycudaDocumentSet(AsycudaDocumentSet i) { if (i == null) { return; } using (var ctx = new AsycudaDocumentSetService()) { await ctx.UpdateAsycudaDocumentSet(i).ConfigureAwait(false); } await DataSpace.BaseDataModel.Instance.CalculateDocumentSetFreight(i.AsycudaDocumentSetId).ConfigureAwait(false); }
//private void SaveSearchResults() //{ // //foreach (var item in AsycudaDocumentSummaryListModel._asycudaDocuments.ToList()) // //{ // // Document_Type doc = db.Document_Type.FirstOrDefault(); // // doc.LoadAllChild(); // // Document_Type ndoc = Common.EntityClone<Document_Type>(doc); // // DetachAll(doc, true); // // //Clear Entity Values of New Object // // ndoc.ClearEntityReference(true); // // //detach the Load empbasic from Context // // ndoc.AsycudaDocumentSet.Clear(); // // //Add new Clone Object and save it DB // // db.Document_Type.AddObject(ndoc); // // //xcuda_ASYCUDA doc = db.xcuda_ASYCUDA.Where(x => x.ASYCUDA_Id == item.ASYCUDA_Id).FirstOrDefault(); // // //doc.LoadAllChild(); // // //xcuda_ASYCUDA ndoc = Common.EntityClone<xcuda_ASYCUDA>(doc); // // //DetachAll(doc,true); // // ////Clear Entity Values of New Object // // //ndoc.ClearEntityReference(true); // // ////detach the Load empbasic from Context // // ////Add new Clone Object and save it DB // // //db.xcuda_ASYCUDA.AddObject(ndoc); // // //ndoc.xcuda_ASYCUDA_ExtendedProperties.AsycudaDocumentSet = BaseDataModel.Instance.CurrentAsycudaDocumentSet; // // SaveDatabase(); // //} //} //private AsycudaDocumentSet CreateNewAsycudaDocumentSet() //{ // return CreateNewAsycudaDocumentSet(db); //} async Task <AsycudaDocumentSet> CreateNewAsycudaDocumentSet() { using (var ctx = new AsycudaDocumentSetService()) { //var dset = (await ctx.AsycudaDocumentSets().ConfigureAwait(false)).FirstOrDefault(ads => ads.Declarant_Reference_Number == docInfo.DeclarantReferenceNumber); //if (dset == null) //{ var dset = new AsycudaDocumentSet() { TrackingState = TrackingState.Added }; // dset = await ctx.CreateAsycudaDocumentSet(dset).ConfigureAwait(false); // UpdateDocSet(dset); await ctx.UpdateAsycudaDocumentSet(dset).ConfigureAwait(false); //} return(dset); } }