private void Save(Models.TextBlock record, bool isNew)
        {
            // add any code to update other fields/tables here
            record.DateModified = DateTime.Now;
            record.Save();
            CheckLock(record);
            lockobj.UnLockTable(record.GetTableName(), record.ID);

            TextBlockCache.Rebuild();
        }
        /// <summary>
        /// Deletes the given record or displays validation errors if cannot delete
        /// GET: /Admin/TextBlock/Delete/5
        /// </summary>
        public ActionResult Delete(int id, string returnPage)
        {
            var    record = Models.TextBlock.LoadID(id);
            string issues = record.CheckForDependentRecords();

            if (issues != null)
            {
                Web.ErrorMessage = "Cannot delete this record. " + issues; return(RedirectToEdit(record.ID));

                return(View("TextBlockEdit"));
            }
            CheckLock(record);
            lockobj.UnLockTable(record.GetTableName(), record.ID);
            //record.Deals.DeleteAll();
            record.Delete();
            TextBlockCache.Rebuild();
            return(Redirect(returnPage));
        }