/// <summary> /// 添加医生 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDoctorAdd_Click(object sender, EventArgs e) { var ed = new EcgDoctor { FormBorderStyle = FormBorderStyle.None }; ed.ShowDialog(); wpDoctor.Bind(); }
private void dGVDocotr_CellClick(object sender, DataGridViewCellEventArgs e) { if (dGVDocotr.SelectedCells.Count != 0 && null != dGVDocotr.CurrentRow) { string id = dGVDocotr.CurrentRow.Cells["ID"].Value.ToString(); if (null != dGVDocotr.CurrentCell.Value && dGVDocotr.CurrentCell.Value.ToString() == "修改") { string doctorCode = dGVDocotr.CurrentRow.Cells["DoctorCode"].Value.ToString(); string doctorName = dGVDocotr.CurrentRow.Cells["DoctorName"].Value.ToString(); string doctorSex = dGVDocotr.CurrentRow.Cells["DoctorSex"].Value.ToString(); string doctorDept = dGVDocotr.CurrentRow.Cells["DoctorDept"].Value.ToString(); byte[] electronicSignature = null; DataTable dt = SelAllEcgDoctor(id); if (null != dt && dt.Rows.Count > 0) { if (dt.Rows[0]["ElectronicSignature"] != DBNull.Value) { electronicSignature = (byte[])dt.Rows[0]["ElectronicSignature"]; } } var ed = new EcgDoctor(id, doctorCode, doctorName, doctorSex, doctorDept, electronicSignature); ed.ShowDialog(); wpDoctor.Bind(); } if (null != dGVDocotr.CurrentCell.Value && dGVDocotr.CurrentCell.Value.ToString() == "删除") { if (XtraMessageBox.Show(@"确定删除此条数据吗?", @"删除提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { bool delOk = DeleteEcgDoctor(id); if (!delOk) { XtraMessageBox.Show(@"删除失败!", @"提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } wpDoctor.Bind(); } if (null != dGVDocotr.CurrentCell.Value && dGVDocotr.CurrentCell.Value.ToString() == "重置密码") { if (XtraMessageBox.Show(@"确定重置此医生的密码吗?", @"重置提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { string doctorName = dGVDocotr.CurrentRow.Cells["DoctorName"].Value.ToString(); bool ok = UpdateEcgDoctorPassword(id); if (ok) { XtraMessageBox.Show(@"医生:" + doctorName + @"的密码已重置为默认密码123456", @"提示:", MessageBoxButtons.OK, MessageBoxIcon.Information); wpDoctor.Bind(); } } } } }