public ViewResult ImageOfArtivle(int aID)
        {
            var model = new ArticleImageDAL().ListByArticleID(aID);

            ViewBag.ADinfo = new ArticleDAL().ViewDetail(aID);
            return(View(model));
        }
        // GET: Admin/ArticleImages/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var articleImage = new ArticleImageDAL().ViewDetail(id);

            if (articleImage == null)
            {
                return(HttpNotFound());
            }
            return(View(articleImage));
        }
        // GET: Admin/ArticleImages/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var articleImage = new ArticleImageDAL().ViewDetail(id);

            if (articleImage == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ArticleID = new SelectList(db.Articles, "ArticleID", "Title", articleImage.ArticleID);
            return(View(articleImage));
        }
        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));
        }
Beispiel #5
0
        public List <ArticleImageEntity> GetArticleImagePaged(List <SqlDbParameter> parms, string OrderBy, int PageSize, int PageIndex, out int RecordCount)
        {
            ArticleImageDAL dal = new ArticleImageDAL();

            return(dal.GetAll(parms, OrderBy, PageSize, PageIndex, out RecordCount));
        }
Beispiel #6
0
        public List <ArticleImageEntity> GetAllArticleImage(List <SqlDbParameter> parms, string orderBy)
        {
            ArticleImageDAL dal = new ArticleImageDAL();

            return(dal.GetAll(parms, orderBy));
        }
Beispiel #7
0
        //返回单实体对象
        public ArticleImageEntity GetArticleImageEntity(List <SqlDbParameter> parms)
        {
            ArticleImageDAL dal = new ArticleImageDAL();

            return(dal.Get(parms));
        }
Beispiel #8
0
        public ArticleImageEntity GetArticleImageEntityById(object Id)
        {
            ArticleImageDAL dal = new ArticleImageDAL();

            return(dal.Get(Id));
        }
Beispiel #9
0
        public void DeleteArticleImageEntityById(ArticleImageEntity entity)
        {
            ArticleImageDAL dal = new ArticleImageDAL();

            dal.Delete(entity);
        }
Beispiel #10
0
        public void DisableArticleImageEntityById(object Id)
        {
            ArticleImageDAL dal = new ArticleImageDAL();

            dal.Disabled(Id);
        }
Beispiel #11
0
        public void UpdateArticleImageEntity(ArticleImageEntity entity)
        {
            ArticleImageDAL dal = new ArticleImageDAL();

            dal.Update(entity);
        }
Beispiel #12
0
        public void AddArticleImageEntity(ArticleImageEntity entity)
        {
            ArticleImageDAL dal = new ArticleImageDAL();

            dal.Insert(entity);
        }
Beispiel #13
0
        public int DelArticleImageByID(int Id)
        {
            ArticleImageDAL articleImageDAL = new ArticleImageDAL();

            return(articleImageDAL.DelArticleImageByID(Id));
        }