Beispiel #1
0
 protected void btnok_Click(object sender, EventArgs e)
 {
     Maticsoft.BLL.MemberInfo   menbll   = new Maticsoft.BLL.MemberInfo();
     Maticsoft.Model.MemberInfo menmodel = menbll.GetModel(1);
     if (txtname.Text.Trim() == "")
     {
         lblusername.Text = "请填写用户名";
         return;
     }
     menmodel.MemberName = txtname.Text.Trim();
     lblusername.Text    = "";
     if (txtpass.Text.Trim() == "")
     {
         lblpass.Text = "请填写密码";
         return;
     }
     if (txtpassord.Text.Trim() == "")
     {
         lblpassword.Text = "请填写确认密码";
         return;
     }
     if (txtpass.Text.Trim() != menmodel.Password)
     {
         lblpass.Text = "您的旧密码输入不正确";
         return;
     }
     menmodel.Password = txtpassord.Text.Trim();
     lblpass.Text      = "";
     lblpassword.Text  = "";
     if (drpsex.SelectedIndex == 0)
     {
         lblsex.Text = "请选择您的性别";
     }
     else if (drpsex.SelectedIndex == 1)
     {
         menmodel.Sex = 1;
     }
     else
     {
         menmodel.Sex = 0;
     }
     if (txtlinkphoto.Text.Trim() == "")
     {
         lblLinkphoto.Text = "请填写联系电话";
         return;
     }
     menmodel.Linkphoto = txtlinkphoto.Text.Trim();
     lblLinkphoto.Text  = "";
     if (txtemail.Text.Trim() == "")
     {
         lblemail.Text = "请填写电子邮箱";
         return;
     }
     menmodel.Email = txtemail.Text.Trim();
     lblemail.Text  = "";
     menmodel.QQMSN = txtqq.Text.Trim();
     menbll.Update(menmodel);
     Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息添加成功!')</script>");
     bind();
 }
Beispiel #2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtMemberName.Text.Trim().Length == 0)
            {
                strErr += "MemberName不能为空!\\n";
            }
            if (this.txtPassword.Text.Trim().Length == 0)
            {
                strErr += "Password不能为空!\\n";
            }
            if (this.txtLinkphoto.Text.Trim().Length == 0)
            {
                strErr += "Linkphoto不能为空!\\n";
            }
            if (this.txtEmail.Text.Trim().Length == 0)
            {
                strErr += "Email不能为空!\\n";
            }
            if (this.txtQQMSN.Text.Trim().Length == 0)
            {
                strErr += "QQMSN不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    MemberID   = int.Parse(this.lblMemberID.Text);
            string MemberName = this.txtMemberName.Text;
            string Password   = this.txtPassword.Text;
            bool   Sex        = this.chkSex.Checked;
            string Linkphoto  = this.txtLinkphoto.Text;
            string Email      = this.txtEmail.Text;
            string QQMSN      = this.txtQQMSN.Text;


            Maticsoft.Model.MemberInfo model = new Maticsoft.Model.MemberInfo();
            model.MemberID   = MemberID;
            model.MemberName = MemberName;
            model.Password   = Password;
            model.Sex        = Sex;
            model.Linkphoto  = Linkphoto;
            model.Email      = Email;
            model.QQMSN      = QQMSN;

            Maticsoft.BLL.MemberInfo bll = new Maticsoft.BLL.MemberInfo();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }