private void OnCurrentTariffCategoryChanged(object sender, NotificationEventArgs<TariffCategory> e)
 {
     if (e.Data != null)
     {
         vloader.FilterExpression = string.Format(@"TariffCodes.TariffCategoryCode == ""{0}""", e.Data.TariffCategoryCode);
         InventoryItemsEx.Refresh();
         NotifyPropertyChanged(x => InventoryItemsEx);
     }
 }
 internal async Task SaveInventoryItem(InventoryItemsEx inv)
 {
     if (inv == null) return;
     StatusModel.Timer("Saving Inventory Item");
     if (inv.TariffCode == "") inv.TariffCode = null;
     await InventoryItemsExRepository.Instance.SaveInventoryItemsEx(inv).ConfigureAwait(false);
     StatusModel.StopStatusUpdate();
     MessageBox.Show("Complete");
 }
Ejemplo n.º 3
0
 public async Task <InventoryItemsEx> CreateInventoryItemsEx(InventoryItemsEx entity)
 {
     try
     {
         using (var t = new InventoryItemsExClient())
         {
             return(new InventoryItemsEx(await t.CreateInventoryItemsEx(entity.DTO).ConfigureAwait(continueOnCapturedContext: false)));
         }
     }
     catch (FaultException <ValidationFault> e)
     {
         throw new Exception(e.Detail.Message, e.InnerException);
     }
     catch (Exception)
     {
         Debugger.Break();
         throw;
     }
 }
Ejemplo n.º 4
0
        public async Task <InventoryItemsEx> UpdateInventoryItemsEx(InventoryItemsEx entity)
        {
            if (entity == null)
            {
                return(entity);
            }
            var entitychanges = entity.ChangeTracker.GetChanges().FirstOrDefault();

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