Example #1
0
        public ActionResult Add(ArticleClassModel model)
        {
            ArticleClassInfo info = new ArticleClassInfo();
            //获取当前登录用户信息
            string       ck           = WebHelper.GetCookie("bs", "uname");
            PartUserInfo partUserInfo = Users.GetPartUserByName(ck);

            if (ModelState.IsValid)
            {
                info.ClassName            = model.ClassName;
                info.ParentArticleClassID = model.ParentArticleClassID;
                info.ClassType            = model.ClassType;
                info.Target       = model.Target;
                info.IsWeb        = model.IsWeb;
                info.IsNav        = model.IsNav;
                info.WebUrl       = model.WebUrl == null ? "" : model.WebUrl;
                info.IsAdmin      = model.IsAdmin;
                info.AdminUrl     = model.AdminUrl == null ? "" : model.AdminUrl;
                info.DisplayOrder = model.DisplayOrder;
                info.IsOpen       = model.IsOpen;
                info.ListView     = model.ListView;
                info.ContentView  = model.ContentView;
                info.Code         = model.Code;
                info.ImgUrl       = model.ImgUrl;
                info.Keyword      = model.Keyword == null ? "" : model.Keyword;
                info.Description  = model.Description == null ? "" : model.Description;
                info.IsClassBrand = model.IsClassBrand;
                info.Subhead      = model.Subhead;
                info.Auditor      = ck;
                info.IsShowNews   = model.IsShowNews;
                ArticleClass.Create(info);
                AddLog(info, "分类新加成功");
                //AddAdminOperateLog
                return(PromptView("分类新加成功"));
            }
            Loads();
            return(View(model));
        }