Пример #1
0
 private void btnAddress_Click(object sender, EventArgs e)
 {
     string telephone = txtTelephone.Text.Trim();
     string address = txtAddress.Text.Trim();
     if (!string.IsNullOrEmpty(telephone))
     {
         int callType = 0;  //手动
         FormIncomingCall form = new FormIncomingCall(telephone, address, callType);
         form.ShowDialog();
         if (!string.IsNullOrEmpty(form.IncomingPhoneNo))
         {
             txtTelephone.Text = form.IncomingPhoneNo;
         }
         if (!string.IsNullOrEmpty(form.SelectedAddress))
         {
             txtAddress.Text = form.SelectedAddress;
         }
         if (form.CurCustomerInfo != null)
         {
             txtName.Text = form.CurCustomerInfo.CustomerName;
         }
     }
 }
Пример #2
0
 private void SetIncomingCall(string strPhoneNo)
 {
     if (txtTelephone.InvokeRequired)
     {
         IncomingCallMessage myInvoke = new IncomingCallMessage(SetIncomingCall);
         this.Invoke(myInvoke, new object[] { strPhoneNo });
     }
     else
     {
         int callType = 1;  //程序
         FormIncomingCall form = new FormIncomingCall(strPhoneNo, string.Empty, callType);
         form.ShowDialog();
         if (!string.IsNullOrEmpty(form.IncomingPhoneNo))
         {
             txtTelephone.Text = form.IncomingPhoneNo;
         }
         if (!string.IsNullOrEmpty(form.SelectedAddress))
         {
             txtAddress.Text = form.SelectedAddress;
         }
         if (form.CurCustomerInfo != null)
         {
             txtTelephone.Text = form.CurCustomerInfo.Telephone;
             txtName.Text = form.CurCustomerInfo.CustomerName;
         }
     }
 }