public RelationUpdate(string entity, string role, RelationOperation operation, int?id = null)
     : base(entity)
 {
     Id        = id;
     Role      = role;
     Operation = operation;
 }
Ejemplo n.º 2
0
        private int LogRelationChange(int operationId, string entity, string role, int id, RelationOperation relOp, SqlConnection conn)
        {
            var cmd = new SqlCommand(SqlConsts.StoredProcedures.LogRelationChange, conn);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("OperationId", operationId);
            cmd.Parameters.AddWithValue("Entity", entity);
            cmd.Parameters.AddWithValue("Role", role);
            cmd.Parameters.AddWithValue("EntityId", id);
            cmd.Parameters.AddWithValue("RelationOperation", relOp);
            cmd.Parameters.Add(new SqlParameter("Id", System.Data.SqlDbType.Int)
            {
                Direction = System.Data.ParameterDirection.Output
            });
            cmd.ExecuteNonQuery();
            return((int)cmd.Parameters["Id"].Value);
        }
Ejemplo n.º 3
0
 private int LogRelationChange(int operationId, string entity, string role, int id, RelationOperation relOp, SqlConnection conn)
 {
     var cmd = new SqlCommand(SqlConsts.StoredProcedures.LogRelationChange, conn);
     cmd.CommandType = System.Data.CommandType.StoredProcedure;
     cmd.Parameters.AddWithValue("OperationId", operationId);
     cmd.Parameters.AddWithValue("Entity", entity);
     cmd.Parameters.AddWithValue("Role", role);
     cmd.Parameters.AddWithValue("EntityId", id);
     cmd.Parameters.AddWithValue("RelationOperation", relOp);
     cmd.Parameters.Add(new SqlParameter("Id", System.Data.SqlDbType.Int) { Direction = System.Data.ParameterDirection.Output });
     cmd.ExecuteNonQuery();
     return (int)cmd.Parameters["Id"].Value;
 }