コード例 #1
0
        public JsonResult Grades(EasyuiAcceptType accept)
        {
            var grades     = _dataStore.Grades;
            var viewResult = grades.AsEasyuiList().FormateByAccept(accept);

            return(Json(viewResult));
        }
コード例 #2
0
        /// <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();
            }
        }
コード例 #3
0
        public static IUrlHelper EasyuiAccept(this IUrlHelper urlhelper, EasyuiAcceptType acceptType)
        {
            var url = new UrlhelperWapper(urlhelper, acceptType);

            return(url);
        }
コード例 #4
0
 public UrlhelperWapper(IUrlHelper urlHelper, EasyuiAcceptType acceptType)
 {
     _urlHelper  = urlHelper;
     _acceptType = acceptType;
 }