예제 #1
0
        public ActionResult Delete(Guid id)
        {
            try
            {
                string paymentMethodId = string.Empty;

                paymentMethodId = paymentMethodRepository.DeletePaymentMethod(id, LogInManager.LoggedInUserId);

                if (!string.IsNullOrWhiteSpace(paymentMethodId))
                {
                    return(Json(new
                    {
                        IsSuccess = true,
                        data = new
                        {
                            PaymentMethodId = paymentMethodId
                        }
                    }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new
                    {
                        IsSuccess = false,
                        errorMessage = "Payment Method details not deleted successfully."
                    }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception e)
            {
                Utility.Utility.LogError(e, "Delete");
                return(Json(new { IsSuccess = false, errorMessage = e.Message }));
            }
        }
예제 #2
0
 public bool DeletePaymentMethod(long paymentMethodId)
 {
     try
     {
         return(_paymentMethodRepository.DeletePaymentMethod(paymentMethodId));
     }
     catch (Exception ex)
     {
         ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message);
         return(false);
     }
 }