You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by hu...@apache.org on 2007/01/09 23:18:50 UTC
svn commit: r494622 -
/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseDelete.cs
Author: husted
Date: Tue Jan 9 14:18:49 2007
New Revision: 494622
URL: http://svn.apache.org/viewvc?view=rev&rev=494622
Log:
PhoneBook2 - Complete initial CRUD workflow.
Added:
struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseDelete.cs
Added: struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseDelete.cs
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseDelete.cs?view=auto&rev=494622
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseDelete.cs (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook2/projects/Core/Commands/BaseDelete.cs Tue Jan 9 14:18:49 2007
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using Nexus.Core;
+
+namespace PhoneBook.Core.Commands
+{
+ /// <summary>
+ /// Execute delete statement indicated by QueryID
+ /// for a single entity.
+ /// </summary>
+ ///
+ public class BaseDelete : BaseMapper
+ {
+ public override bool RequestExecute(IRequestContext context)
+ {
+ int count = Mapper.Delete(QueryID, context);
+ if (count == 0) throw new ApplicationException("Delete: Record not found.");
+ return CONTINUE;
+ }
+ }
+}
\ No newline at end of file