Ejemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtusername.Text.Trim().Length == 0)
            {
                strErr += "username不能为空!\\n";
            }
            if (this.txtpassword.Text.Trim().Length == 0)
            {
                strErr += "password不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string username = this.txtusername.Text;
            string password = this.txtpassword.Text;

            ManagePhones.Model.users model = new ManagePhones.Model.users();
            model.username = username;
            model.password = password;

            ManagePhones.BLL.users bll = new ManagePhones.BLL.users();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }