예제 #1
0
파일: BLUser.cs 프로젝트: elieli/nonProfit
    public int Update()
    {
        int returnValue = 0;

            if (this.id>0)
            {
                BLUser oldUser = new BLUser();
                oldUser.ID = this.id;
                oldUser.Retrieve();
                if (oldUser.ID > 0 )
                {
                    if (oldUser.Login!=this.login || oldUser.Password!=this.password)
                    {
                        this.uid=Guid.NewGuid().ToString();
                    }
                }
            }
            else
            {
                this.uid=Guid.NewGuid().ToString();
            }

            returnValue = Update(this.id, this.customer.ID, this.uid, this.enabled, this.login, this.password, this.email, this.created);

            this.id = returnValue;

            return returnValue;
    }
예제 #2
-28
 private void btnForgotpass_Click(object sender, System.Web.UI.ImageClickEventArgs e)
 {
     if (Page.IsValid)
     {
         if (this.emailNotification)
         {
             BLUser wUser = new BLUser();
             wUser.EMail = txtEMail.Text.Trim().ToLower();
             wUser.Retrieve();
             if (wUser.ID>0 && wUser.Enabled)
             {
                 StringWriter writer = new StringWriter();
                 Server.Execute("email/emailForgotPass.aspx?email="+wUser.EMail, writer);
                 string strhtmlbody = writer.ToString();
                 //					Response.Write(strhtmlbody);
                 //					Response.End();
                 MailMessage objMailMessage = new MailMessage();
                 objMailMessage.Subject = siteName+": your password";
                 objMailMessage.From = this.emailNotificationCustomerFrom;
                 objMailMessage.To = wUser.EMail;
                 objMailMessage.Cc = this.emailNotificationCustomerCc;
                 objMailMessage.Bcc = this.emailNotificationCustomerBcc;
                 objMailMessage.Body = strhtmlbody;
                 objMailMessage.BodyFormat = MailFormat.Html;
                 SmtpMail.SmtpServer = this.smtpServer;
                 SmtpMail.Send( objMailMessage );
             }
         }
         Response.Redirect(".?page=login");
     }
 }