Beispiel #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (window_ != null)
            {
                hash ^= Window.GetHashCode();
            }
            if (Deleted != false)
            {
                hash ^= Deleted.GetHashCode();
            }
            if (asset_ != null)
            {
                hash ^= Asset.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Beispiel #2
0
 public IList <KeyValuePair <string, string> > GetValues()
 {
     return(new List <KeyValuePair <string, string> >()
     {
         new KeyValuePair <string, string>("PickList No", PickListNo),
         new KeyValuePair <string, string>("Carton No", CartonNo.ToString()),
         new KeyValuePair <string, string>("Bar Code", Barcode),
         new KeyValuePair <string, string>("Location Code", LocationCode),
         new KeyValuePair <string, string>("WareHouse Code", WareHouseCode),
         new KeyValuePair <string, string>("Last SentDevice Id", LastSentDeviceId),
         new KeyValuePair <string, string>("Assigned User", AssignedUser),
         new KeyValuePair <string, string>("Request No", RequestNo),
         new KeyValuePair <string, string>("Picked User", PickedUser),
         new KeyValuePair <string, string>("IsPicked", IsPicked.ToString()),
         new KeyValuePair <string, string>("Pick Date", PickDate.ToString()),
         new KeyValuePair <string, string>("Deleted", Deleted.ToString()),
         new KeyValuePair <string, string>("Created User", CreatedUser),
         new KeyValuePair <string, string>("Created Date", CreatedDate),
         new KeyValuePair <string, string>("Lu User", LuUser.ToString()),
         new KeyValuePair <string, string>("Lu Date", LuDate)
     });
 }
Beispiel #3
0
        /// <summary>
        /// Deletes a collection of <see cref="IWarehouseCatalog"/>
        /// </summary>
        /// <param name="warehouseCatalogs">
        /// The warehouse catalogs.
        /// </param>
        /// <param name="raiseEvents">
        /// The raise events.
        /// </param>
        public void Delete(IEnumerable <IWarehouseCatalog> warehouseCatalogs, bool raiseEvents = true)
        {
            var catalogs = warehouseCatalogs.Where(x => x.Key != Core.Constants.Warehouse.DefaultWarehouseCatalogKey).ToArray();

            if (!catalogs.Any())
            {
                return;
            }

            if (raiseEvents)
            {
                Deleting.RaiseEvent(new DeleteEventArgs <IWarehouseCatalog>(catalogs), this);
            }

            foreach (var catalog in catalogs)
            {
                RemoveVariantsFromCatalogInventoryBeforeDeleting(catalog);
            }

            using (new WriteLock(Locker))
            {
                var uow = UowProvider.GetUnitOfWork();
                using (var repository = RepositoryFactory.CreateWarehouseCatalogRepository(uow))
                {
                    foreach (var catalog in catalogs)
                    {
                        repository.Delete(catalog);
                    }

                    uow.Commit();
                }
            }

            if (raiseEvents)
            {
                Deleted.RaiseEvent(new DeleteEventArgs <IWarehouseCatalog>(catalogs), this);
            }
        }
Beispiel #4
0
        /// <summary>
        /// Deletes a single <see cref="ICustomerAddress"/>
        /// </summary>
        /// <param name="address">
        /// The address.
        /// </param>
        /// <param name="raiseEvents">
        /// The raise events.
        /// </param>
        public void Delete(ICustomerAddress address, bool raiseEvents = true)
        {
            if (raiseEvents)
            {
                Deleting.RaiseEvent(new DeleteEventArgs <ICustomerAddress>(address), this);
            }

            using (new WriteLock(Locker))
            {
                var uow = _uowProvider.GetUnitOfWork();
                using (var repository = _repositoryFactory.CreateCustomerAddressRepository(uow))
                {
                    repository.Delete(address);
                    uow.Commit();
                }
            }

            if (raiseEvents)
            {
                Deleted.RaiseEvent(new DeleteEventArgs <ICustomerAddress>(address), this);
            }

            // If we deleted the default address and there are other addresses of this type - pick one
            if (!address.IsDefault)
            {
                return;
            }

            var newDefault = GetByCustomerKey(address.CustomerKey, address.AddressType).FirstOrDefault();

            if (newDefault == null)
            {
                return;
            }

            newDefault.IsDefault = true;
            Save(newDefault);
        }
Beispiel #5
0
 /// <summary>
 /// Gets called when the model element gets deleted
 /// </summary>
 /// <param name="e">The event data</param>
 protected virtual void OnDeleted(UriChangedEventArgs e)
 {
     foreach (var child in Children.Reverse())
     {
         var childME = child as ModelElement;
         if (childME != null)
         {
             Uri oldChildUri = null;
             if (e.OldUri != null)
             {
                 var uriBuilder = new UriBuilder(e.OldUri);
                 uriBuilder.Fragment = uriBuilder.Fragment.Substring(1) + '/' + childME.CreateUriWithFragment(null, false, this).OriginalString;
                 oldChildUri         = uriBuilder.Uri;
             }
             var args = new UriChangedEventArgs(oldChildUri);
             childME.OnDeleting(args);
             childME.OnDeleted(args);
         }
     }
     Deleted?.Invoke(this, e);
     OnBubbledChange(BubbledChangeEventArgs.ElementDeleted(this, e));
     UnsetFlag(ModelElementFlag.Deleting);
 }
        /// <summary>
        /// Deletes a <see cref="INote"/>
        /// </summary>
        /// <param name="note">
        /// The <see cref="INote"/> to be deleted
        /// </param>
        /// <param name="raiseEvents">
        /// Optional boolean indicating whether or not to raise events
        /// </param>
        public void Delete(INote note, bool raiseEvents = true)
        {
            if (raiseEvents)
            {
                if (Deleting.IsRaisedEventCancelled(new DeleteEventArgs <INote>(note), this))
                {
                    ((Note)note).WasCancelled = true;
                    return;
                }
            }

            using (new WriteLock(Locker))
            {
                var uow = UowProvider.GetUnitOfWork();
                using (var repository = RepositoryFactory.CreateNoteRepository(uow))
                {
                    repository.Delete(note);
                    uow.Commit();
                }
            }

            Deleted.RaiseEvent(new DeleteEventArgs <INote>(note), this);
        }
Beispiel #7
0
        private async void DeleteButton_Clicked(object sender, EventArgs e)
        {
            var btn            = sender as IconButton;
            var deleteItemArgs = new DeleteItemEventArgs()
            {
                Id   = btn.Tag as String,
                Type = Field.Name.ToPropertyName()
            };

            var obj = ChildItems as Object;

            if (obj is System.Collections.IList)
            {
                if (await SLWIOC.Get <LagoVista.Core.PlatformSupport.IPopupServices>().ConfirmAsync(XPlatResources.Msg_ConfirmDeleteItemTitle, XPlatResources.Msg_ConfirmDeleteItem))
                {
                    var childList       = ChildItems as System.Collections.IList;
                    var itemToBeDeleted = ChildItems.Where(itm => itm.ToEntityHeader().Id == btn.Tag as string).FirstOrDefault();
                    childList.Remove(itemToBeDeleted);
                    Deleted?.Invoke(sender, deleteItemArgs);
                    Refresh();
                }
            }
        }
Beispiel #8
0
        /// <summary>
        /// Deletes a collection of <see cref="IAnonymousCustomer"/>
        /// </summary>
        /// <param name="anonymouses">
        /// The anonymous customers to be deleted
        /// </param>
        public void Delete(IEnumerable <IAnonymousCustomer> anonymouses)
        {
            var anonymousArray = anonymouses as IAnonymousCustomer[] ?? anonymouses.ToArray();

            Deleting.RaiseEvent(new DeleteEventArgs <IAnonymousCustomer>(anonymousArray), this);

            using (new WriteLock(Locker))
            {
                var uow = UowProvider.GetUnitOfWork();

                using (var repository = RepositoryFactory.CreateAnonymousCustomerRepository(uow))
                {
                    foreach (var anonymous in anonymousArray)
                    {
                        repository.Delete(anonymous);
                    }

                    uow.Commit();
                }
            }

            Deleted.RaiseEvent(new DeleteEventArgs <IAnonymousCustomer>(anonymousArray), this);
        }
Beispiel #9
0
        /// <summary>
        /// Deletes a <see cref="IAuditLog"/>
        /// </summary>
        /// <param name="auditLog">
        /// The <see cref="IAuditLog"/> to be deleted
        /// </param>
        /// <param name="raiseEvents">
        /// Optional boolean indicating whether or not to raise events
        /// </param>
        public void Delete(IAuditLog auditLog, bool raiseEvents = true)
        {
            if (raiseEvents)
            {
                if (Deleting.IsRaisedEventCancelled(new DeleteEventArgs <IAuditLog>(auditLog), this))
                {
                    ((AuditLog)auditLog).WasCancelled = true;
                    return;
                }
            }

            using (new WriteLock(Locker))
            {
                var uow = UowProvider.GetUnitOfWork();
                using (var repository = RepositoryFactory.CreateAuditLogRepository(uow))
                {
                    repository.Delete(auditLog);
                    uow.Commit();
                }
            }

            Deleted.RaiseEvent(new DeleteEventArgs <IAuditLog>(auditLog), this);
        }
Beispiel #10
0
        private async Task DeleteStreamInternal(
            MySqlStreamId streamId,
            int expectedVersion,
            MySqlTransaction transaction,
            CancellationToken cancellationToken)
        {
            var deletedStreamMessage = Deleted.CreateStreamDeletedMessage(streamId.IdOriginal);

            using (var command = BuildStoredProcedureCall(
                       _schema.DeleteStream,
                       transaction,
                       Parameters.StreamId(streamId),
                       Parameters.ExpectedVersion(expectedVersion),
                       Parameters.CreatedUtc(_settings.GetUtcNow?.Invoke()),
                       Parameters.DeletedStreamId(),
                       Parameters.DeletedStreamIdOriginal(),
                       Parameters.DeletedMetadataStreamId(),
                       Parameters.DeletedStreamMessageMessageId(deletedStreamMessage),
                       Parameters.DeletedStreamMessageType(deletedStreamMessage),
                       Parameters.DeletedStreamMessageJsonData(deletedStreamMessage)))
            {
                try
                {
                    await command.ExecuteNonQueryAsync(cancellationToken).NotOnCapturedContext();
                }
                catch (MySqlException ex) when(ex.IsWrongExpectedVersion())
                {
                    await transaction.RollbackAsync(cancellationToken).NotOnCapturedContext();

                    throw new WrongExpectedVersionException(
                              ErrorMessages.DeleteStreamFailedWrongExpectedVersion(streamId.IdOriginal, expectedVersion),
                              streamId.IdOriginal,
                              expectedVersion,
                              ex);
                }
            }
        }
Beispiel #11
0
        /// <summary>
        /// Deletes a collection of entity collections.
        /// </summary>
        /// <param name="entityCollections">
        /// The entity collections.
        /// </param>
        /// <param name="raiseEvents">
        /// Optional boolean indicating whether or not to raise events.
        /// </param>
        internal void Delete(IEnumerable <IEntityCollection> entityCollections, bool raiseEvents = true)
        {
            var collectionsArray = entityCollections as IEntityCollection[] ?? entityCollections.ToArray();

            if (!collectionsArray.Any())
            {
                return;
            }
            if (raiseEvents)
            {
                Deleting.RaiseEvent(new DeleteEventArgs <IEntityCollection>(collectionsArray), this);
            }

            foreach (var collection in collectionsArray)
            {
                this.DeleteAllChildCollections(collection);
            }

            using (new WriteLock(Locker))
            {
                var uow = UowProvider.GetUnitOfWork();
                using (var repository = RepositoryFactory.CreateEntityCollectionRepository(uow))
                {
                    foreach (var collection in collectionsArray)
                    {
                        repository.Delete(collection);
                    }

                    uow.Commit();
                }
            }

            if (raiseEvents)
            {
                Deleted.RaiseEvent(new DeleteEventArgs <IEntityCollection>(collectionsArray), this);
            }
        }
Beispiel #12
0
        public async Task <ICommandResult <TReply> > DeleteAsync(TReply reply)
        {
            // Validate
            if (reply == null)
            {
                throw new ArgumentNullException(nameof(reply));
            }

            var result = new CommandResult <TReply>();

            // Raise Deleting event
            Deleting?.Invoke(this, new EntityReplyEventArgs <TReply>(null, reply));

            // Invoke EntityReplyDeleting subscriptions
            foreach (var handler in _broker.Pub <TReply>(this, "EntityReplyDeleting"))
            {
                reply = await handler.Invoke(new Message <TReply>(reply, this));
            }

            var success = await _entityReplyStore.DeleteAsync(reply);

            if (success)
            {
                // Raise Deleted event
                Deleted?.Invoke(this, new EntityReplyEventArgs <TReply>(null, reply));

                // Invoke EntityReplyDeleted subscriptions
                foreach (var handler in _broker.Pub <TReply>(this, "EntityReplyDeleted"))
                {
                    reply = await handler.Invoke(new Message <TReply>(reply, this));
                }

                return(result.Success(reply));
            }

            return(result.Failed(new CommandError("An unknown error occurred whilst attempting to delete the reply.")));
        }
Beispiel #13
0
        /// <summary>
        /// Removes the current object relationship with others.
        /// </summary>
        /// <since_tizen> preview </since_tizen>
        public void Unrealize()
        {
            if (IsRealized)
            {
                if (_renderPostCallback != null)
                {
                    Interop.Evas.evas_event_callback_del(Interop.Evas.evas_object_evas_get(Handle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback);
                    _renderPostCallback = null;
                }

                OnUnrealize();
                IntPtr toBeDeleted = Handle;
                Handle = IntPtr.Zero;

                DisposeEvent();

                (Parent as Window)?.RemoveChild(this);

                Interop.Evas.evas_object_del(toBeDeleted);
                Deleted?.Invoke(this, EventArgs.Empty);
                Parent = null;
                s_handleTable.Remove(toBeDeleted);
            }
        }
Beispiel #14
0
        /// <summary>
        /// Deletes a collection of <see cref="INote"/>
        /// </summary>
        /// <param name="notes">
        /// The collection of <see cref="INote"/>s to be deleted
        /// </param>
        /// <param name="raiseEvents">
        /// Optional boolean indicating whether or not to raise events
        /// </param>
        public void Delete(IEnumerable <INote> notes, bool raiseEvents = true)
        {
            var notesArray = notes as INote[] ?? notes.ToArray();

            if (raiseEvents)
            {
                Deleting.RaiseEvent(new DeleteEventArgs <INote>(notesArray), this);
            }

            using (new WriteLock(Locker))
            {
                var uow = UowProvider.GetUnitOfWork();
                using (var repository = RepositoryFactory.CreateNoteRepository(uow))
                {
                    foreach (var note in notesArray)
                    {
                        repository.Delete(note);
                    }
                    uow.Commit();
                }
            }

            Deleted.RaiseEvent(new DeleteEventArgs <INote>(notesArray), this);
        }
Beispiel #15
0
		private void handleEvents(object sender, FSEventStreamEventsArgs args)
		{
			foreach (var e in args.Events) {
				if ((e.Flags & FSEventStreamEventFlags.ItemModified) != 0) {
					if (Filter?.Invoke(e.Path) ?? true) {
						Changed?.Invoke(e.Path);
					}
				}
				if ((e.Flags & FSEventStreamEventFlags.ItemCreated) != 0) {
					if (Filter?.Invoke(e.Path) ?? true) {
						Created?.Invoke(e.Path);
					}
				}
				if ((e.Flags & FSEventStreamEventFlags.ItemRemoved) != 0) {
					if (Filter?.Invoke(e.Path) ?? true) {
						Deleted?.Invoke(e.Path);
					}
				}
				if ((e.Flags & FSEventStreamEventFlags.ItemRenamed) != 0) {
					if (((e.Flags & FSEventStreamEventFlags.ItemIsFile) != 0 && System.IO.File.Exists(e.Path)) ||
					    ((e.Flags & FSEventStreamEventFlags.ItemIsDir) != 0 && System.IO.Directory.Exists(e.Path))) {
						if (lastRenameEvent != null && lastRenameEvent.Value.Id == e.Id - 1) {
							Renamed?.Invoke (lastRenameEvent.Value.Path, e.Path);
							lastRenameEvent = null;
						} else {
							Created?.Invoke(e.Path);
						}
					} else {
						CleanLastRenameEvent();
						lastRenameEvent = e;
						continue;
					}
				}
				CleanLastRenameEvent();
			}
		}
Beispiel #16
0
        internal void HandleGuildDelete(UnavailableGuild data)
        {
            if (!_guilds.TryGetValue(data.Id.RawValue, out var guild))
            {
                _logger.Warning($"Failed to process GuildDelete, unknown guild {data.Id}");
                return;
            }

            if (data.Unavailable == true)
            {
                data.Unavailable = true;
                Unavailable?.Invoke(guild);
            }
            else
            {
                if (guild.Unavailable != true)
                {
                    guild.Unavailable = true;
                    Unavailable?.Invoke(guild);
                }
                _guilds.TryRemove(data.Id.RawValue, out _);
                Deleted?.Invoke(guild);
            }
        }
Beispiel #17
0
        private void WatcherEvent(object sender, FileSystemEventArgs e)
        {
            if (_lastFileChangePath?.FullPath == e.FullPath && DateTime.Now.Subtract(_lastFileChangeTime).TotalMilliseconds <= _bufferTimeInMilliseconds)
            {
                return;
            }

            _lastFileChangePath = e;
            _lastFileChangeTime = DateTime.Now;

            switch (e.ChangeType)
            {
            case WatcherChangeTypes.Changed:
                Changed?.Invoke(sender, e);
                break;

            case WatcherChangeTypes.Created:
                Created?.Invoke(sender, e);
                break;

            case WatcherChangeTypes.Deleted:
                Deleted?.Invoke(sender, e);
                break;

            case WatcherChangeTypes.Renamed:
                Renamed?.Invoke(sender, e);
                break;

            default:
                Changed?.Invoke(sender, e);
                Created?.Invoke(sender, e);
                Deleted?.Invoke(sender, e);
                Renamed?.Invoke(sender, e);
                break;
            }
        }
        public Attempt <OperationStatus> Delete(IDomain domain)
        {
            var evtMsgs = EventMessagesFactory.Get();

            if (Deleting.IsRaisedEventCancelled(
                    new DeleteEventArgs <IDomain>(domain, evtMsgs),
                    this))
            {
                return(Attempt.Fail(OperationStatus.Cancelled(evtMsgs)));
            }

            var uow = UowProvider.GetUnitOfWork();

            using (var repository = RepositoryFactory.CreateDomainRepository(uow))
            {
                repository.Delete(domain);
                uow.Commit();
            }

            var args = new DeleteEventArgs <IDomain>(domain, false, evtMsgs);

            Deleted.RaiseEvent(args, this);
            return(Attempt.Succeed(OperationStatus.Success(evtMsgs)));
        }
Beispiel #19
0
        /// <summary>
        /// Deletes a collection of <see cref="IAuditLog"/>
        /// </summary>
        /// <param name="auditLogs">
        /// The collection of <see cref="IAuditLog"/>s to be deleted
        /// </param>
        /// <param name="raiseEvents">
        /// Optional boolean indicating whether or not to raise events
        /// </param>
        public void Delete(IEnumerable <IAuditLog> auditLogs, bool raiseEvents = true)
        {
            var auditLogsArray = auditLogs as IAuditLog[] ?? auditLogs.ToArray();

            if (raiseEvents)
            {
                Deleting.RaiseEvent(new DeleteEventArgs <IAuditLog>(auditLogsArray), this);
            }

            using (new WriteLock(Locker))
            {
                var uow = UowProvider.GetUnitOfWork();
                using (var repository = RepositoryFactory.CreateAuditLogRepository(uow))
                {
                    foreach (var auditLog in auditLogsArray)
                    {
                        repository.Delete(auditLog);
                    }
                    uow.Commit();
                }
            }

            Deleted.RaiseEvent(new DeleteEventArgs <IAuditLog>(auditLogsArray), this);
        }
Beispiel #20
0
        /// <summary>
        /// Deletes a single <see cref="ICustomer"/> object
        /// </summary>
        /// <param name="customer">The <see cref="ICustomer"/> to delete</param>
        /// <param name="raiseEvents">Optional boolean indicating whether or not to raise events</param>
        public void Delete(ICustomer customer, bool raiseEvents = true)
        {
            if (raiseEvents)
            {
                Deleting.RaiseEvent(new DeleteEventArgs <ICustomer>(customer), this);
            }

            DeleteInvoicesAndPayments(customer);

            using (new WriteLock(Locker))
            {
                var uow = _uowProvider.GetUnitOfWork();
                using (var repository = _repositoryFactory.CreateCustomerRepository(uow))
                {
                    repository.Delete(customer);
                    uow.Commit();
                }
            }

            if (raiseEvents)
            {
                Deleted.RaiseEvent(new DeleteEventArgs <ICustomer>(customer), this);
            }
        }
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            if (NameTextBox.Text != "Удалить")
            {
                return;
            }
            var db = Main.Db;
            var departmentlistToRemove = new List <Department>();
            var employeelistToRemove   = new List <Empoyee>();
            var tmp = db.Department.First(l => l.ID == _selecteDepartment.ID);

            FillLists(tmp, departmentlistToRemove, employeelistToRemove);
            foreach (var department in departmentlistToRemove)
            {
                db.Department.Remove(department);
            }
            foreach (var employee in employeelistToRemove)
            {
                db.Empoyee.Remove(employee);
            }
            db.SaveChanges();
            Deleted?.Invoke();
            Close();
        }
Beispiel #22
0
 public virtual void OnDeleted(EntityReplyEventArgs <TModel> e)
 {
     Deleted?.Invoke(this, e);
 }
Beispiel #23
0
 protected virtual void OnDeleted(EntityEventArgs <TModel> e)
 {
     Deleted?.Invoke(this, e);
 }
 private void OnDeleted(object sender, FileSystemEventArgs e) => Deleted?.Invoke(e.FullPath);
Beispiel #25
0
 private void DeletedEvnt(Deleted evnt)
 {
     State.Deleted = true;
 }
Beispiel #26
0
 public void Delete(string Id)
 {
     Connection.Delete <App>(Id);
     Deleted?.Invoke(this, Id);
 }
 public IObservable <ITransition> Start(TModel entity)
 => delete(entity)
 .Select(_ => Deleted.Transition())
 .Catch((Exception e) => Observable.Return(DeletingFailed.Transition()));
Beispiel #28
0
 protected virtual void OnDeleted(Object sender, FileSystemEventArgs fileSystemEventArgs)
 {
     Deleted?.Invoke(sender, fileSystemEventArgs);
 }
Beispiel #29
0
 protected internal virtual void OnDeleted(MFnDagNode dagNode)
 {
     Deleted?.Invoke(this, dagNode);
 }
Beispiel #30
0
 public virtual String ToString()
 {
     return(Id.ToString() + "-" + DisplayName + "-" + Type.ToString() + "-" + Deleted.ToString());
 }