Exemplo n.º 1
0
 protected void btnReply_Click(object sender, EventArgs e)
 {
     try
     {
         if (objMembership.CheckMembershipExists())
         {
             if (Request.QueryString["mid"] != null && btnReply.Text == "Reply")
             {
                 EnableTrue(); ReplyMSG();
             }
             else
             {
                 SendMSG();
                 EnableFalse();
                 ResetButton();
             }
         }
         else
         {
             pnlMSG.Visible = true;
             ModalPopupExtender2.Show();
             ModalPopupExtender2.CancelControlID = "btnCancle1";
         }
     }
     catch
     {
     }
 }
Exemplo n.º 2
0
    protected void btnNew_Click(object sender, EventArgs e)
    {
        if (Session["uid_gender"] != null)
        {
            objMembership.User_Id = Session["uid_gender"].ToString().Split('_')[0];
            if (objMembership.CheckMembershipExists())
            {
                Server.Transfer("NewMessage.aspx");

                // ModalPopupExtender1.Show();
            }
            else
            {
                pnlMSG.Visible = true;
                ModalPopupExtender2.Show();
                ModalPopupExtender2.CancelControlID = "btnCancle1";
            }
        }
    }
Exemplo n.º 3
0
    protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName == "Accept")
            {
                if (Session["uid_gender"] != null)
                {
                    ListViewDataItem Edit       = (ListViewDataItem)e.Item;
                    LinkButton       lbtnUserId = (LinkButton)Edit.FindControl("lbtnUserId");
                    ObjIntrest.Recever = Session["uid_gender"].ToString().Split('_')[0];
                    ObjIntrest.Sender  = lbtnUserId.Text.Trim();
                    ObjIntrest.Status  = 4;
                    if (ObjIntrest.UPdateIntrestCode() > 0)
                    {
                        ucMessage.ShowMessage("You Are Accepted Req. From " + lbtnUserId.Text.Trim(), WebMsgBox.Type.success.ToString());

                        if (Request.QueryString["IntrestType"] == null)
                        {
                            BindDefaultIntrestInbox();
                        }
                        else
                        {
                            BindRejectedIntrests();
                        }
                    }
                    else
                    {
                        ucMessage.ShowMessage("There Is Some Problem .Please Try Agai After Some time ", WebMsgBox.Type.error.ToString());
                    }
                }
            }
            else if (e.CommandName == "Reject")
            {
                if (Session["uid_gender"] != null)
                {
                    ListViewDataItem Edit       = (ListViewDataItem)e.Item;
                    LinkButton       lbtnUserId = (LinkButton)Edit.FindControl("lbtnUserId");
                    ObjIntrest.Recever = Session["uid_gender"].ToString().Split('_')[0];
                    ObjIntrest.Sender  = lbtnUserId.Text.Trim();
                    ObjIntrest.Status  = 2;
                    if (ObjIntrest.UPdateIntrestCode() > 0)
                    {
                        ucMessage.ShowMessage("You Are Rejected Req. From " + lbtnUserId.Text.Trim(), WebMsgBox.Type.success.ToString());

                        if (Request.QueryString["IntrestType"] == null)
                        {
                            BindDefaultIntrestInbox();
                        }
                        else
                        {
                            BindAcceptedIntrests();
                        }
                    }
                    else
                    {
                        ucMessage.ShowMessage("There Is Some Problem .Please Try Agai After Some time ", WebMsgBox.Type.error.ToString());
                    }
                }
            }
            else if (e.CommandName == "AddToFavourite")
            {
                ListViewDataItem Edit    = (ListViewDataItem)e.Item;
                Label            lblname = (Label)Edit.FindControl("Label14");
                lblFavName.Text = lblname.Text;
                //lblMsg.Text = "Hi \n " + lblMemberName.Text + " Please Accept My request. ";
                lblFavuserid.Text = Convert.ToString(ListView1.DataKeys[Edit.DisplayIndex].Value.ToString());
                Image img = (Image)Edit.FindControl("Image2");
                Image3.ImageUrl     = img.ImageUrl;
                pnlAddtoFav.Visible = true;
                ObjIntrest.Recever  = lblFavuserid.Text;
                ObjIntrest.Sender   = Session["uid_gender"].ToString().Split('_')[0];
                if (ObjIntrest.checkFav())
                {
                    btnAddtoFav.Enabled             = false;
                    lblFavStatus.Text               = "you have Already Added As Fav Profile.";
                    ModalPopupExtender3.OkControlID = "btnAddtoFav";
                }
                else
                {
                    lblFavStatus.Text               = "Click Ok/Send To Add In Fav list";
                    btnAddtoFav.Enabled             = true;
                    ModalPopupExtender3.OkControlID = "";
                }
                ModalPopupExtender3.Show();
            }
            else if (e.CommandName == "SendMSG")
            {
                if (Session["uid_gender"] != null)

                {
                    objMembership.User_Id = Session["uid_gender"].ToString().Split('_')[0];
                    if (objMembership.CheckMembershipExists())
                    {
                        ListViewDataItem Edit           = (ListViewDataItem)e.Item;
                        LinkButton       lbtnUserId     = (LinkButton)Edit.FindControl("lbtnUserId");
                        LinkButton       lbPhotoRequest = (LinkButton)Edit.FindControl("lbPhotoRequest");
                        Label            lblname        = (Label)Edit.FindControl("Label14");
                        lblMemberName.Text = lblname.Text;
                        //lblMsg.Text = "Hi \n " + lblMemberName.Text + " Please Accept My request. ";

                        ObjIntrest.Sender = Session["uid_gender"].ToString().Split('_')[0];

                        Server.Transfer("NewMessage.aspx?ProfileID=" + lbtnUserId.Text.Trim(), false);

                        // ModalPopupExtender1.Show();
                    }
                    else
                    {
                        pnlMSG.Visible = true;
                        ModalPopupExtender2.Show();
                        ModalPopupExtender2.CancelControlID = "btnCancle1";
                    }
                }
                else
                {
                    // Response.Redirect("Default.aspx");
                }
            }
        }
        catch (Exception ec)
        {
            ucMessage.ShowMessage(ec.Message, WebMsgBox.Type.error.ToString());
        }
    }