Пример #1
0
        public JsonResult AddNews_type(int txt_parent_id, string txt_title, int?txt_sort_id, string txt_seo_title, string txt_seo_keywords, string txt_seo_description)
        {
            Common.Json         json = new Common.Json();
            DAO.BLL.B_News_type b_nt = new DAO.BLL.B_News_type();
            Domain.News_type    m_nt = new Domain.News_type();
            m_nt.parent_id       = txt_parent_id;
            m_nt.title           = txt_title;
            m_nt.sort_id         = txt_sort_id;
            m_nt.seo_title       = txt_seo_title;
            m_nt.seo_keywords    = txt_seo_keywords;
            m_nt.seo_description = txt_seo_description;
            var res = b_nt.Save(m_nt);

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

            return(Json(json));
        }
Пример #2
0
        public JsonResult EditNews_type(int id, int txt_parent_id, string txt_title, int?txt_sort_id, string txt_seo_title, string txt_seo_keywords, string txt_seo_description)
        {
            Common.Json         json = new Common.Json();
            DAO.BLL.B_News_type b_nt = new DAO.BLL.B_News_type();
            var m_nt = b_nt.Get(id);

            m_nt.parent_id       = txt_parent_id;
            m_nt.title           = txt_title;
            m_nt.sort_id         = txt_sort_id;
            m_nt.seo_title       = txt_seo_title;
            m_nt.seo_keywords    = txt_seo_keywords;
            m_nt.seo_description = txt_seo_description;
            b_nt.Update(m_nt);
            json.msg = "修改成功!";
            return(Json(json));
        }