<cfset LOCAL.ValidationErrors = LOCAL.Gallery.Validate() />
<cfif StructCount( LOCAL.ValidationErrors )>
<cfif StructKeyExists( LOCAL.ValidationErrors, "Name" )>
<cfset LOCAL.Errors.name = LOCAL.ValidationErrors.Name />
</cfif>
<cfif StructKeyExists( LOCAL.ValidationErrors, "Description" )>
<cfset LOCAL.Errors.description =
LOCAL.ValidationErrors.Description />
</cfif>
<cfif StructKeyExists( LOCAL.ValidationErrors, "Photos" )>
<cfset LOCAL.Errors.photo_id_list =
LOCAL.ValidationErrors.Photos />
</cfif>
<cfelse>
<cfset ARGUMENTS.Data.Cache.Factory
.Get( "PhotoGalleryService" )
.SaveWithTransaction( LOCAL.Gallery )
/>
<cflocation
url="#ARGUMENTS.Data.Controller#?do=gallery.view&id=#LOCAL.Gallery.GetID()#"
addtoken="false"
/>
</cfif>