}//if we got any result public static void getImageProp(ICswResources CswResources, NodePropImageReturn Return, BlobDataParams Request) { CswNbtResources NbtResources = (CswNbtResources)CswResources; CswPropIdAttr PropIdAttr = new CswPropIdAttr(Request.propid); CswNbtNode node = NbtResources.Nodes[PropIdAttr.NodeId]; if (null != node) { CswNbtMetaDataNodeType NodeType = node.getNodeType(); CswNbtNodePropWrapper prop = node.Properties[PropIdAttr.NodeTypePropId]; if (NbtResources.Permit.canNodeType(CswEnumNbtNodeTypePermission.View, NodeType, NbtResources.CurrentNbtUser)) { if (Int32.MinValue == prop.JctNodePropId) { prop.makePropRow(); //if we don't have a jct_node_prop row for this prop, we do now node.postChanges(true); } prop.AsImage.SetImages(Request.date); if (null != prop) { Return.Data = prop; } } else { throw new CswDniException(CswEnumErrorType.Warning, "You do not have sufficient priviledges to get this image property", "User " + NbtResources.CurrentNbtUser.UserId + " attempted to call getImageProp on prop " + prop.JctNodePropId); } } }
public static void saveCaption(ICswResources CswResources, NodePropImageReturn Return, BlobDataParams Request) { CswNbtResources NbtResources = (CswNbtResources)CswResources; int BlobDataId = Request.Blob.BlobDataId; CswTableUpdate blobDataTS = NbtResources.makeCswTableUpdate("clearImage", "blob_data"); DataTable blobDataTbl = blobDataTS.getTable("where blobdataid = " + BlobDataId); foreach (DataRow row in blobDataTbl.Rows) { row["caption"] = Request.Blob.Caption; } blobDataTS.update(blobDataTbl); }
public static void clearImage(ICswResources CswResources, NodePropImageReturn Return, BlobDataParams Request) { CswNbtResources NbtResources = (CswNbtResources)CswResources; CswPropIdAttr PropId = new CswPropIdAttr(Request.propid); CswNbtNode Node = NbtResources.Nodes[PropId.NodeId]; if (null != Node) { CswNbtMetaDataNodeTypeProp MetaDataProp = NbtResources.MetaData.getNodeTypeProp(PropId.NodeTypePropId); if (null != MetaDataProp) { CswNbtNodePropWrapper FileProp = Node.Properties[MetaDataProp]; if (NbtResources.Permit.canNodeType(CswEnumNbtNodeTypePermission.Edit, MetaDataProp.getNodeType(), NbtResources.CurrentNbtUser) && NbtResources.Permit.isPropWritable(CswEnumNbtNodeTypePermission.Edit, MetaDataProp, null, FileProp)) { int BlobDataId = Request.Blob.BlobDataId; CswTableUpdate blobDataTS = NbtResources.makeCswTableUpdate("clearImage", "blob_data"); DataTable blobDataTbl = blobDataTS.getTable("where blobdataid = " + BlobDataId); foreach (DataRow row in blobDataTbl.Rows) { row.Delete(); } blobDataTS.update(blobDataTbl); Request.Blob = new CswNbtSdBlobData.CswNbtBlob(); Request.success = true; getImageProp(CswResources, Return, Request); } } } else { throw new CswDniException(CswEnumErrorType.Warning, "You do not have sufficient priveledges to clear this Image property", "User " + NbtResources.CurrentNbtUser.UserId + " attempted to call clearImg without sufficient priviledges."); } }