Summary description for GUIVariables
Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        tagger = Tagger.Instance;
        log = Logger.Instance;

        seperator = gui.Seperator;

        //  QueryString Param Names.
        //  ratingID
        //  value

        string iid = string.Empty;
        string value = string.Empty;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (Request.QueryString != null && Request.QueryString.Count > 0)
        {
            //  ratingID is the Item IID.
            if (!string.IsNullOrEmpty(Request.QueryString["ratingID"]))
            {
                iid = Request.QueryString["ratingID"];
            }
            //  Value is the Rating given by the user. Value: [0, 1, 2, 3, 4]. So add +1 so as to convert Value: [1, 2, 3, 4, 5]
            if (!string.IsNullOrEmpty(Request.QueryString["value"]))
            {
                int intValue = -1;
                value = int.TryParse(Request.QueryString["value"], out intValue) ? (intValue + 1).ToString() : "-1";
            }
        }

        if (!string.IsNullOrEmpty(UID) && !string.IsNullOrEmpty(iid) && !string.IsNullOrEmpty(value))
        {
            UpdateRatings(UID, iid, value);
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        gui = GUIVariables.Instance;
        log = Logger.Instance;
        general = General.Instance;
        engine = ProcessingEngine.Instance;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.
        string UID = string.Empty;
        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (!string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.FrontPageLink, false);
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (!IsPostBack)
        {
            Control MasterPageLoginTable = this.Master.FindControl("LoginTable");
            MasterPageLoginTable.Visible = false;
        }

        UsernameTB.Focus();
        Page.Form.DefaultButton = SLoginButton.UniqueID;
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        links = Links.Instance;
        gui = GUIVariables.Instance;
        dbOps = DBOperations.Instance;
        categories = Categories.Instance;
        log = Logger.Instance;
        engine = ProcessingEngine.Instance;
        general = General.Instance;
        imageEngine = ImageEngine.Instance;

        seperator = gui.Seperator;

        if (string.IsNullOrEmpty(Request.QueryString["UID"]))
        {

        }
        else
        {
            queryStringUID = Request.QueryString["UID"].Trim().ToLower();
        }

        if (string.IsNullOrEmpty(queryStringUID))
        {

        }
        else
        {
            LoadComments(queryStringUID);
        }
    }
Beispiel #4
0
    public RssWriter(XmlWriter tw)
    {
        m_writer = tw;

        links = Links.Instance;
        gui = GUIVariables.Instance;
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        general = (General)Application["general"];
        log = (Logger)Application["log"];
        gui = (GUIVariables)Application["gui"];

        MessageLabel.Text = "Your Feedback is so very important that " + gui.StoocksFont + " had to dedicate an entire page for it!";
    }
Beispiel #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        gui = (GUIVariables)Application["gui"];

        ContactLabel.Text = "For any and all inquiries, contact "
            + gui.RedFontStart + "Vatsal H. Shah" + gui.RedFontEnd + " "
            + gui.BoldFontStart + gui.GrayFontStart + "(E-Mail: com dot vatsals at vatsals)" + gui.GrayFontEnd + gui.BoldFontEnd;
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        links = (Links)Application["links"];
        gui = (GUIVariables)Application["gui"];

        CopyrightLabel.Text = gui.SmallFontStart + gui.GrayFontStart
            + copyrightText
            + gui.GrayFontEnd + gui.SmallFontEnd;
    }
Beispiel #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        links = Links.Instance;
        gui = GUIVariables.Instance;
        dbOps = DBOperations.Instance;
        categories = Categories.Instance;
        log = Logger.Instance;
        engine = ProcessingEngine.Instance;

        WriteRSSFile();
        Response.Redirect(links.RssFeedLink, false);
    }
Beispiel #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;

        //  If not using ReCaptcha Project, but using the other Captcha Library.
        //if (!IsPostBack)
        //{
        //    HttpContext.Current.Session["CaptchaImageText"] = general.GenerateRandomCode();
        //}
    }
Beispiel #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        links = (Links)Application["links"];
        general = (General)Application["general"];
        gui = (GUIVariables)Application["gui"];
        engine = (ProcessingEngine)Application["engine"];

        AboutStoockerLabel.Text = gui.GrayFontStart
            + gui.StoocksFont + " is a Stock Recommendation Engine." + gui.LineBreak
            + "Maintain a " + gui.GreenFontStart + "Portfolio" + gui.GreenFontEnd + " of your stocks." + gui.LineBreak
            + "Get updated " + gui.GreenFontStart + "News" + gui.GreenFontEnd + " about the latest happenings in the Stock Market." + gui.LineBreak
            + gui.GreenFontStart + "Predict" + gui.GreenFontEnd + " tomorrows movement of your favorite stocks." + gui.LineBreak
            + "See what the other users " + gui.GreenFontStart + "Recommend" + gui.GreenFontEnd + " about the stock movement for tomorrow."
            + gui.GrayFontEnd;
    }
Beispiel #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        general = General.Instance;
        log = Logger.Instance;
        gui = GUIVariables.Instance;

        MessageLabel.Text = "Your Feedback is so very important that we dedicated an entire page just for getting your feedback!";

        //Uncomment to Test If File Read/Write is working Fine.
        //string logPath = HttpRuntime.AppDomainAppPath + ConfigurationManager.AppSettings["logPath"];
        //string feedbackPath = HttpRuntime.AppDomainAppPath + ConfigurationManager.AppSettings["feedbackPath"];
        //OutputLabel.Text = "Log: " + logPath + gui.LineBreak + "Feedback: " + feedbackPath;

        if (!IsPostBack)
        {
            HttpContext.Current.Session["CaptchaImageText"] = general.GenerateRandomCode();
        }
    }
Beispiel #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        gui = (GUIVariables)Application["gui"];

        AboutLabel.Text = gui.GrayFontStart
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + gui.StoocksFont + " is a Stock Recommendation Engine." + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + "Helps you take informed decisions about stock investments." + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + "Maintain a " + gui.GreenFontStart + "Portfolio" + gui.GreenFontEnd + " of your stocks." + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + "Get updated " + gui.GreenFontStart + "News" + gui.GreenFontEnd + " about the latest happenings in the Stock Market." + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + gui.GreenFontStart + "Predict" + gui.GreenFontEnd + " tomorrows movement of your favorite stocks." + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + "See what the other users " + gui.GreenFontStart + "Recommend" + gui.GreenFontEnd + " about the stock movement for tomorrow."
            + gui.GrayFontEnd;

        ExplanationLabel.Text = gui.LineBreak + gui.BoldFontStart + gui.RedFontStart + "How does the engine work?" + gui.RedFontEnd + gui.BoldFontEnd + gui.LineBreak
            + gui.GrayFontStart
            + gui.SmallFontStart + "Note: User A represents all users who use stoocker.com, and Stock X represents all the stocks that are currently being tracked by the users." + gui.SmallFontEnd + gui.LineBreak
            + "(1) User A " + gui.BlueFontStart + "Registers" + gui.BlueFontEnd + " at stoocker.com." + gui.LineBreak
            + "(2) User A " + gui.BlueFontStart + "Creates a Portfolio" + gui.BlueFontEnd + " of the stocks he/she is interested in." + gui.LineBreak
            + "(3) User A can now Login and get" + gui.BlueFontStart + " Updated Stock Feeds" + gui.BlueFontEnd + " and " + gui.BlueFontStart + "Latest News" + gui.BlueFontEnd + " tailored according to User A's portfolio." + gui.LineBreak
            + "(4) User A can make an " + gui.BlueFontStart + "Informed Prediction" + gui.BlueFontEnd + " about whether the price of a particular stock (say stock X) will go up or will go down tomorrow." + gui.LineBreak
            + "(5) The stoocker Recommendation Engine takes this recommendation from User A and blends it into the combined predictions of all other Users who have also made a recommendation on Stock X. " + gui.LineBreak
            + "(6) The stoocker Engine uses its own mix of " + gui.BlueFontStart + "Machine Algorithms" + gui.BlueFontEnd + " which then make an inference on the movement of Stock X for tomorrow." + gui.LineBreak
            + "(7) This Prediction helps all the other Users who have stock X added to their portfolio, in making a decision on whether to buy or sell Stock X in the very-near future." + gui.LineBreak
            + "(8) The influence of User A (for Stock X) on the stoocker Recommendation Engine fluctuates according to the number of accurate predictions User A makes for Stock X. " + gui.LineBreak
            //+ "(8) If User A predicted the movement correctly, User A will carry a much higher weight the next time User A makes a prediction," + gui.LineBreak
            //+ "     but if User A makes an incorrect prediction, User A's influence on the stoocker Engine will be drastically reduced." + gui.LineBreak
            //+ "     Thus overtime, those who keep making correct recommendations keep on gaining higher respect from the algorithm and " + gui.LineBreak
            //+ "     Those who keep making false predictions get treated as spam and discarded." + gui.LineBreak
            + "(9) All in all, stoocker.com tries to " + gui.BlueFontStart + "Approximate who the best Investor's" + gui.BlueFontEnd + "  are and then makes a recommendation for short-term price movement changes based on the collaborative judgement and intuition of those experts." + gui.LineBreak
            + gui.GrayFontEnd;

        AdvantageLabel.Text = gui.LineBreak + gui.BoldFontStart + gui.RedFontStart + "Advantages" + gui.RedFontEnd + gui.BoldFontEnd + gui.LineBreak
            + gui.GrayFontStart
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + gui.GreenFontStart + "Extremely Simple" + gui.GreenFontEnd + " and " + "Easy to Use." + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + gui.GreenFontStart + "Very Secure" + gui.GreenFontEnd + " (User's can only view their own portfolio and not the portfolio of others.)" + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + gui.GreenFontStart + "Scalable" + gui.GreenFontEnd + " (across 1000's of users with Accuracy of the Algorithm increasing in proportion to the number of users who use it everyday.)" + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + "The system might just make you a lot of money (or save you a lot of money) if you keep tracking what the crowd thinks about the stocks you follow." + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + "Helps you " + gui.GreenFontStart + " Take the Right Investment Decision At The Right Time." + gui.GreenFontEnd + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + "Unearths and Taps the intuition of the best investor's from a pool of large number of users. (Who knows, afterall your Mother might have a better judgement and intuition than you have." + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + "If nothing else, it does improve your judgement and intuition." + gui.LineBreak
            + gui.RedFontStart + ">>" + gui.RedFontEnd + " " + gui.GreenFontStart + "Absolutely Free" + gui.GreenFontEnd + " (Unlike those sites which make you pay just for getting expert advice.)" + gui.LineBreak
            + gui.GrayFontEnd;
    }
Beispiel #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        gui = GUIVariables.Instance;
        log = Logger.Instance;
        general = General.Instance;
        engine = ProcessingEngine.Instance;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.
        string UID = string.Empty;
        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (!string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.FrontPageLink, false);
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists
    }
Beispiel #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;
        categories = Categories.Instance;
        tokenizer = Tokenizer.Instance;
        tagger =Tagger.Instance;
        imageEngine = ImageEngine.Instance;
        log = Logger.Instance;

        spamDetection = (SpamDetection)Application["spamDetection"];

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.LoginLink, false);
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        StringBuilder explanationSB = new StringBuilder();

        explanationSB.Append(gui.GreenFontStart);
        explanationSB.Append(gui.BoldFontStart);

        explanationSB.Append("Posting News has never been this easy!");
        explanationSB.Append(gui.LineBreak);

        explanationSB.Append(gui.HTMLTab + "(1) Copy and Paste the Link of the news/webpage you want to Post.");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append(gui.HTMLTab + "(2) Click on the \"Get Title\" Button to automatically get the Title,");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append(gui.HTMLTab + "OR, Write a Descriptive Title.");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append(gui.HTMLTab + "(3) Select an appropriate Category.");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append("And you are done!");
        explanationSB.Append(gui.LineBreak);

        explanationSB.Append(gui.BoldFontEnd);
        explanationSB.Append(gui.GreenFontEnd);

        explanationSB.Append(gui.LineBreak);
        explanationSB.Append(gui.LineBreak);

        explanationSB.Append("If submitting a link, keep the text section empty.");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append("If submitting text, keep the link section empty.");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append("If there is a link, the text section will be ignored.");

        ExplanationLabel.Text = explanationSB.ToString();

        AddTags();

        //  For the Bookmarklet.
        //  Check the Tools.aspx page for matching the Title/Link parameters.
        if (!string.IsNullOrEmpty(Request.QueryString["title"]) && !string.IsNullOrEmpty(Request.QueryString["url"]))
        {
            TitleTB.Text = Request.QueryString["title"].Trim();
            LinkTB.Text = Request.QueryString["url"];
        }

        //  If not using ReCaptcha Project, but using the Captcha Library.
        //if (!IsPostBack)
        //{
        //    HttpContext.Current.Session["CaptchaImageText"] = general.GenerateRandomCode();
        //    //  log.Log("Inside !IsPostBack : " + HttpContext.Current.Session["CaptchaImageText"].ToString());
        //}
    }
Beispiel #15
0
    protected override void OnInit(EventArgs e)
    {
        try
        {
            links = Links.Instance;
            gui = GUIVariables.Instance;
            dbOps = DBOperations.Instance;
            categories = Categories.Instance;
            log = Logger.Instance;
            engine = ProcessingEngine.Instance;
            general = General.Instance;
            imageEngine = ImageEngine.Instance;
            gui = GUIVariables.Instance;
            itemDisplayer = ItemDisplayer.Instance;

            if (Request != null)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["category"]))
                {
                    requestedTag = Request.QueryString["category"].Trim();
                }
            }

            #region CookieAlreadyExists
            //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

            if (Request.Cookies["getputsCookie"] != null)
            {
                HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
                UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
            }

            //TopAboutLabel.Text = "getputs is a utility for discovering, sharing and recommending user generated content."
            //    + gui.LineBreak
            //    + "Read/Post the latest/hottest news and classified submissions, ask queries, discuss your views!";

            TopAboutLabel.Text = gui.GrayFontStart
                + "getputs is a utility for discovering, sharing, and recommending news."
                + gui.GrayFontEnd;

            if (string.IsNullOrEmpty(UID))
            {
                TopAboutTable.Visible = true;

                //  If the Page is SLogin.aspx, then the LoginTable will not be visible.
                //  Else it is going to be visible in anycase.
                //  LoginTable.Visible = true;

                UsernameTB.Focus();
                Page.Form.DefaultButton = LoginButton.ID;

                //LoginHL.Visible = true;
                //RegisterHL.Visible = true;

                //  SubmitHL.Visible = false;
                SubmitHL.Visible = true;
                SavedHL.Visible = false;
                UserAccountHL.Visible = false;
                MyNewsHL.Visible = false;

                LogoutHL.Visible = false;

                UserWelcomeLabel.Text = "";

                PostItDiv.Visible = true;

            }
            else
            {
                TopAboutTable.Visible = false;

                LoginTable.Visible = false;

                //LoginHL.Visible = false;
                //RegisterHL.Visible = false;

                SubmitHL.Visible = true;
                SavedHL.Visible = true;
                UserAccountHL.Visible = true;
                MyNewsHL.Visible = true;

                LogoutHL.Visible = true;
                UserAccountHL.NavigateUrl = links.UserDetailsPageLink + "?UID=" + UID;

                //  UserWelcomeLabel.Text = gui.GrayFontStart + "Welcome " + UID + gui.GrayFontEnd;
                UserWelcomeLabel.Text = gui.BoldFontStart + gui.GreenFontStart + "Welcome " + UID + gui.GreenFontEnd + gui.BoldFontEnd;

                PostItDiv.Visible = false;

                //  Vatsal Shah | 2009-08-08 | LogVisitor() Throws a lot of errors. Thus commented for now.
                //  LogVisitor(UID);
            }

            //  PopularCategoriesLabel.Visible = false;
            //  CategoryDiv.Visible = false;
            //  MoreHL.Visible = false;

            //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
            #endregion CookieAlreadyExists

            RandomNewsHL.Text = gui.BlueFontStart + "Bored? " + gui.BlueFontEnd
                //  + gui.LineBreak
                + gui.GreenFontStart + "Read random stuff" + gui.GreenFontEnd;

            CopyrightLabel.Text = gui.SmallFontStart + gui.GrayFontStart
                + copyrightText
                + gui.GrayFontEnd + gui.SmallFontEnd;

            #region RandomQuoteFact
            Random randomQuoteFact = new Random();
            int randomQuoteFactInt = randomQuoteFact.Next(0, 100);

            if (randomQuoteFactInt % 2 == 0)    //  Serve Facts
            {
                gp.Files.FileLoader.FilePath = HttpRuntime.AppDomainAppPath + ConfigurationManager.AppSettings["FilesPath"];
                string randomFact = gp.Files.FactDB.Instance.GetRandomFact();
                if (!string.IsNullOrEmpty(randomFact))
                {
                    QuoteFactLiteral.Text = gui.BoldFontStart + gui.GreenFontStart + "getputs Fact: " + gui.GreenFontEnd + gui.BoldFontEnd + gui.LineBreak
                        + gui.GrayFontStart + randomFact + gui.GrayFontEnd;
                }
            }
            else    //  Serve Quotes
            {
                gp.Files.FileLoader.FilePath = HttpRuntime.AppDomainAppPath + ConfigurationManager.AppSettings["FilesPath"];
                string randomQuote = gp.Files.QuoteDB.Instance.GetRandomQuote();
                if (!string.IsNullOrEmpty(randomQuote))
                {
                    randomQuote = randomQuote.Replace("|", gui.LineBreak + " - <i>") + "</i>";
                    QuoteFactLiteral.Text = gui.BoldFontStart + gui.GreenFontStart + "getputs Quote: " + gui.GreenFontEnd + gui.BoldFontEnd + gui.LineBreak
                        + gui.GrayFontStart + randomQuote + gui.GrayFontEnd;
                }
            }
            #endregion RandomQuoteFact

            #region RandomTip

            gp.Files.FileLoader.FilePath = HttpRuntime.AppDomainAppPath + ConfigurationManager.AppSettings["FilesPath"];
            string randomTip = gp.Files.TipsDB.Instance.GetRandomTip();
            if (!string.IsNullOrEmpty(randomTip))
            {
                //  TipLiteral.Text = gui.MediumFontStart + gui.GrayFontStart + randomTip + gui.GrayFontEnd + gui.MediumFontEnd;
                TipLiteral.Text = randomTip;
            }

            #endregion RandomTip

            GetNavigationTableURL();
            LoadCategoryTable(UID);
            AddMouseEffects();

            //  Load the Carousels only for the Front-Page (Default.aspx)
            //  For all other pages CarouselDiv would be invisible.
            CarouselDiv.Visible = false;
            //  Make the TopAboutTable Invisible for any page other than the Front-Page (Default.aspx)
            TopAboutTable.Visible = false;

            StringBuilder strScript = new StringBuilder();
            strScript.Append("var itemImageList = [];");
            strScript.Append("var itemContentList = [];");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "CarouselJavaScript", strScript.ToString(), true);

            //List<Item> itemList = engine.LoadItemDB(ProcessingEngine.Sort.New);
            //if (itemList != null && itemList.Count > 0)
            //{
            //    LoadItemImageCarousel(itemList);
            //    LoadItemNewsCarousel(itemList);
            //}

            ////  string pagename = System.IO.Path.GetFileName(Request.ServerVariables["SCRIPT_NAME"]);
            //string pagename = Path.GetFileName(System.Web.HttpContext.Current.Request.Url.AbsolutePath);
            //if (links.FrontPageLink.EndsWith(pagename))     //  Load the Carousels only for the Front-Page (Default.aspx)
            //{
            //    List<Item> itemList = engine.LoadItemDB(ProcessingEngine.Sort.New);
            //    if (itemList != null && itemList.Count > 0)
            //    {
            //        LoadItemImageCarousel(itemList);
            //        LoadItemNewsCarousel(itemList);
            //    }

            //}
            //else    //  Do not show the CarouselDiv.
            //{
            //    CarouselDiv.Visible = false;

            //    //  Instantiate Empty JavaScriptLists so as to avoid Client Side Exceptions.
            //    StringBuilder strScript = new StringBuilder();
            //    strScript.Append("var itemImageList = [];");
            //    strScript.Append("var itemContentList = [];");
            //    Page.ClientScript.RegisterClientScriptBlock(GetType(), "CarouselJavaScript", strScript.ToString(), true);

            //    //  Make the TopAboutTable Invisible for any page other than the Front-Page (Default.aspx)
            //    TopAboutTable.Visible = false;
            //}

            //  SearchTB.Attributes.Add("onkeypress", "if ((event.which ? event.which : event.keyCode) == 13){var sendElem = document.getElementById(\"SearchButton\"); if(!sendElem.disabled) DoSearch(); }");
            //  SearchTB.Attributes.Add("onkeypress", "if ((event.which ? event.which : event.keyCode) == 13){document.getElementById('SearchButton').click()}");
            //  SearchTB.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + SearchButton.ID + "').click();return false;}} else {return true}; ");

        }
        catch (Exception ex)
        {
            if (log.isLoggingOn && log.isAppLoggingOn)
            {
                log.Log("Error in getputs.master: OnInit() Method: ");
                log.Log(ex);
            }
        }
    }
Beispiel #16
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected void Page_Load(object sender, EventArgs e)
    {
        DirectContactButton.Visible = false;

        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        categories = Categories.Instance;
        tagger = Tagger.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            user = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(user))
        {
            //  Response.Redirect(links.LoginLink, false);
            MessageLabel.Text = gui.RedFontStart + "Please login to enter a comment." + gui.RedFontEnd;
        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (string.IsNullOrEmpty(Request.QueryString["IID"]))
        {
            Response.Redirect(links.FrontPageLink, false);
        }
        else
        {
            iid = Request.QueryString["IID"].Trim().ToLower();
        }

        if (!general.IsValidInt(iid))
        {

        }
        else
        {
            LoadItemDetails(iid);
            LoadComments(iid);
        }
    }
Beispiel #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        rssReader = (RssReader)Application["rssReader"];
        gui = (GUIVariables)Application["gui"];
        stockService = (StockService)Application["stockService"];
        links = (Links)Application["links"];
        log = (Logger)Application["log"];

        NewsSearchLabel.Text = gui.GreenFontStart + "Enter a Stock Symbol: " + gui.GreenFontEnd;

        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());

            GoBackLink.Text = "Home Page";
            LogoutLink.Visible = true;
        }
        else
        {
            GoBackLink.Text = "Login";
            LogoutLink.Visible = false;
        }

        //  if (!Page.IsPostBack)
        {
            GetNews(newsFeedsTable);
            RenderNews();

            StockTable.Visible = false;
        }
    }
Beispiel #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        gui = (GUIVariables)Application["gui"];
        links = (Links)Application["links"];
        engine = (ProcessingEngine)Application["engine"];

        //  username = Convert.ToString(Session["username"]);

        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(username))
        {
            Response.Redirect(links.SessionExpiredPageLink);
        }

        FindStockTB.Attributes.Add("onkeypress", "if ((event.which ? event.which : event.keyCode) == 13){document.getElementById('" + FindStockButton.UniqueID + "').click(); }");

        //  InterestsLabel.Text = "Select the Stocks you would like to <font color=\"Red\">Stoock!!<\font>";
        InterestsLabel.Text = "Other User's have been making predictions for the stocks shown."
            + "Select the Stocks you would like to " + gui.StoockFont
            + gui.LineBreak + "(Max. of " + gui.RedFontStart + maxStocksPerUser.ToString() + gui.RedFontEnd + " stocks allowed)";

        string findStockMessage = "Could not find the Symbol you were looking for?"
                + gui.LineBreak + gui.StoocksFont + " only shows the Stocks which other Stoockers have predicted."
                + gui.LineBreak  + "Type the Symbol of the Stock you want to analyze and " + gui.StoocksFont + " will add the Symbol for You.";
        FindStockLabel.Text = findStockMessage;

        if (!Page.IsPostBack)
        {
            FillStocksCBL();
            ShowAlreadySelectedStocks(username);

            //  AlphabeticButton.Attributes.Add("onmouseover", "this.style.backgroundColor='red'");
            //  AlphabeticButton.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");
        }

        for (int i = 0; i < StocksCBL.Items.Count; i++)
        {
            StocksCBL.Items[i].Attributes.Add("onmouseover", "this.style.backgroundColor='red'");
            StocksCBL.Items[i].Attributes.Add("onmouseout", "this.style.backgroundColor='white'");
        }

        FindStockTB.Attributes.Add("onkeypress", "if ((event.which ? event.which : event.keyCode) == 13){var sendElem = document.getElementById(\"FindStockButton\"); if(!sendElem.disabled) FindStockButton_Click(); }");
    }
Beispiel #19
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["sort"]))
        {
            string sortStr = Convert.ToString(Request.QueryString["sort"]);
            sort = engine.GetSortType(sortStr);
        }

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.LoginLink, false);
        }
        else
        {
            MessageLabel.Text = gui.GreenFontStart + UID + "'s Saved Items" + gui.GreenFontEnd;
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        LoadItemDB(sort);
    }
Beispiel #20
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        MyAccountLink.Visible = false;

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["sort"]))
        {
            string sortStr = Convert.ToString(Request.QueryString["sort"]);
            sort = engine.GetSortType(sortStr);
        }

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.FrontPageLink, false);
        }
        else
        {
            string queryString = "SELECT PreferredCategories FROM user WHERE UID='" + UID + "';";
            MySqlDataReader retList = dbOps.ExecuteReader(queryString);

            string prefferedCategoriesStr = string.Empty;
            if (retList != null && retList.HasRows)
            {
                while (retList.Read())
                {
                    prefferedCategoriesStr = Convert.ToString(retList["PreferredCategories"]);
                }
                retList.Close();
            }

            if (string.IsNullOrEmpty(prefferedCategoriesStr))
            {
                MessageLabel.Text = "Please visit the My Account Page and select the Categories that you would like to read more news from.";
                MyAccountLink.Visible = true;
                MyAccountLink.NavigateUrl = links.UserDetailsPageLink + "?UID=" + UID;
            }
            else
            {
                MyAccountLink.Visible = false;

                List<string> preferredCategoriesList = GetPreferredCategoriesList(prefferedCategoriesStr);
                List<Item> itemList = LoadItemDB(sort, preferredCategoriesList);
                if (itemList != null && itemList.Count > 0)
                {
                    MessageLabel.Text = gui.GreenFontStart + "Personalized Items for " + gui.GreenFontEnd + gui.BlueFontStart + UID + gui.BlueFontEnd;

                    //  LoadItemTable(itemList);

                    ItemDisplayer.ShowItemsOptions itemOptions = ItemDisplayer.ShowItemsOptions.ShowUIDLink
                        | ItemDisplayer.ShowItemsOptions.ShowTime
                        | ItemDisplayer.ShowItemsOptions.ShowCategoryLink
                        | ItemDisplayer.ShowItemsOptions.ShowSaveLink
                        | ItemDisplayer.ShowItemsOptions.ShowEMailLink
                        | ItemDisplayer.ShowItemsOptions.ShowCommentsLink
                        | ItemDisplayer.ShowItemsOptions.ShowImage
                        | ItemDisplayer.ShowItemsOptions.ShowRatings
                        | ItemDisplayer.ShowItemsOptions.ShowTags
                        | ItemDisplayer.ShowItemsOptions.CountClicks
                        | ItemDisplayer.ShowItemsOptions.ShowPreviousNextLinks;
                    string itemTable = itemDisplayer.LoadItemTable(itemList, itemOptions, itemLayoutOptions, startItem, UID, sort, links.MyNewsPageLink.Replace("~\\", ""));
                    ItemDiv.InnerHtml = itemTable;
                }
                else
                {
                    MessageLabel.Text = "getputs did not find anything worth your attention today!";
                }
            }
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists
    }
Beispiel #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        rssReader = (RssReader)Application["rssReader"];
        gui = (GUIVariables)Application["gui"];
        links = (Links)Application["links"];
        engine = (ProcessingEngine)Application["engine"];

        //  username = Convert.ToString(Session["username"]);

        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(username))
        {
            Response.Redirect(links.SessionExpiredPageLink);
        }
        else
        {
            upPredict = (int)ProcessingEngine.Movement.Up;
            downPredict = (int)ProcessingEngine.Movement.Down;

            yesterday = DateTime.Now.AddDays(-1).ToString(dateFormatString);
            today = DateTime.Now.ToString(dateFormatString);
            tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);

            //  If Today=Friday Then Tomorrow=Monday. Why? Because Stock Markets are closed on Weekends.
            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday || DateTime.Now.DayOfWeek == DayOfWeek.Saturday || DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
            {
                if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                    tomorrow = DateTime.Now.AddDays(+3).ToString(dateFormatString);
                if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
                    tomorrow = DateTime.Now.AddDays(+2).ToString(dateFormatString);
                if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
                    tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);
            }

            symbol = Convert.ToString(Request.QueryString["stock"]);
            if (string.IsNullOrEmpty(symbol))
            {
                Response.Redirect(links.HomePageLink);
            }
            else
            {
                StockDetailsLabel.Text = LoadStockDetails(symbol);
                LoadYahooFinanceBadgeIFrame(symbol);

                string newsFeeds = rssReader.LoadPerStockNews(symbol);
                if (!string.IsNullOrEmpty(newsFeeds))
                {
                    NewsMessageLabel.Text = gui.BoldFontStart + "Latest News & Recommended Readings from " + gui.StoocksFont + gui.BoldFontEnd;
                    NewsLabel.Text = newsFeeds;
                }
            }
        }
    }
Beispiel #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        categories = Categories.Instance;
        tagger = new Tagger();

        seperator = gui.Seperator;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            user = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(user))
        {
            //  Response.Redirect(links.LoginLink, false);
            MessageLabel.Text = gui.RedFontStart + "Please login to enter a comment." + gui.RedFontEnd;
        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (string.IsNullOrEmpty(Request.QueryString["uid"]) || string.IsNullOrEmpty(Request.QueryString["iid"]) || string.IsNullOrEmpty(Request.QueryString["cid"]))
        {
            Response.Redirect(links.FrontPageLink, true);
        }
        else
        {
            uid = Request.QueryString["uid"].Trim();
            iid = Request.QueryString["iid"].Trim();
            cid = Request.QueryString["cid"].Trim();
        }

        if (!general.IsValidInt(iid) || !general.IsValidInt(cid) || !uid.Equals(user))
        {
            Response.Redirect(links.FrontPageLink, true);
        }
        else
        {
            string comment = LoadComment(uid, iid, cid);

            if (string.IsNullOrEmpty(comment))
            {
                Response.Redirect(links.FrontPageLink, true);
            }
            else
            {
                MessageLabel.Text = gui.GreenFontStart + "Your comment cannot be edited."
                    + gui.LineBreak + "However, you can append more details to your previous comment." + gui.GreenFontEnd;

                CurrentCommentLabel.Text = gui.GreenFontStart + "Your comment: " + gui.GreenFontEnd + gui.LineBreak + comment;
            }
        }
    }
Beispiel #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;

        seperator = gui.Seperator;

        if (string.IsNullOrEmpty(Request.QueryString["IID"]))
        {
            EMailDiv.Visible = false;
            ItemTitleLabel.Text = "No such item found.";
        }
        else
        {
            iid = Request.QueryString["IID"].Trim().ToLower();
        }

        if (!general.IsValidInt(iid))
        {
            EMailDiv.Visible = false;
        }
        else
        {
            item = new Item();

            string queryString = "SELECT Title, Link, Text, Date, UID, NComments, Category FROM item WHERE IID=" + iid + ";";
            MySqlDataReader retList;

            retList = dbOps.ExecuteReader(queryString);

            if (retList != null && retList.HasRows)
            {
                while (retList.Read())
                {
                    item.IID = Convert.ToInt32(iid);
                    item.UID = Convert.ToString(retList["UID"]);
                    item.Title = Convert.ToString(retList["Title"]);
                    item.Link = Convert.ToString(retList["Link"]);
                    item.Text = Convert.ToString(retList["Text"]);
                    item.Date = Convert.ToString(retList["Date"]);
                    item.NComments = Convert.ToInt32(retList["NComments"]);
                    item.Category = Convert.ToString(retList["Category"]);

                    if (!string.IsNullOrEmpty(item.Link))
                    {
                        item.Text = string.Empty;
                    }
                }
                retList.Close();
            }
            ItemTitleLabel.Text = "Title: " + gui.GrayFontStart + item.Title + gui.GrayFontEnd;
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            user = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(user))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        //  If the user has logged in, populate the 'EMail From' TextBox.
        //  The variable 'user' = Logged in User.

        EMailOutputMessageLabel.Text = string.Empty;
        if (!string.IsNullOrEmpty(user))
        {
            string queryString = "SELECT EMail FROM user WHERE UID='" + user + "';";
            MySqlDataReader retList = dbOps.ExecuteReader(queryString);
            if (retList != null && retList.HasRows)
            {
                while (retList.Read())
                {
                    FromTB.Text = Convert.ToString(retList["EMail"]);
                }
                retList.Close();
            }
        }

        //  If not using ReCaptcha Project, but using the Captcha Library.
        //if (!IsPostBack)
        //{
        //    HttpContext.Current.Session["CaptchaImageText"] = general.GenerateRandomCode();
        //}
    }
Beispiel #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MessageLabel.Text = string.Empty;

        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {
            if (general.IsUserAdministrator(UID))
            {

            }
            else
            {
                Response.Redirect(links.FrontPageLink, false);
            }
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        //if (!IsPostBack)
        //{
        //    string queryString = @"SELECT * FROM getputs.item;";
        //    PopulateItemGridView(queryString);
        //}

        if(!IsPostBack)
            MaxRowsTB.Text = maxRows.ToString();
    }
Beispiel #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        links = (Links)Application["links"];
        gui = (GUIVariables)Application["gui"];
        log = (Logger)Application["log"];
        general = (General)Application["general"];
        engine = (ProcessingEngine)Application["engine"];

        #region CookieAlreadyExists
        //  START: If a stoockerCookie with the Username already exists, do not show the Login Page.
        string username = "";
        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());
        }
        if (!string.IsNullOrEmpty(username))
        {
            Response.Redirect(links.HomePageLink);
        }
        //  END: If a stoockerCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        AboutStoockerLabel.Text = gui.GrayFontStart
            + gui.StoocksFont + " is a Stock Recommendation Engine." + gui.LineBreak
            + "Maintain a " + gui.GreenFontStart + "Portfolio" + gui.GreenFontEnd + " of your stocks." + gui.LineBreak
            + "Get updated " + gui.GreenFontStart + "News" + gui.GreenFontEnd + " about the latest happenings in the Stock Market." + gui.LineBreak
            + gui.GreenFontStart + "Predict" + gui.GreenFontEnd + " tomorrows movement of your favorite stocks." + gui.LineBreak
            + "See what the other users " + gui.GreenFontStart + "Recommend" + gui.GreenFontEnd + " about the stock movement for tomorrow."
            + gui.GrayFontEnd;

        yesterday = DateTime.Now.AddDays(-1).ToString(dateFormatString);
        today = DateTime.Now.ToString(dateFormatString);
        tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);
        dayOfWeekTomorrow = DateTime.Now.AddDays(+1).DayOfWeek.ToString();

        //  If Today=Friday Then Tomorrow=Monday. Why? Because Stock Markets are closed on Weekends.
        if (DateTime.Now.DayOfWeek == DayOfWeek.Friday || DateTime.Now.DayOfWeek == DayOfWeek.Saturday || DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
        {
            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
            {
                tomorrow = DateTime.Now.AddDays(+3).ToString(dateFormatString);
                dayOfWeekTomorrow = DateTime.Now.AddDays(+3).DayOfWeek.ToString();
            }
            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
            {
                tomorrow = DateTime.Now.AddDays(+2).ToString(dateFormatString);
                dayOfWeekTomorrow = DateTime.Now.AddDays(+2).DayOfWeek.ToString();
            }
            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
            {
                tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);
                dayOfWeekTomorrow = DateTime.Now.AddDays(+1).DayOfWeek.ToString();
            }
        }

        FillRecommendedStocksTable();
    }
Beispiel #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        rssReader = (RssReader)Application["rssReader"];
        gui = (GUIVariables)Application["gui"];
        stockService = (StockService)Application["stockService"];
        links = (Links)Application["links"];
        general = (General)Application["general"];
        engine = (ProcessingEngine)Application["engine"];

        //  username = Convert.ToString(Session["username"]);
        //  username = "******";

        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(username))
        {
            Response.Redirect(links.SessionExpiredPageLink);
        }
        else
        {
            upPredict = (int)ProcessingEngine.Movement.Up;
            downPredict = (int)ProcessingEngine.Movement.Down;

            yesterday = DateTime.Now.AddDays(-1).ToString(dateFormatString);
            today = DateTime.Now.ToString(dateFormatString);
            tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);

            //  If Today=Friday Then Tomorrow=Monday. Why? Because Stock Markets are closed on Weekends.
            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday || DateTime.Now.DayOfWeek == DayOfWeek.Saturday || DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
            {
                if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                    tomorrow = DateTime.Now.AddDays(+3).ToString(dateFormatString);
                if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
                    tomorrow = DateTime.Now.AddDays(+2).ToString(dateFormatString);
                if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
                    tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);
            }

            string welcomeMessage = gui.BoldFontStart + "Welcome to" + gui.StoocksFont + gui.BoldFontEnd;
            WelcomeLabel.Text = welcomeMessage;

            //  Trace.Write("Enter LoadCommonIndicesData");
            LoadCommonIndicesData();
            //  Trace.Write("Exit LoadCommonIndicesData");

            Trace.Write("Enter ShowAlreadySelectedStocks");
            interestedStocks = ShowAlreadySelectedStocks(username);
            Trace.Write("Exit ShowAlreadySelectedStocks");

            if (!string.IsNullOrEmpty(alreadySelectedStocks))
            {
                Trace.Write("Enter LoadYahooFinanceBadgeIFrame");
                LoadYahooFinanceBadgeIFrame(alreadySelectedStocks);
                Trace.Write("Exit LoadYahooFinanceBadgeIFrame");
            }

            //  if (!Page.IsPostBack)
            {
                Trace.Write("Enter LoadUserData");
                UserDetailsLabel.Text = LoadUserData(username);
                Trace.Write("Exit LoadUserData");

                if (isShowUserStockData)
                {
                    Trace.Write("Enter LoadCurrentData");
                    LoadCurrentData();
                    Trace.Write("Exit LoadCurrentData");
                }

                MessageLabel.Text = "";

                Trace.Write("Enter LoadNews");
                string newsFeeds = "";
                if (isGenericNews)      //  Show the same News for all Users, Do Cache, Update every 30 minutes.
                {
                    newsFeeds = rssReader.LoadPerStockNews(alreadySelectedStocks);
                }
                else
                {
                    newsFeeds = rssReader.LoadGenericNews("", false);
                }
                Trace.Write("Exit LoadNews");

                if (!string.IsNullOrEmpty(newsFeeds))
                {
                    NewsMessageLabel.Text = gui.BoldFontStart + "Latest News & Recommended Readings from " + gui.StoocksFont + gui.BoldFontEnd;
                    NewsLabel.Text = newsFeeds;
                }
            }
        }
    }
Beispiel #27
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        //  requestedTag = Request.QueryString["category"].Trim();
        requestedCategory = Request.QueryString.Get("category");

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["sort"]))
        {
            string sortStr = Convert.ToString(Request.QueryString["sort"]);
            sort = engine.GetSortType(sortStr);
        }

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (string.IsNullOrEmpty(requestedCategory))
        {
            LoadGenericCategoryTable();
        }
        else if (!(categories.CategoriesList.Contains(requestedCategory) || categories.CategoriesList.Contains(requestedCategory.ToLower())))
        {
            MessageLabel.Text = gui.RedFontStart + "Invalid Category" + gui.RedFontEnd;
        }
        else
        {
            string currentCategory = requestedCategory;
            if (imageEngine.IsIconsOn)
            {
                string iconLocation = imageEngine.LoadIconLocation(currentCategory);
                if (!string.IsNullOrEmpty(iconLocation))
                {
                    System.Web.UI.WebControls.Image icon = new System.Web.UI.WebControls.Image();
                    //  icon.ImageUrl = links.DomainLink + iconLocation;
                    icon.ImageUrl = iconLocation;
                    icon.ToolTip = currentCategory;
                    CategoryDiv.Controls.Add(icon);
                    CategoryDiv.Controls.Add(new LiteralControl(" "));
                }
            }
            MessageLabel.Text = gui.GreenFontStart + requestedCategory + gui.GreenFontEnd;
            //  MessageLabel.Text = gui.WhiteFontStart + requestedCategory + gui.WhiteFontEnd;
            LoadCategoryTable(requestedCategory, sort);
        }
    }
Beispiel #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            OutputTB.Text = string.Empty;

            dbOps = DBOperations.Instance;
            links = Links.Instance;
            general = General.Instance;
            gui = GUIVariables.Instance;
            engine = ProcessingEngine.Instance;
            categories = Categories.Instance;
            imageEngine = ImageEngine.Instance;
        }
        catch (Exception ex)
        {
            OutputTB.Text = "Error in PageLoad: " + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace;
        }
    }
Beispiel #29
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected override void OnInit(EventArgs e)
    {
        // Create dynamic controls here.

        //  Default Search Parameters.
        query = String.Empty;
        sType = SearchEngine.SearchType.Title;
        sCategory = "All Categories";
        sTime = SearchEngine.SearchTime.Today;

        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        searchEngine = SearchEngine.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["sort"]))
        {
            string sortStr = Convert.ToString(Request.QueryString["sort"]);
            sort = engine.GetSortType(sortStr);
        }

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(UID))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        LoadSearchDDL();
        GetQueryParameters();

        if (!string.IsNullOrEmpty(SearchTB.Text))
        {
            query = SearchTB.Text.Trim();
        }

        string sTypeDDLValue = SearchTypeDDL.SelectedValue;
        string sCategoryDDLValue = SearchCategoryDDL.SelectedValue;
        string sTimeDDLValue = SearchTimeDDL.SelectedValue;

        Control MasterPageSearchTable = this.Master.FindControl("SearchTable");
        MasterPageSearchTable.Visible = false;

        SearchTB.Focus();
        Page.Form.DefaultButton = SearchButton.ID;

        if (!string.IsNullOrEmpty(query))
        {
            SearchTB.Text = query;

            if (sType == SearchEngine.SearchType.Comments)
            {
                sType = SearchEngine.SearchType.Title;
                List<Item> itemList = searchEngine.LoadSearchResults(query, sType, sCategory, sTime);
                LoadItemTable(itemList);
            }
            else
            {

                //  List<Item> itemList = searchEngine.LoadSearchResults(query);
                List<Item> itemList = searchEngine.LoadSearchResults(query, sType, sCategory, sTime);

                //  LoadItemTable(itemList);

                ItemDisplayer.ShowItemsOptions itemOptions = ItemDisplayer.ShowItemsOptions.ShowUIDLink
                    | ItemDisplayer.ShowItemsOptions.ShowTime
                    | ItemDisplayer.ShowItemsOptions.ShowCategoryLink
                    | ItemDisplayer.ShowItemsOptions.ShowSaveLink
                    | ItemDisplayer.ShowItemsOptions.ShowEMailLink
                    | ItemDisplayer.ShowItemsOptions.ShowCommentsLink
                    | ItemDisplayer.ShowItemsOptions.ShowImage
                    | ItemDisplayer.ShowItemsOptions.ShowRatings
                    | ItemDisplayer.ShowItemsOptions.ShowTags
                    | ItemDisplayer.ShowItemsOptions.CountClicks
                    | ItemDisplayer.ShowItemsOptions.ShowPreviousNextLinks;

                string itemTable = itemDisplayer.LoadItemTable(itemList, itemOptions, itemLayoutOptions, startItem, UID, sort, links.SearchPageLink.Replace("~\\", ""));
                ItemDiv.InnerHtml = itemTable;

            }
        }

        //
        // CODEGEN: This call is required by the ASP.NET Web Form Designer.
        //
        //  InitializeComponent();
        base.OnInit(e);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        gui = (GUIVariables)Application["gui"];
        links = (Links)Application["links"];
        general = (General)Application["general"];
        engine = (ProcessingEngine)Application["engine"];

        //  username = Convert.ToString(Session["username"]);

        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(username))
        {
            Response.Redirect(links.SessionExpiredPageLink);
        }
        else
        {
            yesterday = DateTime.Now.AddDays(-1).ToString(dateFormatString);
            today = DateTime.Now.ToString(dateFormatString);
            tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);

            UserDetailsLabel.Text = LoadUserData(username);
            LoadUserPredictionHistory();

            interestedStocks = ShowAlreadySelectedStocks(username);
            if (!string.IsNullOrEmpty(alreadySelectedStocks))
            {
                LoadStoockerAccuracy(interestedStocks);
            }

        }
    }