public ActionResult PaymentAccountUpdate(VM_PaymentAccount paymentAccount) { if (_DL.PaymentAccount.Get.ByID((int)paymentAccount.AccountID) == null) { throw new PaymentAccountNotFoundException(); } return(GetJson(_DL.PaymentAccount.Update.UpdateAccount(paymentAccount))); }
public ActionResult PaymentAccountAdd(VM_PaymentAccount paymentAccount) { paymentAccount.User = CurrentUser; paymentAccount.AccountTypeName = paymentAccount.AccountType.ToString(); switch (paymentAccount.AccountType) { case En_AccountType.Bitcoin: case En_AccountType.PayPal: case En_AccountType.WebMoney: return(GetJson(_DL.PaymentAccount.Add.New(paymentAccount))); default: throw new IncorrectPaymentAccountTypeException(); } }
public static int UpdateAccount(VM_PaymentAccount account) { using (var exodusDB = new exodusEntities()) { var rez = new ObjectParameter("Result", 0); exodusDB.stp_User_Account_Update( accountID: account.AccountID, accountValue: account.AccountDetails, result: rez ); return(Convert.ToInt32(rez.Value)); } }
public static long New(VM_PaymentAccount account) { using (var exodusDB = new exodusEntities()) { var accountID = new ObjectParameter("AccountID", 0); exodusDB.stp_User_Account_Add( userID: account.User.UserID, accountTypeID: (int)account.AccountType, accountValue: account.AccountDetails, accountID: accountID ); return(Convert.ToInt64(accountID.Value)); } }