Exemplo n.º 1
0
        public void ShowLatestNews()
        {
            strPageNo = Request["PageNo"];
            try
            {
                PageNo = Convert.ToInt32(strPageNo);
                if (PageNo == 0)
                {
                    PageNo = 1;
                }
                if (PageNo > 50)
                {
                    PageNo = 50;
                }

                BOLNews NewsBOL = new BOLNews();
                IQueryable <vLatestNews> ItemList = NewsBOL.GetLatestNews(_pageSize, PageNo);
                int ResultCount = NewsBOL.GetLatestNewsCount();
                rptNewsList.DataSource = ItemList;
                rptNewsList.DataBind();

                int PageCount = ResultCount / _pageSize;
                if (ResultCount % _pageSize > 0)
                {
                    PageCount++;
                }
                pgrToolbar.PageNo    = PageNo;
                pgrToolbar.PageCount = PageCount;
                pgrToolbar.ConcatUrl = ConcatUrl;
                pgrToolbar.PageBind();
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (_hCNewsTypeCode)
            {
            case 1:
                ltrHeader.Text = "خبر";
                break;

            case 2:
                ltrHeader.Text = "یادداشت";
                break;

            case 3:
                ltrHeader.Text = "گزارش";
                break;

            case 4:
                ltrHeader.Text = "گفتگو";
                break;

            default:
                break;
            }

            BOLNews NewsBOL = new BOLNews();

            rptNews.DataSource = NewsBOL.GetLatestNews(5, _hCNewsTypeCode);
            rptNews.DataBind();

            hplArchive.NavigateUrl = "~/News/?NTC=" + _hCNewsTypeCode;
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BOLNews NewsBOL = new BOLNews();

            rptNews.DataSource = NewsBOL.GetLatestNews(4);
            rptNews.DataBind();
        }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        BOLLogs LogsBOL = new BOLLogs();

        LogsBOL.LogRequest();

        Response.ContentEncoding = System.Text.Encoding.UTF8;
        Response.ContentType     = "text/xml";
        BOLNews NewsBOL = new BOLNews();

        rptNews.DataSource = NewsBOL.GetLatestNews(10, 1);
        rptNews.DataBind();
    }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         BOLNews NewsBOL = new BOLNews();
         IQueryable <vLatestNews> ItemList = NewsBOL.GetLatestNews(10, _pageNo);
         rptNews.DataSource = ItemList;
         rptNews.DataBind();
     }
     catch
     {
     }
 }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPageNo = Request["PageNo"];
            try
            {
                PageNo = Convert.ToInt32(strPageNo);
            }
            catch
            {
            }
            if (PageNo == 0)
            {
                PageNo = 1;
            }
            if (PageNo > 50)
            {
                PageNo = 50;
            }

            BOLNews NewsBOL = new BOLNews();
            IQueryable <vLatestNews> ItemList = NewsBOL.GetLatestNews(_pageSize, PageNo);
            int ResultCount = 1000;//NewsBOL.GetLatestNewsCount();

            rptNewsList.DataSource = ItemList;
            rptNewsList.DataBind();

            int PageCount = ResultCount / _pageSize;

            if (ResultCount % _pageSize > 0)
            {
                PageCount++;
            }
            pgrToolbar.PageNo    = PageNo;
            pgrToolbar.PageCount = PageCount;
            pgrToolbar.ConcatUrl = ConcatUrl;
            pgrToolbar.PageBind();
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DateTimeMethods dtm = new DateTimeMethods();

            try
            {
                //Page.Form.Attributes.Add("enctype", "multipart/form-data");
                //ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(this.btnSend);
                BOLLogs LogsBOL  = new BOLLogs();
                int?    Result   = 1;
                string  UserCode = "";
                if (Session["UserCode"] != null)
                {
                    UserCode = Session["UserCode"].ToString();
                }
                bool HCReqTypeCode = false;
                if (Request.UserAgent == "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" ||
                    Request.UserAgent == "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" ||
                    Request.UserAgent == "msnbot/2.0b (+http://search.msn.com/msnbot.htm)._" ||
                    Request.UserAgent == "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" ||
                    Request.UserAgent == "Mozilla/5.0 (en-us) AppleWebKit/525.13 (KHTML, like Gecko; Google Web Preview) Version/3.1 Safari/525.13" ||
                    Request.UserAgent == "Mozilla/5.0 (compatible; MJ12bot/v1.3.3; http://www.majestic12.co.uk/bot.php?+)"

                    )
                {
                    HCReqTypeCode = true;
                }

                Result = LogsBOL.InsertLog(Request.UserAgent, Request.QueryString.ToString(), UserCode, Request.UserHostAddress, Request.Url.AbsolutePath, Tools.GetIranDate(), Page.Request.ServerVariables["http_referer"], HCReqTypeCode, ref Result);
                if (Result == 0)
                {
                    Response.End();
                }
            }
            catch
            {
            }


            if (!Page.IsPostBack)
            {
                //this.form1.DefaultButton = btnSearch.UniqueID;

                txtKeyword.Attributes.Add("onblur", "this.className='Keyword';if(this.value == '') this.value = '" + "جستجو" + "';");

                DateTime CurDT = DateTime.Now;
                StartHour   = CurDT.Hour.ToString();
                StartMinute = CurDT.Minute.ToString();
                StartSecond = CurDT.Second.ToString();


                lblPersianDate.Text    = Tools.ChangeEnc(dtm.GetPersianLongDate(DateTime.Now));
                lblArabicDate.Text     = Tools.ChangeEncArabic(DateTime.Now.ToString("d MMM yyyy", new CultureInfo("ar")));
                lblGerigorianDate.Text = DateTime.Now.ToString("ddd d MMM yyyy", CultureInfo.CreateSpecificCulture("en-US"));


                BOLNews NewsBOL = new BOLNews();
                rptTitleNews.DataSource = NewsBOL.GetLatestNews(60, null);
                rptTitleNews.DataBind();
            }


            #region Load Scripts
            HtmlGenericControl scriptJQuery = new HtmlGenericControl("script");
            scriptJQuery.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jquery.min1.7.2.js"));
            scriptJQuery.Attributes.Add("type", "text/javascript");
            Page.Header.Controls.Add(scriptJQuery);


            //HtmlGenericControl scriptBootstrap = new HtmlGenericControl("script");
            //scriptBootstrap.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/bootstrap.min.js"));
            //scriptBootstrap.Attributes.Add("type", "text/javascript");
            //Page.Header.Controls.Add(scriptBootstrap);


            HtmlGenericControl script = new HtmlGenericControl("script");
            script.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/main.js"));
            script.Attributes.Add("type", "text/javascript");
            Page.Header.Controls.Add(script);


            //HtmlGenericControl script2 = new HtmlGenericControl("script");
            //script2.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jquery-ui.js"));
            //script2.Attributes.Add("type", "text/javascript");
            //Page.Header.Controls.Add(script2);

            HtmlGenericControl scriptCycle = new HtmlGenericControl("script");
            scriptCycle.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jquery.cycle.all.js"));
            scriptCycle.Attributes.Add("type", "text/javascript");
            Page.Header.Controls.Add(scriptCycle);


            //HtmlGenericControl script8 = new HtmlGenericControl("script");
            //script8.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jquery.orbit.js"));
            //script8.Attributes.Add("type", "text/javascript");
            //Page.Header.Controls.Add(script8);

            //HtmlGenericControl script4 = new HtmlGenericControl("script");
            //script4.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jcarousellite_1.0.1c4.js"));
            //script4.Attributes.Add("type", "text/javascript");
            //Page.Header.Controls.Add(script4);

            //HtmlGenericControl scriptRotate = new HtmlGenericControl("script");
            //scriptRotate.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jQueryRotate.js"));
            //scriptRotate.Attributes.Add("type", "text/javascript");
            //Page.Header.Controls.Add(scriptRotate);


            HtmlGenericControl scriptTicker = new HtmlGenericControl("script");
            scriptTicker.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jquery.ticker.js"));
            scriptTicker.Attributes.Add("type", "text/javascript");
            Page.Header.Controls.Add(scriptTicker);

            HtmlGenericControl scriptFarsi = new HtmlGenericControl("script");
            scriptFarsi.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/farsi.js"));
            scriptFarsi.Attributes.Add("type", "text/javascript");
            Page.Header.Controls.Add(scriptFarsi);

            HtmlGenericControl scriptprettyPhoto = new HtmlGenericControl("script");
            scriptprettyPhoto.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jquery.prettyPhoto.js"));
            scriptprettyPhoto.Attributes.Add("type", "text/javascript");
            Page.Header.Controls.Add(scriptprettyPhoto);

            //HtmlGenericControl script3 = new HtmlGenericControl("script");
            //script3.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/scripts.min.js"));
            //script3.Attributes.Add("type", "text/javascript");
            //Page.Header.Controls.Add(script3);


            //HtmlGenericControl script5 = new HtmlGenericControl("script");
            //script5.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jquery.min.js"));
            //script5.Attributes.Add("type", "text/javascript");
            //Page.Header.Controls.Add(script5);


            #endregion


            //BOLNews NewsBOL = new BOLNews();
            //rptNewsTicker.DataSource = NewsBOL.GetLatestTelexNews(5, null);
            //rptNewsTicker.DataBind();
        }