public JsonResult Grades(EasyuiAcceptType accept) { var grades = _dataStore.Grades; var viewResult = grades.AsEasyuiList().FormateByAccept(accept); return(Json(viewResult)); }
/// <summary> /// formate source to easyui responce /// </summary> /// <typeparam name="T"></typeparam> /// <param name="source"></param> /// <param name="accept"></param> /// <returns></returns> public static IEasyuiResponce FormateByAccept <T>(this IEasyuiList <T> source, EasyuiAcceptType accept) { switch (accept) { case EasyuiAcceptType.NotSpecificated: return(source); case EasyuiAcceptType.Datagrid: return(ToDatagridResult(source)); case EasyuiAcceptType.Combobox: return(ToComboboxResult(source)); default: throw new ArgumentOutOfRangeException(); } }
public static IUrlHelper EasyuiAccept(this IUrlHelper urlhelper, EasyuiAcceptType acceptType) { var url = new UrlhelperWapper(urlhelper, acceptType); return(url); }
public UrlhelperWapper(IUrlHelper urlHelper, EasyuiAcceptType acceptType) { _urlHelper = urlHelper; _acceptType = acceptType; }