Exemplo n.º 1
0
        public static List <Entities.Values> ListarValues(string ticketid)
        {
            var lista = new List <Entities.Values>();

            using (var cn = new SqlConnection(conexion.Cadena))
            {
                string query = "select tv.Id as id,TicketId,f.Name as Field, case" +
                               " when f.Name = 'contratopdf' then 'http://118.247.29.138:8095/WEB' + Value " +
                               " when f.Name = 'uploadpdfcronogama' then 'http://118.247.29.138:8095/WEB' + Value " +
                               " when f.Name = 'links' then 'http://118.247.29.138:8095/WEB' + Value " +
                               "Else Value End as Value,ClonedValueOrder " +
                               "from[EES.BBVA.2018v1].dbo.TicketValues tv " +
                               "inner join[EES.BBVA.2018v1].dbo.Fields f on f.Id = tv.FieldId where TicketId = " + ticketid + " order by tv.id";
                using (var cmd = new SqlCommand(query, cn))
                {
                    cn.Open();
                    using (var dr = cmd.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            var oValues = new Entities.Values();
                            oValues.id               = Convert.ToString(dr[dr.GetOrdinal("id")]);
                            oValues.ticketid         = Convert.ToString(dr[dr.GetOrdinal("ticketid")]);
                            oValues.field            = Convert.ToString(dr[dr.GetOrdinal("Field")]);
                            oValues.value            = Convert.ToString(dr[dr.GetOrdinal("value")]);
                            oValues.clonedvalueorder = Convert.ToString(dr[dr.GetOrdinal("clonedvalueorder")]);
                            lista.Add(oValues);
                        }
                    }
                    return(lista);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the values associated with the property. Can return null.
        /// </summary>
        /// <param name="property">
        /// The property whose values are required.
        /// </param>
        /// <para>
        /// The <see cref="Values"/> type is used to return values so that
        /// helper methods like ToBool can be used to convert the response to
        /// a boolean.
        /// </para>
        /// <returns>
        /// Array of the values associated with the property, or null if the
        /// property does not exist.
        /// </returns>
        public Values this[Property property]
        {
            get
            {
                Values values = null;

                // A read / write upgradable guard could be used in the future
                // should the performance of GetPropertyValueIndexes prove too
                // slow in the future. The use of a lock on the dictionary
                // ensures that this implementation is thread safe.
                lock (PropertyIndexToValues)
                {
                    if (PropertyIndexToValues.TryGetValue(
                            property.Index,
                            out values) == false)
                    {
                        values = new Entities.Values(
                            property,
                            GetPropertyValueIndexes(property));
                        PropertyIndexToValues.Add(property.Index, values);
                    }
                }
                return(values);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Gets the values associated with the property.
 /// </summary>
 /// <param name="property">The property whose values are required</param>
 /// <returns>
 /// Array of the values associated with the property, or null if the property does not exist
 /// </returns>
 /// <para>
 /// The <see cref="Values"/> type is used to return values so that
 /// helper methods like ToBool can be used to convert the response to
 /// a boolean.
 /// </para>
 public Values this[Property property]
 {
     get
     {
         Values values = null;
         if (PropertyIndexToValues.TryGetValue(property.Index, out values) == false)
         {
             lock (this)
             {
                 if (PropertyIndexToValues.TryGetValue(property.Index, out values) == false)
                 {
                     values = new Entities.Values(
                         property,
                         GetPropertyValuesEnumerable(property));
                     PropertyIndexToValues.Add(property.Index, values);
                 }
             }
         }
         return(values);
     }
 }