public ActionResult Edit(int id)
        {
            var model = new ads_dao().GetById(id);

            SetListPosition(model.advertisement_position_id);
            return(View(model));
        }
        public ActionResult Index(int page = 1, int page_size = 10)
        {
            var dao   = new ads_dao();
            var model = dao.ListAllPaging(page, page_size);

            return(View(model));
        }
        public JsonResult ChangeActive(int id)
        {
            var result = new ads_dao().ChangeActive(id);

            return(Json(new
            {
                status = result
            }));
        }
        public JsonResult IncreaseClickAd(int id)
        {
            var result = new ads_dao().IncreaseClickCount(id);

            return(Json(new
            {
                status = result
            }));
        }
        public ActionResult Index()
        {
            var content_dao = new content_dao();
            var ad_dao      = new ads_dao();

            var model = content_dao.ListTopNewContent_By_Category(0, 6);

            ViewBag.ListBanner = ad_dao.ListAd_ByPostion("1280x500");
            return(View(model));
        }
 public ActionResult DeleteAllChecked(string ids)
 {
     if (ids != "" && ids != null)
     {
         string[] array_id = ids.Split(',');
         var      dao      = new ads_dao();
         foreach (var id in array_id)
         {
             dao.Delete(int.Parse(id));
         }
     }
     return(RedirectToAction("Index"));
 }
Exemple #7
0
        public ActionResult Detail(int match_id)
        {
            var match_dao = new match_dao();
            var model     = match_dao.Get_By_Id(match_id);

            ViewBag.ListGoal    = new match_goal_dao().ListGoal_ByMatchID(match_id);
            ViewBag.TopViewPost = new content_dao().ListTopViewContent_By_Category(0, 3);
            ViewBag.MatchName   = match_dao.GetMatchName_ByMatchID(match_id);

            //advertisement
            var ad_dao = new ads_dao();

            ViewBag.Advertisement_300x250 = ad_dao.GetAdvertisement_By_Type("300x250");

            return(View(model));
        }
        public ActionResult Detail(long ID)
        {
            var content_dao          = new content_dao();
            var content_category_dao = new content_category_dao();

            var model = content_dao.View_DetailContent_By_ID(ID);

            ViewBag.ContentTag  = new tag_dao().ListAllTag_By_ContentID(ID);
            ViewBag.RelatedPost = content_dao.ListTopView_RelatedPost_By_ContentID(ID, 3);

            //advertisement
            var ad_dao = new ads_dao();

            ViewBag.Advertisement_300x250 = ad_dao.GetAdvertisementByType("300x250");
            ViewBag.Advertisement_300x600 = ad_dao.GetAdvertisementByType("300x600");

            return(View(model));
        }
Exemple #9
0
        // GET: Admin/home
        public ActionResult Index()
        {
            var ads_dao     = new ads_dao();
            var content_dao = new content_dao();

            // ViewBag - return List<>
            ViewBag.ListContentTag  = new content_tag_dao().ListTag_NumberContent_Des(10);
            ViewBag.ListContentView = content_dao.ListContent_ViewCount_Des(7);

            ViewBag.ListAdClick = ads_dao.ListAd_ClickCount_Des(10);

            //ViewBag - return 1 value not List<>
            ViewBag.TotalClickAd = ads_dao.Check_TotalClickAd();

            ViewBag.TotalShareContent = content_dao.Check_TotalShareContent();
            ViewBag.TotalViewContent  = content_dao.Check_TotalViewContent();

            return(View());
        }
        public ActionResult Edit(advertisement ad)
        {
            if (ModelState.IsValid)
            {
                var dao     = new ads_dao();
                var session = (UserLogin)Session[CommonConstants.USER_SESSION];
                ad.modified_by = session.username;

                var result = dao.Update(ad);
                if (result)
                {
                    SetAlert(StaticResources.Resources.Pub_UpdateSucess, "success");
                    return(RedirectToAction("Index", "Advertisement"));
                }
                else
                {
                    ModelState.AddModelError("", StaticResources.Resources.UpdateAdsPostitionFailed);
                }
            }
            SetListPosition(ad.advertisement_position_id);
            return(View());
        }
        public ActionResult Create(advertisement ad)
        {
            if (ModelState.IsValid)
            {
                var dao     = new ads_dao();
                var session = (UserLogin)Session[CommonConstants.USER_SESSION];
                ad.created_by = session.username;

                bool result = dao.Insert(ad);
                if (result)
                {
                    SetAlert(StaticResources.Resources.Pub_InsertSuccess, "success");
                    return(RedirectToAction("Index", "Advertisement"));
                }
                else
                {
                    ModelState.AddModelError("", StaticResources.Resources.InsertAdvertisementFailed);
                }
            }
            SetListPosition();
            return(View());
        }