public async Task <IEnumerable <AsycudaDocumentItem> > AsycudaDocumentItems(List <string> includesLst = null) { if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime) { return(new List <AsycudaDocumentItem>().AsEnumerable()); } try { using (var t = new AsycudaDocumentItemClient()) { var res = await t.GetAsycudaDocumentItems(includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(res.Select(x => new AsycudaDocumentItem(x)).AsEnumerable()); } else { return(null); } } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task <AsycudaDocumentItem> GetAsycudaDocumentItem(string id, List <string> includesLst = null) { try { using (var t = new AsycudaDocumentItemClient()) { var res = await t.GetAsycudaDocumentItemByKey(id, includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(new AsycudaDocumentItem(res) { // AsycudaDocument = (res.AsycudaDocument != null?new AsycudaDocument(res.AsycudaDocument): null), // OverShortAllocationsEXes = new System.Collections.ObjectModel.ObservableCollection<OverShortAllocationsEX>(res.OverShortAllocationsEXes.Select(y => new OverShortAllocationsEX(y))) }); } else { return(null); } } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task <IEnumerable <AsycudaDocumentItem> > GetAsycudaDocumentItemByEntryDataDetailsId(string EntryDataDetailsId, List <string> includesLst = null) { if (EntryDataDetailsId == "0") { return(null); } try { using (AsycudaDocumentItemClient t = new AsycudaDocumentItemClient()) { var res = await t.GetAsycudaDocumentItemByEntryDataDetailsId(EntryDataDetailsId, includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(res.Select(x => new AsycudaDocumentItem(x)).AsEnumerable()); } else { return(null); } } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task SaveAsycudaDocumentItem(AsycudaDocumentItem asycudaDocumentItem) { using (var ctx = new AsycudaDocumentItemClient()) { await ctx.SaveAsycudaDocumentItem(asycudaDocumentItem.DTO).ConfigureAwait(false); } }
public async Task RemoveSelectedItems(List <AsycudaDocumentItem> lst) { using (var ctx = new AsycudaDocumentItemClient()) { await ctx.RemoveSelectedItems(lst.Select(x => x.Item_Id)).ConfigureAwait(false); } }
public async Task <AsycudaDocumentItem> GetAsycudaDocumentItem(string id, List <string> includesLst = null) { try { using (var t = new AsycudaDocumentItemClient()) { var res = await t.GetAsycudaDocumentItemByKey(id, includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(new AsycudaDocumentItem(res) { // AsycudaDocument = (res.AsycudaDocument != null?new AsycudaDocument(res.AsycudaDocument): null), // SubItems = new System.Collections.ObjectModel.ObservableCollection<SubItems>(res.SubItems.Select(y => new SubItems(y))), // PreviousItems = new System.Collections.ObjectModel.ObservableCollection<EntryPreviousItems>(res.PreviousItems.Select(y => new EntryPreviousItems(y))), // xcuda_Supplementary_unit = new System.Collections.ObjectModel.ObservableCollection<xcuda_Supplementary_unit>(res.xcuda_Supplementary_unit.Select(y => new xcuda_Supplementary_unit(y))) }); } else { return(null); } } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task <decimal> SumNav(string whereExp, Dictionary <string, string> navExp, string sumExp) { try { using (var t = new AsycudaDocumentItemClient()) { return(await t.SumNav(whereExp, navExp, sumExp).ConfigureAwait(false)); } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public decimal SumField(string whereExp, string sumExp) { try { using (var t = new AsycudaDocumentItemClient()) { return(t.SumField(whereExp, sumExp)); } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task <bool> DeleteAsycudaDocumentItem(string id) { try { using (var t = new AsycudaDocumentItemClient()) { return(await t.DeleteAsycudaDocumentItem(id).ConfigureAwait(continueOnCapturedContext: false)); } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
//Virtural List Implementation public async Task <Tuple <IEnumerable <AsycudaDocumentItem>, int> > LoadRange(int startIndex, int count, string exp, Dictionary <string, string> navExp, IEnumerable <string> includeLst = null) { var overallCount = 0; if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None") { return(new Tuple <IEnumerable <AsycudaDocumentItem>, int>(new List <AsycudaDocumentItem>().AsEnumerable(), overallCount)); } try { using (var t = new AsycudaDocumentItemClient()) { IEnumerable <DTO.AsycudaDocumentItem> res = null; res = await t.LoadRangeNav(startIndex, count, exp, navExp, includeLst).ConfigureAwait(continueOnCapturedContext: false); overallCount = await t.CountNav(exp, navExp).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(new Tuple <IEnumerable <AsycudaDocumentItem>, int>(res.Select(x => new AsycudaDocumentItem(x)).AsEnumerable(), overallCount)); } else { return(null); } } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task <IEnumerable <AsycudaDocumentItem> > GetAsycudaDocumentItemsByExpressionNav(string exp, Dictionary <string, string> navExp, List <string> includesLst = null) { if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None") { return(new List <AsycudaDocumentItem>().AsEnumerable()); } try { using (var t = new AsycudaDocumentItemClient()) { IEnumerable <DTO.AsycudaDocumentItem> res = null; if (exp == "All" && navExp.Count == 0) { res = await t.GetAsycudaDocumentItems(includesLst).ConfigureAwait(continueOnCapturedContext: false); } else { res = await t.GetAsycudaDocumentItemsByExpressionNav(exp, navExp, includesLst).ConfigureAwait(continueOnCapturedContext: false); } if (res != null) { return(res.Select(x => new AsycudaDocumentItem(x)).AsEnumerable()); } else { return(null); } } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task <AsycudaDocumentItem> UpdateAsycudaDocumentItem(AsycudaDocumentItem entity) { if (entity == null) { return(entity); } var entitychanges = entity.ChangeTracker.GetChanges().FirstOrDefault(); if (entitychanges != null) { try { using (var t = new AsycudaDocumentItemClient()) { var updatedEntity = await t.UpdateAsycudaDocumentItem(entitychanges).ConfigureAwait(false); entity.EntityId = updatedEntity.EntityId; entity.DTO.AcceptChanges(); //var = entity.; //entity.ChangeTracker.MergeChanges(,updatedEntity); //entity. = ; return(entity); } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } } else { return(entity); } }