示例#1
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();
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                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();
                }

                //lblTodayVisitCount.Text = Tools.ChageEnc(LogsBOL.GetTodayLogs().ToString());
            }
            catch (Exception err)
            {
            }


            DateTime CurDT = DateTime.Now;

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

            DateTimeMethods dtm = new DateTimeMethods();

            lblDate.Text = Tools.ChangeEnc(dtm.GetPersianLongDate(DateTime.Now));

            #region Load Scripts
            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 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 script2 = new HtmlGenericControl("script");
            script2.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jquery-ui-1.7.2.min.js"));
            script2.Attributes.Add("type", "text/javascript");
            Page.Header.Controls.Add(script2);

            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 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 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 scriptSequence = new HtmlGenericControl("script");
            scriptSequence.Attributes.Add("src", this.ResolveClientUrl("~/Scripts/jquery.sequence-min.js"));
            scriptSequence.Attributes.Add("type", "text/javascript");
            Page.Header.Controls.Add(scriptSequence);



            //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();
            //                                 { text: 'لایحه موافقت‌نامه تجارت آزاد بین ایران و سوریه تقدیم مجلس شد', link: '/News/No/13209', title: 'شنبه, 28 خرداد 1390 13:22' },
            IQueryable <vNews> LatestTelexNews = NewsBOL.GetLatestTelexNews(5, 1);
            foreach (var NewsItem in LatestTelexNews)
            {
                string   CurTitle    = NewsItem.Title.Replace("'", "").Replace("\"", "");
                DateTime?NewsDate    = NewsItem.NewsDate;
                string   PersianDate = "";
                if (NewsDate != null)
                {
                    PersianDate = dtm.GetPersianLongDate((DateTime)NewsDate);
                }
                strTypingNews += "{ text: '" + CurTitle + "', link: '/News/ShowNews.aspx?Code=" + NewsItem.Code + "', title: '" + PersianDate + "' },";
            }
            if (strTypingNews.Length > 0)
            {
                strTypingNews = strTypingNews.Substring(0, strTypingNews.Length - 1);
            }
        }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            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)")
            {
                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 (Exception err)
        {
        }


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

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

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

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

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

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

        HtmlGenericControl script = new HtmlGenericControl("script");
        script.Attributes.Add("src", this.ResolveClientUrl("https://static.Khabardaan.ir/Scripts/mainv1.2.js"));
        script.Attributes.Add("type", "text/javascript");
        Page.Header.Controls.Add(script);

        HtmlGenericControl script2 = new HtmlGenericControl("script");
        script2.Attributes.Add("src", this.ResolveClientUrl("https://static.Khabardaan.ir/Scripts/farsi.js"));
        script2.Attributes.Add("type", "text/javascript");
        Page.Header.Controls.Add(script2);
        #endregion
    }