Exemple #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);
        }
Exemple #3
0
 public static ReceivedValueDatetime Error(int ErrorCode, string ErrorMessage = CxConvert.Empty)
 {
     return(new ReceivedValueDatetime(ReturnCodeFactory.Error(ErrorCode, ErrorMessage), DefaultValue));
 }
Exemple #4
0
 public static ReceivedValueDatetime Success(DateTime value) => new ReceivedValueDatetime(ReturnCodeFactory.Success(), value);
Exemple #5
0
 public static ReceivedValueFont Success(Font value) => new ReceivedValueFont(ReturnCodeFactory.Success(), value);
Exemple #6
0
 public static ReceivedValueColor Success(Color value) => new ReceivedValueColor(ReturnCodeFactory.Success(), value);