Exemplo n.º 1
0
        public async Task <IEnumerable <xcuda_Supplementary_unit> > Getxcuda_Supplementary_unitByTarification_Id(string Tarification_Id, List <string> includesLst = null)
        {
            if (Tarification_Id == "0")
            {
                return(null);
            }
            try
            {
                using (xcuda_Supplementary_unitClient t = new xcuda_Supplementary_unitClient())
                {
                    var res = await t.Getxcuda_Supplementary_unitByTarification_Id(Tarification_Id, includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(res.Select(x => new xcuda_Supplementary_unit(x)).AsEnumerable());
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Exemplo n.º 2
0
        public async Task <IEnumerable <xcuda_Supplementary_unit> > xcuda_Supplementary_unit(List <string> includesLst = null)
        {
            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime)
            {
                return(new List <xcuda_Supplementary_unit>().AsEnumerable());
            }
            try
            {
                using (var t = new xcuda_Supplementary_unitClient())
                {
                    var res = await t.Getxcuda_Supplementary_unit(includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(res.Select(x => new xcuda_Supplementary_unit(x)).AsEnumerable());
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Exemplo n.º 3
0
        public async Task <xcuda_Supplementary_unit> Getxcuda_Supplementary_unit(string id, List <string> includesLst = null)
        {
            try
            {
                using (var t = new xcuda_Supplementary_unitClient())
                {
                    var res = await t.Getxcuda_Supplementary_unitByKey(id, includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(new xcuda_Supplementary_unit(res)
                        {
                            // 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;
            }
        }
Exemplo n.º 4
0
 public async Task <decimal> SumNav(string whereExp, Dictionary <string, string> navExp, string sumExp)
 {
     try
     {
         using (var t = new xcuda_Supplementary_unitClient())
         {
             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;
     }
 }
Exemplo n.º 5
0
 public decimal SumField(string whereExp, string sumExp)
 {
     try
     {
         using (var t = new xcuda_Supplementary_unitClient())
         {
             return(t.SumField(whereExp, sumExp));
         }
     }
     catch (FaultException <ValidationFault> e)
     {
         throw new Exception(e.Detail.Message, e.InnerException);
     }
     catch (Exception)
     {
         Debugger.Break();
         throw;
     }
 }
Exemplo n.º 6
0
 public async Task <bool> Deletexcuda_Supplementary_unit(string id)
 {
     try
     {
         using (var t = new xcuda_Supplementary_unitClient())
         {
             return(await t.Deletexcuda_Supplementary_unit(id).ConfigureAwait(continueOnCapturedContext: false));
         }
     }
     catch (FaultException <ValidationFault> e)
     {
         throw new Exception(e.Detail.Message, e.InnerException);
     }
     catch (Exception)
     {
         Debugger.Break();
         throw;
     }
 }
Exemplo n.º 7
0
        //Virtural List Implementation

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

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

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

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