public async Task <IEnumerable <OverShortDetail> > OverShortDetails(List <string> includesLst = null) { if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime) { return(new List <OverShortDetail>().AsEnumerable()); } try { using (var t = new OverShortDetailClient()) { var res = await t.GetOverShortDetails(includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(res.Select(x => new OverShortDetail(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 <OverShortDetail> GetOverShortDetail(string id, List <string> includesLst = null) { try { using (var t = new OverShortDetailClient()) { var res = await t.GetOverShortDetailByKey(id, includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(new OverShortDetail(res) { // OverShortDetailAllocations = new System.Collections.ObjectModel.ObservableCollection<OverShortDetailAllocation>(res.OverShortDetailAllocations.Select(y => new OverShortDetailAllocation(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 <OverShortDetail> > GetOverShortDetailByOversShortsId(string OversShortsId, List <string> includesLst = null) { if (OversShortsId == "0") { return(null); } try { using (OverShortDetailClient t = new OverShortDetailClient()) { var res = await t.GetOverShortDetailByOversShortsId(OversShortsId, includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(res.Select(x => new OverShortDetail(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 <decimal> SumNav(string whereExp, Dictionary <string, string> navExp, string sumExp) { try { using (var t = new OverShortDetailClient()) { 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 OverShortDetailClient()) { 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> DeleteOverShortDetail(string id) { try { using (var t = new OverShortDetailClient()) { return(await t.DeleteOverShortDetail(id).ConfigureAwait(continueOnCapturedContext: false)); } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task <OverShortDetail> CreateOverShortDetail(OverShortDetail entity) { try { using (var t = new OverShortDetailClient()) { return(new OverShortDetail(await t.CreateOverShortDetail(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 <OverShortDetail>, 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 <OverShortDetail>, int>(new List <OverShortDetail>().AsEnumerable(), overallCount)); } try { using (var t = new OverShortDetailClient()) { IEnumerable <DTO.OverShortDetail> 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 <OverShortDetail>, int>(res.Select(x => new OverShortDetail(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 <OverShortDetail> > GetOverShortDetailsByExpressionNav(string exp, Dictionary <string, string> navExp, List <string> includesLst = null) { if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None") { return(new List <OverShortDetail>().AsEnumerable()); } try { using (var t = new OverShortDetailClient()) { IEnumerable <DTO.OverShortDetail> res = null; if (exp == "All" && navExp.Count == 0) { res = await t.GetOverShortDetails(includesLst).ConfigureAwait(continueOnCapturedContext: false); } else { res = await t.GetOverShortDetailsByExpressionNav(exp, navExp, includesLst).ConfigureAwait(continueOnCapturedContext: false); } if (res != null) { return(res.Select(x => new OverShortDetail(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 <OverShortDetail> UpdateOverShortDetail(OverShortDetail entity) { if (entity == null) { return(entity); } var entitychanges = entity.ChangeTracker.GetChanges().FirstOrDefault(); if (entitychanges != null) { try { using (var t = new OverShortDetailClient()) { var updatedEntity = await t.UpdateOverShortDetail(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); } }