Ejemplo n.º 1
0
        protected void imgSubmit_Click(object sender, ImageClickEventArgs e)
        {
            //判断输入格式
            if (!String.IsNullOrEmpty(txtCellphone.Text.Trim()) && !Utility.IsCellPhone(txtCellphone.Text.Trim()))
            {
                lbCellPhoneError.Text = "手机号码格式不正确!";
                return;
            }
            if (!String.IsNullOrEmpty(txtPhone.Text.Trim()) && !Utility.IsPhone(txtPhone.Text.Trim()))
            {
                lbPhoneError.Text = "座机号码格式不正确!";
                return;
            }
            if (!String.IsNullOrEmpty(txtQQ.Text.Trim()) && !Utility.IsNumeric(txtQQ.Text.Trim()))
            {
                lbQQError.Text = "QQ号码应该都是数字!";
                return;
            }
            if (!String.IsNullOrEmpty(txtEmail.Text.Trim()) && !Utility.IsEmail(txtEmail.Text.Trim()))
            {
                lbQQError.Text = "Email格式不正确!";
                return;
            }
            if (!String.IsNullOrEmpty(txtZIPCode.Text.Trim()) && !Utility.IsZIPCode(txtZIPCode.Text.Trim()))
            {
                lbZIPError.Text = "邮编格式不正确!";
                return;
            }
            Buyers objBuyer = new Buyers();

            objBuyer.SELLER_ID       = Users.Nick;
            objBuyer.BuyerId         = Convert.ToInt64(Request.QueryString["buyer_id"].ToString());
            objBuyer.Buyer_reallName = txtRealName.Text.Trim();
            objBuyer.CellPhone       = txtCellphone.Text.Trim();
            objBuyer.Phone           = txtPhone.Text.Trim();
            objBuyer.QQ       = txtQQ.Text.Trim();
            objBuyer.birthDay = dateBirthDay.Value.ToString();
            objBuyer.Email    = txtEmail.Text.Trim();
            objBuyer.ZipCode  = txtZIPCode.Text.Trim();
            objBuyer.Address  = txtAddress.Text.Trim();
            objBuyer.Memo     = txtMemo.Text.Trim();
            if (BuyerBLL.UpdateBuyerDetails(objBuyer))
            {
                InitControls();
                lbMsg.Text      = "会员信息修改成功!";
                lbMsg.ForeColor = Color.Blue;
            }
        }