Created
April 25, 2012 20:46
-
-
Save tomfulton/2493234 to your computer and use it in GitHub Desktop.
Umbraco Contour - Manually approve a record
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Record Storage | |
Umbraco.Forms.Data.Storage.RecordStorage rs = new Umbraco.Forms.Data.Storage.RecordStorage(); | |
Guid formGuidGuid = new Guid("<your form GUID here>"); | |
// Get the record | |
Umbraco.Forms.Core.Record record = rs.GetRecord(formGuidGuid); | |
// RecordService | |
Umbraco.Forms.Core.Services.RecordService s = new Umbraco.Forms.Core.Services.RecordService(record); | |
// Approve | |
if (s != null) | |
{ | |
if (s.Record.State != Umbraco.Forms.Core.Enums.FormState.Approved) | |
{ | |
s.Approve(); | |
} | |
} | |
s.Dispose(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment