private void btPat_Click(object sender, EventArgs e) { DlgInpatients dlgInpatients = new DlgInpatients(); if (!(_functionName == "Fun_ts_zy_czgl_all" || _functionName == "Fun_ts_zy_czgl_cx_all" || _functionName == "Fun_ts_zy_czgl_sh_all")) { if (InstanceForm.BCurrentDept.WardId == "") { return; } dlgInpatients = new DlgInpatients(InstanceForm.BCurrentDept.WardId); } dlgInpatients.ShowDialog(); string inpatientNo = DlgInpatients.SelectedInpatientNO; Guid inpatientId = DlgInpatients.SelectedInpatientID; string name = DlgInpatients.SelectedInpatientName; if (inpatientNo != "" && inpatientId != Guid.Empty) { txtinpatientNo.Text = inpatientNo; txtinpatientNo.Tag = inpatientId; txtName.Text = name; chkCzrq.Checked = false; chkJzrq.Checked = false; } }
private void txtinpatientNo_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { if (txtinpatientNo.Text != InpatientNo.GetEmptyZyh()) { if (txtinpatientNo.Tag == null) { DlgInpatients dlgInpatients = new DlgInpatients(); if (!(_functionName == "Fun_ts_zy_czgl_all" || _functionName == "Fun_ts_zy_czgl_cx_all" || _functionName == "Fun_ts_zy_czgl_sh_all")) { if (InstanceForm.BCurrentDept.WardId == "") { return; } dlgInpatients = new DlgInpatients(InstanceForm.BCurrentDept.WardId); } dlgInpatients.txtZyh.Text = txtinpatientNo.Text; dlgInpatients.tabControl1.SelectedTab = dlgInpatients.tpZyh; dlgInpatients.cmbDept.SelectedIndex = -1; DlgInpatients.SelectedDeptID = -1; dlgInpatients.rbAll.Enabled = true; dlgInpatients.rbAll.Checked = true; dlgInpatients.txtZyh_KeyPress(null, new KeyPressEventArgs((char)13)); dlgInpatients.ShowDialog(); string inpatientNo = DlgInpatients.SelectedInpatientNO; Guid inpatientId = DlgInpatients.SelectedInpatientID; string name = DlgInpatients.SelectedInpatientName; if (inpatientNo != "" && inpatientId != Guid.Empty) { txtinpatientNo.Text = inpatientNo; txtinpatientNo.Tag = inpatientId; txtName.Text = name; chkCzrq.Checked = false; chkJzrq.Checked = false; } else { return; } } } } }