Exemplo n.º 1
0
 public void DeleteCategory(Sender sender, Guid CategoryID)
 {
     try
     {
         using (ObjectProxy op = new ObjectProxy(true))
         {
             if (op.LoadCategorysByParentID(CategoryID).Count > 0)
             {
                 throw new Exception("请删除子节点后再删除此节点。");
             }
             else
             {
                 op.DeleteCategoryByCategoryID(CategoryID);
                 op.CommitTransaction();
             }
         }
     }
     catch (Exception ex)
     {
         PLogger.LogError(ex);
         throw ex;
     }
 }