Exemple #1
0
        public ActionResult Index()
        {
            SCategoryModel SModels = new SCategoryModel();

            SModels.TypeDroList = CSer.GetParentType(SModels.TypeId);
            return(View(SModels));
        }
Exemple #2
0
 public List <CategoryModel> GetPageList(SCategoryModel SModel)
 {
     try { return(CDal.GetPageList(SModel)); }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #3
0
        public ActionResult PageList(SCategoryModel SModels)
        {
            var PageList = CSer.GetPageList(SModels);

            return(new ContentResult
            {
                Content = new JavaScriptSerializer {
                    MaxJsonLength = Int32.MaxValue
                }.Serialize(PageList),
                ContentType = "application/json"
            });
        }
Exemple #4
0
 public List <CategoryModel> GetPageList(SCategoryModel SModel)
 {
     using (var db = new HTJKEntities())
     {
         var List = (from p in db.A_NewsType.Where(k => k.State == true)
                     where !string.IsNullOrEmpty(SModel.Name) ? p.Name.Contains(SModel.Name) : true
                     where SModel.TypeId != null && SModel.TypeId > 0 ? p.Id == SModel.TypeId : true
                     orderby p.Rank
                     select new CategoryModel
         {
             Id = p.Id,
             Name = p.Name,
             Rank = p.Rank,
             CreateTime = p.CreateTime,
             ParentId = p.ParentId,
             ParentName = p.A_NewsType2.Name,
         }).ToList();
         return(List);
     }
 }