HN.UI/Controllers/CategoryController.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using HN.BLL;
using HN.Model;
using System.Data;
using Newtonsoft.Json;

namespace HN.UI.Controllers
{
    public class CategoryController : Controller
    {
        Category categorybll = new Category();

        #region View-分类管理 Index()
        [GlobalFilter("menu")]
        public ActionResult Index()
        {
            return View();
        }
        #endregion

        #region Method-获取分类列表 GetCategory(int type)
        [HttpPost]
        public string GetCategory(int type,int cateID=-1)
        {
            return categorybll.GetCategoryList(type,cateID);
        }
        #endregion

        #region View-添加/编辑分类 Edit(string id,string keyID,string keyName)
        [GlobalFilter("btn", "/Category/Index")]
        public ActionResult Edit(string id, string type)
        {
            CategoryInfo model = new CategoryInfo();
            string strType = "";
            if (!string.IsNullOrEmpty(id))
            {
                model = categorybll.GetModel(null, Convert.ToInt32(id));
                strType = model.Type == 1 ? "客户分类" : (model.Type == 2 ? "供应商分类" : "商品分类");
            }
            else
            {
                model.Type = Convert.ToInt32(type);
                strType = type == "1" ? "客户分类" : (type == "2" ? "供应商分类" : "商品分类");
            }
            ViewBag.Type = strType;
            return View(model);
        }
        #endregion

        #region Method-添加/编辑分类 Edit(DictValueInfo model)
        [HttpPost]
        [GlobalFilter("btn", "/Category/Index")]
        public string Edit(CategoryInfo model)
        {
            return categorybll.AddOrEdit(model);
        }
后面还有 21 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。