/// <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(); } }
/// <summary> /// 选择发件人 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CkChooseSendManCheckedChanged(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) { var parentForm = ParentForm; if (parentForm is BaseForm) { // 设置发件人 (parentForm as BaseForm).SendManEntity = userEntity; } } } } chooseSendMan.Dispose(); } }