Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string strCommentId = Request.QueryString["commentId"];
        strCommentId = Server.UrlDecode(strCommentId);
        strCommentId = strCommentId.Replace('$', '+');
        strCommentId = Tools.Decrypt(strCommentId, true);
        strCommentId = strCommentId.Split('.')[0];

        int commentId = 0;
        int.TryParse(strCommentId, out commentId);

        string mapPathHtmls = System.Configuration.ConfigurationManager.AppSettings["PhysicalPath"] + @"\htmls";
        string template = mapPathHtmls + "\\MailReply.htm";
        MailData data = new MailData();

        PostAroundServiceClient client = new PostAroundServiceClient();

        Comment currComment = client.GetCommentByID(commentId);
        MyMessage mainMessage = client.GetMessageById(currComment.messageID, "", "", 0, 0, 0);
        User senderUser = client.GetUserByID(currComment.userID);
        client.Close();

        postHeader = mainMessage.title;
        postId = currComment.messageID;
        date = DateTime.Now.ToString("d MMMM, yyyy", System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));
        message = currComment.body;
        senderFName = senderUser.firstName;
        senderFullName = senderUser.firstName + " " + senderUser.lastName;
        senderImage = senderUser.avatarImageUrl;
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //string test = "userid=14&permissionId=1";
            //test = Tools.Encrypt(test, true);
            //test = Tools.EncodeTo64(test);

            string code64Encoded = Request.QueryString["code"];
            up = GetUserPermissionDataFromQueryString(code64Encoded);
            if (up != null)
            {
                // call the method to show user First Name
                PostAroundServiceClient client = new PostAroundServiceClient();
                User user = client.GetUserByID(up.userId);
                client.Close();
                ltrlFname.Text = user.firstName;
                if (!IsPostBack)
                {
                    if (UserIsGrantPermission((int)Enums.Permissions.EmailPermission))
                    {
                        bool isSucceed = Unsubscribe();
                        if (isSucceed)
                            ltrlStatus.Text = "You have been unsubscribed!";
                        else
                            ltrlStatus.Text = "Unsubscribtion Failed. Please Try Again.";
                    }
                    else
                        ltrlStatus.Text = "User already unsubscribed.";
                }
            }

        }
        catch (Exception ex)
        {
            PrintStatus(ex.Message);
        }
    }