Example #1
0
    protected void DDL_SiteList_TextChanged(object sender, EventArgs e)
    {
        IList <SiteAdsInfo> list = new SiteAdsService().SelectSiteAdsById(new Guid(DDL_SiteList.SelectedValue));

        RPT_AdsList.DataSource = list;
        RPT_AdsList.DataBind();
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DDL_SiteList.DataSource     = adsSiteDal.SelectAllSite();
            DDL_SiteList.DataValueField = "SiteId";
            DDL_SiteList.DataTextField  = "SiteName";
            DDL_SiteList.DataBind();
            DDL_SiteList.Items.Insert(0, new ListItem("所有", Guid.Empty.ToString()));

            //显示网站名称和地址
            if (!string.IsNullOrEmpty(Request.QueryString["siteid"]))
            {
                try
                {
                    DDL_SiteList.SelectedValue = Request.QueryString["siteid"];
                    IList <SiteAdsInfo> list = new SiteAdsService().SelectSiteAdsById(new Guid(DDL_SiteList.SelectedValue));
                    RPT_AdsList.DataSource = list;
                    RPT_AdsList.DataBind();
                }
                catch (Exception ex) { }
            }

            DDL_AdsList.DataSource     = CacheCollection.GetAllAdsInfo();
            DDL_AdsList.DataValueField = "AdsId";
            DDL_AdsList.DataTextField  = "AdsName";
            DDL_AdsList.DataBind();
        }
    }
Example #3
0
    protected void DDL_SiteList_TextChanged(object sender, EventArgs e)
    {
        IList <AdsInfo> list = adsSiteDal.SelectAllAdsBySiteId(new Guid(DDL_SiteList.SelectedValue));

        RPT_AdsList.DataSource = list;
        RPT_AdsList.DataBind();
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DDL_SiteList.DataSource     = adsSiteDal.SelectAllSite();
            DDL_SiteList.DataValueField = "SiteUrl";
            DDL_SiteList.DataTextField  = "SiteName";
            DDL_SiteList.DataBind();
            DDL_SiteList.Items.Insert(0, new ListItem("所有", Guid.Empty.ToString()));

            //显示网站名称和地址
            if (!string.IsNullOrEmpty(Request.QueryString["url"]))
            {
                try
                {
                    IList <SiteAdsInfo> list = siteAdsDal.SelectAllSiteAds(Request.QueryString["url"]);
                    RPT_AdsList.DataSource = list;
                    RPT_AdsList.DataBind();

                    DDL_SiteList.SelectedValue = Request.QueryString["url"];
                }
                catch (Exception ex) { }
            }
        }
    }
Example #5
0
    protected void DDL_SiteList_TextChanged(object sender, EventArgs e)
    {
        IList <SiteAdsInfo> list = siteAdsDal.SelectAllSiteAds(DDL_SiteList.SelectedValue);

        RPT_AdsList.DataSource = list;
        RPT_AdsList.DataBind();
    }
Example #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string nick = "";
            if (Request.Cookies["nick"] != null)
            {
                nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value); //"nick";
            }
            else
            {
                nick = Session["snick"].ToString();
            }
            if (nick == "")
            {
                Response.Write("请重新登录");
                return;
            }
            IList <UserAdsInfo> list = uasDal.SelectAllUserAdsList(nick);

            //IList<UserAdsInfo> useradsList = uasDal.SelectAllUserAds(nick);
            IList <BuyInfo> buyList = CacheCollection.GetAllBuyInfo().Where(o => o.Nick == nick).ToList();

            ViewState["toucount"]   = list.Where(o => o.UserAdsState == 1).ToList().Count;
            ViewState["notoucount"] = list.Where(o => o.UserAdsState != 1).ToList().Count;
            if (buyList.Count > 0)
            {
                ViewState["adscount"] = CacheCollection.GetAllFeeInfo().Where(o => o.FeeId == buyList[0].FeeId).ToList()[0].AdsCount;
            }

            if (Request.QueryString["istou"] == "1")
            {
                list = list.Where(o => o.UserAdsState == 1).ToList();
                Lbl_ShowAdsDec.Text = "投放中的广告";
            }
            else
            {
                list = list.Where(o => o.UserAdsState != 1).ToList();
                Lbl_ShowAdsDec.Text = "未投放的广告";
            }

            int TotalCount = list.Count;
            int TotalPage  = 1; //总页数

            int page = 1;
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["Page"]))
                {
                    page = int.Parse(Request.QueryString["Page"]);
                }
            }
            catch { }

            pds.DataSource  = list;
            pds.AllowPaging = true;
            pds.PageSize    = 5;

            if (TotalCount == 0)
            {
                TotalPage = 1;
            }
            else
            {
                if (TotalCount % pds.PageSize == 0)
                {
                    TotalPage = TotalCount / pds.PageSize;
                }
                else
                {
                    TotalPage = TotalCount / pds.PageSize + 1;
                }
            }

            pds.CurrentPageIndex = page - 1;
            lblCurrentPage.Text  = "共" + TotalCount.ToString() + "条记录 当前页:" + page + "/" + TotalPage;

            string paramArray = Request.QueryString["istou"] == "1" ? "&istou=1" : "";

            lnkFrist.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=1" + paramArray;
            if (!pds.IsFirstPage)
            {
                lnkPrev.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + (page - 1) + paramArray;
            }

            if (!pds.IsLastPage)
            {
                lnkNext.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + (page + 1) + paramArray;
            }
            lnkEnd.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + TotalPage + paramArray;

            RPT_AdsList.DataSource = pds;
            RPT_AdsList.DataBind();
        }
    }
Example #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string cid   = Request.QueryString["cid"];
            string adsId = Request.QueryString["adsid"];

            //IList<TaoBaoGoodsClassInfo> list = tbgcDal.SelectAllGoodsClass("0");

            RPT_GOODSCLASS.DataSource = new List <TaoBaoGoodsClassInfo>();
            RPT_GOODSCLASS.DataBind();


            //获取分类下所有用户投放的广告
            IList <UserAdsInfo> adsList = uadsDal.SelectAllUserAdsByAdsId(new Guid(adsId), 1);
            //按时间倒序排列
            adsList = adsList.OrderByDescending(o => o.AddTime).ToList();

            if (Request.Cookies["nick"] != null)
            {
                ShowLoginAds(adsList, HttpUtility.UrlDecode(Request.Cookies["nick"].Value));
            }
            else
            {
                if (Session["snick"] != null)
                {
                    ShowLoginAds(adsList, Session["snick"].ToString());
                }
            }

            int TotalCount = adsList.Count;
            int TotalPage  = 1; //总页数

            int page = 1;
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["Page"]))
                {
                    page = int.Parse(Request.QueryString["Page"]);
                }
            }
            catch { }

            pds.DataSource  = adsList;
            pds.AllowPaging = true;
            pds.PageSize    = 80;

            if (TotalCount == 0)
            {
                TotalPage = 1;
            }
            else
            {
                if (TotalCount % pds.PageSize == 0)
                {
                    TotalPage = TotalCount / pds.PageSize;
                }
                else
                {
                    TotalPage = TotalCount / pds.PageSize + 1;
                }
            }

            pds.CurrentPageIndex = page - 1;
            lblCurrentPage.Text  = "共" + TotalCount.ToString() + "条记录 当前页:" + page + "/" + TotalPage;

            string paramArray = "&adsId=" + adsId;

            lnkFrist.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=1" + paramArray;
            if (!pds.IsFirstPage)
            {
                lnkPrev.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + (page - 1) + paramArray;
            }

            if (!pds.IsLastPage)
            {
                lnkNext.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + (page + 1) + paramArray;
            }
            lnkEnd.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + TotalPage + paramArray;


            RPT_AdsList.DataSource = pds;
            RPT_AdsList.DataBind();
        }
    }