Пример #1
0
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                EntityServiceReference.EntityServiceClient ServiceRefClient = new EntityServiceReference.EntityServiceClient();
                ServiceRefClient.Open();

                if (Session["RegId"] != null && Session["RegId"] != "")
                {
                    int cnfrm = ServiceRefClient.ChangePassword(LblMembershipId.Text.ToString(), txtOldPassword.Text.ToString(), txtNewPassword.Text.ToString());
                    if (cnfrm == 1)
                    {
                        LblMsg.Text = "Password Changed";
                        EntityServiceReference.EntityServiceClient ServiceRefClient2 = new EntityServiceReference.EntityServiceClient();
                        ServiceRefClient2.Open();
                        var arr = ServiceRefClient2.GetUserDetails(Session["RegId"].ToString());
                        if (arr.Length > 0)
                        {
                            HTMLMailer(arr[0].Email.ToString(), txtNewPassword.Text.ToString(), Session["RegId"].ToString());
                        }
                        ServiceRefClient2.Close();
                    }
                    else
                    {
                        LblMsg.Text = "Entered Password Is Wrong";
                    }
                }
                ServiceRefClient.Close();
            }
            catch (Exception ex)
            {
                LblMsg.Text = ex.Message;
            }
        }
Пример #2
0
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                EntityServiceReference.EntityServiceClient ServiceRefClient = new EntityServiceReference.EntityServiceClient();
                ServiceRefClient.Open();

                if (Session["RegId"] != null && Session["RegId"] != "")
                {

                    int cnfrm = ServiceRefClient.ChangePassword(LblMembershipId.Text.ToString(), txtOldPassword.Text.ToString(), txtNewPassword.Text.ToString());
                    if (cnfrm == 1)
                    {
                        LblMsg.Text = "Password Changed";
                          EntityServiceReference.EntityServiceClient ServiceRefClient2 = new EntityServiceReference.EntityServiceClient();
                          ServiceRefClient2.Open();
                        var arr=ServiceRefClient2.GetUserDetails(Session["RegId"].ToString());
                        if(arr.Length>0)
                        {
                        HTMLMailer(arr[0].Email.ToString(),txtNewPassword.Text.ToString(), Session["RegId"].ToString());
                        }
                        ServiceRefClient2.Close();
                    }
                    else
                    {
                        LblMsg.Text = "Entered Password Is Wrong";
                    }
                }
                ServiceRefClient.Close();            
              }
            catch (Exception ex)
            {
             LblMsg.Text= ex.Message;
            }
        }