Example #1
0
        public string GetDescription()
        {
            Type type = this.Type.GetType();

            MemberInfo[] memInfo = type.GetMember(Type.ToString());
            if (memInfo != null && memInfo.Length > 0)
            {
                object[] attrs = (object[])memInfo[0].GetCustomAttributes(typeof(DescriptionAttribute), false);
                if (attrs != null && attrs.Length > 0)
                {
                    return(((DescriptionAttribute)attrs[0]).Description);
                }
            }

            return(Type.ToString());
        }
Example #2
0
        public static MvcHtmlString EnumDisplayName(this HtmlHelper hpmlHelper, TypeCar typeCar)
        {
            var nameTypeCar = typeCar.GetType().GetMember(typeCar.ToString()).First().GetCustomAttributes <DisplayAttribute>();

            //var nameTypeCar = Enum.GetName(typeof (TypeCar), typeCar);

            return(new MvcHtmlString(nameTypeCar.First().Name));
        }
Example #3
0
 public string[] ToRows()
 {
     string[] row = { FullName, TypeLicense.ToString(), ModelCar, TypeCar.ToString(), CarNumber.ToString(), CarDate.ToString() };
     return(row);
 }