Ejemplo n.º 1
0
        /// <summary>
        /// List Request Results
        /// </summary>
        /// <param name="FKRequestUID"></param>
        /// <returns></returns>
        public static List <ProcessRequestResults> List(int FKRequestUID)
        {
            var result = new List <ProcessRequestResults>();

            using (var connection = new SqlConnection(ConnString.ConnectionString))
            {
                var commandString = string.Format(
                    " SELECT " +
                    FieldString() +
                    "   FROM     [ProcessRequestResults] " +
                    "  WHERE  " +
                    "    [FKRequestUID] = " + FKRequestUID.ToString() +
                    "  ORDER BY 1 ASC "
                    );

                using (var command = new SqlCommand(
                           commandString, connection))
                {
                    connection.Open();
                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            var _ProcessRequest = new ProcessRequestResults();
                            ProcessRequestResults.LoadFromReader(_ProcessRequest, reader);
                            result.Add(_ProcessRequest);
                        }
                    }
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Load from Reader
 /// </summary>
 /// <param name="processRequest"></param>
 /// <param name="tablePrefix"></param>
 /// <param name="reader"></param>
 public static void LoadFromReader(
     ProcessRequestResults processRequest,
     SqlDataReader reader)
 {
     processRequest.FKRequestUID   = Convert.ToInt32(reader[FieldName.FKRequestUID].ToString());
     processRequest.FKClientUID    = Convert.ToInt32(reader[FieldName.FKClientUID].ToString());
     processRequest.SequenceNumber = Convert.ToInt32(reader[FieldName.SequenceNumber].ToString());
     processRequest.Type           = reader[FieldName.Type].ToString();
     processRequest.LongText       = reader[FieldName.LongText].ToString();
     return;
 }