コード例 #1
0
        /// <summary>
        /// Froms the identifier.
        /// </summary>
        /// <returns>The identifier.</returns>
        /// <param name="context">Context.</param>
        /// <param name="id">Identifier.</param>
        public static new ActivityTep FromId(IfyContext context, int id)
        {
            ActivityTep result = new ActivityTep(context);

            result.Id = id;
            result.Load();
            return(result);
        }
コード例 #2
0
        /// <summary>
        /// Froms the entity and privilege.
        /// </summary>
        /// <returns>The entity and privilege.</returns>
        /// <param name="context">Context.</param>
        /// <param name="entity">Entity.</param>
        /// <param name="operation">Operation.</param>
        public static new ActivityTep FromEntityAndPrivilege(IfyContext context, Entity entity, EntityOperationType operation)
        {
            var         etype  = EntityType.GetEntityType(entity.GetType());
            var         priv   = Privilege.Get(EntityType.GetEntityTypeFromId(etype.Id), Privilege.GetOperationType(((char)operation).ToString()));
            ActivityTep result = new ActivityTep(context);

            result.Entity       = entity;
            result.EntityTypeId = etype.Id;
            result.Privilege    = priv;
            result.Load();
            return(result);
        }