Exemplo n.º 1
0
        public JsonResult EditNav(int id, string txt_parent_id, string txt_icon_url, string txt_title, string txt_link_url, string txt_sort_id, string txt_is_lock, string txt_action_type)
        {
            Common.Json  json  = new Common.Json();
            B_Navigation b_nav = new B_Navigation();

            Domain.Navigation model = b_nav.GetNav(id);
            model.icon_url = txt_icon_url;
            model.title    = txt_title;
            model.link_url = txt_link_url;
            if (!string.IsNullOrEmpty(model.link_url) && model.link_url != "#")
            {
                model.controllerName = model.link_url.Substring(model.link_url.LastIndexOf("/") + 1);
            }
            else
            {
                model.controllerName = "";
            }
            model.sort_id     = Convert.ToInt32(txt_sort_id);
            model.is_lock     = txt_is_lock;
            model.parent_id   = Convert.ToInt32(txt_parent_id);
            model.action_type = txt_action_type;
            if (model.parent_id == 0)
            {
                model.channel_id = 1;
            }
            else
            {
                model.channel_id = 2;
            }
            b_nav.Update(model);
            json.msg = "修改成功!";
            return(Json(json));
        }
Exemplo n.º 2
0
        public JsonResult AddNav(string txt_parent_id, string txt_icon_url, string txt_title, string txt_link_url, string txt_sort_id, string txt_is_lock, string txt_action_type)
        {
            Common.Json  json  = new Common.Json();
            B_Navigation b_nav = new B_Navigation();

            Domain.Navigation model = new Domain.Navigation();

            model.icon_url = txt_icon_url;
            model.title    = txt_title;
            model.link_url = txt_link_url;
            if (!string.IsNullOrEmpty(model.link_url) && model.link_url != "#")
            {
                model.controllerName = model.link_url.Substring(model.link_url.LastIndexOf("/") + 1);
            }
            model.sort_id     = Convert.ToInt32(txt_sort_id);
            model.is_lock     = txt_is_lock;
            model.parent_id   = Convert.ToInt32(txt_parent_id);
            model.action_type = txt_action_type;
            if (model.parent_id == 0)
            {
                model.channel_id = 1;
            }
            else
            {
                model.channel_id = 2;
            }
            var res = b_nav.Save(model);

            if (res <= 0)
            {
                json.status = -1;
                json.msg    = "添加失败!";
                return(Json(json));
            }
            json.msg = "添加成功!";

            return(Json(json));
        }
Exemplo n.º 3
0
 public void Update(Domain.Navigation model)
 {
     dal.Update(model);
 }
Exemplo n.º 4
0
 public int Save(Domain.Navigation model)
 {
     return(Convert.ToInt32(dal.Save(model)));
 }