コード例 #1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (!CheckOldPass())
        {
            ltrMsg.Text = String.Format("<div class='alert alert-warning margin-bottom-30'><strong>Warning!</strong> {0}</div>", "Old Password Incorrectly.");
            return;
        }

        User _us = new Bitcoin.Data.DTO.User();

        _us.Password = MD5Password.MD5Hash(txtNewPass.Text);
        _us.UserID   = BitcoinSession.LoginMemberId;

        UserBLL _usBLL = new UserBLL();

        _usBLL.UpdatePassword(_us);
        Response.Redirect(Request.RawUrl);
    }
コード例 #2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        ltrMsg.Text = string.Empty;

        if (!chkCheck.Checked)
        {
            ltrMsg.Text = String.Format("<div class='alert alert-warning margin-bottom-30'><strong>Warning!</strong> {0}</div>", "Chọn checkbox");
            return;
        }

        Bitcoin.Data.DTO.User user = new Bitcoin.Data.DTO.User();
        user.SponsorID     = txtSponsorID.Text.Trim();
        user.EmailID       = txtEmailID.Text.Trim();
        user.Currency      = Convert.ToInt32(drdlCurrency.SelectedItem.Value);
        user.MobileNo      = txtMobileNo.Text;
        user.FullName      = txtFullName.Text;
        user.Country       = drdlCountry.SelectedItem.Text;
        user.State         = txtState.Text;
        user.City          = txtCity.Text;
        user.Password      = MD5Password.MD5Hash(txtPassword.Text);
        user.AssociateName = string.Empty;
        user.CreateDate    = DateTime.Now;
        user.LevelID       = 1;
        user.Status        = 1;//Đã kích hoạt
        user.Rate          = 15;

        UserBLL userBLL = new UserBLL();
        int     result  = userBLL.InsertUser(user);

        switch (result)
        {
        case 1:
            userBLL.UpdateUserLevel(user.EmailID);
            break;

        case 9:
            ltrMsg.Text = String.Format("<div class='alert alert-warning margin-bottom-30'><strong>Warning!</strong> {0}</div>", "Email ID already exists.");
            break;

        case 10:
            ltrMsg.Text = String.Format("<div class='alert alert-warning margin-bottom-30'><strong>Warning!</strong> {0}</div>", "Sponsor ID does not exist.");
            break;
        }
    }