Ejemplo n.º 1
0
        public AddWarrantCommand(
            string inmateId,
            WarrantType warrantType,
            DateTime effectiveDate,
            IIssuingAuthority issuingAuthority

            )
        {
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Получаем из атрибута описание данного результата проверки
        /// </summary>
        /// <param name="element"></param>
        /// <returns></returns>
        public static string GetAttrName(this WarrantType element)
        {
            var type       = typeof(WarrantType);
            var memInfo    = type.GetMember(element.ToString());
            var attributes = memInfo[0].GetCustomAttributes(typeof(DescriptionAttribute), false);

            if (!attributes.Any())
            {
                throw new Exception(String.Format("Элемент перечисления {0} не имеет атрибута  DescriptionAttribute", element.ToString()));
            }
            return(((DescriptionAttribute)attributes[0]).Description);
        }
Ejemplo n.º 3
0
 public AddWarrantCommand(
     string inmateId,
     WarrantType warrantType,
     DateTime issueAt,
     DateTime effectiveFrom,
     string issuerId,
     string scanLocationUrl,
     TimeSpan duration)
 {
     _inmateId = inmateId;
     _warrantType = warrantType;
     _issueAt = issueAt;
     _effectiveFrom = effectiveFrom;
     _issuerId = issuerId;
     _scanLocationUrl = scanLocationUrl;
     _duration = duration;
 }
Ejemplo n.º 4
0
 public AddWarrantCommand(
     string inmateId,
     WarrantType warrantType,
     DateTime issueAt,
     DateTime effectiveFrom,
     string issuerId,
     string scanAttachmentId,
     TimeSpan duration)
 {
     _inmateId         = inmateId;
     _warrantType      = warrantType;
     _issueAt          = issueAt;
     _effectiveFrom    = effectiveFrom;
     _issuerId         = issuerId;
     _scanAttachmentId = scanAttachmentId;
     _duration         = duration;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Получаем коллекцию всех возможных результатов проверки сборки
        /// </summary>
        /// <param name="element"></param>
        /// <returns></returns>
        public static IEnumerable <KeyValuePair <int, string> > GetAll(this WarrantType element)
        {
            var collection = (IEnumerable <WarrantType>)System.Enum.GetValues(typeof(WarrantType));

            return(collection.Select(t => new KeyValuePair <int, string>((int)t, t.GetAttrName())));
        }