public ActionResult Edit([Bind(Include = "ArticleImageID,ArticleID,MetaTitle,Description,Image,CreateDate,CreateUser,ModifiedDate,ModifiedUser,IsActive")] ArticleImage articleImage)
        {
            var UserSession = (UserLogin)Session[TechDeviShopVs002.Common.CommonConstants.USER_SESSION];

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

                articleImage.ModifiedUser = UserSession.UserID;

                var _result = _dal.Update(articleImage);
                if (_result)
                {
                    return(RedirectToAction("Index", "ArticleImages"));
                }
                else
                {
                    ModelState.AddModelError("", "Cập nhật ảnh bài viết ko thành công");
                }
            }
            ViewBag.ArticleID = new SelectList(db.Articles, "ArticleID", "Title", articleImage.ArticleID);
            return(View(articleImage));
        }
Ejemplo n.º 2
0
        public void UpdateArticleImageEntity(ArticleImageEntity entity)
        {
            ArticleImageDAL dal = new ArticleImageDAL();

            dal.Update(entity);
        }