Index: /trunk/grails-app/controllers/SiteController.groovy
===================================================================
--- /trunk/grails-app/controllers/SiteController.groovy	(revision 162)
+++ /trunk/grails-app/controllers/SiteController.groovy	(revision 163)
@@ -27,5 +27,5 @@
         if(siteInstance) {
             try {
-                siteInstance.delete()
+                siteInstance.delete(flush:true)
                 flash.message = "Site ${params.id} deleted"
                 redirect(action:list)
@@ -77,5 +77,5 @@
         else {
             flash.message = "Site not found with id ${params.id}"
-            redirect(action:edit,id:params.id)
+            redirect(action:list)
         }
     }
Index: /trunk/grails-app/domain/Site.groovy
===================================================================
--- /trunk/grails-app/domain/Site.groovy	(revision 162)
+++ /trunk/grails-app/domain/Site.groovy	(revision 163)
@@ -3,4 +3,5 @@
     String name
     String description = ""
+    String costCode = ""
     Boolean isActive = true
 
Index: /trunk/grails-app/views/site/create.gsp
===================================================================
--- /trunk/grails-app/views/site/create.gsp	(revision 162)
+++ /trunk/grails-app/views/site/create.gsp	(revision 163)
@@ -47,4 +47,13 @@
                             <tr class="prop">
                                 <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:siteInstance,field:'costCode','errors')}">
+                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:siteInstance,field:'costCode')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
                                     <label for="isActive">Is Active:</label>
                                 </td>
Index: /trunk/grails-app/views/site/edit.gsp
===================================================================
--- /trunk/grails-app/views/site/edit.gsp	(revision 162)
+++ /trunk/grails-app/views/site/edit.gsp	(revision 163)
@@ -45,4 +45,13 @@
                                 <td valign="top" class="value ${hasErrors(bean:siteInstance,field:'description','errors')}">
                                     <input type="text" maxlength="100" id="description" name="description" value="${fieldValue(bean:siteInstance,field:'description')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:siteInstance,field:'costCode','errors')}">
+                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:siteInstance,field:'costCode')}"/>
                                 </td>
                             </tr> 
Index: /trunk/grails-app/views/site/list.gsp
===================================================================
--- /trunk/grails-app/views/site/list.gsp	(revision 162)
+++ /trunk/grails-app/views/site/list.gsp	(revision 163)
@@ -28,4 +28,6 @@
                    	        <g:sortableColumn property="description" title="Description" />
                         
+                   	        <g:sortableColumn property="costCode" title="Cost Code" />
+                        
                    	        <g:sortableColumn property="isActive" title="Is Active" />
                         
@@ -42,4 +44,6 @@
                             <td>${fieldValue(bean:siteInstance, field:'description')}</td>
                         
+                            <td>${fieldValue(bean:siteInstance, field:'costCode')}</td>
+                        
                             <td>${fieldValue(bean:siteInstance, field:'isActive')}</td>
                         
Index: /trunk/grails-app/views/site/show.gsp
===================================================================
--- /trunk/grails-app/views/site/show.gsp	(revision 162)
+++ /trunk/grails-app/views/site/show.gsp	(revision 163)
@@ -41,4 +41,11 @@
                             
                             <td valign="top" class="value">${fieldValue(bean:siteInstance, field:'description')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Cost Code:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:siteInstance, field:'costCode')}</td>
                             
                         </tr>
