public async Task <IEnumerable <AsycudaSalesAllocationsEx> > GetAsycudaSalesAllocationsExBypASYCUDA_Id(string pASYCUDA_Id, List <string> includesLst = null)
        {
            if (pASYCUDA_Id == "0")
            {
                return(null);
            }
            try
            {
                using (AsycudaSalesAllocationsExClient t = new AsycudaSalesAllocationsExClient())
                {
                    var res = await t.GetAsycudaSalesAllocationsExBypASYCUDA_Id(pASYCUDA_Id, includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(res.Select(x => new AsycudaSalesAllocationsEx(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 <AsycudaSalesAllocationsEx> > AsycudaSalesAllocationsExs(List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime)
            {
                return(new List <AsycudaSalesAllocationsEx>().AsEnumerable());
            }
            try
            {
                using (var t = new AsycudaSalesAllocationsExClient())
                {
                    var res = await t.GetAsycudaSalesAllocationsExs(includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(res.Select(x => new AsycudaSalesAllocationsEx(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 <AsycudaSalesAllocationsEx> GetAsycudaSalesAllocationsEx(string id, List <string> includesLst = null)
        {
            try
            {
                using (var t = new AsycudaSalesAllocationsExClient())
                {
                    var res = await t.GetAsycudaSalesAllocationsExByKey(id, includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(new AsycudaSalesAllocationsEx(res));
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Example #4
0
 public IQueryable <AsycudaSalesAllocationsEx> AsycudaSalesAllocationsExByDates(DateTime startDate, DateTime endDate)
 {
     if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
     {
         return(new List <AsycudaSalesAllocationsEx>().AsQueryable());
     }
     using (var t = new AsycudaSalesAllocationsExClient())
     {
         var res = t.GetAsycudaSalesAllocationsExesByDates(startDate, endDate).Result;
         if (res != null)
         {
             return(res.Select(x => new AsycudaSalesAllocationsEx(x)).AsQueryable());
         }
         else
         {
             return(null);
         }
     }
 }
 public async Task <decimal> SumNav(string whereExp, Dictionary <string, string> navExp, string sumExp)
 {
     try
     {
         using (var t = new AsycudaSalesAllocationsExClient())
         {
             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 AsycudaSalesAllocationsExClient())
         {
             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> DeleteAsycudaSalesAllocationsEx(string id)
 {
     try
     {
         using (var t = new AsycudaSalesAllocationsExClient())
         {
             return(await t.DeleteAsycudaSalesAllocationsEx(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 <AsycudaSalesAllocationsEx>, 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 <AsycudaSalesAllocationsEx>, int>(new List <AsycudaSalesAllocationsEx>().AsEnumerable(), overallCount));
            }

            try
            {
                using (var t = new AsycudaSalesAllocationsExClient())
                {
                    IEnumerable <DTO.AsycudaSalesAllocationsEx> 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 <AsycudaSalesAllocationsEx>, int>(res.Select(x => new AsycudaSalesAllocationsEx(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 <AsycudaSalesAllocationsEx> > GetAsycudaSalesAllocationsExsByExpressionNav(string exp, Dictionary <string, string> navExp, List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None")
            {
                return(new List <AsycudaSalesAllocationsEx>().AsEnumerable());
            }
            try
            {
                using (var t = new AsycudaSalesAllocationsExClient())
                {
                    IEnumerable <DTO.AsycudaSalesAllocationsEx> res = null;
                    if (exp == "All" && navExp.Count == 0)
                    {
                        res = await t.GetAsycudaSalesAllocationsExs(includesLst).ConfigureAwait(continueOnCapturedContext: false);
                    }
                    else
                    {
                        res = await t.GetAsycudaSalesAllocationsExsByExpressionNav(exp, navExp, includesLst).ConfigureAwait(continueOnCapturedContext: false);
                    }

                    if (res != null)
                    {
                        return(res.Select(x => new AsycudaSalesAllocationsEx(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 <AsycudaSalesAllocationsEx> UpdateAsycudaSalesAllocationsEx(AsycudaSalesAllocationsEx entity)
        {
            if (entity == null)
            {
                return(entity);
            }
            var entitychanges = entity.ChangeTracker.GetChanges().FirstOrDefault();

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