コード例 #1
0
        public ActionResult Create([Bind(Include = "ArticleCategoryID,ArticleCategoryName,Description,Image,MetaTitle,ParentID,DisplayOrder,SeoTitle,MetaDescription,MetaKeywords,CreateDate,CreateUser,ModifiedDate,ModifiedUser,IsActive")] ArticleCategory articleCategory)
        {
            var UserSession = (UserLogin)Session[TechDeviShopVs002.Common.CommonConstants.USER_SESSION];

            if (ModelState.IsValid)
            {
                var _dal = new ArticleCategoryDAL();

                articleCategory.CreateUser = UserSession.UserID;

                int id = _dal.Insert(articleCategory);
                if (id > 0)
                {
                    return(RedirectToAction("Index", "ArticleCategories"));
                }
                else
                {
                    ModelState.AddModelError("", "Thêm danh muc bài viết ko thành công");
                }
            }

            return(View(articleCategory));
        }
コード例 #2
0
        public void AddArticleCategoryEntity(ArticleCategoryEntity entity)
        {
            ArticleCategoryDAL dal = new ArticleCategoryDAL();

            dal.Insert(entity);
        }