Exemple #1
0
        public async Task <IEnumerable <OverShortAllocationsEX> > OverShortAllocationsEXes(List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime)
            {
                return(new List <OverShortAllocationsEX>().AsEnumerable());
            }
            try
            {
                using (var t = new OverShortAllocationsEXClient())
                {
                    var res = await t.GetOverShortAllocationsEXes(includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(res.Select(x => new OverShortAllocationsEX(x)).AsEnumerable());
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Exemple #2
0
        public async Task <OverShortAllocationsEX> GetOverShortAllocationsEX(string id, List <string> includesLst = null)
        {
            try
            {
                using (var t = new OverShortAllocationsEXClient())
                {
                    var res = await t.GetOverShortAllocationsEXByKey(id, includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(new OverShortAllocationsEX(res)
                        {
                            // OverShortDetailAllocation = (res.OverShortDetailAllocation != null?new OverShortDetailAllocation(res.OverShortDetailAllocation): null),
                            // OverShortDetailsEX = (res.OverShortDetailsEX != null?new OverShortDetailsEX(res.OverShortDetailsEX): null),
                            // AsycudaDocumentItem = (res.AsycudaDocumentItem != null?new AsycudaDocumentItem(res.AsycudaDocumentItem): null)
                        });
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Exemple #3
0
        public async Task <IEnumerable <OverShortAllocationsEX> > GetOverShortAllocationsEXByItem_Id(string Item_Id, List <string> includesLst = null)
        {
            if (Item_Id == "0")
            {
                return(null);
            }
            try
            {
                using (OverShortAllocationsEXClient t = new OverShortAllocationsEXClient())
                {
                    var res = await t.GetOverShortAllocationsEXByItem_Id(Item_Id, includesLst).ConfigureAwait(continueOnCapturedContext: false);

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

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

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

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

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