public JSONResult<string> AddCustomerAccount(CustomerAccountJSON customerAccount) { try { var customer = AuthoriseRequest(); CustomerAccount entityCustomerAccount = customerAccount.ToCustomerAccount(); m_service.InsertCustomerAccount(customer.Name, entityCustomerAccount); return new JSONResult<string>() { Success = true, Result = entityCustomerAccount.ID }; } catch (Exception excp) { return new JSONResult<string>() { Success = false, Error = excp.Message }; } }
public JSONResult <string> UpdateCustomerAccount(CustomerAccountJSON customerAccount) { try { var customer = AuthoriseRequest(); CustomerAccount entityCustomerAccount = customerAccount.ToCustomerAccount(); m_service.UpdateCustomerAccount(customer.Name, entityCustomerAccount); return(new JSONResult <string>() { Success = true, Result = entityCustomerAccount.ID }); } catch (Exception excp) { return(new JSONResult <string>() { Success = false, Error = excp.Message }); } }