Ejemplo n.º 1
0
 // 点击注册,向数据库添加记录
 private void btnRegist_Click(object sender, EventArgs e)
 {
     if (ValidateInput())
     {
         EditInfoRequestModel requestModel = new EditInfoRequestModel();
         requestModel.age    = Convert.ToInt32(txtAge.Text);
         requestModel.blood  = cboBlood.Text;
         requestModel.conste = cboConste.Text;
         if (rdoMan.Checked)
         {
             requestModel.gender = "男";
         }
         else
         {
             requestModel.gender = "女";
         }
         requestModel.nickname = txtNickName.Text.Trim();
         requestModel.userpass = txtUserPass.Text.Trim();
         requestModel.faceimg  = Convert.ToInt32(picFace.Tag);
         SystemHelper.EditInfo(requestModel, new Action <bool>(m => {
             if (!m)
             {
                 MessageBox.Show("信息发送失败");
             }
             else
             {
                 this.Invoke(new Action(() => {
                     this.Close();
                 }));
             }
         }));
     }
 }
Ejemplo n.º 2
0
 public static void EditInfo(EditInfoRequestModel requestModel, Action <bool> action)
 {
     sendMess(MessType.EditInfo, requestModel, action);
 }