コード例 #1
0
        public static DatabaseResponseMessage Parse(DataSet dataSet)
        {
            var row                     = dataSet.Tables[0].Rows[0];
            var fields                  = row[0].ToString().Split('~');
            var statusCode              = int.Parse(fields[0]);
            var statusMessage           = fields[1];
            var databaseResponseMessage = new DatabaseResponseMessage();

            databaseResponseMessage.StatusCode          = statusCode;
            databaseResponseMessage.StatusMessage       = statusMessage;
            databaseResponseMessage.IsSuccessStatusCode = (statusCode == 0);
            return(databaseResponseMessage);
        }
コード例 #2
0
        public static DatabaseResponseMessage Parse(string value)
        {
            var rows                    = value.Split('|');
            var fields                  = rows[0].Split('~');
            var statusCode              = int.Parse(fields[0]);
            var statusMessage           = fields[1];
            var databaseResponseMessage = new DatabaseResponseMessage();

            databaseResponseMessage.StatusCode          = statusCode;
            databaseResponseMessage.StatusMessage       = statusMessage;
            databaseResponseMessage.IsSuccessStatusCode = (statusCode == 0);
            databaseResponseMessage.Data = rows.Skip(1).ToList();

            return(databaseResponseMessage);
        }