public long AddPaymentMethod(PaymentMethodObject paymentMethod) { try { return(_paymentMethodRepository.AddPaymentMethod(paymentMethod)); } catch (Exception ex) { ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message); return(0); } }
public ActionResult Create(PaymentMethodVM model) { try { string paymentMethodId = string.Empty; model.CreatedBy = LogInManager.LoggedInUserId; paymentMethodId = paymentMethodRepository.AddPaymentMethod(model); 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 saved successfully." }, JsonRequestBehavior.AllowGet)); } } catch (Exception e) { Utility.Utility.LogError(e, "Create"); return(Json(new { IsSuccess = false, errorMessage = e.Message })); } }