internal static void AssertEqual(this IUpdateCustomerNoteParameters expected, CustomerNote result)
 {
     Assert.AreEqual(expected.CustomerNoteKey, result.ToCustomerNoteKey().KeyValue);
     Assert.AreEqual(expected.UserToken, result.Employee.UserName);
     Assert.AreEqual(expected.Text, result.Text);
     Assert.AreEqual(expected.Type, result.Type);
     Assert.AreEqual(expected.Bold, result.Bold);
 }
 public IResult UpdateCustomerNote(IUpdateCustomerNoteParameters parameters)
 {
     try
     {
         return(_companyServiceProvider.UpdateCustomerNote(parameters));
     }
     catch (Exception ex)
     {
         _exceptionLogger.LogException(ex);
         return(new FailureResult(ex.Message));
     }
 }
        public IResult UpdateCustomerNote(IUpdateCustomerNoteParameters parameters)
        {
            var customerNoteKeyResult = KeyParserHelper.ParseResult<ICustomerNoteKey>(parameters.CustomerNoteKey);
            if(!customerNoteKeyResult.Success)
            {
                return customerNoteKeyResult;
            }

            var result = new CustomerNoteConductor(_companyUnitOfWork).Update(customerNoteKeyResult.ResultingObject.ToCustomerNoteKey(), _timeStamper.CurrentTimeStamp, parameters);
            if(!result.Success)
            {
                return result;
            }

            _companyUnitOfWork.Commit();

            return SyncParameters.Using(new SuccessResult<string>(customerNoteKeyResult.ResultingObject.ToCustomerNoteKey()), new CompanyKey(customerNoteKeyResult.ResultingObject.ToCustomerKey()));
        }