コード例 #1
0
ファイル: Accounting.cs プロジェクト: sipsorcery/sipsorcery
        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 };
            }
        }
コード例 #2
0
        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
                });
            }
        }