private void EnterMZD_ToolStripMenuItem_Click(object sender, EventArgs e) { if (dgvJizhenPaiban.Rows.Count > 0) { string PatID = dgvJizhenPaiban.CurrentRow.Cells["patid"].Value.ToString(); if (string.IsNullOrEmpty(PatID)) { MessageBox.Show("住院号不能为空。"); return; } string Oroom = dgvJizhenPaiban.CurrentRow.Cells["oroom"].Value.ToString(); if (string.IsNullOrEmpty(Oroom)) { MessageBox.Show("手术间号不能为空。"); return; } int mzjldID = 0; string Odate = dtOSDate.Value.ToString("yyyy-MM-dd HH:mm"); DataTable dt = bll.selectSinglemzjld(PatID, dtOSDate.Value.ToString("yyyy-MM-dd")); if (dt.Rows.Count > 0) { mzjldID = Convert.ToInt32(dt.Rows[0][0]); } mzjldEdit F1 = new mzjldEdit(PatID, Oroom, DateTime.Parse(Odate), mzjldID); F1.ShowDialog(); this.Close(); new PaiBanForm().Close(); } }
private void btnConfirm_Click(object sender, EventArgs e) { string patid = dtOdate.Value.ToString("yyyyMMddHHmmss"); string oroom = cmbOroom.Text.Trim(); string patname = tbPatname.Text.Trim(); DateTime odate = DateTime.Parse(dtOdate.Value.Date.ToString("yyyy-MM-dd")); // int ASAE = 1; if (oroom == "") { MessageBox.Show("手术间不能为空!"); cmbOroom.Focus(); return; } int i = dal.InsertPAIBAN(patid, patname, oroom, odate);//插入急诊排班 if (i > 0) { mzjldEdit mzjld1 = new mzjldEdit(patid, oroom, odate, 0); mzjld1.Owner = this; this.Hide(); mzjld1.ShowDialog(); Application.ExitThread(); //this.Close(); } }
private void MZJLDToolStripMenuItem_Click(object sender, EventArgs e) { if (dgvMzjld.SelectedRows.Count == 1) { int mzID = Convert.ToInt32(dgvMzjld.SelectedRows[0].Cells["mzid"].Value); String patID = Convert.ToString(dgvMzjld.SelectedRows[0].Cells["patid"].Value); String oroom = Convert.ToString(dgvMzjld.SelectedRows[0].Cells["oroom"].Value); string dttime = dgvMzjld.SelectedRows[0].Cells["otime"].Value.ToString(); DateTime dt = Convert.ToDateTime((Convert.ToDateTime(dgvMzjld.SelectedRows[0].Cells["otime"].Value)).ToShortDateString()); mzjldEdit mzjld1 = new mzjldEdit(patID, oroom, dt, mzID, true); mzjld1.ShowDialog(); } }
/// <summary> /// 确定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOK_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count == 1) { if (this.rdNew.Checked == true) { string patid = Convert.ToString(dataGridView1.SelectedRows[0].Cells["病人编号"].Value); string oroom = dataGridView1.SelectedRows[0].Cells["手术间名称"].Value.ToString(); DateTime odate = DateTime.Parse(dtDATE.Value.Date.ToString("yyyy-MM-dd")); string time = dtDATE.Value.Date.ToString("yyyy-MM-dd"); DataTable dt = new DataTable(); #region 打开麻醉记录单 dt = bll.selectSinglemzjld1(patid, time); if (dt.Rows.Count > 0) { DialogResult result = MessageBox.Show("此病人当日已麻醉记录单存在,是否新建?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (result == DialogResult.Cancel) { rdOld.Checked = true; return; } else { mzjldEdit mzjld1 = new mzjldEdit(patid, oroom, odate, 0); mzjld1.ShowDialog(); this.Close(); } } else { mzjldEdit mzjld1 = new mzjldEdit(patid, oroom, odate, 0); mzjld1.ShowDialog(); this.Close(); } #endregion } else if (this.rdOld.Checked == true) { //int mzid = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value); string patid = Convert.ToString(dataGridView1.SelectedRows[0].Cells["病人编号"].Value); string oroom = dataGridView1.SelectedRows[0].Cells["手术间名称"].Value.ToString(); DateTime odate = DateTime.Parse(dtDATE.Value.ToShortDateString()); mzjldid = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["麻醉编号"].Value); mzjldEdit mzjld1 = new mzjldEdit(patid, oroom, odate, mzjldid); mzjld1.ShowDialog(); this.Close(); } } }
/// <summary> /// 双击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.SelectedRows.Count == 1) { if (this.rdNew.Checked == true) { string patid = Convert.ToString(dataGridView1.SelectedRows[0].Cells["住院号"].Value); string oroom = dataGridView1.SelectedRows[0].Cells["手术间名称"].Value.ToString(); string odate = dtDATE.Value.ToString("yyyy-MM-dd"); DataTable dt = new DataTable(); dt = bll.selectSinglemzjld(patid, odate); if (dt.Rows.Count > 0) { DialogResult result = MessageBox.Show("此病人当日已麻醉记录单存在,是否新建?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.No) { return; } else { this.Close(); mzjldEdit mzjld1 = new mzjldEdit(patid, oroom, DateTime.Parse(odate), 0); mzjld1.ShowDialog(); } } else { this.Close(); mzjldEdit mzjld1 = new mzjldEdit(patid, oroom, DateTime.Parse(odate), 0); mzjld1.ShowDialog(); } } else if (this.rdOld.Checked == true) { string patid = Convert.ToString(dataGridView1.SelectedRows[0].Cells["住院号"].Value); string oroom = dataGridView1.SelectedRows[0].Cells["手术间名称"].Value.ToString(); DateTime odate = DateTime.Parse(dtDATE.Value.ToShortDateString()); mzjldid = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["麻醉编号"].Value); this.Close(); mzjldEdit mzjld1 = new mzjldEdit(patid, oroom, odate, mzjldid); mzjld1.ShowDialog(); } } }
void newPAL_DoubleClick(object sender, EventArgs e) { Point p = Cursor.Position; IntPtr h = WindowFromPoint(p); foreach (Control con in this.Controls) { if (con.Handle == h) { string OROOM = con.Name; DataTable dt = bll.slectOroomINFO(OROOM); if (Convert.ToInt32(dt.Rows[0][0]) != 0) { //this.Close(); mzjldEdit mzjldform = new mzjldEdit(dt.Rows[0][2].ToString(), OROOM, Convert.ToDateTime(DateTime.Now.ToShortDateString()), Convert.ToInt32(dt.Rows[0][1]), true); mzjldform.ShowDialog(); } } } }