Ejemplo n.º 1
0
 static public DataAccessGroup Insert(IUpdateContext update, DataAccessGroup entity)
 {
     var broker = update.GetBroker<IDataAccessGroupEntityBroker>();
     var updateColumns = new DataAccessGroupUpdateColumns();
     updateColumns.AuthorityGroupOID = entity.AuthorityGroupOID;
     updateColumns.Deleted = entity.Deleted;
     DataAccessGroup newEntity = broker.Insert(updateColumns);
     return newEntity;
 }
Ejemplo n.º 2
0
 public DataAccessGroup AddDataAccessIfNotExists(string oid)
 {
     DataAccessGroup theGroup = FindDataAccessGroup(oid);
     if (theGroup == null)
     {
         using (IUpdateContext update = PersistentStoreRegistry.GetDefaultStore().OpenUpdateContext(UpdateContextSyncMode.Flush))
         {
             DataAccessGroupUpdateColumns insert = new DataAccessGroupUpdateColumns
                                                       {
                                                           AuthorityGroupOID =
                                                               new ServerEntityKey("AuthorityGroupOID",
                                                                                   new Guid(oid)),
                                                           Deleted = false
                                                       };
             IDataAccessGroupEntityBroker broker = update.GetBroker<IDataAccessGroupEntityBroker>();
             theGroup = broker.Insert(insert);
             update.Commit();
         }
     }
     return theGroup;
 }