/// <summary>
        /// 得到类目
        /// </summary>
        /// <returns></returns>
        protected virtual IList <CustomerTypeEntity> GetCustomerTypes(CustomerTypeListModel model)
        {
            var query = new QueryInfo {
                IsReturnCount = false
            };

            query.SetPageSize(model.PageSize).SetPageIndex(model.PageIndex)
            .Query <CustomerTypeEntity>().Where(it => it.Crm.Id == CrmId).OrderBy(it => it.Sequence)
            .Select(it => new object[] { it.Id, it.Name, it.Sequence });
            return(this.GetEntities <CustomerTypeEntity>(query));
        }
        /// <summary>
        /// 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult List(int?page)
        {
            var model = new CustomerTypeListModel
            {
                PageIndex = page.HasValue ? page.Value : 0
            };

            model.CustomerTypes = GetCustomerTypes(model);
            if (model.CustomerTypes == null || model.CustomerTypes.Count == 0)
            {
                return(Content(""));
            }
            return(View("~/Views/CustomerType/_CustomerType.cshtml", model));
        }
        /// <summary>
        /// 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            var model = new CustomerTypeListModel();

            return(View("~/Views/CustomerType/index.cshtml", model));
        }