/// <summary>
/// The index.
/// </summary>
/// <returns>
/// The <see cref="ActionResult"/>.
/// </returns>
public ActionResult Index()
{
var db = new LibiadaWebEntities();
var viewDataHelper = new ViewDataHelper(db);
Func<CharacteristicType, bool> filter;
if (UserHelper.IsAdmin())
{
filter = c => c.FullSequenceApplicable;
}
else
{
filter = c => c.FullSequenceApplicable && Aliases.UserAvailableCharacteristics.Contains((Aliases.CharacteristicType)c.Id);
}
var data = new Dictionary<string, object>
{
{ "characteristicTypes", viewDataHelper.GetCharacteristicTypes(filter) }
};
var transformationLinks = new[] { Link.Start, Link.End, Link.CycleStart, Link.CycleEnd };
transformationLinks = transformationLinks.OrderBy(n => (int)n).ToArray();
data.Add("transformationLinks", transformationLinks.ToSelectList());
var operations = new List<SelectListItem> { new SelectListItem { Text = "Dissimilar", Value = 1.ToString() }, new SelectListItem { Text = "Higher order", Value = 2.ToString() } };
data.Add("operations", operations);
ViewBag.data = JsonConvert.SerializeObject(data);
return View();
}