public async Task <IEnumerable <ContainerEx> > GetContainerExByEntryDataId(string EntryDataId, List <string> includesLst = null) { if (EntryDataId == "0") { return(null); } try { using (ContainerExClient t = new ContainerExClient()) { var res = await t.GetContainerExByEntryDataId(EntryDataId, includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(res.Select(x => new ContainerEx(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 <IEnumerable <ContainerEx> > ContainerExes(List <string> includesLst = null) { if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime) { return(new List <ContainerEx>().AsEnumerable()); } try { using (var t = new ContainerExClient()) { var res = await t.GetContainerExes(includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(res.Select(x => new ContainerEx(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 <ContainerEx> GetContainerEx(string id, List <string> includesLst = null) { try { using (var t = new ContainerExClient()) { var res = await t.GetContainerExByKey(id, includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(new ContainerEx(res) { // ContainerEntryDatas = new System.Collections.ObjectModel.ObservableCollection<ContainerEntryData>(res.ContainerEntryDatas.Select(y => new ContainerEntryData(y))) }); } else { return(null); } } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task SaveContainer(ContainerEx container) { using (var ctx = new ContainerExClient()) { await ctx.SaveContainer(container.DTO).ConfigureAwait(false); } }
public async Task <decimal> SumNav(string whereExp, Dictionary <string, string> navExp, string sumExp) { try { using (var t = new ContainerExClient()) { 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 ContainerExClient()) { 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> DeleteContainerEx(string id) { try { using (var t = new ContainerExClient()) { return(await t.DeleteContainerEx(id).ConfigureAwait(continueOnCapturedContext: false)); } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task <ContainerEx> CreateContainerEx(ContainerEx entity) { try { using (var t = new ContainerExClient()) { return(new ContainerEx(await t.CreateContainerEx(entity.DTO).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 <ContainerEx>, 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 <ContainerEx>, int>(new List <ContainerEx>().AsEnumerable(), overallCount)); } try { using (var t = new ContainerExClient()) { IEnumerable <DTO.ContainerEx> 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 <ContainerEx>, int>(res.Select(x => new ContainerEx(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 <ContainerEx> > GetContainerExesByExpressionNav(string exp, Dictionary <string, string> navExp, List <string> includesLst = null) { if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None") { return(new List <ContainerEx>().AsEnumerable()); } try { using (var t = new ContainerExClient()) { IEnumerable <DTO.ContainerEx> res = null; if (exp == "All" && navExp.Count == 0) { res = await t.GetContainerExes(includesLst).ConfigureAwait(continueOnCapturedContext: false); } else { res = await t.GetContainerExesByExpressionNav(exp, navExp, includesLst).ConfigureAwait(continueOnCapturedContext: false); } if (res != null) { return(res.Select(x => new ContainerEx(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 <ContainerEx> UpdateContainerEx(ContainerEx entity) { if (entity == null) { return(entity); } var entitychanges = entity.ChangeTracker.GetChanges().FirstOrDefault(); if (entitychanges != null) { try { using (var t = new ContainerExClient()) { var updatedEntity = await t.UpdateContainerEx(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); } }