コード例 #1
0
    protected void Registerbtn_Click(object sender, EventArgs e)
    {
        int IntReturnValue = ucObj.AddUser(usernameTextBox.Text.Trim(), pwdTextBox.Text.Trim(), transfer(sexRadioBL.SelectedItem.Text), questionTextBox.Text.Trim(), answerTextBox.Text.Trim(), IDCardTextBox.Text.Trim(), phoneTextBox.Text.Trim(), emailTextBox.Text.Trim(), classDropDownList.SelectedItem.Text.Trim());

        if (IntReturnValue == 1)
        {
            Response.Write(ccObj.MessageBox("恭喜您,注册成功!返回登录!", "login.aspx"));
        }
        else
        {
            Response.Write(ccObj.MessageBoxPage("注册失败!"));
        }
    }
コード例 #2
0
    protected void Registerbtn_Click(object sender, EventArgs e)
    {
        int IntReturnValue = ucObj.AddUser(usernameTextBox.Text.Trim(), pwdTextBox.Text.Trim(), transfer(sexRadioBL.SelectedItem.Text), questionTextBox.Text.Trim(), answerTextBox.Text.Trim(), IDCardTextBox.Text.Trim(), phoneTextBox.Text.Trim(), emailTextBox.Text.Trim(), classDropDownList.SelectedItem.Text.Trim());

        if (IntReturnValue == 1)
        {
            Response.Write(ccObj.MessageBoxPage("添加成功!"));
        }
        else
        {
            Response.Write(ccObj.MessageBoxPage("添加失败!"));
        }
        ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>window.opener=null;window.close();</script>");
    }
コード例 #3
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     //check required information
     if (this.txtPostCode.Text.Trim() == "" && this.txtPhone.Text.Trim() == "" && this.txtEmail.Text.Trim() == "")
     {
         Response.Write(ccObj.MessageBoxPage("Please enter required information!"));
     }
     else
     {
         int IntReturnValue = ucObj.AddUser(txtName.Text.Trim(), txtPassword.Text.Trim(), txtTrueName.Text.Trim(), transfer(this.ddlSex.SelectedItem.Text), txtPhone.Text.Trim(), txtEmail.Text.Trim(), txtAddress.Text.Trim(), txtPostCode.Text.Trim(), Convert.ToInt32(this.ddlCategory.SelectedValue.ToString()));
         if (IntReturnValue == 100)
         {
             Response.Write(ccObj.MessageBox("Congratulation, you are the member!", "Default.aspx"));
         }
         else
         {
             Response.Write(ccObj.MessageBox("Sorry, user name existed!"));
         }
     }
 }
コード例 #4
0
ファイル: Register.aspx.cs プロジェクト: 1351300313/pre
 protected void btnSave_Click(object sender, EventArgs e)
 {
     //判断是否输入必要的信息
     if (this.txtPostCode.Text.Trim() == "" && this.txtPhone.Text.Trim() == "" && this.txtEmail.Text.Trim() == "")
     {
         Response.Write(ccObj.MessageBoxPage("请输入必要的信息!"));
     }
     else
     {
         //将用户输入的信息插入到用户表tb_Member中
         int IntReturnValue = ucObj.AddUser(txtName.Text.Trim(), txtPassword.Text.Trim(), txtTrueName.Text.Trim(), transfer(this.ddlSex.SelectedItem.Text), txtPhone.Text.Trim(), txtEmail.Text.Trim(), txtAddress.Text.Trim(), txtPostCode.Text.Trim());
         if (IntReturnValue == 100)
         {
             Response.Write(ccObj.MessageBox("恭喜您,注册成功!", "Default.aspx"));
         }
         else
         {
             Response.Write(ccObj.MessageBox("注册失败,该名字已存在!"));
         }
     }
 }
コード例 #5
0
ファイル: Register.aspx.cs プロジェクト: wwwanc/SnackShop
 //立即注册点击
 protected void btnRegister_Click(object sender, EventArgs e)
 {
     if (this.UserNameIsExist.Visible == false && this.PwdIsExist.Visible == false && this.confrimPwdSpan.Visible == false && this.txtPhoneLabel.Visible == false && this.textAddressLabel.Visible == false) //用户名不存在
     {
         //将用户输入的信息插入到用户表tb_User中
         int IntReturnValue = ucObj.AddUser(txtName.Text.Trim(), txtPassword.Text.Trim(), txtTrueName.Text.Trim(), this.ddlSex.SelectedValue.ToString(), txtPhone.Text.Trim(), txtAddress.Text.Trim(), DateTime.Now);
         if (IntReturnValue == 100)
         {
             //返回登录界面(带参数)
             string s_url;
             s_url = "Login.aspx?UserName="******"恭喜您,注册成功!", s_url));
         }
         else
         {
             Response.Write(ccObj.MessageBox("插入失败,该名字已存在!"));
         }
     }
     else //用户名存在
     {
         Response.Write(ccObj.MessageBox("注册失败,请先检查输入是否有误!"));
     }
 }
コード例 #6
0
    protected void btnReg_Click(object sender, EventArgs e)
    {
        int IntReturnValue = ucObj.AddUser(TxtFirstName.Text.Trim(), TxtLastName.Text.Trim(), TxtUserName.Text.Trim(), TxtPassword.Text.Trim(), TxtEmail.Text.Trim(),
                                           TxtMobile.Text.Trim(), TxtWorkPhone.Text.Trim(), TxtHomePhone.Text.Trim(), TxtAddress.Text.Trim());

        if (IntReturnValue == 100)
        {
            //MailMessage mailMsg = new MailMessage();
            //mailMsg.From = new MailAddress("*****@*****.**");// Source
            //mailMsg.To.Add(new MailAddress(TxtEmail.Text.Trim()));//Destination
            //mailMsg.Subject = "Congratulations! Welcome to Crazy Hat!";// Subject
            //mailMsg.Body = "<a href='http://*****:*****@gmail.com", "nikki123456");// sender's account.
            //client.Send(mailMsg);
            Response.Write(ccObj.MessageBox("Congratulations! Register succeeded!"));
            autoLogin();
        }
        else
        {
            Response.Write(ccObj.MessageBox("Sorry, this user name has been already exsit."));
        }
    }
コード例 #7
0
 public bool AddUser(UserModel userModel)
 {
     return(_user.AddUser(userModel));
 }
コード例 #8
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            var fullname        = Request.Form["FullName"];  //Getting Full Name from Textbox
            var email           = Request.Form["email"];     //Getting Email from Textbox
            var startDate       = Request.Form["StartDate"]; //Getting StartDate from Textbox
            var role            = "";
            var roleId          = 0;
            var teamId          = 0;
            var managerId       = 0;
            var secondManagerId = 0;
            var locationId      = 0;

            var adminCheck         = Request.Form["IsAdmin"];
            var managerCheck       = Request.Form["IsManager"];
            var secondManagerCheck = Request.Form["IsSecondManager"];
            var financialCheck     = Request.Form["IsFinancialUser"];

            /* Dropdown Controls */
            if (!string.IsNullOrEmpty(ddlUnvan.SelectedValue))
            {
                role   = ddlUnvan.SelectedItem.ToString();
                roleId = int.Parse(ddlUnvan.SelectedItem.Value);
            }

            if (!string.IsNullOrEmpty(TeamDDL.SelectedValue))
            {
                teamId = int.Parse(TeamDDL.SelectedValue);
            }

            if (!string.IsNullOrEmpty(ddlEmployees.SelectedValue))
            {
                managerId = int.Parse(ddlEmployees.SelectedValue);
            }

            if (!string.IsNullOrEmpty(secondManager.SelectedValue))
            {
                secondManagerId = int.Parse(secondManager.SelectedValue);
            }

            if (!string.IsNullOrEmpty(LocationDDL.SelectedValue))
            {
                locationId = int.Parse(LocationDDL.SelectedValue);
            }
            /* Dropdown Controls - Finish */


            //If all fields are not bull
            if (fullname != "" && email != "" && roleId != 0 && managerId != 0 && teamId != 0)
            {
                //Check mail if it exists in the system
                var emailResult = _add.UserMailControl(email);
                if (emailResult) //If it exists
                {
                    Response.Write("<script>alert('Email adresi mevcut!');</script>");
                }

                //All values send to User Class
                var newUser = new UserClass
                {
                    FullName           = fullname,
                    StartDate          = SetDateFormat(startDate),
                    Email              = email,
                    Role               = role,
                    TeamId             = teamId,
                    ManagerId          = managerId,
                    SecondManagerId    = secondManagerId != 0 ? secondManagerId.ToString() : null,
                    LocationId         = locationId,
                    AdminCheck         = adminCheck,
                    ManagerCheck       = managerCheck,
                    SecondManagerCheck = secondManagerCheck,
                    FinancialUserCheck = financialCheck
                };

                if (emailResult == false) //If mail does not exist in system
                {
                    //Trying to add user to Database
                    Response.Write(_add.AddUser(newUser)
                        ? "<script lang='Javascript'>alert('Kullanıcı başarıyla oluşturulmuştur.'); window.location = 'AddUser'</script>"
                        : "<script>alert('Kullanıcı oluşturma işlemi başarısız. Lütfen sistem admin ile iletişime geçiniz.'); window.location = 'AddUser'</script>");
                }
            }
            else //If any value is missing
            {
                Response.Write(Login.Language == "tr"
                    ? "<script lang='Javascript'>alert('Tüm alanları doldurunuz.'); window.location = 'AddUser'</script>"
                    : "<script lang='Javascript'>alert('Fill in all fields.'); window.location = 'AddUser'</script>");
            }
        }