예제 #1
0
    //Browsing the last
    protected void LB_Previous_Click(object sender, EventArgs e)
    {
        HttpCookieCollection objHttpCookieCollection = Request.Cookies;
        HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatCookie5639sb");
        string strMatrimonialID = Crypto.DeCrypto(objHttpCookie.Values["MatrimonialID"]);

        LB_Next_1.Enabled = true;

        //Getting values
        int intStart = int.Parse(HF_Start.Value);
        int intCount = 0;

        switch (L_Type.Text)
        {
        case "Pending [Inbox]":
            intCount = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Pending, InternalMessage.MailType.Inbox);
            break;

        case "Pending [Outbox]":
            intCount = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Pending, InternalMessage.MailType.OutBox);
            break;

        case "Accepted [Inbox]":
            intCount = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Accepted, InternalMessage.MailType.Inbox);
            break;

        case "Accepted [Outbox]":
            intCount = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Accepted, InternalMessage.MailType.OutBox);
            break;

        case "Declined [Inbox]":
            intCount = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Declined, InternalMessage.MailType.Inbox);
            break;

        case "Declined [Outbox]":
            intCount = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Declined, InternalMessage.MailType.OutBox);
            break;
        }

        intStart -= 10;
        // End of record?
        if (intStart < 10)
        {
            LB_Previous_1.Enabled = false;
            L_Current_1.Text      = "10";
        }
        else
        {
            L_Current_1.Text = (intStart + 10).ToString();
        }
        //Update Start Pointer
        HF_Start.Value = (intStart).ToString();
        //Getting SSList

        switch (L_Type.Text)
        {
        case "Pending [Inbox]":
            LoadList(intStart, InternalMessage.GetIntrestList(strMatrimonialID, true, intStart, MemberIntrest.TypeOfIntrest.Pending));
            break;

        case "Pending [Outbox]":
            LoadList(intStart, InternalMessage.GetIntrestList(strMatrimonialID, false, intStart, MemberIntrest.TypeOfIntrest.Pending));
            break;

        case "Accepted [Inbox]":
            LoadList(intStart, InternalMessage.GetIntrestList(strMatrimonialID, true, intStart, MemberIntrest.TypeOfIntrest.Approved));
            break;

        case "Accepted [Outbox]":
            LoadList(intStart, InternalMessage.GetIntrestList(strMatrimonialID, false, intStart, MemberIntrest.TypeOfIntrest.Approved));
            break;

        case "Declined [Inbox]":
            LoadList(intStart, InternalMessage.GetIntrestList(strMatrimonialID, true, intStart, MemberIntrest.TypeOfIntrest.Declined));
            break;

        case "Declined [Outbox]":
            LoadList(intStart, InternalMessage.GetIntrestList(strMatrimonialID, false, intStart, MemberIntrest.TypeOfIntrest.Declined));
            break;
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Adding meta Discription
            HtmlMeta objMeta = new HtmlMeta();
            objMeta.Name    = "Description";
            objMeta.Content = WebConfig.GetValues("MetaDiscription");
            this.Header.Controls.Add(objMeta);

            // Adding meta KeyWords
            objMeta         = new HtmlMeta();
            objMeta.Name    = "keywords";
            objMeta.Content = WebConfig.GetValues("MetaKeword");
            this.Header.Controls.Add(objMeta);

            bool isInbox;
            if (Request.QueryString["typ"] == "o") // Inbox
            {
                isInbox = false;
            }
            else
            {
                isInbox = true;
            }
            try
            {
                HttpCookieCollection objHttpCookieCollection = Request.Cookies;
                HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatCookie5639sb");

                string strMatrimonialID = Crypto.DeCrypto(objHttpCookie.Values["MatrimonialID"]);

                int intCount; // Which Type
                switch (Request.QueryString["id"])
                {
                case "p":
                    if (isInbox)     // Inbox
                    {
                        L_Type.Text = "Pending [Inbox]";
                        intCount    = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Pending, InternalMessage.MailType.Inbox);
                    }
                    else     //Out Box
                    {
                        L_Type.Text = "Pending [Outbox]";
                        intCount    = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Pending, InternalMessage.MailType.OutBox);
                    }
                    break;

                case "a":
                    if (isInbox)     // Inbox
                    {
                        L_Type.Text = "Accepted [Inbox]";
                        intCount    = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Accepted, InternalMessage.MailType.Inbox);
                    }
                    else    //Out Box
                    {
                        L_Type.Text = "Accepted [Outbox]";
                        intCount    = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Accepted, InternalMessage.MailType.OutBox);
                    }
                    break;

                case "d":
                    if (isInbox)     // Inbox
                    {
                        L_Type.Text = "Declined [Inbox]";
                        intCount    = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Declined, InternalMessage.MailType.Inbox);
                    }
                    else    //Out Box
                    {
                        L_Type.Text = "Declined [Outbox]";
                        intCount    = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Declined, InternalMessage.MailType.OutBox);
                    }
                    break;

                default:
                    if (isInbox)     // Inbox
                    {
                        L_Type.Text = "Pending [Inbox]";
                        intCount    = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Pending, InternalMessage.MailType.Inbox);
                    }
                    else    //Out Box
                    {
                        L_Type.Text = "Pending [Outbox]";
                        intCount    = InternalMessage.GetIntrestCount(strMatrimonialID, InternalMessage.IntrestStatus.Pending, InternalMessage.MailType.OutBox);
                    }
                    break;
                }
                // Loading Controls


                //Setting Count
                L_Last_1.Text = intCount.ToString();
                if (intCount > 0)
                {
                    if (intCount < 10)
                    {
                        LB_Next_1.Enabled = false;
                        L_Current_1.Text  = intCount.ToString();
                    }
                    else
                    {
                        LB_Next_1.Enabled = true;
                        L_Current_1.Text  = "10";
                    }
                    HF_Start.Value = "0";
                    switch (L_Type.Text)
                    {
                    case "Pending [Inbox]":
                        LoadList(0, InternalMessage.GetIntrestList(strMatrimonialID, true, 0, MemberIntrest.TypeOfIntrest.Pending));
                        break;

                    case "Pending [Outbox]":
                        LoadList(0, InternalMessage.GetIntrestList(strMatrimonialID, false, 0, MemberIntrest.TypeOfIntrest.Pending));
                        break;

                    case "Accepted [Inbox]":
                        LoadList(0, InternalMessage.GetIntrestList(strMatrimonialID, true, 0, MemberIntrest.TypeOfIntrest.Approved));
                        break;

                    case "Accepted [Outbox]":
                        LoadList(0, InternalMessage.GetIntrestList(strMatrimonialID, false, 0, MemberIntrest.TypeOfIntrest.Approved));
                        break;

                    case "Declined [Inbox]":
                        LoadList(0, InternalMessage.GetIntrestList(strMatrimonialID, true, 0, MemberIntrest.TypeOfIntrest.Declined));
                        break;

                    case "Declined [Outbox]":
                        LoadList(0, InternalMessage.GetIntrestList(strMatrimonialID, false, 0, MemberIntrest.TypeOfIntrest.Declined));
                        break;
                    }
                }
                else
                {
                    L_Current_1.Text = "0";
                }
            }
            catch (Exception EX)
            {
                ErrorLog.WriteErrorLog("Intrest : 403 OR Cookie", EX);
                Server.Transfer("~/Extras/ErrorReport.aspx?id=cookie");
            }
        }   //if
    }