Exemplo n.º 1
0
        /// <summary>
        /// Validate date visit.
        /// </summary>
        /// <param name="item"></param>
        public void Visit(DateDataItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            AB_RootDataTag tag   = RetrieveTag(item);
            DateTime       value = DateTime.Parse(tag.Value, CultureInfo.InvariantCulture);

            Assert.IsTrue(value.Equals(item.Value));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Visit date item.
        /// </summary>
        /// <param name="item"></param>
        public void Visit(DateDataItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            byte[] values = GetItemValue(item);
            Int16  year   = BitConverter.ToInt16(new[] { values[1], values[0] }, 0);
            Int16  month  = BitConverter.ToInt16(new byte[] { values[2], 0 }, 0);
            Int16  day    = BitConverter.ToInt16(new byte[] { values[3], 0 }, 0);

            item.Value = new DateTime(year, month, day);
            Context.DataItems.Add(item);
        }
Exemplo n.º 3
0
 public static TextValueModel <TValue> ToModel <TValue>(this DateDataItem <TValue> entity)
 {
     return(Mapper.Map <DateDataItem <TValue>, TextValueModel <TValue> >(entity));
 }