public ActionResult Create([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.CreateUser = UserSession.UserID; int id = _dal.Insert(articleImage); if (id > 0) { return(RedirectToAction("Index", "ArticleImages")); } else { ModelState.AddModelError("", "Thêm ảnh bài viết ko thành công"); } } ViewBag.ArticleID = new SelectList(db.Articles, "ArticleID", "Title", articleImage.ArticleID); return(View(articleImage)); }
public void AddArticleImageEntity(ArticleImageEntity entity) { ArticleImageDAL dal = new ArticleImageDAL(); dal.Insert(entity); }