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