// ================================================================================ public Guid GetObjectOwnerIDFromNamespace(string context, string nameSpace, ref string aux) { //CREATE PROCEDURE spGK_PM_GetOwnerIDFromNamespace // @context VARCHAR(120), // @objectOwnerID uniqueidentifier OUTPUT, // @objectOwnerNamespace VARCHAR(510), // @aux VARCHAR(1020) OUTPUT // Init params StoredProcedureCallContext.ClearStandardParams(ref context, ref aux); StoredProcedureCallContext spContext = new StoredProcedureCallContext("CPRMapperDB", "spGK_PM_GetOwnerIDFromNamespace"); spContext.AddInParameter("objectOwnerNamespace", DbType.String, nameSpace.Trim()); spContext.AddOutParameter("objectOwnerID", DbType.Guid); spContext.ExecuteNonQueryWithReturnValue(); aux = spContext.Aux; return(spContext.GetParameterGuidValue("objectOwnerID")); }
// ================================================================================ public Guid CreateObjectOwner(string context, string nameSpace, Guid objectOwnerID, ref string aux) { //CREATE PROCEDURE spGK_PM_GetOwnerIDFromNamespace // @context VARCHAR(120), // @objectOwnerID uniqueidentifier OUTPUT, // @objectOwnerNamespace VARCHAR(510), // @aux VARCHAR(1020) OUTPUT // Init params StoredProcedureCallContext.ClearStandardParams(ref context, ref aux); aux = "CREATE-ON-NON-EXISTENCE"; StoredProcedureCallContext spContext = new StoredProcedureCallContext("CPRMapperDB", "spGK_PM_GetOwnerIDFromNamespace", context, aux); spContext.AddInParameter("objectOwnerNamespace", DbType.String, nameSpace.Trim()); spContext.AddInOutParameter("objectOwnerID", DbType.Guid, null); spContext.ExecuteNonQueryWithReturnValue(); aux = spContext.Aux; return spContext.GetParameterGuidValue("objectOwnerID"); }