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