public bool UpdateSecuritySetting(Int64 subjectid, Int64 predicateid, int securitygroup)
{
EditActivityLog(subjectid, GetProperty(predicateid), "" + securitygroup);
string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
SqlConnection dbconnection = new SqlConnection(connstr);
SqlParameter[] param = new SqlParameter[3];
bool error = false;
try
{
dbconnection.Open();
param[0] = new SqlParameter("@NodeID", subjectid);
param[1] = new SqlParameter("@PropertyID", predicateid);
param[2] = new SqlParameter("@ViewSecurityGroup", securitygroup);
SqlCommand comm = GetDBCommand(ref dbconnection, "[RDF.].SetNodePropertySecurity", CommandType.StoredProcedure, CommandBehavior.CloseConnection, param);
//For Output Parameters you need to pass a connection object to the framework so you can close it before reading the output params value.
ExecuteSQLDataCommand(comm);
comm.Connection.Close();
if (dbconnection.State != ConnectionState.Closed)
dbconnection.Close();
}
catch (Exception e)
{
Framework.Utilities.DebugLogging.Log(e.Message + e.StackTrace);
error = true;
throw new Exception(e.Message);
}
return error;
}