<% // Display server-side errors that may have occured. var UserAdapter = Modules.PhotoData.Users; e = new Enumerator(UserAdapter.Errors) if (!e.atEnd()) { Response.Write('

The following error(s) happened with Users:'); for (; !e.atEnd(); e.moveNext()) Response.Write("

  • " + e.item().Message) } var Categories = Modules.PhotoData.Categories; e = new Enumerator(Categories.Errors) if (!e.atEnd()) { Response.Write('

    The following error(s) happened with Categories:'); for (; !e.atEnd(); e.moveNext()) Response.Write("

  • " + e.item().Message) } %>
    <% // Shortcuts to the categories fields; this speeds up processing of the script. Categories_CAT_NAME = Categories.CAT_NAME; %> <% // This will tell WebSnap what action to execut %> <% Categories.Mode = 'Edit'; e = new Enumerator(Categories.Records); for (e.moveFirst(); !e.atEnd(); e.moveNext()) { %> <% // Write out hidden fields for each record (needed to maintain state) if (Categories.HiddenRecordFields != null) Categories.HiddenRecordFields.WriteFields(Response) } e.moveFirst(); // Move back to the first record, for inserting. // Write out hidden fields for the whole adapter (needed to maintain state) if (Categories.HiddenFields != null) Categories.HiddenFields.WriteFields(Response) %> <% // Add the option to insert a new category // Notice how __act is set to the NewRow as the action. Categories.Mode = 'Insert'; %> <% // Write out hidden fields (needed to maintain state) if (Categories.HiddenFields != null) Categories.HiddenFields.WriteFields(Response) if (Categories.HiddenRecordFields != null) Categories.HiddenRecordFields.WriteFields(Response) %>
    Modify Categories
    Category ID Category Name  
    <%=Categories.CAT_ID.DisplayText%>  
    New Category:  

    <% // the __act value is set in the onclick of the button %> <% e = new Enumerator(UserAdapter.Records); UserAdapter.Mode = 'Edit'; var UserAdapterLogin = UserAdapter.USR_LOGIN; var UserRights = UserAdapter.USR_RIGHTS; for (; !e.atEnd(); e.moveNext()) { %> <% // Write out hidden fields for each record (needed to maintain state) if (UserAdapter.HiddenRecordFields != null) UserAdapter.HiddenRecordFields.WriteFields(Response) } // Write out hidden fields for the entire form if (UserAdapter.HiddenFields != null) UserAdapter.HiddenFields.WriteFields(Response) %> <% // Now, add the ability to add a new user - it must be in a new form e.moveFirst(); // we have to be at the start to insert a new record UserAdapter.Mode = 'Insert'; %>
    Login Password Access Rights    
    -- Add a new user --
     
    <% // Write out hidden fields for the entire form if (UserAdapter.HiddenFields != null) UserAdapter.HiddenFields.WriteFields(Response) %>