Beispiel #1
0
        /// <summary>
        /// Parses NetSuite response status and returns the detailed string message
        /// </summary>
        /// <param name="operationType">NetSuite operation type</param>
        /// <param name="status">NetSuite response status</param>
        /// <param name="recordType">NetSuite entity type</param>
        /// <returns></returns>
        public static string ParseStatus(NetSuiteOperationType operationType,
                                         Status status,
                                         RecordType recordType)
        {
            if (null == status)
            {
                return(null);
            }

            string details = ParseStatusDetails(status.statusDetail);

            string result = !status.isSuccess ? GetFailedOperationMessage(operationType, recordType) :
                            GetSuccessOperationMessage(operationType, recordType);

            if (!string.IsNullOrEmpty(details))
            {
                result = string.Format("{0} Details: {1}", result, details);
            }

            return(result);
        }
 internal NetSuiteOperationResult(Status status, RecordType recordType, NetSuiteOperationType operationType)
 {
     _status        = status;
     _recordType    = recordType;
     _operationType = operationType;
 }
Beispiel #3
0
 internal NetSuiteReadWriteResult(Status status, RecordType recordType, NetSuiteOperationType operationType, Record record, BaseRef baseRef)
     : base(status, recordType, operationType)
 {
     _record  = record;
     _baseRef = baseRef;
 }
Beispiel #4
0
 /// <summary>
 /// Returns string message for failed operation with NetSuite.
 /// </summary>
 /// <param name="operationType">NetSuite operation type</param>
 /// <param name="recordType">NetSuite entity type</param>
 public static string GetFailedOperationMessage(
     NetSuiteOperationType operationType,
     RecordType recordType)
 {
     return(string.Format("{0} {1}(s) was done with errors.", operationType, recordType));
 }
Beispiel #5
0
 /// <summary>
 /// Returns string message for successful operation with NetSuite.
 /// </summary>
 /// <param name="operationType">NetSuite operation type</param>
 /// <param name="recordType">NetSuite entity type</param>
 public static string GetSuccessOperationMessage(
     NetSuiteOperationType operationType,
     RecordType recordType)
 {
     return(string.Format("{0} {1}(s) was successful.", operationType, recordType));
 }