Пример #1
0
 /// <summary>
 /// 加载默认发件人
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ckGetDefaultSendMan_CheckedChanged(object sender, EventArgs e)
 {
     if (ckGetDefaultSendMan.Checked)
     {
         // 加载默认发件人
         ZtoUserManager userManager = new ZtoUserManager(BillPrintHelper.DbHelper);
         var            userList    = userManager.GetList <ZtoUserEntity>(new KeyValuePair <string, object>(ZtoUserEntity.FieldIsDefault, 1), new KeyValuePair <string, object>(ZtoUserEntity.FieldIssendorreceive, 1));
         if (userList.Any())
         {
             var userEntity = userList.First();
             txtSendMan.Text     = userEntity.Realname;
             dgvSendArea.Text    = string.Format("{0}-{1}-{2}", userEntity.Province, userEntity.City, userEntity.County);
             txtSendAddress.Text = userEntity.Address;
             txtSendPhone.Text   = userEntity.Mobile + " " + userEntity.TelePhone;
             txtSendCompany.Text = userEntity.Company;
             txtReceiveMan.Focus();
             txtReceiveMan.Select();
             BillPrintHelper.SetLoadDefaultSendMan();
         }
         else
         {
             if (XtraMessageBox.Show(@"未添加默认发件人信息,是否添加?", AppMessage.MSG0000, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
             {
                 FrmAddSendMan addSendMan = new FrmAddSendMan();
                 addSendMan.ShowDialog();
                 addSendMan.Dispose();
             }
         }
     }
     else
     {
         BillPrintHelper.SetLoadDefaultSendMan(false);
     }
 }
Пример #2
0
 /// <summary>
 /// 选择发件人
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ckChooseSendMan_CheckedChanged(object sender, EventArgs e)
 {
     if (ckChooseSendMan.Checked)
     {
         var chooseSendMan = new FrmChooseSendMan();
         if (chooseSendMan.ShowDialog() == DialogResult.OK)
         {
             if (!string.IsNullOrEmpty(chooseSendMan.sendManControl1.ChooseId))
             {
                 var           userManager = new ZtoUserManager(BillPrintHelper.DbHelper);
                 ZtoUserEntity userEntity  = userManager.GetObject(chooseSendMan.sendManControl1.ChooseId);
                 if (userEntity != null)
                 {
                     txtSendMan.Text     = userEntity.Realname;
                     dgvSendArea.Text    = string.Format("{0}-{1}-{2}", userEntity.Province, userEntity.City, userEntity.County);
                     txtSendAddress.Text = userEntity.Address;
                     txtSendPhone.Text   = userEntity.Mobile + " " + userEntity.TelePhone;
                     txtSendCompany.Text = userEntity.Company;
                     txtReceiveMan.Focus();
                     txtReceiveMan.Select();
                     BillPrintHelper.SetLoadDefaultSendMan();
                 }
             }
         }
         chooseSendMan.Dispose();
     }
 }
Пример #3
0
 private void ckUserDefaultSendMan_CheckedChanged(object sender, EventArgs e)
 {
     // 是否使用默认发件人
     BillPrintHelper.SetLoadDefaultSendMan(ckUserDefaultSendMan.Checked);
 }