Exemple #1
0
        //protected System.Web.UI.WebControls.LinkButton lnkBtnView;

        protected void Page_Load(object sender, System.EventArgs e)
        {
            //LinkButton lnkBtn = new LinkButton();
            //lnkBtn = (LinkButton)FindControl("lnkBtnAddNew");

            //if (lnkBtn == null)
            //{
            //    Response.Write("Not cool");
            //    return;
            //}

            // Put user code to initialize the page here
            if (!Page.IsPostBack)
            {
                Global.AuthenticateUser(Request.Url.ToString());
            }

            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            // Call the ItemsGet method to populate control,
            ItemsGet();

            Page.DataBind();
        }
Exemple #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                // Put user code to initialize the page here
                Global.AuthenticateUser();

                lnkSignIn.Text = Global.SetLnkSignIn();
                lnkSignUp.Text = Global.SetLnkSignUp();

                CheckForPro();
                BindData();
                //ShowLinks();


                if (hdnACT.Value == Global.ACCT_BIZ)
                {
                    pnlQP.Visible = true;
                    if (!hasCoupons())
                    {
                        //hide footer settings & edit links
                        lnkManageQP.Visible = false;
                        lnkSettings.Visible = false;
                    }
                }
                else
                {
                    pnlQP.Visible = false;
                }
            }
            pnlQP.Visible = false;
        }
Exemple #3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            classes.BoardItem tmpBoardItem = (classes.BoardItem)Session["Item"];

            //TODO: fix double load
            ErrorLog.ErrorRoutine(false, "preview_post:Page_Load:SID: " + Session.SessionID + " isPB: " + Page.IsPostBack);

            if (tmpBoardItem == null)
            {
                HandleError();
                return;
            }

            if (!Page.IsPostBack)
            {
                Global.AuthenticateUser();

                // Put user code to initialize the page here
                lnkSignIn.Text = Global.SetLnkSignIn( );
                lnkSignUp.Text = Global.SetLnkSignUp( );

                //Hide all sub-panels then enable accordingly
                pnlAll.Visible       = false;
                pnlWidth.Visible     = false;
                pnlSurfOnly.Visible  = false;
                pnlBoardType.Visible = false;

                //Load up display data and show a preview of the posting
                BindData(tmpBoardItem);
            }

            ErrorLog.ErrorRoutine(false, "preview_post:Page_Load:END:SID:" + Session.SessionID + " isPB: " + Page.IsPostBack);
        }
Exemple #4
0
        //protected System.Web.UI.WebControls.TextBox searchTextField;

        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            Global.AuthenticateUser("post.aspx");

            string iUID = Session["userId"].ToString();
            string i;

            //check for ProUser
            BoardHunt.wsBH.BHService oWS = new BoardHunt.wsBH.BHService();
            i = oWS.isPro(Convert.ToInt32(iUID)).ToString();

            if (i != "1")             //if not Pro acct the check to see if they're maxed out of posts
            {
                if (oWS.GetActiveBoardCount(Convert.ToInt32(iUID), 1, 0) > 4)
                {
                    Response.Redirect("/UserMenu.aspx", true);                     //TODO: add message that they're out of posts
                }
            }

            BindData();             //unconditionally bind the data for the controls

            //if (!Page.IsPostBack)
            //{
            //	Session ["EditMode"] = "false"; //a check for edit mode ???
            //}

            //check first time arrival or edit mode
            string[] arString;
            arString = Request.QueryString.GetValues("em");
            if (arString != null)
            {
                if (HttpUtility.UrlDecode(arString [0].ToString()) == "1")
                {
                    //load object values
                    classes.BoardItem tmpBoardItem = (classes.BoardItem)Session["Item"];
                    if (tmpBoardItem != null)
                    {
                        txtTown.Text = tmpBoardItem.Town;
                        txtZip.Text  = tmpBoardItem.Zip;
                    }
                }
            }
            else
            {
                Session ["EditMode"] = "false";
            }

            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            Session ["Item"] = null;
        }
Exemple #5
0
        //FIXME: need to pass Cat id to item details
        //public static string iCategory;

        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            Global.AuthenticateUser();

            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            // Call the ItemsGet method to populate control,
            // passing in the sample data.
            ItemsGet();
        }
Exemple #6
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            Global.AuthenticateUser(Request.Url.ToString());

            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            if (!(Page.IsPostBack))
            {
                LoadControl();
                GetUserProfileData();
                SetControls();
                pnlChangePwd.Visible = false;
            }
        }
Exemple #7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            String strSQL;
            String myConnectString;

            // Put user code to initialize the page here
            Global.AuthenticateUser();

            Session["LoggedIn"] = "No";

            lnkSignIn.Text = Global.SetLnkSignIn();
            lnkSignUp.Text = Global.SetLnkSignUp();

            if (!Page.IsPostBack)
            {
                // Put user code to initialize the page here
                ErrorLog.ErrorRoutine(false, "Registered EmailId: " + Session["EmailId"].ToString());

                //Get DB connect string
                myConnectString = ConfigurationManager.ConnectionStrings["myConn"].ConnectionString;;

                //***TODO: E-mail verfication & activation
                //***see contact us page

                strSQL = "Select * FROM tblUser WHERE txtEmail = '" + Session["EmailId"].ToString() + "'";
                SqlConnection myConnection = new SqlConnection(myConnectString);

                string usersId = "unknown";

                try
                {
                    myConnection.Open();
                    SqlCommand objCommand = new SqlCommand(strSQL, myConnection);

                    SqlDataReader objReader = null;
                    objReader = objCommand.ExecuteReader();

                    if (objReader.Read())
                    {
                        usersId = objReader["iD"].ToString();
                        //ErrorLog.ErrorRoutine(false, "userId:" + usersId);

                        //Create dirs
                        if (CreateUserDir(usersId))
                        {
                            //set userID
                            //Session["userId"] = usersId;
                            //Session["LoggedIn"] = "Yes";
                            //Session["BlogFlg"] = "N";
                            //Session["LoggedIn"] = "No";

                            lblMessage.Text = "Your account has been created.  An e-mail confirmation has been sent.";
                            SendCongratEmail();
                            NotifyBHEmail(usersId);

                            if (Session["ServiceId"] != null)
                            {
                                if (Session["ServiceId"].ToString() == "6" || Session["ServiceId"].ToString() == "7") //upgrade
                                {
                                    classes.Login clsLogin = new classes.Login();
                                    if (clsLogin.DoLogin(Session["EmailId"].ToString(), string.Empty, true, true))
                                    {
                                        Session["LoggedIn"] = "Yes";
                                        Response.Redirect("Pay/OrderForm.aspx", false);
                                    }
                                }
                            }
                            else
                            {
                                Session["LoggedIn"] = "No";
                                Session["EmailId"]  = null;
                                Session["acctType"] = null;
                                Session["pw"]       = null;
                            }
                        }
                        else
                        {
                            Session["LoggedIn"] = "No";
                            Session["EmailId"]  = null;
                            Session["acctType"] = null;
                            Session["pw"]       = null;
                            ErrorLog.ErrorRoutine(false, "Error creating user dirs");
                            lblMessage.Text = "Registration Failed.  Please close this browser and try again.";
                        }
                    }
                    else
                    {
                        ErrorLog.ErrorRoutine(false, "RegisterFinish:PageLoad:Couldn't locate user.");
                        classes.Email.SendErrorEmail("RegisterFinish:PageLoad:Couldn't locate user.");
                    }
                }

                catch (Exception ex)
                {
                    ErrorLog.ErrorRoutine(false, "RegisterFinish:PageLoad: " + ex.Message);
                    lblMessage.Text     = "Registration Failed.  Please close this browser and try again.";
                    Session["LoggedIn"] = "No";
                    Session["EmailId"]  = null;
                    Session["pw"]       = null;
                    Session["acctType"] = null;
                }

                finally
                {
                    myConnection.Close();
                }
            }
        }
Exemple #8
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            Global.AuthenticateUser();

            lnkSignIn.Text = Global.SetLnkSignIn();
            lnkSignUp.Text = Global.SetLnkSignUp();

            if (!Page.IsPostBack)
            {
                classes.BoardItem tmpBoardItem = (classes.BoardItem)Session["Item"];

                string serverURL = System.Configuration.ConfigurationSettings.AppSettings["ServerURL"];

                string entryId = GetNewEntryId();   //this should be moved closer to INSERT in p_preview
                hdnEntryVal.Value = entryId;

                BoardHunt.wsBH.BHService oWS = new BoardHunt.wsBH.BHService();
                oWS.InsertBoardForRatings(Convert.ToInt32(entryId.ToString()));

                string eLink;

                //reg posts
                if (tmpBoardItem.AdType != 4)
                {
                    pnlBoost.Visible        = true;
                    eLink                   = serverURL + "/surfboard.aspx?iD=" + entryId;
                    hypLnkPost.Visible      = true;
                    hypLnkPostModel.Visible = false;
                }
                else //AdType: 4 = Shaperhouse Model
                {
                    pnlBoost.Visible        = false;
                    eLink                   = serverURL + "/Shaper/ModelDetails.aspx?iD=" + entryId;
                    hypLnkPost.Visible      = false;
                    hypLnkPostModel.Visible = true;
                }

                //FB
                lnkFBShare.Attributes.Add("href", "javascript:void(window.open('http://www.facebook.com/sharer.php?u=" + eLink + "&t=Boardhunt.com|Surfboards+For+Sale'))");

                lnkLivePost.NavigateUrl = eLink;

                txtEntryLink.Text     = eLink;
                txtEntryLink.ReadOnly = true;

                switch (tmpBoardItem.AdType)
                {
                case 1:
                    break;

                case 2:
                    break;

                case 3:
                    lnkPostItem.Text        = serverURL + "/ShowcaseDetails.aspx?iD=" + entryId + "&uId=" + tmpBoardItem.IUser + "&iCat=" + tmpBoardItem.Category;
                    lnkPostItem.NavigateUrl = "ShowcaseDetails.aspx?iD=" + entryId + "&uId=" + tmpBoardItem.IUser + "&iCat=" + tmpBoardItem.Category;
                    break;

                case 4:
                    break;

                default:
                    break;
                }

                //hide upgrade for non-surf items
                if (tmpBoardItem.Category != (int)1)
                {
                    //btnUpgrade.Visible = false;
                }

                string[] eLinkArr = new string[4];
                eLinkArr[0] = eLink;
                eLinkArr[1] = tmpBoardItem.ActivateCode;
                eLinkArr[2] = entryId;

                //TODO: refine for categories and ad types
                if (tmpBoardItem.BoardType > 0)//surf or accessory?
                {
                    if (tmpBoardItem.AdType == 4)
                    {
                        eLinkArr[3] = tmpBoardItem.Model; //SH
                    }
                    else
                    {
                        eLinkArr[3] = tmpBoardItem.HtFt + "'" + " " + tmpBoardItem.HtIn + "\"" + " " + tmpBoardItem.Brand;
                    }
                }
                else
                {
                    eLinkArr[3] = tmpBoardItem.Brand + " " + tmpBoardItem.GearItem;
                }

                if (tmpBoardItem.AdType != 4)
                {
                    classes.Email.SendEmail("Thanks", Session["EmailId"].ToString(), classes.Email.MSG_THX_FOR_POST, eLinkArr);
                }
                else
                {
                    classes.Email.SendEmail("Thanks", Session["EmailId"].ToString(), classes.Email.MSG_THX_FOR_MODEL, eLinkArr);
                }


                //check for pro and..
                //BoardHunt.wsBH.BHService
                oWS = new BoardHunt.wsBH.BHService();
                string i = oWS.isPro(Convert.ToInt32(Session["userId"].ToString())).ToString();

                //set style accordingly
                if (i == "1")
                {
                    oWS.boost(Convert.ToInt32(Session["userId"].ToString()), Convert.ToInt32(entryId));
                    btnUpgradePro.Visible = false;
                    ImageButton1.Visible  = false;
                    hypLnkPost.Visible    = true;
                }
                else
                {
                    btnUpgradePro.Visible = true;
                    ImageButton1.Visible  = false;

                    if (classes.User.NeedsUpgrade(Convert.ToInt32(Session["userId"].ToString())))
                    {
                        hypLnkPost.Text        = "All free posts have been used.  Please UPGRADE your account to Pro in UserMenu";
                        hypLnkPost.NavigateUrl = "/UserMenu.aspx";
                    }
                }

                //All done - clean up Session variable
                Session["Item"] = null;
            }
        }