Ejemplo n.º 1
0
        public Response <Customer> DeleteCustomer(long ID)
        {
            CustomerAccessor    accessor = new CustomerAccessor();
            Response <Customer> response = new Response <Customer>();

            try
            {
                if (accessor.DeleteCustomer(ID))
                {
                    response.IsSuccess      = true;
                    response.SuccessMessage = "删除成功!";
                }
                else
                {
                    response.IsSuccess = false;
                }
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess      = false;
                response.SuccessMessage = "删除失败!" + ex.Message;
            }
            return(response);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Deletes the customer.
        /// </summary>
        /// <param name="customer">The customer.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public bool DeleteCustomer(Customer customer)
        {
            int count = 0;

            count = CustomerAccessor.DeleteCustomer(customer.CustomerID);

            if (count >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }