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

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

                    if (res != null)
                    {
                        return(new EntryDataDetailsEx(res)
                        {
                            // InventoryItemsEx = (res.InventoryItemsEx != null?new InventoryItemsEx(res.InventoryItemsEx): null),
                            // EntryDataEx = (res.EntryDataEx != null?new EntryDataEx(res.EntryDataEx): null),
                            // AsycudaDocumentSets = new System.Collections.ObjectModel.ObservableCollection<AsycudaDocumentSetEntryDataDetail>(res.AsycudaDocumentSets.Select(y => new AsycudaDocumentSetEntryDataDetail(y)))
                        });
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
Example #3
0
        public async Task <EntryDataDetailsEx> GetEntryDataDetailsEx(string id, List <string> includesLst = null)
        {
            try
            {
                using (var t = new EntryDataDetailsExClient())
                {
                    var res = await t.GetEntryDataDetailsExByKey(id, includesLst).ConfigureAwait(continueOnCapturedContext: false);

                    if (res != null)
                    {
                        return(new EntryDataDetailsEx(res)
                        {
                            // InventoryItemsEx = (res.InventoryItemsEx != null?new InventoryItemsEx(res.InventoryItemsEx): null)
                        });
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }
 public async Task <bool> DeleteEntryDataDetailsEx(string id)
 {
     try
     {
         using (var t = new EntryDataDetailsExClient())
         {
             return(await t.DeleteEntryDataDetailsEx(id).ConfigureAwait(continueOnCapturedContext: false));
         }
     }
     catch (FaultException <ValidationFault> e)
     {
         throw new Exception(e.Detail.Message, e.InnerException);
     }
     catch (Exception)
     {
         Debugger.Break();
         throw;
     }
 }
 public async Task <EntryDataDetailsEx> CreateEntryDataDetailsEx(EntryDataDetailsEx entity)
 {
     try
     {
         using (var t = new EntryDataDetailsExClient())
         {
             return(new EntryDataDetailsEx(await t.CreateEntryDataDetailsEx(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 <EntryDataDetailsEx>, 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 <EntryDataDetailsEx>, int>(new List <EntryDataDetailsEx>().AsEnumerable(), overallCount));
            }

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

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

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