Esempio n. 1
0
        public async Task <IEnumerable <AsycudaDocumentSetEx> > AsycudaDocumentSetExs(List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime)
            {
                return(new List <AsycudaDocumentSetEx>().AsEnumerable());
            }
            try
            {
                using (var t = new AsycudaDocumentSetExClient())
                {
                    var res = await t.GetAsycudaDocumentSetExs(includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(res.Select(x => new AsycudaDocumentSetEx(x)).AsEnumerable());
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Esempio n. 2
0
        public IEnumerable <AsycudaDocumentSetEx> GetAsycudaDocumentSetExsByExpression(string exp, Dictionary <string, string> navExp)
        {
            if (LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None")
            {
                return(new List <AsycudaDocumentSetEx>().AsEnumerable());
            }
            using (var t = new AsycudaDocumentSetExClient())
            {
                IEnumerable <DTO.AsycudaDocumentSetEx> res = null;
                if (exp == "All" && navExp.Count == 0)
                {
                    res = t.GetAsycudaDocumentSetExs().Result;
                }
                else
                {
                    res = t.GetAsycudaDocumentSetExsByExpressionNav(exp, navExp).Result;
                }

                if (res != null)
                {
                    return(res.Select(x => new AsycudaDocumentSetEx(x)).AsEnumerable());
                }
                else
                {
                    return(null);
                }
            }
        }
Esempio n. 3
0
        public async Task <AsycudaDocumentSetEx> GetAsycudaDocumentSetEx(string id, List <string> includesLst = null)
        {
            try
            {
                using (var t = new AsycudaDocumentSetExClient())
                {
                    var res = await t.GetAsycudaDocumentSetExByKey(id, includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(new AsycudaDocumentSetEx(res)
                        {
                            // AsycudaDocuments = new System.Collections.ObjectModel.ObservableCollection<AsycudaDocument>(res.AsycudaDocuments.Select(y => new AsycudaDocument(y))),
                            // LicenceSummary = new System.Collections.ObjectModel.ObservableCollection<LicenceSummary>(res.LicenceSummary.Select(y => new LicenceSummary(y)))
                        });
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Esempio n. 4
0
        public async Task <IEnumerable <AsycudaDocumentSetEx> > GetAsycudaDocumentSetExByDocument_TypeId(string Document_TypeId, List <string> includesLst = null)
        {
            if (Document_TypeId == "0")
            {
                return(null);
            }
            try
            {
                using (AsycudaDocumentSetExClient t = new AsycudaDocumentSetExClient())
                {
                    var res = await t.GetAsycudaDocumentSetExByDocument_TypeId(Document_TypeId, includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(res.Select(x => new AsycudaDocumentSetEx(x)).AsEnumerable());
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Esempio n. 5
0
 public async Task <decimal> SumNav(string whereExp, Dictionary <string, string> navExp, string sumExp)
 {
     try
     {
         using (var t = new AsycudaDocumentSetExClient())
         {
             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;
     }
 }
Esempio n. 6
0
 public decimal SumField(string whereExp, string sumExp)
 {
     try
     {
         using (var t = new AsycudaDocumentSetExClient())
         {
             return(t.SumField(whereExp, sumExp));
         }
     }
     catch (FaultException <ValidationFault> e)
     {
         throw new Exception(e.Detail.Message, e.InnerException);
     }
     catch (Exception)
     {
         Debugger.Break();
         throw;
     }
 }
Esempio n. 7
0
 public async Task <bool> DeleteAsycudaDocumentSetEx(string id)
 {
     try
     {
         using (var t = new AsycudaDocumentSetExClient())
         {
             return(await t.DeleteAsycudaDocumentSetEx(id).ConfigureAwait(continueOnCapturedContext: false));
         }
     }
     catch (FaultException <ValidationFault> e)
     {
         throw new Exception(e.Detail.Message, e.InnerException);
     }
     catch (Exception)
     {
         Debugger.Break();
         throw;
     }
 }
Esempio n. 8
0
 public async Task <AsycudaDocumentSetEx> CreateAsycudaDocumentSetEx(AsycudaDocumentSetEx entity)
 {
     try
     {
         using (var t = new AsycudaDocumentSetExClient())
         {
             return(new AsycudaDocumentSetEx(await t.CreateAsycudaDocumentSetEx(entity.DTO).ConfigureAwait(continueOnCapturedContext: false)));
         }
     }
     catch (FaultException <ValidationFault> e)
     {
         throw new Exception(e.Detail.Message, e.InnerException);
     }
     catch (Exception)
     {
         Debugger.Break();
         throw;
     }
 }
Esempio n. 9
0
        //Virtural List Implementation

        public async Task <Tuple <IEnumerable <AsycudaDocumentSetEx>, 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 <AsycudaDocumentSetEx>, int>(new List <AsycudaDocumentSetEx>().AsEnumerable(), overallCount));
            }

            try
            {
                using (var t = new AsycudaDocumentSetExClient())
                {
                    IEnumerable <DTO.AsycudaDocumentSetEx> 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 <AsycudaDocumentSetEx>, int>(res.Select(x => new AsycudaDocumentSetEx(x)).AsEnumerable(), overallCount));
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Esempio n. 10
0
        public async Task <IEnumerable <AsycudaDocumentSetEx> > GetAsycudaDocumentSetExsByExpressionNav(string exp, Dictionary <string, string> navExp, List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None")
            {
                return(new List <AsycudaDocumentSetEx>().AsEnumerable());
            }
            try
            {
                using (var t = new AsycudaDocumentSetExClient())
                {
                    IEnumerable <DTO.AsycudaDocumentSetEx> res = null;
                    if (exp == "All" && navExp.Count == 0)
                    {
                        res = await t.GetAsycudaDocumentSetExs(includesLst).ConfigureAwait(continueOnCapturedContext: false);
                    }
                    else
                    {
                        res = await t.GetAsycudaDocumentSetExsByExpressionNav(exp, navExp, includesLst).ConfigureAwait(continueOnCapturedContext: false);
                    }

                    if (res != null)
                    {
                        return(res.Select(x => new AsycudaDocumentSetEx(x)).AsEnumerable());
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Esempio n. 11
0
        public async Task <AsycudaDocumentSetEx> UpdateAsycudaDocumentSetEx(AsycudaDocumentSetEx entity)
        {
            if (entity == null)
            {
                return(entity);
            }
            var entitychanges = entity.ChangeTracker.GetChanges().FirstOrDefault();

            if (entitychanges != null)
            {
                try
                {
                    using (var t = new AsycudaDocumentSetExClient())
                    {
                        var updatedEntity = await t.UpdateAsycudaDocumentSetEx(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);
            }
        }