Beispiel #1
0
 /// <summary>
 /// 查询
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtQuery.Text.Trim()))
         {
             var mobileEntity = MobileHelper.GetMobileInfo(txtQuery.Text.Trim());
             if (mobileEntity != null)
             {
                 if (mobileEntity.QueryResult)
                 {
                     txtMobile.Text   = mobileEntity.Mobile;
                     txtProvince.Text = mobileEntity.Province;
                     txtCity.Text     = mobileEntity.City;
                     txtAreaCode.Text = mobileEntity.AreaCode;
                     txtPostCode.Text = mobileEntity.PostCode;
                     txtCorp.Text     = mobileEntity.Corp;
                 }
                 else
                 {
                     XtraMessageBox.Show("未查询到该号码信息", AppMessage.MSG0000);
                 }
             }
             else
             {
                 XtraMessageBox.Show("未查询到该号码信息", AppMessage.MSG0000);
             }
         }
         else
         {
             txtMobile.Text   = "";
             txtProvince.Text = "";
             txtCity.Text     = "";
             txtAreaCode.Text = "";
             txtPostCode.Text = "";
             txtCorp.Text     = "";
             XtraMessageBox.Show("请输入手机号码!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }