InputSize simplification

This commit is contained in:
2015-07-21 23:07:41 -04:00
parent 5563e68d02
commit 8266598e0d
8 changed files with 38 additions and 73 deletions
+9 -3
View File
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel.DataAnnotations;
using System.Data.SqlTypes;
using System.Linq;
@@ -8,9 +7,7 @@ using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using MileageTraker.Web.Models;
using MiscUtil.Collections;
namespace MileageTraker.Web.Utility
{
@@ -53,6 +50,15 @@ namespace MileageTraker.Web.Utility
: enumeration.ToString();
}
public static Dictionary<string, object> GetInputSizeClass(this HtmlHelper helper)
{
var inputSize = (string)helper.ViewData.ModelMetadata.AdditionalValues["InputSize"];
//var cls = !string.IsNullOrEmpty(inputSize) ? new { @class = inputSize } : null;
var dictionary = new Dictionary<string, object> {{"class", inputSize}};
return dictionary;
}
public static IEnumerable<SelectListItem> GetSelectListItems(this Enum enumeration)
{
var type = enumeration.GetType();