コード例 #1
0
ファイル: PermissionState.cs プロジェクト: 573000126/wms-4
        public virtual void When(IPermissionStateDeleted e)
        {
            ThrowOnWrongEvent(e);

            this.Deleted   = true;
            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;
        }
コード例 #2
0
        public virtual PermissionStateDeletedDto ToPermissionStateDeletedDto(IPermissionStateDeleted e)
        {
            var dto = new PermissionStateDeletedDto();

            dto.PermissionEventId = e.PermissionEventId;
            dto.CreatedAt         = e.CreatedAt;
            dto.CreatedBy         = e.CreatedBy;
            dto.CommandId         = e.CommandId;

            return(dto);
        }
コード例 #3
0
        protected virtual IPermissionStateDeleted Map(IDeletePermission c)
        {
            var stateEventId          = new PermissionStateEventId(c.PermissionId, c.Version);
            IPermissionStateDeleted e = NewPermissionStateDeleted(stateEventId);

            ReflectUtils.CopyPropertyValue("CommandId", c, e);


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = DateTime.Now;


            return(e);
        }
コード例 #4
0
        protected virtual IPermissionStateDeleted Map(IDeletePermission c)
        {
            var stateEventId          = new PermissionEventId(c.PermissionId, c.Version);
            IPermissionStateDeleted e = NewPermissionStateDeleted(stateEventId);

            e.CommandId = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();


            return(e);
        }
コード例 #5
0
        protected virtual IPermissionStateDeleted Map(IDeletePermission c)
        {
            var stateEventId          = new PermissionStateEventId(c.PermissionId, c.Version);
            IPermissionStateDeleted e = NewPermissionStateDeleted(stateEventId);

            e.CommandId = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = DateTime.Now;


            return(e);
        }
コード例 #6
0
        public virtual void Delete(IDeletePermission c)
        {
            IPermissionStateDeleted e = Map(c);

            Apply(e);
        }
コード例 #7
0
 void IPermissionState.When(IPermissionStateDeleted e)
 {
     throw new NotSupportedException();
 }
コード例 #8
0
 public void AddPermissionEvent(IPermissionStateDeleted e)
 {
     _innerStateEvents.Add((PermissionStateDeletedDto)e);
 }