Beispiel #1
0
        public static ReturnCode ReturnCode(string json) // The logic is this: if the message text is empty, then the result = Success, otherwise = depending on the code //
        {
            ReturnCode code = ReturnCodeFactory.Error(ExtractTextMessage(json));

            code.NumericValue = CxConvert.ToInt32(ExtractNumericCode(json), ReturnCodeFactory.NcError);
            if (code.StringValue == string.Empty)
            {
                code.NumericValue = ReturnCodeFactory.NcSuccess;
            }
            return(code);
        }
        public static ReturnCode First(IList <ReturnCode> list)
        {
            ReturnCode code = default(ReturnCode);

            try
            {
                code = list.First();
            }
            catch
            {
                code = ReturnCodeFactory.Error("Procedure did not return any data.", "Процедура не вернула результатов.");
            }
            return(code);
        }
Beispiel #3
0
 public static ReceivedValueDatetime Error(int ErrorCode, string ErrorMessage = CxConvert.Empty)
 {
     return(new ReceivedValueDatetime(ReturnCodeFactory.Error(ErrorCode, ErrorMessage), DefaultValue));
 }