Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (User.Identity.IsAuthenticated)
        {
            MembershipUser userObject = Membership.GetUser();
            string UserID = userObject.ProviderUserKey.ToString();

            pm = new MessageControl(UserID);

            if (pm.getCreatedProfile(User.Identity.Name) != "1")
            {
                Response.Redirect("CreateProfile.aspx");
            }

            if (Request.QueryString["SendTo"] != null)
            {
                SendTo.Text = Request.QueryString["SendTo"];
            }

            if (Request.QueryString["messageId"] != null)
            {
                string ViewMessageId = Request.QueryString["messageId"];
                DataSet replyMessages = pm.getMessage(ViewMessageId);
                DataRow replyMessage = replyMessages.Tables["Messages"].Rows[0] as DataRow;
                SendTo.Text = pm.getUserName(replyMessage["FromUserId"].ToString());
                SendTitle.Text = "Re: " + replyMessage["Title"].ToString();
            }
        }
        else
        {
            Response.Redirect("Login.aspx?ReturnUrl=pmInbox.aspx");
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DeleteButton.Attributes.Add("onclick", "return confirm('Are you sure you want to delete the selected messages?');");

        if (User.Identity.IsAuthenticated)
        {
            MembershipUser userObject = Membership.GetUser();
            string UserID = userObject.ProviderUserKey.ToString();

            pm = new MessageControl(UserID);

            if (pm.getCreatedProfile(User.Identity.Name) != "1")
            {
                Response.Redirect("CreateProfile.aspx");
            }

            //Label1.Text = pm.getUserId("sosuke");
            //Label2.Text = pm.getUserName(Label1.Text.ToString());
            //pm.sendMessage("sosuke", "test", "omg i love you!");
            //pm.toDeleted("4f561504-964e-492b-af24-7c506528a96a", 0);
            //pm.toViewed("4f561504-964e-492b-af24-7c506528a96a", 0);

            if (!Page.IsPostBack)
            {
                Repeater1.DataSource = pm.getMessages("sent");
                Repeater1.DataBind();
            }
        }
        else
        {
            Response.Redirect("Login.aspx?ReturnUrl=pmSent.aspx");
        }
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (User.Identity.IsAuthenticated)
        {
            MessageControl pm = new MessageControl(User.Identity.Name);

            if (pm.getCreatedProfile(User.Identity.Name) != "1")
            {
                Response.Redirect("CreateProfile.aspx");
            }

            Label1.Text = Profile.UserName;
        }
        else
        {
            Response.Redirect("Login.aspx?ReturnUrl=ImageManager.aspx");
        }
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DeleteButton.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this message?');");

        if (User.Identity.IsAuthenticated)
        {
            MembershipUser userObject = Membership.GetUser();
            string UserID = userObject.ProviderUserKey.ToString();

            pm = new MessageControl(UserID);

            if (pm.getCreatedProfile(User.Identity.Name) != "1")
            {
                Response.Redirect("CreateProfile.aspx");
            }

            if (Request.QueryString["messageId"] != null && Request.QueryString["source"] != null)
            {
                ViewMessageId = Request.QueryString["messageId"];
                Repeater1.DataSource =  pm.getMessage(ViewMessageId);
                Repeater1.DataBind();

                if (Request.QueryString["source"] == "to")
                {
                    pm.toViewed(ViewMessageId, 1);
                }

                if (Request.QueryString["source"] == "from")
                {
                    pm.fromViewed(ViewMessageId, 1);
                    ReplyButton.Visible = false;
                }
            }
            else
            {
                Response.Redirect("pmInbox.aspx");
            }
        }
        else
        {
            Response.Redirect("Login.aspx?ReturnUrl=pmInbox.aspx");
        }
    }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (User.Identity.IsAuthenticated)
        {
            MessageControl pm = new MessageControl(User.Identity.Name);

            if (pm.getCreatedProfile(User.Identity.Name) != "1")
            {
                Response.Redirect("CreateProfile.aspx");
            }

            if (!Page.IsPostBack)
            {
                populateDropDownLists();
                selectDropDownValues();
            }
        }
        else
        {
            Response.Redirect("Login.aspx?ReturnUrl=EditProfile.aspx");
        }
    }