public async Task <EmptyFullCode> GetEmptyFullCode(string id, List <string> includesLst = null) { try { using (var t = new EmptyFullCodeClient()) { var res = await t.GetEmptyFullCodeByKey(id, includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(new EmptyFullCode(res)); } else { return(null); } } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task <IEnumerable <EmptyFullCode> > EmptyFullCodes(List <string> includesLst = null) { if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime) { return(new List <EmptyFullCode>().AsEnumerable()); } try { using (var t = new EmptyFullCodeClient()) { var res = await t.GetEmptyFullCodes(includesLst).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(res.Select(x => new EmptyFullCode(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 EmptyFullCodeClient()) { 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 EmptyFullCodeClient()) { 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> DeleteEmptyFullCode(string id) { try { using (var t = new EmptyFullCodeClient()) { return(await t.DeleteEmptyFullCode(id).ConfigureAwait(continueOnCapturedContext: false)); } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }
public async Task <EmptyFullCode> CreateEmptyFullCode(EmptyFullCode entity) { try { using (var t = new EmptyFullCodeClient()) { return(new EmptyFullCode(await t.CreateEmptyFullCode(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 <EmptyFullCode>, 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 <EmptyFullCode>, int>(new List <EmptyFullCode>().AsEnumerable(), overallCount)); } try { using (var t = new EmptyFullCodeClient()) { IEnumerable <DTO.EmptyFullCode> 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 <EmptyFullCode>, int>(res.Select(x => new EmptyFullCode(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 <EmptyFullCode> > GetEmptyFullCodesByExpressionNav(string exp, Dictionary <string, string> navExp, List <string> includesLst = null) { if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None") { return(new List <EmptyFullCode>().AsEnumerable()); } try { using (var t = new EmptyFullCodeClient()) { IEnumerable <DTO.EmptyFullCode> res = null; if (exp == "All" && navExp.Count == 0) { res = await t.GetEmptyFullCodes(includesLst).ConfigureAwait(continueOnCapturedContext: false); } else { res = await t.GetEmptyFullCodesByExpressionNav(exp, navExp, includesLst).ConfigureAwait(continueOnCapturedContext: false); } if (res != null) { return(res.Select(x => new EmptyFullCode(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 <EmptyFullCode> UpdateEmptyFullCode(EmptyFullCode entity) { if (entity == null) { return(entity); } var entitychanges = entity.ChangeTracker.GetChanges().FirstOrDefault(); if (entitychanges != null) { try { using (var t = new EmptyFullCodeClient()) { var updatedEntity = await t.UpdateEmptyFullCode(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); } }