Ejemplo n.º 1
0
        private void dependency_OnChange(object sender, RecordChangedEventArgs <Order> e)
        {
            switch (e.ChangeType)
            {
            case ChangeType.None:
                return;

            case ChangeType.Update:
                if (e.Entity.LoadId != null)
                {
                    OrderCentralHub.Delete(e.Entity.OrderId, DateTime.Now, false);
                }
                else
                {
                    OrderCentralHub.Update(e.Entity.OrderId, DateTime.Now, false);
                }
                break;

            case ChangeType.Delete:
                OrderCentralHub.Delete(e.Entity.OrderId, DateTime.Now, false);
                break;

            case ChangeType.Insert:
                OrderCentralHub.Add(e.Entity.OrderId, DateTime.Now, false);
                break;

            default:
                OrderCentralHub.RefreshRequest();
                break;
            }
        }
Ejemplo n.º 2
0
        private void dependency_OnChange(object sender, RecordChangedEventArgs <Load> e)
        {
            switch (e.ChangeType)
            {
            case ChangeType.None:
                return;

            case ChangeType.Update:
                OrderCentralHub.Update(e.Entity.LoadId, e.Entity.LoadDate, true);
                break;

            case ChangeType.Delete:
                OrderCentralHub.Delete(e.Entity.LoadId, e.Entity.LoadDate, true);
                break;

            case ChangeType.Insert:
                OrderCentralHub.Add(e.Entity.LoadId, e.Entity.LoadDate, true);
                break;

            default:
                OrderCentralHub.RefreshRequest();
                break;
            }
        }