diff --git a/AIMS/AIMS.csproj b/AIMS/AIMS.csproj index 5f8eb0f..383ac3f 100644 --- a/AIMS/AIMS.csproj +++ b/AIMS/AIMS.csproj @@ -494,6 +494,9 @@ + + Component + Form diff --git a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.Designer.cs b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.Designer.cs index 713a852..73062be 100644 --- a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.Designer.cs +++ b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.Designer.cs @@ -75,6 +75,7 @@ this.superTabControlPanel1 = new DevComponents.DotNetBar.SuperTabControlPanel(); this.panelExZKZB = new DevComponents.DotNetBar.PanelEx(); this.panel8 = new AIMS.PublicUI.UI.DrawPanel(); + this.paneltop = new System.Windows.Forms.Panel(); this.circularProgress1 = new DevComponents.DotNetBar.Controls.CircularProgress(); this.zgcAnaesRecord = new DrawGraph.ZedGraphControl(); this.spTabQXQDD = new DevComponents.DotNetBar.SuperTabItem(); @@ -921,6 +922,7 @@ // this.panel8.AutoScroll = true; this.panel8.BackColor = System.Drawing.Color.White; + this.panel8.Controls.Add(this.paneltop); this.panel8.Controls.Add(this.circularProgress1); this.panel8.Controls.Add(this.zgcAnaesRecord); this.panel8.Dock = System.Windows.Forms.DockStyle.Fill; @@ -930,6 +932,14 @@ this.panel8.TabIndex = 2; this.panel8.Scroll += new System.Windows.Forms.ScrollEventHandler(this.panel8_Scroll); // + // paneltop + // + this.paneltop.Location = new System.Drawing.Point(9, 137); + this.paneltop.Name = "paneltop"; + this.paneltop.Size = new System.Drawing.Size(690, 30); + this.paneltop.TabIndex = 7; + this.paneltop.Visible = false; + // // circularProgress1 // this.circularProgress1.AnimationSpeed = 50; @@ -2163,5 +2173,6 @@ private System.Windows.Forms.Button button10; private System.Windows.Forms.ComboBox cmbBGType; private System.Windows.Forms.Panel PanelSave; + private System.Windows.Forms.Panel paneltop; } } \ No newline at end of file diff --git a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs index 97e4eeb..38b52be 100644 --- a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs +++ b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs @@ -211,6 +211,7 @@ namespace AIMS.OperationAanesthesia panel8.VerticalScroll.Value = 0; panel82.VerticalScroll.Value = 0; + paneltop.Visible = false; mPanes = new List(); UpPanes = new List(); @@ -300,7 +301,7 @@ namespace AIMS.OperationAanesthesia if (pDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { pDoc.Print(); - } + } } private void PageSetting_Click3(object sender, EventArgs e) @@ -329,7 +330,7 @@ namespace AIMS.OperationAanesthesia if (pDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { pDoc.Print(); - } + } } private void PageSetting_Click4(object sender, EventArgs e) { @@ -339,11 +340,11 @@ namespace AIMS.OperationAanesthesia while (_record.pageCount != 1) { btnUpPage_Click(null, null); - } + } for (int i = 1; i <= _record.pageCount; i++) { - PrintDocPane(null, zgcAnaesRecord, templateManage, true); - btnNextPage_Click(null, null); + PrintDocPane(null, zgcAnaesRecord, templateManage, true); + btnNextPage_Click(null, null); } count = 0; int pylWidth = 3; @@ -360,7 +361,7 @@ namespace AIMS.OperationAanesthesia if (pDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { pDoc.Print(); - } + } } private void PrintDocPage(object sender, PrintPageEventArgs e) { @@ -487,7 +488,7 @@ namespace AIMS.OperationAanesthesia else { e.HasMorePages = false; - } + } } #endregion @@ -940,6 +941,17 @@ namespace AIMS.OperationAanesthesia { if (templateManage != null) templateManage.SetPYL(); + + paneltop.Location = new Point(0, paneltop.VerticalScroll.Value); + if (panel8.VerticalScroll.Value > 240) + { + paneltop.Width = panel8.Width - 50; + paneltop.Visible = true; + } + else + { + paneltop.Visible = false; + } } private void panel82_Scroll(object sender, ScrollEventArgs e) { @@ -951,6 +963,17 @@ namespace AIMS.OperationAanesthesia { if (templateManage != null) templateManage.SetPYL(); + + paneltop.Location = new Point(0, paneltop.VerticalScroll.Value); + if (panel8.VerticalScroll.Value > 240) + { + paneltop.Width = panel8.Width - 50; + paneltop.Visible = true; + } + else + { + paneltop.Visible = false; + } } private void panel82_MouseWheel(object sender, MouseEventArgs e) { @@ -2054,9 +2077,9 @@ namespace AIMS.OperationAanesthesia { area.MouseWheelParam += Area_MouseWheelParam; } - reDrawEvent(); templateManage.Bind(); templateManage2.Bind(); + reDrawEvent(); reDrawAnalysis(); zgcAnaesRecord.Refresh(); @@ -2095,15 +2118,16 @@ namespace AIMS.OperationAanesthesia private void DrawEvent() { - reDrawEvent(); templateManage.Bind("IconManage"); templateManage.Bind("RemarkManage"); + reDrawEvent(); zgcAnaesRecord.Refresh(); } private void reDrawEvent() { ClearTimeText(); + DrawPanelTopTime(); if (_record.InRoomTime != null) { txtInRoom.CustomFormat = "MM-dd HH:mm"; @@ -2189,6 +2213,34 @@ namespace AIMS.OperationAanesthesia EndOperationOutRoom(); } } + public void DrawPanelTopTime() + { + paneltop.Controls.Clear(); + int LoactionX = Convert.ToInt32(panel8.Width * 0.19); + int SpanX = (panel8.Width - LoactionX) / (240 / 15 + 2); + paneltop.BringToFront(); + System.Windows.Forms.Label label = new System.Windows.Forms.Label(); + label.AutoSize = true; + label.Font = new System.Drawing.Font("微软雅黑", 9.5F); + label.Location = new System.Drawing.Point(LoactionX - 100, 7); + label.Size = new System.Drawing.Size(39, 17); + label.TabIndex = 0; + label.Text = "时间(min)"; + paneltop.Controls.Add(label); + for (int i = 0; i <= (240 / 15); i++) + { + DateTime tempTime = _record.PageBegin.AddMinutes(i * 15); + System.Windows.Forms.Label labeltemp = new System.Windows.Forms.Label(); + labeltemp.AutoSize = true; + labeltemp.Font = new System.Drawing.Font("微软雅黑", 9.5F); + labeltemp.Location = new System.Drawing.Point(LoactionX + SpanX * i, 7); + labeltemp.Size = new System.Drawing.Size(39, 17); + labeltemp.TabIndex = 0; + labeltemp.Text = tempTime.ToString("HH:mm"); + paneltop.Controls.Add(labeltemp); + } + + } private void ClearTimeText() { txtInRoom.CustomFormat = " "; @@ -2224,6 +2276,7 @@ namespace AIMS.OperationAanesthesia this.picBG.BackgroundImage = global::AIMS.Properties.Resources.拔管; this.picAnesEnd.BackgroundImage = global::AIMS.Properties.Resources.麻醉结束; this.picOutRoom.BackgroundImage = global::AIMS.Properties.Resources.出手术室; + } private bool GetOpeState(ref string message) @@ -2345,6 +2398,7 @@ namespace AIMS.OperationAanesthesia { panel8.VerticalScroll.Value = 0; panel82.VerticalScroll.Value = 0; + paneltop.Visible = false; //清空记录点并重新加载 ClearTimeText(); //关闭采集的服务 @@ -2429,7 +2483,7 @@ namespace AIMS.OperationAanesthesia { if (_record != null) { - EMRExtension.OpenFeesRecord(_record , "麻醉"); + EMRExtension.OpenFeesRecord(_record, "麻醉"); } } private void frmAnasRecordBill2_VisibleChanged(object sender, EventArgs e) @@ -2438,6 +2492,7 @@ namespace AIMS.OperationAanesthesia { panel8.VerticalScroll.Value = 0; panel82.VerticalScroll.Value = 0; + paneltop.Visible = false; if (templateManage != null) templateManage.SetPYL(); if (templateManage2 != null) diff --git a/AIMS/OperationAanesthesia/oldSystemCode/frmOperatingRoomRegister.cs b/AIMS/OperationAanesthesia/oldSystemCode/frmOperatingRoomRegister.cs index 6d33388..144fe9f 100644 --- a/AIMS/OperationAanesthesia/oldSystemCode/frmOperatingRoomRegister.cs +++ b/AIMS/OperationAanesthesia/oldSystemCode/frmOperatingRoomRegister.cs @@ -1,5 +1,7 @@ using AIMSBLL; +using AIMSExtension; using AIMSModel; +using HelperDB; using System; using System.Collections.Generic; using System.Data; @@ -12,6 +14,10 @@ namespace AIMS.OperationAanesthesia { public partial class frmOperatingRoomRegister : Form { + public OperatingRoomPutDoorRegister opr; + private string patientModel; + private OrisPatient p; + List execdepartments; public frmOperatingRoomRegister() { InitializeComponent(); @@ -22,6 +28,7 @@ namespace AIMS.OperationAanesthesia lblTitle.Left = (this.Width - lblTitle.Width) / 2; txtQuery.Text = "门诊/住院号/姓名"; txtQuery.ForeColor = Color.Silver; + GetPatientModel(); dgvYP.AutoGenerateColumns = false; dgvInfo.AutoGenerateColumns = false; @@ -30,6 +37,15 @@ namespace AIMS.OperationAanesthesia } private void Initial() { + //PublicMethod.BindBasicDictionaryToComboBox(cboOperationLevel, "手术分级"); + //PublicMethod.BindBasicDictionaryToComboBox(cboASALevel, "ASA分级"); + //PublicMethod.BindBasicDictionaryToComboBox(cboOperationPosition, "手术体位"); + execdepartments = BDepartment.Select(" isvalid=1 ", null, RecursiveType.None, 0); + + } + private void FullDgvInfo(List list) + { + dgvInfo.DataSource = list; } private void tsbExit_Click(object sender, EventArgs e) { @@ -38,8 +54,77 @@ namespace AIMS.OperationAanesthesia private void btnImport_Click(object sender, EventArgs e) { + if (chkZhuYuan.Checked == false && chkMenZhen.Checked == false) + { + MessageBox.Show("请选择门诊或住院患者!", "系统提示"); + return; + } + if (txtInHospitalNo.Text.Trim() == "") + { + MessageBox.Show("请输入正确的住院号或者病历号!", "系统提示"); + return; + } + try + { + + if (PublicMethod.HospitalName.Contains("屯留")) + { + string sqlStr = string.Format("select * from AIMS_PATIENT where IPD_NO like '%{0}%'", txtInHospitalNo.Text); + DataTable dt = null; + dt = HisDBHelper.GetDataTable(sqlStr); + if (dt != null && dt.Rows.Count > 0) + { + DataRow row = dt.Rows[0]; + //填充窗体 + txtName.Text = row["PATIENT_NAME"].ToString(); + if (row["PATIENT_SEX"].ToString() == "男") + { + RbMan.Checked = true; + RbWuMan.Checked = false; + } + else + { + RbMan.Checked = false; + RbWuMan.Checked = true; + } + lblBed.Text = row["PATIENT_BED"].ToString(); + txtContacts.Text = row["PATIENT_CONTACTOR"].ToString(); + txtContactsTel.Text = row["PATIENT_CONTACTOR_PHONE"].ToString(); + txtAddress.Text = row["PATIENT_ADDRESS"].ToString(); + txtIdEntityNo.Text = row["IDNO"].ToString(); + //if (p.BirthDay != null) txtAge.Text = PublicMethod.GetAge(p.BirthDay.Value); + //hisPatientId = p.HISPatientId; + //hisVisitId = p.VisitId.ToString(); + if (p.Height != null) txtHeight.Text = row["PATIENT_HEIGHT"].ToString(); + if (p.Weight != null) txtWeight.Text = row["PATIENT_WEIGHT"].ToString(); + //if (p.InHospitalTime != null) dtpInHospitalTime.Value = p.InHospitalTime.Value; + //if (p.BirthDay != null) dtpBirthDay.Value = p.BirthDay.Value; + + cboPDepartment.Text = row["PATIENT_SECTION_NAME"].ToString(); + } + else + { + MessageBox.Show("未找到该患者信息!"); + } + } + } + catch (Exception ex) + { + PublicMethod.WriteLog(ex); + MessageBox.Show("未找到患者信息 ,请检查门诊号或ID号!"); + } } + private void GetPatientModel() + { + foreach (Control ctl in panel6.Controls) + { + if (ctl is CheckBox && (ctl as CheckBox).Checked == true) + { + patientModel = (ctl as CheckBox).Text; + } + } + } private void SetCheckBoxValue(Panel pnl, CheckBox chk) { foreach (Control ctl in pnl.Controls) @@ -103,10 +188,6 @@ namespace AIMS.OperationAanesthesia this.cboPDepartment.DroppedDown = true; } - public void setDoctor(TextBox controlTextBox, int workersType, bool isRadio = false) - { - } - private void txtInstrumentNurse_Click(object sender, EventArgs e) { setDoctor(sender as TextBox, 1); @@ -347,9 +428,58 @@ namespace AIMS.OperationAanesthesia private void tsbSaveOperationApply_Click(object sender, EventArgs e) { + if (ValidInput()) + { + if (opr == null) + { + opr = new OperatingRoomPutDoorRegister(); + SetOPRValue(opr); + opr.Id = BOperatingRoomPutDoorRegister.Insert(opr); + if (opr.Id > 0) + { + InsertOPRDrugsRecords(opr); + } + } + else + { + SetOPRValue(opr); + int num = BOperatingRoomPutDoorRegister.Update(opr); + if (num > 0) + { + int dnum = DelOPRDrugsRecords(opr); + InsertOPRDrugsRecords(opr); + + } + } + } + } + private int DelOPRDrugsRecords(OperatingRoomPutDoorRegister opr) + { + string sql = string.Format("delete OperatingRoomPutDoorRegisterDrugsRecords where PutDoorRegisterId=" + opr.Id.Value); + return DBHelper.ExecNonQuery(sql); + } + private void InsertOPRDrugsRecords(OperatingRoomPutDoorRegister opr) + { + StringBuilder sb = new StringBuilder(); + foreach (DataGridViewRow r in dgvDrugs.Rows) + { + if (r.Cells["DrugName"].EditedFormattedValue.ToString() != "") + { + string sql = string.Format("insert into OperatingRoomPutDoorRegisterDrugsRecords values({0},'{1}','{2}','{3}',{4},{5},{6},'{7}')", opr.Id.Value, opr.HISPatientId, r.Cells["DrugId"].Value.ToString(), r.Cells["DrugName"].Value.ToString(), decimal.Parse(r.Cells["Dosage"].Value.ToString()), 1, 0, DateTime.Now); + sb.AppendLine(sql); + } + } + if (sb.ToString().Length > 0) + { + int num = DBHelper.ExecNonQuery(sb.ToString()); + } + MessageBox.Show("保存成功!"); + SetControlNull(); + btnQuery.PerformClick(); } private void SetControlNull() { + opr = null; chkMenZhen.Checked = true; txtInHospitalNo.Text = ""; chkIsPlanAgainOperation.Checked = false; @@ -357,8 +487,7 @@ namespace AIMS.OperationAanesthesia cboPDepartment.Text = ""; chkMZ.Checked = false; chkZQ.Checked = false; - chkRJ.Checked = false; - cboExecDepart.Text = ""; + chkRJ.Checked = false; txtName.Text = ""; RbMan.Checked = true; txtAge.Text = ""; @@ -410,6 +539,65 @@ namespace AIMS.OperationAanesthesia } txtothere.Text = ""; } + private void SetOPRValue(OperatingRoomPutDoorRegister opr) + { + opr.Address = txtAddress.Text; + opr.Age = txtAge.Text; + opr.Anaesthesia = txtAnaesthesia.Text; + opr.AnaesthesiaBeginTime = txtAnaesthesiaBeginTime.Text != "" ? DateTime.Parse(txtAnaesthesiaBeginTime.Text) : (DateTime?)null; + opr.AnaesthesiaDoctorName = txtAnaesthesiaDoctor.Text != "" ? txtAnaesthesiaDoctor.Text : ""; + opr.AnaesthesiaDoctorNo = txtAnaesthesiaDoctor.Tag != null ? txtAnaesthesiaDoctor.Tag.ToString() : ""; + opr.AnaesthesiaDrugs = GetDugsIds(); + opr.AnaesthesiaEndTime = txtAnaesthesiaEndTime.Text != "" ? DateTime.Parse(txtAnaesthesiaEndTime.Text) : (DateTime?)null; + opr.AnaesthesiaMethod = GetCheckBoxCheckedValues(panel5); + opr.ASALevel = cboASALevel.Text; + opr.BirthDay = p != null ? p.BirthDay : (DateTime?)null; + opr.Complication = txtComplication.Text; + opr.Contacts = txtContacts.Text; + opr.ContactsTel = txtContactsTel.Text; + opr.Diagnose = txtDiagnose.Text; + opr.DiagnoseRemark = txtDiagnoseRemark.Text; + opr.ExecDeptName = "手术室"; + opr.ExecDeptNo = "手术室"; + opr.Height = txtHeight.Text != "" ? decimal.Parse(txtHeight.Text) : (decimal?)null; + opr.HISPatientId = p != null ? p.HisPatientId : ""; + opr.IdEntityNo = txtIdEntityNo.Text; + opr.InHospitalNo = txtInHospitalNo.Text; + opr.InstrumentNurseName = txtInstrumentNurse.Text; + opr.InstrumentNurseNo = txtInstrumentNurse.Text != "" ? txtInstrumentNurse.Tag.ToString() : ""; + opr.IsPainClinic = chkIsPainClinic.Checked == true ? 1 : 0; + opr.IsPlanAgainOperation = chkIsPlanAgainOperation.Checked == true ? 1 : chkIsPlanAgainOperation.Checked == true ? 2 : 0; + opr.IsValid = 1; + opr.Name = txtName.Text; + opr.HCode = PublicMethod.GetFirstLetter(opr.Name); + opr.OpeatorNo = PublicMethod.OperatorName; + opr.Operation = txtOperation.Text; + opr.OperationBeginTime = txtOperationBeginTime.Text != "" ? DateTime.Parse(txtOperationBeginTime.Text) : (DateTime?)null; + opr.OperationDate = opr.OperationBeginTime; + opr.OperationDoctorName = txtOperationDoctor.Text; + opr.OperationDoctorNo = txtOperationDoctor.Text != "" ? txtOperationDoctor.Tag.ToString() : ""; + opr.OperationEndTime = txtOperationEndTime.Text != "" ? DateTime.Parse(txtOperationEndTime.Text) : (DateTime?)null; + opr.OperationLevel = cboOperationLevel.Text; + opr.OperationPosition = cboOperationPosition.Text; + opr.OPerationRemark = txtOperationRemark.Text; + opr.OperationSituation = txtOperationSituation.Text; + opr.OperationType = GetCheckBoxCheckedValue(panel4); + opr.OperatorTime = DateTime.Now; + opr.PainTreatment = txtPainTreatment.Text; + opr.PainTreatmentRemark = txtPainTreatmentRemark.Text; + opr.PatientBedNo = lblBed.Text; + opr.PatientDeptName = cboPDepartment.Text; + //opr.PatientDeptNo = cboPDepartment.Text != "" ? cboPDepartment.SelectedValue.ToString() : ""; + opr.PatientId = p != null ? p.Id.ToString() : ""; + opr.PatientModel = GetCheckBoxCheckedValue(panel6); + opr.Sex = RbMan.Checked == true ? "男" : "女"; + opr.State = 0; + opr.Tel = txtContactsTel.Text; + opr.TourNurseName = txtTourNurse.Text; + opr.TourNurseNo = txtTourNurse.Text != "" ? txtTourNurse.Tag.ToString() : ""; + opr.VisitId = p != null ? p.VisitTimes.ToString() : ""; + opr.Weight = txtWeight.Text != "" ? decimal.Parse(txtWeight.Text) : (decimal?)null; + } private string GetDugsIds() { StringBuilder sb = new StringBuilder(); @@ -464,7 +652,7 @@ namespace AIMS.OperationAanesthesia { MessageBox.Show("请输入患者年龄!", "系统提示"); } - else if (GetCheckBoxCheckedValue(panel5) == "") + else if (GetCheckBoxCheckedValue(panel5) == "" && txtothere.Text.Trim() == "") { MessageBox.Show("请选择其他类型麻醉!", "系统提示"); } @@ -472,10 +660,18 @@ namespace AIMS.OperationAanesthesia { MessageBox.Show("请输入患者诊断!", "系统提示"); } + else if (txtOperationBeginTime.Text == "") + { + MessageBox.Show("请输入手术开始时间!", "系统提示"); + } + else if (txtOperationEndTime.Text == "") + { + MessageBox.Show("请输入手术结束时间!", "系统提示"); + } else { flag = true; - } + } return flag; } private string GetCheckBoxCheckedValue(Panel p) @@ -524,10 +720,98 @@ namespace AIMS.OperationAanesthesia } private void btnQuery_Click(object sender, EventArgs e) { + string begin = dtpDate.Value.ToShortDateString() + " 00:00:00"; + string end = dtpDate.Value.ToShortDateString() + " 23:59:59"; + string str = txtQuery.Text.Trim(); + if (str == "门诊/住院号/姓名") str = ""; + string where = ""; + if (str != "") where = " and (HCode like '%" + str + "%' or InHospitalNo like '%" + str + "%' or Name like '%" + str + "%')"; + List list = BOperatingRoomPutDoorRegister.Select("OperationBeginTime>='" + begin + "' and OperationBeginTime<='" + end + "' " + where, new ParameterList()); + FullDgvInfo(list); } private void dgvInfo_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { + if (e.RowIndex >= 0) + { + SetControlNull(); + int id = int.Parse(dgvInfo.CurrentRow.Cells["pId"].Value.ToString()); + opr = BOperatingRoomPutDoorRegister.SelectSingle(id); + InitialOperatingRoomPutDoorRegister(opr); + } + } + private void InitialOperatingRoomPutDoorRegister(OperatingRoomPutDoorRegister opr) + { + SetCheckBoxValue(opr.PatientModel, panel6); + txtInHospitalNo.Text = opr.InHospitalNo; + if (opr.IsPlanAgainOperation == 1) + { + chkIsPlanAgainOperation.Checked = true; + } + else if (opr.IsPlanAgainOperation == 2) + { + chkIsNotPlanAgainOperation.Checked = true; + } + cboPDepartment.Text = opr.PatientDeptName; + lblBed.Text = opr.PatientBedNo; + SetCheckBoxValue(opr.OperationType, panel4); + txtName.Text = opr.Name; + if (opr.Sex == "男") + { + RbMan.Checked = true; + } + else + { + RbWuMan.Checked = true; + } + txtAge.Text = opr.Age; + txtHeight.Text = opr.Height.ToString(); + txtHeight.Text = opr.Weight.ToString(); + txtIdEntityNo.Text = opr.IdEntityNo; + txtContacts.Text = opr.Contacts; + txtContactsTel.Text = opr.ContactsTel; + txtAddress.Text = opr.Address; + SetCheckBoxValues(opr.AnaesthesiaMethod, panel5); + chkIsPainClinic.Checked = opr.IsPainClinic == 0 ? false : true; + txtPainTreatment.Text = opr.PainTreatment; + txtPainTreatmentRemark.Text = opr.PainTreatmentRemark; + txtDiagnose.Text = opr.Diagnose; + txtDiagnoseRemark.Text = opr.DiagnoseRemark; + txtOperation.Text = opr.Operation; + txtOperationRemark.Text = opr.OPerationRemark; + txtAnaesthesia.Text = opr.Anaesthesia; + cboASALevel.Text = opr.ASALevel; + cboOperationLevel.Text = opr.OperationLevel; + cboOperationPosition.Text = opr.OperationPosition; + txtComplication.Text = opr.Complication; + txtOperationSituation.Text = opr.OperationSituation; + if (opr.AnaesthesiaBeginTime != null) txtAnaesthesiaBeginTime.Text = opr.AnaesthesiaBeginTime.Value.ToString("yyyy-MM-dd HH:mm"); + if (opr.AnaesthesiaEndTime != null) txtAnaesthesiaEndTime.Text = opr.AnaesthesiaEndTime.Value.ToString("yyyy-MM-dd HH:mm"); + if (opr.OperationBeginTime != null) txtOperationBeginTime.Text = opr.OperationBeginTime.Value.ToString("yyyy-MM-dd HH:mm"); + if (opr.OperationEndTime != null) txtOperationEndTime.Text = opr.OperationEndTime.Value.ToString("yyyy-MM-dd HH:mm"); + txtOperationDoctor.Text = opr.OperationDoctorName; + txtOperationDoctor.Tag = opr.OperationDoctorNo; + txtAnaesthesiaDoctor.Text = opr.AnaesthesiaDoctorName; + txtAnaesthesiaDoctor.Tag = opr.AnaesthesiaDoctorNo; + txtInstrumentNurse.Text = opr.InstrumentNurseName; + txtInstrumentNurse.Tag = opr.InstrumentNurseNo; + txtTourNurse.Text = opr.TourNurseName; + txtTourNurse.Tag = opr.TourNurseNo; + + FullDgvDrugs(opr.Id.Value); + + } + private void FullDgvDrugs(int id) + { + List list = BOperatingRoomPutDoorRegisterDrugsRecords.Select("PutDoorRegisterId=" + id, new ParameterList()); + dgvDrugs.Rows.Clear(); + foreach (OperatingRoomPutDoorRegisterDrugsRecords oprr in list) + { + int index = dgvDrugs.Rows.Add(); + dgvDrugs.Rows[index].Cells["DrugId"].Value = oprr.DrugsNo; + dgvDrugs.Rows[index].Cells["DrugName"].Value = oprr.DrugsName; + dgvDrugs.Rows[index].Cells["Dosage"].Value = oprr.Dosage.Value.ToString("0.###"); + } } private void SetCheckBoxValue(string str, Panel p) { @@ -615,6 +899,52 @@ namespace AIMS.OperationAanesthesia } } + private void tsbConfigDataGridview_Click(object sender, EventArgs e) + { + //frmOperatingRoomQuery frm = new frmOperatingRoomQuery(); + //frm.ShowDialog(); + } + + private void txtDiagnose_DoubleClick(object sender, EventArgs e) + { + //frmSelectDisease fmdis = new frmSelectDisease(); + //fmdis._controlName = sender as TextBox; + //fmdis._RemarkName = txtDiagnoseRemark; + //fmdis.ShowDialog(); + } + + private void txtOperation_DoubleClick(object sender, EventArgs e) + { + //frmSelectOperations frmso = new frmSelectOperations(); + //frmso._controlName = sender as TextBox; + //frmso._RemarkName = txtOperationRemark; + //frmso.ShowDialog(); + } + + private void txtAnaesthesia_DoubleClick(object sender, EventArgs e) + { + //frmSelectAnaesthesiaMethod fmatm = new frmSelectAnaesthesiaMethod(); + //fmatm._controlName = sender as TextBox; + //fmatm._formName = this.Name; + //fmatm.ShowDialog(); + } + + public void setDoctor(TextBox controlTextBox, int workersType, bool isRadio = false) + { + //frmSelectWorkers_New frmwok = new frmSelectWorkers_New(); + //frmwok._controlName = controlTextBox; + //if (cboPDepartment.Text == "全部科室" || cboPDepartment.Text == "") + //{ + // frmwok._deptId = 0; + //} + //else + //{ + // frmwok._deptId = (BLL.BDepartments.SelectSingle("Name=@name", new ParameterList("@name", cboPDepartment.Text), RecursiveType.None, 0).Id.Value); + //} + //frmwok._workersType = workersType; + //frmwok.isRadio = isRadio; + //frmwok.ShowDialog(); + } private void txtOperationDoctor_DoubleClick(object sender, EventArgs e) { setDoctor(sender as TextBox, 0, true); @@ -663,6 +993,17 @@ namespace AIMS.OperationAanesthesia private void tsmDel_Click(object sender, EventArgs e) { + int id = int.Parse(dgvInfo.CurrentRow.Cells["pId"].Value.ToString()); + DialogResult dialogResult = MessageBox.Show("确定删除当前患者记录?", "系统提示", MessageBoxButtons.YesNo); + if (dialogResult == DialogResult.Yes) + { + int num = BOperatingRoomPutDoorRegister.Delete("Id=" + id, new ParameterList()); + if (num > 0) + { + btnQuery.PerformClick(); + MessageBox.Show("删除成功!"); + } + } } private void dgvInfo_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) @@ -674,7 +1015,6 @@ namespace AIMS.OperationAanesthesia private void txtOperationBeginTime_DoubleClick(object sender, EventArgs e) { (sender as TextBox).Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm"); - } } } diff --git a/AIMS/OperationAanesthesia/oldSystemCode/frmOperatingRoomRegister.designer.cs b/AIMS/OperationAanesthesia/oldSystemCode/frmOperatingRoomRegister.designer.cs index 0ce88e7..33ce5d0 100644 --- a/AIMS/OperationAanesthesia/oldSystemCode/frmOperatingRoomRegister.designer.cs +++ b/AIMS/OperationAanesthesia/oldSystemCode/frmOperatingRoomRegister.designer.cs @@ -140,7 +140,6 @@ this.label13 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label44 = new System.Windows.Forms.Label(); - this.cboExecDepart = new System.Windows.Forms.ComboBox(); this.panel7 = new System.Windows.Forms.Panel(); this.label43 = new System.Windows.Forms.Label(); this.RbMan = new System.Windows.Forms.RadioButton(); @@ -164,7 +163,6 @@ this.label10 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); this.panel3 = new System.Windows.Forms.Panel(); this.cboPDepartment = new System.Windows.Forms.ComboBox(); this.lblBed = new System.Windows.Forms.Label(); @@ -1001,7 +999,6 @@ this.txtPainTreatmentRemark.Name = "txtPainTreatmentRemark"; this.txtPainTreatmentRemark.Size = new System.Drawing.Size(346, 26); this.txtPainTreatmentRemark.TabIndex = 32; - this.txtPainTreatmentRemark.Visible = false; // // txtAnaesthesia // @@ -1063,7 +1060,6 @@ this.txtPainTreatment.Name = "txtPainTreatment"; this.txtPainTreatment.Size = new System.Drawing.Size(448, 26); this.txtPainTreatment.TabIndex = 27; - this.txtPainTreatment.Visible = false; // // label15 // @@ -1073,7 +1069,6 @@ this.label15.Size = new System.Drawing.Size(37, 20); this.label15.TabIndex = 23; this.label15.Text = "说明"; - this.label15.Visible = false; // // label23 // @@ -1171,7 +1166,6 @@ this.label14.Size = new System.Drawing.Size(65, 20); this.label14.TabIndex = 25; this.label14.Text = "疼痛治疗"; - this.label14.Visible = false; // // panel5 // @@ -1382,7 +1376,6 @@ // groupBox2 // this.groupBox2.Controls.Add(this.label44); - this.groupBox2.Controls.Add(this.cboExecDepart); this.groupBox2.Controls.Add(this.panel7); this.groupBox2.Controls.Add(this.txtAddress); this.groupBox2.Controls.Add(this.label35); @@ -1403,7 +1396,6 @@ this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.label9); this.groupBox2.Controls.Add(this.label8); - this.groupBox2.Controls.Add(this.label7); this.groupBox2.Controls.Add(this.panel3); this.groupBox2.Controls.Add(this.panel4); this.groupBox2.Location = new System.Drawing.Point(9, 38); @@ -1422,16 +1414,6 @@ this.label44.TabIndex = 638; this.label44.Text = "手术类型"; // - // cboExecDepart - // - this.cboExecDepart.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.cboExecDepart.FormattingEnabled = true; - this.cboExecDepart.Location = new System.Drawing.Point(830, 17); - this.cboExecDepart.Name = "cboExecDepart"; - this.cboExecDepart.Size = new System.Drawing.Size(208, 28); - this.cboExecDepart.TabIndex = 637; - this.cboExecDepart.Visible = false; - // // panel7 // this.panel7.Controls.Add(this.label43); @@ -1640,17 +1622,6 @@ this.label8.TabIndex = 16; this.label8.Text = "姓名"; // - // label7 - // - this.label7.AutoSize = true; - this.label7.ForeColor = System.Drawing.Color.Red; - this.label7.Location = new System.Drawing.Point(759, 21); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(65, 20); - this.label7.TabIndex = 17; - this.label7.Text = "执行科室"; - this.label7.Visible = false; - // // panel3 // this.panel3.Controls.Add(this.cboPDepartment); @@ -2277,7 +2248,6 @@ private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label7; private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Label lblBed; private System.Windows.Forms.Label label5; @@ -2298,7 +2268,6 @@ public System.Windows.Forms.RadioButton RbMan; public System.Windows.Forms.RadioButton RbWuMan; public System.Windows.Forms.ComboBox cboPDepartment; - public System.Windows.Forms.ComboBox cboExecDepart; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8; diff --git a/AIMS/OperationFront/frmOperationApplyDetail.Designer.cs b/AIMS/OperationFront/frmOperationApplyDetail.Designer.cs index 6844e9f..78d6114 100644 --- a/AIMS/OperationFront/frmOperationApplyDetail.Designer.cs +++ b/AIMS/OperationFront/frmOperationApplyDetail.Designer.cs @@ -908,8 +908,7 @@ this.txtContactsPhone.Location = new System.Drawing.Point(918, 100); this.txtContactsPhone.Name = "txtContactsPhone"; this.txtContactsPhone.Size = new System.Drawing.Size(134, 23); - this.txtContactsPhone.TabIndex = 36; - this.txtContactsPhone.TextChanged += new System.EventHandler(this.txtContactsPhone_TextChanged); + this.txtContactsPhone.TabIndex = 36; // // label16 // @@ -969,8 +968,7 @@ this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(63, 14); this.label15.TabIndex = 29; - this.label15.Text = "入院日期"; - this.label15.Click += new System.EventHandler(this.label15_Click); + this.label15.Text = "入院日期"; // // cboPatientKind // diff --git a/AIMS/OperationFront/frmOperationApplyDetail.cs b/AIMS/OperationFront/frmOperationApplyDetail.cs index a640770..fef76c6 100644 --- a/AIMS/OperationFront/frmOperationApplyDetail.cs +++ b/AIMS/OperationFront/frmOperationApplyDetail.cs @@ -1215,17 +1215,7 @@ namespace AIMS.OperationFront.UI private void cboDepartment_SelectedIndexChanged(object sender, EventArgs e) { //cboApplyDepId.Text = cboDepartment.Text; - } - - private void txtContactsPhone_TextChanged(object sender, EventArgs e) - { - - } - - private void label15_Click(object sender, EventArgs e) - { - - } + } private void btnDR_Click(object sender, EventArgs e) { diff --git a/AIMS/OremrUserControl/ExtendedPanel.cs b/AIMS/OremrUserControl/ExtendedPanel.cs new file mode 100644 index 0000000..3fe6285 --- /dev/null +++ b/AIMS/OremrUserControl/ExtendedPanel.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace AIMS.OremrUserControl +{ + public class ExtendedPanel : Panel + { + private const int WS_EX_TRANSPARENT = 0x20; + public ExtendedPanel() + { + SetStyle(ControlStyles.Opaque, true); + } + + private int opacity = 90; + [DefaultValue(50)] + public int Opacity + { + get + { + return this.opacity; + } + set + { + if (value < 0 || value > 100) + throw new ArgumentException("value must be between 0 and 100"); + this.opacity = value; + } + } + protected override CreateParams CreateParams + { + get + { + CreateParams cp = base.CreateParams; + cp.ExStyle = cp.ExStyle | WS_EX_TRANSPARENT; + return cp; + } + } + protected override void OnPaint(PaintEventArgs e) + { + using (var brush = new SolidBrush(Color.FromArgb(this.opacity * 255 / 100, this.BackColor))) + { + e.Graphics.FillRectangle(brush, this.ClientRectangle); + } + base.OnPaint(e); + } + } +} diff --git a/AIMSEntity/AIMSEntity.csproj b/AIMSEntity/AIMSEntity.csproj index 0a60e65..bb62743 100644 --- a/AIMSEntity/AIMSEntity.csproj +++ b/AIMSEntity/AIMSEntity.csproj @@ -54,6 +54,8 @@ + + @@ -62,6 +64,8 @@ + + @@ -348,6 +352,8 @@ + + @@ -520,6 +526,8 @@ + + diff --git a/AIMSEntity/BLL/AutoGenerate/BOperatingRoomPutDoorRegister.cs b/AIMSEntity/BLL/AutoGenerate/BOperatingRoomPutDoorRegister.cs new file mode 100644 index 0000000..2c619ea --- /dev/null +++ b/AIMSEntity/BLL/AutoGenerate/BOperatingRoomPutDoorRegister.cs @@ -0,0 +1,166 @@ +using AIMSDAL; +using AIMSModel; +using System.Collections.Generic; +using System.Data; + +namespace AIMSBLL + +{ + public partial class BOperatingRoomPutDoorRegister + { + #region 插入实体操作部份 + /// + /// 插入实体 + /// + /// 实体类对象 + /// 标识列值或影响的记录行数 + public static int Insert(OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + return DOperatingRoomPutDoorRegister.Insert(operatingRoomPutDoorRegister); + } + #endregion + + #region 删除实体操作 + /// + /// 删除实体 + /// + /// 实体类对象 + /// 影响的记录行数 + public static int Delete(OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + return DOperatingRoomPutDoorRegister.Delete(operatingRoomPutDoorRegister); + } + /// + /// 根据对象查询语句删除 + /// + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Delete(string oql, ParameterList parameters) + { + return DOperatingRoomPutDoorRegister.Delete(oql,parameters); + } + #endregion + + #region 更新实体操作 + + /// + /// 更新实体 + /// + /// 实体类对象 + /// 影响的记录行数 + public static int Update(OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + return DOperatingRoomPutDoorRegister.Update(operatingRoomPutDoorRegister); + } + + /// + /// 根据对象查询语句更新实体 + /// + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Update(string oql, ParameterList parameters) + { + return DOperatingRoomPutDoorRegister.Update(oql,parameters); + } + #endregion + + #region 查询实体集合 + /// + /// \查询实体集合 + /// + /// 实体类对象集合 + public static List Select() + { + return DOperatingRoomPutDoorRegister.Select(); + } + /// + /// 递归查询实体集合 + /// + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List Select(RecursiveType recursiveType, int recursiveDepth) + { + return DOperatingRoomPutDoorRegister.Select(recursiveType, recursiveDepth); + } + + /// + /// 根据对象查询语句查询实体集合 + /// + /// 对象查询语句 + /// 参数列表 + /// 实体类对象集合 + public static List Select(string oql, ParameterList parameters) + { + return DOperatingRoomPutDoorRegister.Select(oql, parameters); + } + + /// + /// 根据对象查询语句递归查询实体集合 + /// + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List Select(string oql, ParameterList parameters,RecursiveType recursiveType, int recursiveDepth) + { + return DOperatingRoomPutDoorRegister.Select(oql, parameters, recursiveType, recursiveDepth); + } + #endregion + + #region 查询单个实体 + /// + /// 更据对象查询语句查询单个实体 + /// + /// 对象查询语句 + /// 参数列表 + /// 实体对象 + public static OperatingRoomPutDoorRegister SelectSingle(string oql, ParameterList parameters) + { + return DOperatingRoomPutDoorRegister.SelectSingle(oql, parameters); + } + /// + /// 更据对象查询语句递归查询单个实体 + /// + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegister SelectSingle(string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + return DOperatingRoomPutDoorRegister.SelectSingle(oql, parameters, recursiveType, recursiveDepth); + } + + /// + /// 按主键字段查询特定实体 + /// + /// 主键值 + /// 实体类对象 + public static OperatingRoomPutDoorRegister SelectSingle(int? id) + { + return DOperatingRoomPutDoorRegister.SelectSingle(id); + } + + /// + /// 更据主键递归查询单个实体 + /// + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegister SelectSingle(int? id, RecursiveType recursiveType, int recursiveDepth) + { + return DOperatingRoomPutDoorRegister.SelectSingle(id, recursiveType, recursiveDepth); + } + #endregion + + + public static DataTable GetOperatingRoomPutDoorRegisterByCondition(string begin, string end, string anaesthesiaMethod, string anaesthesiaDoctor, string execDepart, string pDept,string Asa) + { + return DOperatingRoomPutDoorRegister.GetOperatingRoomPutDoorRegisterByCondition(begin, end, anaesthesiaMethod, anaesthesiaDoctor, execDepart, pDept,Asa); + } + } +} diff --git a/AIMSEntity/BLL/AutoGenerate/BOperatingRoomPutDoorRegisterDrugsRecords.cs b/AIMSEntity/BLL/AutoGenerate/BOperatingRoomPutDoorRegisterDrugsRecords.cs new file mode 100644 index 0000000..dfa7aa4 --- /dev/null +++ b/AIMSEntity/BLL/AutoGenerate/BOperatingRoomPutDoorRegisterDrugsRecords.cs @@ -0,0 +1,158 @@ +using AIMSDAL; +using AIMSModel; +using System.Collections.Generic; + +namespace AIMSBLL +{ + public partial class BOperatingRoomPutDoorRegisterDrugsRecords + { + #region 插入实体操作部份 + /// + /// 插入实体 + /// + /// 实体类对象 + /// 标识列值或影响的记录行数 + public static int Insert(OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.Insert(operatingRoomPutDoorRegisterDrugsRecords); + } + #endregion + + #region 删除实体操作 + /// + /// 删除实体 + /// + /// 实体类对象 + /// 影响的记录行数 + public static int Delete(OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.Delete(operatingRoomPutDoorRegisterDrugsRecords); + } + /// + /// 根据对象查询语句删除 + /// + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Delete(string oql, ParameterList parameters) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.Delete(oql,parameters); + } + #endregion + + #region 更新实体操作 + + /// + /// 更新实体 + /// + /// 实体类对象 + /// 影响的记录行数 + public static int Update(OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.Update(operatingRoomPutDoorRegisterDrugsRecords); + } + + /// + /// 根据对象查询语句更新实体 + /// + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Update(string oql, ParameterList parameters) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.Update(oql,parameters); + } + #endregion + + #region 查询实体集合 + /// + /// \查询实体集合 + /// + /// 实体类对象集合 + public static List Select() + { + return DOperatingRoomPutDoorRegisterDrugsRecords.Select(); + } + /// + /// 递归查询实体集合 + /// + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List Select(RecursiveType recursiveType, int recursiveDepth) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.Select(recursiveType, recursiveDepth); + } + + /// + /// 根据对象查询语句查询实体集合 + /// + /// 对象查询语句 + /// 参数列表 + /// 实体类对象集合 + public static List Select(string oql, ParameterList parameters) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.Select(oql, parameters); + } + + /// + /// 根据对象查询语句递归查询实体集合 + /// + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List Select(string oql, ParameterList parameters,RecursiveType recursiveType, int recursiveDepth) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.Select(oql, parameters, recursiveType, recursiveDepth); + } + #endregion + + #region 查询单个实体 + /// + /// 更据对象查询语句查询单个实体 + /// + /// 对象查询语句 + /// 参数列表 + /// 实体对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(string oql, ParameterList parameters) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.SelectSingle(oql, parameters); + } + /// + /// 更据对象查询语句递归查询单个实体 + /// + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.SelectSingle(oql, parameters, recursiveType, recursiveDepth); + } + + /// + /// 按主键字段查询特定实体 + /// + /// 主键值 + /// 实体类对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(int? id) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.SelectSingle(id); + } + + /// + /// 更据主键递归查询单个实体 + /// + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(int? id, RecursiveType recursiveType, int recursiveDepth) + { + return DOperatingRoomPutDoorRegisterDrugsRecords.SelectSingle(id, recursiveType, recursiveDepth); + } + #endregion + } +} diff --git a/AIMSEntity/DAL/AutoGenerate/DOperatingRoomPutDoorRegister.cs b/AIMSEntity/DAL/AutoGenerate/DOperatingRoomPutDoorRegister.cs new file mode 100644 index 0000000..2b7d88d --- /dev/null +++ b/AIMSEntity/DAL/AutoGenerate/DOperatingRoomPutDoorRegister.cs @@ -0,0 +1,957 @@ +using AIMSModel; +using AIMSObjectQuery; +using HelperDB; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; + +namespace AIMSDAL +{ + public partial class DOperatingRoomPutDoorRegister + { + #region 插入实体操作部份 + /// + /// 插入 + /// + /// Command对象 + /// 实体类对象 + /// 标识列值或影响的记录行数 + public static int Insert(SqlCommand cmd, OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + cmd.Parameters.Clear(); + cmd.CommandText = "insert into OperatingRoomPutDoorRegister (PatientId,HISPatientId,InHospitalNo,VisitId,PatientModel,PatientDeptNo,PatientDeptName,PatientBedNo,Name,Sex,Age,BirthDay,Height,Weight,IdEntityNo,Tel,Address,Contacts,ContactsTel,OperationType,IsPlanAgainOperation,ExecDeptNo,ExecDeptName,AnaesthesiaMethod,IsPainClinic,PainTreatment,PainTreatmentRemark,Diagnose,DiagnoseRemark,Operation,OPerationRemark,Anaesthesia,AnaesthesiaRemark,ASALevel,OperationLevel,OperationPosition,AnaesthesiaDrugs,Complication,OperationSituation,OperationDate,AnaesthesiaBeginTime,AnaesthesiaEndTime,OperationBeginTime,OperationEndTime,OperationDoctorNo,OperationDoctorName,AnaesthesiaDoctorNo,AnaesthesiaDoctorName,InstrumentNurseNo,InstrumentNurseName,TourNurseNo,TourNurseName,IsValid,State,OpeatorNo,OperatorTime,Remark,HCode) values (@PatientId,@HISPatientId,@InHospitalNo,@VisitId,@PatientModel,@PatientDeptNo,@PatientDeptName,@PatientBedNo,@Name,@Sex,@Age,@BirthDay,@Height,@Weight,@IdEntityNo,@Tel,@Address,@Contacts,@ContactsTel,@OperationType,@IsPlanAgainOperation,@ExecDeptNo,@ExecDeptName,@AnaesthesiaMethod,@IsPainClinic,@PainTreatment,@PainTreatmentRemark,@Diagnose,@DiagnoseRemark,@Operation,@OPerationRemark,@Anaesthesia,@AnaesthesiaRemark,@ASALevel,@OperationLevel,@OperationPosition,@AnaesthesiaDrugs,@Complication,@OperationSituation,@OperationDate,@AnaesthesiaBeginTime,@AnaesthesiaEndTime,@OperationBeginTime,@OperationEndTime,@OperationDoctorNo,@OperationDoctorName,@AnaesthesiaDoctorNo,@AnaesthesiaDoctorName,@InstrumentNurseNo,@InstrumentNurseName,@TourNurseNo,@TourNurseName,@IsValid,@State,@OpeatorNo,@OperatorTime,@Remark,@HCode);select @@identity"; + //从实体中取出值放入Command的参数列表 + cmd.Parameters.Add(new SqlParameter("@PatientId", operatingRoomPutDoorRegister.PatientId == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PatientId)); + cmd.Parameters.Add(new SqlParameter("@HISPatientId", operatingRoomPutDoorRegister.HISPatientId == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.HISPatientId)); + cmd.Parameters.Add(new SqlParameter("@InHospitalNo", operatingRoomPutDoorRegister.InHospitalNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.InHospitalNo)); + cmd.Parameters.Add(new SqlParameter("@VisitId", operatingRoomPutDoorRegister.VisitId == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.VisitId)); + cmd.Parameters.Add(new SqlParameter("@PatientModel", operatingRoomPutDoorRegister.PatientModel == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PatientModel)); + cmd.Parameters.Add(new SqlParameter("@PatientDeptNo", operatingRoomPutDoorRegister.PatientDeptNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PatientDeptNo)); + cmd.Parameters.Add(new SqlParameter("@PatientDeptName", operatingRoomPutDoorRegister.PatientDeptName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PatientDeptName)); + cmd.Parameters.Add(new SqlParameter("@PatientBedNo", operatingRoomPutDoorRegister.PatientBedNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PatientBedNo)); + cmd.Parameters.Add(new SqlParameter("@Name", operatingRoomPutDoorRegister.Name == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Name)); + cmd.Parameters.Add(new SqlParameter("@Sex", operatingRoomPutDoorRegister.Sex == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Sex)); + cmd.Parameters.Add(new SqlParameter("@Age", operatingRoomPutDoorRegister.Age == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Age)); + cmd.Parameters.Add(new SqlParameter("@BirthDay", operatingRoomPutDoorRegister.BirthDay.HasValue ? (object)operatingRoomPutDoorRegister.BirthDay.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@Height", operatingRoomPutDoorRegister.Height.HasValue ? (object)operatingRoomPutDoorRegister.Height.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@Weight", operatingRoomPutDoorRegister.Weight.HasValue ? (object)operatingRoomPutDoorRegister.Weight.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@IdEntityNo", operatingRoomPutDoorRegister.IdEntityNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.IdEntityNo)); + cmd.Parameters.Add(new SqlParameter("@Tel", operatingRoomPutDoorRegister.Tel == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Tel)); + cmd.Parameters.Add(new SqlParameter("@Address", operatingRoomPutDoorRegister.Address == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Address)); + cmd.Parameters.Add(new SqlParameter("@Contacts", operatingRoomPutDoorRegister.Contacts == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Contacts)); + cmd.Parameters.Add(new SqlParameter("@ContactsTel", operatingRoomPutDoorRegister.ContactsTel == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.ContactsTel)); + cmd.Parameters.Add(new SqlParameter("@OperationType", operatingRoomPutDoorRegister.OperationType == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationType)); + cmd.Parameters.Add(new SqlParameter("@IsPlanAgainOperation", operatingRoomPutDoorRegister.IsPlanAgainOperation.HasValue ? (object)operatingRoomPutDoorRegister.IsPlanAgainOperation.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@ExecDeptNo", operatingRoomPutDoorRegister.ExecDeptNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.ExecDeptNo)); + cmd.Parameters.Add(new SqlParameter("@ExecDeptName", operatingRoomPutDoorRegister.ExecDeptName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.ExecDeptName)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaMethod", operatingRoomPutDoorRegister.AnaesthesiaMethod == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.AnaesthesiaMethod)); + cmd.Parameters.Add(new SqlParameter("@IsPainClinic", operatingRoomPutDoorRegister.IsPainClinic.HasValue ? (object)operatingRoomPutDoorRegister.IsPainClinic.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@PainTreatment", operatingRoomPutDoorRegister.PainTreatment == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PainTreatment)); + cmd.Parameters.Add(new SqlParameter("@PainTreatmentRemark", operatingRoomPutDoorRegister.PainTreatmentRemark == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PainTreatmentRemark)); + cmd.Parameters.Add(new SqlParameter("@Diagnose", operatingRoomPutDoorRegister.Diagnose == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Diagnose)); + cmd.Parameters.Add(new SqlParameter("@DiagnoseRemark", operatingRoomPutDoorRegister.DiagnoseRemark == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.DiagnoseRemark)); + cmd.Parameters.Add(new SqlParameter("@Operation", operatingRoomPutDoorRegister.Operation == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Operation)); + cmd.Parameters.Add(new SqlParameter("@OPerationRemark", operatingRoomPutDoorRegister.OPerationRemark == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OPerationRemark)); + cmd.Parameters.Add(new SqlParameter("@Anaesthesia", operatingRoomPutDoorRegister.Anaesthesia == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Anaesthesia)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaRemark", operatingRoomPutDoorRegister.AnaesthesiaRemark == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.AnaesthesiaRemark)); + cmd.Parameters.Add(new SqlParameter("@ASALevel", operatingRoomPutDoorRegister.ASALevel == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.ASALevel)); + cmd.Parameters.Add(new SqlParameter("@OperationLevel", operatingRoomPutDoorRegister.OperationLevel == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationLevel)); + cmd.Parameters.Add(new SqlParameter("@OperationPosition", operatingRoomPutDoorRegister.OperationPosition == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationPosition)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaDrugs", operatingRoomPutDoorRegister.AnaesthesiaDrugs == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.AnaesthesiaDrugs)); + cmd.Parameters.Add(new SqlParameter("@Complication", operatingRoomPutDoorRegister.Complication == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Complication)); + cmd.Parameters.Add(new SqlParameter("@OperationSituation", operatingRoomPutDoorRegister.OperationSituation == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationSituation)); + cmd.Parameters.Add(new SqlParameter("@OperationDate", operatingRoomPutDoorRegister.OperationDate.HasValue ? (object)operatingRoomPutDoorRegister.OperationDate.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaBeginTime", operatingRoomPutDoorRegister.AnaesthesiaBeginTime.HasValue ? (object)operatingRoomPutDoorRegister.AnaesthesiaBeginTime.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaEndTime", operatingRoomPutDoorRegister.AnaesthesiaEndTime.HasValue ? (object)operatingRoomPutDoorRegister.AnaesthesiaEndTime.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OperationBeginTime", operatingRoomPutDoorRegister.OperationBeginTime.HasValue ? (object)operatingRoomPutDoorRegister.OperationBeginTime.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OperationEndTime", operatingRoomPutDoorRegister.OperationEndTime.HasValue ? (object)operatingRoomPutDoorRegister.OperationEndTime.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OperationDoctorNo", operatingRoomPutDoorRegister.OperationDoctorNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationDoctorNo)); + cmd.Parameters.Add(new SqlParameter("@OperationDoctorName", operatingRoomPutDoorRegister.OperationDoctorName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationDoctorName)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaDoctorNo", operatingRoomPutDoorRegister.AnaesthesiaDoctorNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.AnaesthesiaDoctorNo)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaDoctorName", operatingRoomPutDoorRegister.AnaesthesiaDoctorName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.AnaesthesiaDoctorName)); + cmd.Parameters.Add(new SqlParameter("@InstrumentNurseNo", operatingRoomPutDoorRegister.InstrumentNurseNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.InstrumentNurseNo)); + cmd.Parameters.Add(new SqlParameter("@InstrumentNurseName", operatingRoomPutDoorRegister.InstrumentNurseName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.InstrumentNurseName)); + cmd.Parameters.Add(new SqlParameter("@TourNurseNo", operatingRoomPutDoorRegister.TourNurseNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.TourNurseNo)); + cmd.Parameters.Add(new SqlParameter("@TourNurseName", operatingRoomPutDoorRegister.TourNurseName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.TourNurseName)); + cmd.Parameters.Add(new SqlParameter("@IsValid", operatingRoomPutDoorRegister.IsValid.HasValue ? (object)operatingRoomPutDoorRegister.IsValid.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@State", operatingRoomPutDoorRegister.State.HasValue ? (object)operatingRoomPutDoorRegister.State.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OpeatorNo", operatingRoomPutDoorRegister.OpeatorNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OpeatorNo)); + cmd.Parameters.Add(new SqlParameter("@OperatorTime", operatingRoomPutDoorRegister.OperatorTime.HasValue ? (object)operatingRoomPutDoorRegister.OperatorTime.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@Remark", operatingRoomPutDoorRegister.Remark == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Remark)); + cmd.Parameters.Add(new SqlParameter("@HCode", operatingRoomPutDoorRegister.HCode == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.HCode)); + return Convert.ToInt32(cmd.ExecuteScalar()); + } + /// + /// 不使用事务的插入方法 + /// + /// 实体类对象 + /// 标识列值或影响的记录行数 + public static int Insert(OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return Insert(cmd, operatingRoomPutDoorRegister); + } + } + } + + /// + /// 使用事务的插入方法 + /// + /// 实现共享Connection的对象 + /// 实体类对象 + /// 标识列值或影响的记录行数 + public static int Insert(Connection connection, OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + return Insert(connection.Command, operatingRoomPutDoorRegister); + } + #endregion + + #region 删除实体操作 + + /// + /// 删除 + /// + /// Command对象 + /// 实体类对象 + /// 影响的记录行数 + public static int ExcuteDeleteCommand(SqlCommand cmd, OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + cmd.Parameters.Clear(); + cmd.CommandText = "delete from OperatingRoomPutDoorRegister where Id=@Id"; + //从实体中取出值放入Command的参数列表 + cmd.Parameters.Add(new SqlParameter("@Id", operatingRoomPutDoorRegister.Id)); + return cmd.ExecuteNonQuery(); + } + /// + /// 不使用事务的删除方法 + /// + /// 实体类对象 + /// 影响的记录行数 + public static int Delete(OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteDeleteCommand(cmd, operatingRoomPutDoorRegister); + } + } + } + /// + /// 使用事务的删除方法 + /// + /// 实现共享Connection的对象 + /// 实体类对象 + /// 影响的记录行数 + public static int Delete(Connection connection, OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + return ExcuteDeleteCommand(connection.Command, operatingRoomPutDoorRegister); + } + + /// + /// 执行删除命令 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int ExcuteDeleteCommand(SqlCommand cmd, string oql, ParameterList parameters) + { + //解析过滤部份Sql语句 + string filterString = SyntaxAnalyzer.ParseSql(oql, new OperatingRoomPutDoorRegisterMap()); + if (filterString != string.Empty) + { + filterString = " where " + filterString; + } + cmd.Parameters.Clear(); + cmd.CommandText = "delete from OperatingRoomPutDoorRegister " + filterString; + //添加参数 + if (parameters != null) + { + foreach (string key in parameters.Keys) + { + cmd.Parameters.Add(new SqlParameter(key, parameters[key])); + } + } + return cmd.ExecuteNonQuery(); + } + + /// + /// 不使用事务的删除方法 + /// + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Delete(string oql, ParameterList parameters) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteDeleteCommand(cmd, oql, parameters); + } + } + } + + /// + /// 使用事务的删除方法 + /// + /// 实现共享Connection的对象 + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Delete(Connection connection, string oql, ParameterList parameters) + { + return ExcuteDeleteCommand(connection.Command, oql, parameters); + } + + #endregion + + #region 更新实体操作 + + /// + /// 更新 + /// + /// Command对象 + /// 实体类对象 + /// 影响的记录行数 + public static int ExcuteUpdateCommand(SqlCommand cmd, OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + cmd.CommandText = "update OperatingRoomPutDoorRegister set PatientId=@PatientId,HISPatientId=@HISPatientId,InHospitalNo=@InHospitalNo,VisitId=@VisitId,PatientModel=@PatientModel,PatientDeptNo=@PatientDeptNo,PatientDeptName=@PatientDeptName,PatientBedNo=@PatientBedNo,Name=@Name,Sex=@Sex,Age=@Age,BirthDay=@BirthDay,Height=@Height,Weight=@Weight,IdEntityNo=@IdEntityNo,Tel=@Tel,Address=@Address,Contacts=@Contacts,ContactsTel=@ContactsTel,OperationType=@OperationType,IsPlanAgainOperation=@IsPlanAgainOperation,ExecDeptNo=@ExecDeptNo,ExecDeptName=@ExecDeptName,AnaesthesiaMethod=@AnaesthesiaMethod,IsPainClinic=@IsPainClinic,PainTreatment=@PainTreatment,PainTreatmentRemark=@PainTreatmentRemark,Diagnose=@Diagnose,DiagnoseRemark=@DiagnoseRemark,Operation=@Operation,OPerationRemark=@OPerationRemark,Anaesthesia=@Anaesthesia,AnaesthesiaRemark=@AnaesthesiaRemark,ASALevel=@ASALevel,OperationLevel=@OperationLevel,OperationPosition=@OperationPosition,AnaesthesiaDrugs=@AnaesthesiaDrugs,Complication=@Complication,OperationSituation=@OperationSituation,OperationDate=@OperationDate,AnaesthesiaBeginTime=@AnaesthesiaBeginTime,AnaesthesiaEndTime=@AnaesthesiaEndTime,OperationBeginTime=@OperationBeginTime,OperationEndTime=@OperationEndTime,OperationDoctorNo=@OperationDoctorNo,OperationDoctorName=@OperationDoctorName,AnaesthesiaDoctorNo=@AnaesthesiaDoctorNo,AnaesthesiaDoctorName=@AnaesthesiaDoctorName,InstrumentNurseNo=@InstrumentNurseNo,InstrumentNurseName=@InstrumentNurseName,TourNurseNo=@TourNurseNo,TourNurseName=@TourNurseName,IsValid=@IsValid,State=@State,OpeatorNo=@OpeatorNo,OperatorTime=@OperatorTime,Remark=@Remark,HCode=@HCode where Id=@Id"; + //从实体中取出值放入Command的参数列表 + cmd.Parameters.Add(new SqlParameter("@PatientId", operatingRoomPutDoorRegister.PatientId == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PatientId)); + cmd.Parameters.Add(new SqlParameter("@HISPatientId", operatingRoomPutDoorRegister.HISPatientId == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.HISPatientId)); + cmd.Parameters.Add(new SqlParameter("@InHospitalNo", operatingRoomPutDoorRegister.InHospitalNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.InHospitalNo)); + cmd.Parameters.Add(new SqlParameter("@VisitId", operatingRoomPutDoorRegister.VisitId == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.VisitId)); + cmd.Parameters.Add(new SqlParameter("@PatientModel", operatingRoomPutDoorRegister.PatientModel == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PatientModel)); + cmd.Parameters.Add(new SqlParameter("@PatientDeptNo", operatingRoomPutDoorRegister.PatientDeptNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PatientDeptNo)); + cmd.Parameters.Add(new SqlParameter("@PatientDeptName", operatingRoomPutDoorRegister.PatientDeptName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PatientDeptName)); + cmd.Parameters.Add(new SqlParameter("@PatientBedNo", operatingRoomPutDoorRegister.PatientBedNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PatientBedNo)); + cmd.Parameters.Add(new SqlParameter("@Name", operatingRoomPutDoorRegister.Name == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Name)); + cmd.Parameters.Add(new SqlParameter("@Sex", operatingRoomPutDoorRegister.Sex == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Sex)); + cmd.Parameters.Add(new SqlParameter("@Age", operatingRoomPutDoorRegister.Age == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Age)); + cmd.Parameters.Add(new SqlParameter("@BirthDay", operatingRoomPutDoorRegister.BirthDay.HasValue ? (object)operatingRoomPutDoorRegister.BirthDay.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@Height", operatingRoomPutDoorRegister.Height.HasValue ? (object)operatingRoomPutDoorRegister.Height.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@Weight", operatingRoomPutDoorRegister.Weight.HasValue ? (object)operatingRoomPutDoorRegister.Weight.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@IdEntityNo", operatingRoomPutDoorRegister.IdEntityNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.IdEntityNo)); + cmd.Parameters.Add(new SqlParameter("@Tel", operatingRoomPutDoorRegister.Tel == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Tel)); + cmd.Parameters.Add(new SqlParameter("@Address", operatingRoomPutDoorRegister.Address == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Address)); + cmd.Parameters.Add(new SqlParameter("@Contacts", operatingRoomPutDoorRegister.Contacts == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Contacts)); + cmd.Parameters.Add(new SqlParameter("@ContactsTel", operatingRoomPutDoorRegister.ContactsTel == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.ContactsTel)); + cmd.Parameters.Add(new SqlParameter("@OperationType", operatingRoomPutDoorRegister.OperationType == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationType)); + cmd.Parameters.Add(new SqlParameter("@IsPlanAgainOperation", operatingRoomPutDoorRegister.IsPlanAgainOperation.HasValue ? (object)operatingRoomPutDoorRegister.IsPlanAgainOperation.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@ExecDeptNo", operatingRoomPutDoorRegister.ExecDeptNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.ExecDeptNo)); + cmd.Parameters.Add(new SqlParameter("@ExecDeptName", operatingRoomPutDoorRegister.ExecDeptName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.ExecDeptName)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaMethod", operatingRoomPutDoorRegister.AnaesthesiaMethod == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.AnaesthesiaMethod)); + cmd.Parameters.Add(new SqlParameter("@IsPainClinic", operatingRoomPutDoorRegister.IsPainClinic.HasValue ? (object)operatingRoomPutDoorRegister.IsPainClinic.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@PainTreatment", operatingRoomPutDoorRegister.PainTreatment == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PainTreatment)); + cmd.Parameters.Add(new SqlParameter("@PainTreatmentRemark", operatingRoomPutDoorRegister.PainTreatmentRemark == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.PainTreatmentRemark)); + cmd.Parameters.Add(new SqlParameter("@Diagnose", operatingRoomPutDoorRegister.Diagnose == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Diagnose)); + cmd.Parameters.Add(new SqlParameter("@DiagnoseRemark", operatingRoomPutDoorRegister.DiagnoseRemark == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.DiagnoseRemark)); + cmd.Parameters.Add(new SqlParameter("@Operation", operatingRoomPutDoorRegister.Operation == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Operation)); + cmd.Parameters.Add(new SqlParameter("@OPerationRemark", operatingRoomPutDoorRegister.OPerationRemark == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OPerationRemark)); + cmd.Parameters.Add(new SqlParameter("@Anaesthesia", operatingRoomPutDoorRegister.Anaesthesia == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Anaesthesia)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaRemark", operatingRoomPutDoorRegister.AnaesthesiaRemark == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.AnaesthesiaRemark)); + cmd.Parameters.Add(new SqlParameter("@ASALevel", operatingRoomPutDoorRegister.ASALevel == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.ASALevel)); + cmd.Parameters.Add(new SqlParameter("@OperationLevel", operatingRoomPutDoorRegister.OperationLevel == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationLevel)); + cmd.Parameters.Add(new SqlParameter("@OperationPosition", operatingRoomPutDoorRegister.OperationPosition == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationPosition)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaDrugs", operatingRoomPutDoorRegister.AnaesthesiaDrugs == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.AnaesthesiaDrugs)); + cmd.Parameters.Add(new SqlParameter("@Complication", operatingRoomPutDoorRegister.Complication == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Complication)); + cmd.Parameters.Add(new SqlParameter("@OperationSituation", operatingRoomPutDoorRegister.OperationSituation == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationSituation)); + cmd.Parameters.Add(new SqlParameter("@OperationDate", operatingRoomPutDoorRegister.OperationDate.HasValue ? (object)operatingRoomPutDoorRegister.OperationDate.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaBeginTime", operatingRoomPutDoorRegister.AnaesthesiaBeginTime.HasValue ? (object)operatingRoomPutDoorRegister.AnaesthesiaBeginTime.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaEndTime", operatingRoomPutDoorRegister.AnaesthesiaEndTime.HasValue ? (object)operatingRoomPutDoorRegister.AnaesthesiaEndTime.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OperationBeginTime", operatingRoomPutDoorRegister.OperationBeginTime.HasValue ? (object)operatingRoomPutDoorRegister.OperationBeginTime.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OperationEndTime", operatingRoomPutDoorRegister.OperationEndTime.HasValue ? (object)operatingRoomPutDoorRegister.OperationEndTime.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OperationDoctorNo", operatingRoomPutDoorRegister.OperationDoctorNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationDoctorNo)); + cmd.Parameters.Add(new SqlParameter("@OperationDoctorName", operatingRoomPutDoorRegister.OperationDoctorName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OperationDoctorName)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaDoctorNo", operatingRoomPutDoorRegister.AnaesthesiaDoctorNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.AnaesthesiaDoctorNo)); + cmd.Parameters.Add(new SqlParameter("@AnaesthesiaDoctorName", operatingRoomPutDoorRegister.AnaesthesiaDoctorName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.AnaesthesiaDoctorName)); + cmd.Parameters.Add(new SqlParameter("@InstrumentNurseNo", operatingRoomPutDoorRegister.InstrumentNurseNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.InstrumentNurseNo)); + cmd.Parameters.Add(new SqlParameter("@InstrumentNurseName", operatingRoomPutDoorRegister.InstrumentNurseName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.InstrumentNurseName)); + cmd.Parameters.Add(new SqlParameter("@TourNurseNo", operatingRoomPutDoorRegister.TourNurseNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.TourNurseNo)); + cmd.Parameters.Add(new SqlParameter("@TourNurseName", operatingRoomPutDoorRegister.TourNurseName == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.TourNurseName)); + cmd.Parameters.Add(new SqlParameter("@IsValid", operatingRoomPutDoorRegister.IsValid.HasValue ? (object)operatingRoomPutDoorRegister.IsValid.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@State", operatingRoomPutDoorRegister.State.HasValue ? (object)operatingRoomPutDoorRegister.State.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OpeatorNo", operatingRoomPutDoorRegister.OpeatorNo == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.OpeatorNo)); + cmd.Parameters.Add(new SqlParameter("@OperatorTime", operatingRoomPutDoorRegister.OperatorTime.HasValue ? (object)operatingRoomPutDoorRegister.OperatorTime.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@Remark", operatingRoomPutDoorRegister.Remark == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.Remark)); + cmd.Parameters.Add(new SqlParameter("@HCode", operatingRoomPutDoorRegister.HCode == null ? (object)DBNull.Value : (object)operatingRoomPutDoorRegister.HCode)); + cmd.Parameters.Add(new SqlParameter("@Id", operatingRoomPutDoorRegister.Id)); + return cmd.ExecuteNonQuery(); + } + + /// + /// 不使用事务的更新方法 + /// + /// 实体类对象 + /// 影响的记录行数 + public static int Update(OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteUpdateCommand(cmd, operatingRoomPutDoorRegister); + } + } + } + /// + /// 使用事务的更新方法 + /// + /// 实现共享Connection的对象 + /// 实体类对象 + /// 影响的记录行数 + public static int Update(Connection connection, OperatingRoomPutDoorRegister operatingRoomPutDoorRegister) + { + return ExcuteUpdateCommand(connection.Command, operatingRoomPutDoorRegister); + } + /// + /// 执行更新命令 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int ExcuteUpdateCommand(SqlCommand cmd, string oql, ParameterList parameters) + { + //解析过滤部份Sql语句 + string updateString = SyntaxAnalyzer.ParseSql(oql, new OperatingRoomPutDoorRegisterMap()); + cmd.CommandText = "update OperatingRoomPutDoorRegister set " + updateString; + cmd.Parameters.Clear(); + //添加参数 + if (parameters != null) + { + foreach (string key in parameters.Keys) + { + cmd.Parameters.Add(new SqlParameter(key, parameters[key])); + } + } + return cmd.ExecuteNonQuery(); + } + + /// + /// 不使用事务的更新方法 + /// + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Update(string oql, ParameterList parameters) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteUpdateCommand(cmd, oql, parameters); + } + } + } + + /// + /// 使用事务的更新方法 + /// + /// 实现共享Connection的对象 + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Update(Connection connection, string oql, ParameterList parameters) + { + return ExcuteUpdateCommand(connection.Command, oql, parameters); + } + #endregion + + #region 查询实体集合 + /// + /// 执行Command获取对象列表 + /// + /// Command对象 + /// 递归类型 + /// 递归深度 + /// 实体类对象列表 + public static List ExcuteSelectCommand(SqlCommand cmd, RecursiveType recursiveType, int recursiveDepth) + { + List operatingRoomPutDoorRegisterList = new List(); + using (SqlDataReader dr = cmd.ExecuteReader()) + { + while (dr.Read()) + { + OperatingRoomPutDoorRegister operatingRoomPutDoorRegister = DataReaderToEntity(dr); + operatingRoomPutDoorRegisterList.Add(operatingRoomPutDoorRegister); + } + } + return operatingRoomPutDoorRegisterList; + } + /// + /// 执行查询命令 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List ExcuteSelectCommand(SqlCommand cmd, string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + //解析过滤部份Sql语句 + string filterString = SyntaxAnalyzer.ParseSql(oql, new OperatingRoomPutDoorRegisterMap()); + if (filterString != string.Empty) + { + if (filterString.Trim().ToLower().IndexOf("order ") != 0) + filterString = " where " + filterString; + } + cmd.Parameters.Clear(); + cmd.CommandText = "select * from OperatingRoomPutDoorRegister " + filterString; + //添加参数 + if (parameters != null) + { + foreach (string key in parameters.Keys) + { + cmd.Parameters.Add(new SqlParameter(key, parameters[key])); + } + } + return ExcuteSelectCommand(cmd, recursiveType, recursiveDepth); + } + + /// + /// 根据对象查询语句查询实体集合 + /// + /// 实体类对象集合 + public static List Select() + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + cmd.CommandText = "select * from OperatingRoomPutDoorRegister"; + return ExcuteSelectCommand(cmd, RecursiveType.Parent, 1); + } + } + } + /// + /// 根据对象查询语句查询实体集合 + /// + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List Select(RecursiveType recursiveType, int recursiveDepth) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + cmd.CommandText = "select * from OperatingRoomPutDoorRegister"; + return ExcuteSelectCommand(cmd, recursiveType, recursiveDepth); + } + } + } + + /// + /// 根据对象查询语句查询实体集合 + /// + /// 对象查询语句 + /// 参数列表 + /// 实体类对象集合 + public static List Select(string oql, ParameterList parameters) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteSelectCommand(cmd, oql, parameters, RecursiveType.Parent, 1); + } + } + } + + /// + /// 根据对象查询语句查询实体集合 + /// + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List Select(string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteSelectCommand(cmd, oql, parameters, recursiveType, recursiveDepth); + } + } + } + + /// + /// 根据对象查询语句查询实体集合(启用事务) + /// + /// 连接对象 + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List Select(Connection connection, string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + return ExcuteSelectCommand(connection.Command, oql, parameters, recursiveType, recursiveDepth); + } + #endregion + + #region 查询单个实体 + + /// + /// 递归查询单个实体 + /// + /// Command对象 + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegister ExcuteSelectSingleCommand(SqlCommand cmd, RecursiveType recursiveType, int recursiveDepth) + { + OperatingRoomPutDoorRegister operatingRoomPutDoorRegister = null; + using (SqlDataReader dr = cmd.ExecuteReader()) + { + if (dr.Read()) + operatingRoomPutDoorRegister = DataReaderToEntity(dr); + } + if (operatingRoomPutDoorRegister == null) + return operatingRoomPutDoorRegister; + return operatingRoomPutDoorRegister; + } + /// + /// 更据对象查询语句递归查询单个实体 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegister ExcuteSelectSingleCommand(SqlCommand cmd, string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + //解析过滤部份Sql语句 + string filterString = SyntaxAnalyzer.ParseSql(oql, new OperatingRoomPutDoorRegisterMap()); + if (filterString != string.Empty) + { + filterString = " where " + filterString; + } + cmd.CommandText = "select * from OperatingRoomPutDoorRegister " + filterString; + cmd.Parameters.Clear(); + //添加参数 + if (parameters != null) + { + foreach (string key in parameters.Keys) + { + cmd.Parameters.Add(new SqlParameter(key, parameters[key])); + } + } + return ExcuteSelectSingleCommand(cmd, recursiveType, recursiveDepth); + } + + /// + /// 更据对象查询语句递归查询单个实体 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegister SelectSingle(string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteSelectSingleCommand(cmd, oql, parameters, recursiveType, recursiveDepth); + } + } + } + + /// + /// 更据对象查询语句查询单个实体 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 实体对象 + public static OperatingRoomPutDoorRegister SelectSingle(string oql, ParameterList parameters) + { + return SelectSingle(oql, parameters, RecursiveType.Parent, 1); + } + + /// + /// 更据对象查询语句并启用事务查询单个实体 + /// + /// 连接对象 + /// 对象查询语句 + /// 参数列表 + /// 实体对象 + public static OperatingRoomPutDoorRegister SelectSingle(Connection connection, string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + return ExcuteSelectSingleCommand(connection.Command, oql, parameters, recursiveType, recursiveDepth); + } + + /// + /// 更据主键值递归查询单个实体 + /// + /// Command对象 + /// 主键值 + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegister SelectSingle(SqlCommand cmd, int? id, RecursiveType recursiveType, int recursiveDepth) + { + cmd.Parameters.Clear(); + if (id.HasValue) + { + cmd.CommandText = "select * from OperatingRoomPutDoorRegister where Id=@pk"; + cmd.Parameters.Add(new SqlParameter("@pk", id.Value)); + } + else + { + cmd.CommandText = "select * from OperatingRoomPutDoorRegister where Id is null"; + } + return ExcuteSelectSingleCommand(cmd, recursiveType, recursiveDepth); + } + + /// + /// 按主键字段查询特定实体 + /// + /// 主键值 + /// 实体类对象 + public static OperatingRoomPutDoorRegister SelectSingle(int? id) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return SelectSingle(cmd, id, RecursiveType.Parent, 1); + } + } + } + /// + /// 按主键字段查询特定实体 + /// + /// 主键值 + /// 递归类型 + /// 递归深度 + /// 实体类对象 + public static OperatingRoomPutDoorRegister SelectSingle(int? id, RecursiveType recursiveType, int recursiveDepth) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return SelectSingle(cmd, id, recursiveType, recursiveDepth); + } + } + } + + /// + /// 使用事务并按主键字段查询特定实体 + /// + /// 连接对象 + /// 主键值 + /// 实体类对象 + public static OperatingRoomPutDoorRegister SelectSingle(Connection connection, int? id, RecursiveType recursiveType, int recursiveDepth) + { + return SelectSingle(connection.Command, id, recursiveType, recursiveDepth); + } + #endregion + + + /// + /// 从DataReader中取出值生成实体对象 + /// + /// 查询对象 + /// 过滤条件字符串 + private static OperatingRoomPutDoorRegister DataReaderToEntity(SqlDataReader dr) + { + OperatingRoomPutDoorRegister entity = new OperatingRoomPutDoorRegister(); + if (dr["Id"] != System.DBNull.Value) + { + entity.Id = Convert.ToInt32(dr["Id"]); + } + if (dr["PatientId"] != System.DBNull.Value) + { + entity.PatientId = dr["PatientId"].ToString(); + } + if (dr["HISPatientId"] != System.DBNull.Value) + { + entity.HISPatientId = dr["HISPatientId"].ToString(); + } + if (dr["InHospitalNo"] != System.DBNull.Value) + { + entity.InHospitalNo = dr["InHospitalNo"].ToString(); + } + if (dr["VisitId"] != System.DBNull.Value) + { + entity.VisitId = dr["VisitId"].ToString(); + } + if (dr["PatientModel"] != System.DBNull.Value) + { + entity.PatientModel = dr["PatientModel"].ToString(); + } + if (dr["PatientDeptNo"] != System.DBNull.Value) + { + entity.PatientDeptNo = dr["PatientDeptNo"].ToString(); + } + if (dr["PatientDeptName"] != System.DBNull.Value) + { + entity.PatientDeptName = dr["PatientDeptName"].ToString(); + } + if (dr["PatientBedNo"] != System.DBNull.Value) + { + entity.PatientBedNo = dr["PatientBedNo"].ToString(); + } + if (dr["Name"] != System.DBNull.Value) + { + entity.Name = dr["Name"].ToString(); + } + if (dr["Sex"] != System.DBNull.Value) + { + entity.Sex = dr["Sex"].ToString(); + } + if (dr["Age"] != System.DBNull.Value) + { + entity.Age = dr["Age"].ToString(); + } + if (dr["BirthDay"] != System.DBNull.Value) + { + entity.BirthDay = Convert.ToDateTime(dr["BirthDay"]); + } + if (dr["Height"] != System.DBNull.Value) + { + entity.Height = Convert.ToDecimal(dr["Height"]); + } + if (dr["Weight"] != System.DBNull.Value) + { + entity.Weight = Convert.ToDecimal(dr["Weight"]); + } + if (dr["IdEntityNo"] != System.DBNull.Value) + { + entity.IdEntityNo = dr["IdEntityNo"].ToString(); + } + if (dr["Tel"] != System.DBNull.Value) + { + entity.Tel = dr["Tel"].ToString(); + } + if (dr["Address"] != System.DBNull.Value) + { + entity.Address = dr["Address"].ToString(); + } + if (dr["Contacts"] != System.DBNull.Value) + { + entity.Contacts = dr["Contacts"].ToString(); + } + if (dr["ContactsTel"] != System.DBNull.Value) + { + entity.ContactsTel = dr["ContactsTel"].ToString(); + } + if (dr["OperationType"] != System.DBNull.Value) + { + entity.OperationType = dr["OperationType"].ToString(); + } + if (dr["IsPlanAgainOperation"] != System.DBNull.Value) + { + entity.IsPlanAgainOperation = Convert.ToInt32(dr["IsPlanAgainOperation"]); + } + if (dr["ExecDeptNo"] != System.DBNull.Value) + { + entity.ExecDeptNo = dr["ExecDeptNo"].ToString(); + } + if (dr["ExecDeptName"] != System.DBNull.Value) + { + entity.ExecDeptName = dr["ExecDeptName"].ToString(); + } + if (dr["AnaesthesiaMethod"] != System.DBNull.Value) + { + entity.AnaesthesiaMethod = dr["AnaesthesiaMethod"].ToString(); + } + if (dr["IsPainClinic"] != System.DBNull.Value) + { + entity.IsPainClinic = Convert.ToInt32(dr["IsPainClinic"]); + } + if (dr["PainTreatment"] != System.DBNull.Value) + { + entity.PainTreatment = dr["PainTreatment"].ToString(); + } + if (dr["PainTreatmentRemark"] != System.DBNull.Value) + { + entity.PainTreatmentRemark = dr["PainTreatmentRemark"].ToString(); + } + if (dr["Diagnose"] != System.DBNull.Value) + { + entity.Diagnose = dr["Diagnose"].ToString(); + } + if (dr["DiagnoseRemark"] != System.DBNull.Value) + { + entity.DiagnoseRemark = dr["DiagnoseRemark"].ToString(); + } + if (dr["Operation"] != System.DBNull.Value) + { + entity.Operation = dr["Operation"].ToString(); + } + if (dr["OPerationRemark"] != System.DBNull.Value) + { + entity.OPerationRemark = dr["OPerationRemark"].ToString(); + } + if (dr["Anaesthesia"] != System.DBNull.Value) + { + entity.Anaesthesia = dr["Anaesthesia"].ToString(); + } + if (dr["AnaesthesiaRemark"] != System.DBNull.Value) + { + entity.AnaesthesiaRemark = dr["AnaesthesiaRemark"].ToString(); + } + if (dr["ASALevel"] != System.DBNull.Value) + { + entity.ASALevel = dr["ASALevel"].ToString(); + } + if (dr["OperationLevel"] != System.DBNull.Value) + { + entity.OperationLevel = dr["OperationLevel"].ToString(); + } + if (dr["OperationPosition"] != System.DBNull.Value) + { + entity.OperationPosition = dr["OperationPosition"].ToString(); + } + if (dr["AnaesthesiaDrugs"] != System.DBNull.Value) + { + entity.AnaesthesiaDrugs = dr["AnaesthesiaDrugs"].ToString(); + } + if (dr["Complication"] != System.DBNull.Value) + { + entity.Complication = dr["Complication"].ToString(); + } + if (dr["OperationSituation"] != System.DBNull.Value) + { + entity.OperationSituation = dr["OperationSituation"].ToString(); + } + if (dr["OperationDate"] != System.DBNull.Value) + { + entity.OperationDate = Convert.ToDateTime(dr["OperationDate"]); + } + if (dr["AnaesthesiaBeginTime"] != System.DBNull.Value) + { + entity.AnaesthesiaBeginTime = Convert.ToDateTime(dr["AnaesthesiaBeginTime"]); + } + if (dr["AnaesthesiaEndTime"] != System.DBNull.Value) + { + entity.AnaesthesiaEndTime = Convert.ToDateTime(dr["AnaesthesiaEndTime"]); + } + if (dr["OperationBeginTime"] != System.DBNull.Value) + { + entity.OperationBeginTime = Convert.ToDateTime(dr["OperationBeginTime"]); + } + if (dr["OperationEndTime"] != System.DBNull.Value) + { + entity.OperationEndTime = Convert.ToDateTime(dr["OperationEndTime"]); + } + if (dr["OperationDoctorNo"] != System.DBNull.Value) + { + entity.OperationDoctorNo = dr["OperationDoctorNo"].ToString(); + } + if (dr["OperationDoctorName"] != System.DBNull.Value) + { + entity.OperationDoctorName = dr["OperationDoctorName"].ToString(); + } + if (dr["AnaesthesiaDoctorNo"] != System.DBNull.Value) + { + entity.AnaesthesiaDoctorNo = dr["AnaesthesiaDoctorNo"].ToString(); + } + if (dr["AnaesthesiaDoctorName"] != System.DBNull.Value) + { + entity.AnaesthesiaDoctorName = dr["AnaesthesiaDoctorName"].ToString(); + } + if (dr["InstrumentNurseNo"] != System.DBNull.Value) + { + entity.InstrumentNurseNo = dr["InstrumentNurseNo"].ToString(); + } + if (dr["InstrumentNurseName"] != System.DBNull.Value) + { + entity.InstrumentNurseName = dr["InstrumentNurseName"].ToString(); + } + if (dr["TourNurseNo"] != System.DBNull.Value) + { + entity.TourNurseNo = dr["TourNurseNo"].ToString(); + } + if (dr["TourNurseName"] != System.DBNull.Value) + { + entity.TourNurseName = dr["TourNurseName"].ToString(); + } + if (dr["IsValid"] != System.DBNull.Value) + { + entity.IsValid = Convert.ToInt32(dr["IsValid"]); + } + if (dr["State"] != System.DBNull.Value) + { + entity.State = Convert.ToInt32(dr["State"]); + } + if (dr["OpeatorNo"] != System.DBNull.Value) + { + entity.OpeatorNo = dr["OpeatorNo"].ToString(); + } + if (dr["OperatorTime"] != System.DBNull.Value) + { + entity.OperatorTime = Convert.ToDateTime(dr["OperatorTime"]); + } + if (dr["Remark"] != System.DBNull.Value) + { + entity.Remark = dr["Remark"].ToString(); + } + if (dr["HCode"] != System.DBNull.Value) + { + entity.HCode = dr["HCode"].ToString(); + } + return entity; + + } + + public static DataTable GetOperatingRoomPutDoorRegisterByCondition(string begin, string end, string anaesthesiaMethod, string anaesthesiaDoctor, string execDepart, string pDept, string Asa) + { + DataTable dt = null; + string sql = "select *,dbo.split(AnaesthesiaDoctorName,',',0)AnaesthesiaDoctorName1,dbo.split(AnaesthesiaDoctorName,',',1)AnaesthesiaDoctorName2 from OperatingRoomPutDoorRegister where OperationDate>='" + begin + "' and OperationDate<='" + end + "' "; + if (anaesthesiaMethod != "") + { + sql += " and AnaesthesiaMethod like '%" + anaesthesiaMethod + "%'"; + } + if (anaesthesiaDoctor != "") + { + sql += " and AnaesthesiaDoctorName='" + anaesthesiaDoctor + "'"; + } + if (execDepart != "") + { + sql += " and ExecDeptName='" + execDepart + "'"; + } + if (Asa != "") + { + sql += " and ASALevel='" + Asa + "'"; + } + if (pDept != "") + { + sql += " and PatientDeptName='" + pDept + "'"; + } + dt = DBHelper.GetDataTable(sql); + return dt; + } + + } +} + diff --git a/AIMSEntity/DAL/AutoGenerate/DOperatingRoomPutDoorRegisterDrugsRecords.cs b/AIMSEntity/DAL/AutoGenerate/DOperatingRoomPutDoorRegisterDrugsRecords.cs new file mode 100644 index 0000000..d81f103 --- /dev/null +++ b/AIMSEntity/DAL/AutoGenerate/DOperatingRoomPutDoorRegisterDrugsRecords.cs @@ -0,0 +1,625 @@ +using AIMSModel; +using AIMSObjectQuery; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; + +namespace AIMSDAL +{ + public partial class DOperatingRoomPutDoorRegisterDrugsRecords + { + #region 插入实体操作部份 + /// + /// 插入 + /// + /// Command对象 + /// 实体类对象 + /// 标识列值或影响的记录行数 + public static int Insert(SqlCommand cmd, OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + cmd.Parameters.Clear(); + cmd.CommandText = "insert into OperatingRoomPutDoorRegisterDrugsRecords (PutDoorRegisterId,HisPatientId,DrugsNo,DrugsName,Dosage,IsValid,state,OperatorTime) values (@PutDoorRegisterId,@HisPatientId,@DrugsNo,@DrugsName,@Dosage,@IsValid,@state,@OperatorTime);select @@identity"; + //从实体中取出值放入Command的参数列表 + cmd.Parameters.Add(new SqlParameter("@PutDoorRegisterId",operatingRoomPutDoorRegisterDrugsRecords.PutDoorRegisterId.HasValue?(object)operatingRoomPutDoorRegisterDrugsRecords.PutDoorRegisterId.Value:(object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@HisPatientId",operatingRoomPutDoorRegisterDrugsRecords.HisPatientId==null?(object)DBNull.Value:(object)operatingRoomPutDoorRegisterDrugsRecords.HisPatientId)); + cmd.Parameters.Add(new SqlParameter("@DrugsNo",operatingRoomPutDoorRegisterDrugsRecords.DrugsNo==null?(object)DBNull.Value:(object)operatingRoomPutDoorRegisterDrugsRecords.DrugsNo)); + cmd.Parameters.Add(new SqlParameter("@DrugsName",operatingRoomPutDoorRegisterDrugsRecords.DrugsName==null?(object)DBNull.Value:(object)operatingRoomPutDoorRegisterDrugsRecords.DrugsName)); + cmd.Parameters.Add(new SqlParameter("@Dosage",operatingRoomPutDoorRegisterDrugsRecords.Dosage.HasValue?(object)operatingRoomPutDoorRegisterDrugsRecords.Dosage.Value:(object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@IsValid",operatingRoomPutDoorRegisterDrugsRecords.IsValid.HasValue?(object)operatingRoomPutDoorRegisterDrugsRecords.IsValid.Value:(object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@state",operatingRoomPutDoorRegisterDrugsRecords.State.HasValue?(object)operatingRoomPutDoorRegisterDrugsRecords.State.Value:(object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OperatorTime",operatingRoomPutDoorRegisterDrugsRecords.OperatorTime.HasValue?(object)operatingRoomPutDoorRegisterDrugsRecords.OperatorTime.Value:(object)DBNull.Value)); + return Convert.ToInt32(cmd.ExecuteScalar()); + } + /// + /// 不使用事务的插入方法 + /// + /// 实体类对象 + /// 标识列值或影响的记录行数 + public static int Insert(OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return Insert(cmd, operatingRoomPutDoorRegisterDrugsRecords); + } + } + } + + /// + /// 使用事务的插入方法 + /// + /// 实现共享Connection的对象 + /// 实体类对象 + /// 标识列值或影响的记录行数 + public static int Insert(Connection connection,OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + return Insert(connection.Command, operatingRoomPutDoorRegisterDrugsRecords); + } + #endregion + + #region 删除实体操作 + + /// + /// 删除 + /// + /// Command对象 + /// 实体类对象 + /// 影响的记录行数 + public static int ExcuteDeleteCommand(SqlCommand cmd, OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + cmd.Parameters.Clear(); + cmd.CommandText = "delete from OperatingRoomPutDoorRegisterDrugsRecords where Id=@Id"; + //从实体中取出值放入Command的参数列表 + cmd.Parameters.Add(new SqlParameter("@Id", operatingRoomPutDoorRegisterDrugsRecords.Id)); + return cmd.ExecuteNonQuery(); + } + /// + /// 不使用事务的删除方法 + /// + /// 实体类对象 + /// 影响的记录行数 + public static int Delete(OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteDeleteCommand(cmd, operatingRoomPutDoorRegisterDrugsRecords); + } + } + } + /// + /// 使用事务的删除方法 + /// + /// 实现共享Connection的对象 + /// 实体类对象 + /// 影响的记录行数 + public static int Delete(Connection connection,OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + return ExcuteDeleteCommand(connection.Command, operatingRoomPutDoorRegisterDrugsRecords); + } + + /// + /// 执行删除命令 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int ExcuteDeleteCommand(SqlCommand cmd, string oql, ParameterList parameters) + { + //解析过滤部份Sql语句 + string filterString = SyntaxAnalyzer.ParseSql(oql, new OperatingRoomPutDoorRegisterDrugsRecordsMap()); + if (filterString != string.Empty) + { + filterString = " where " + filterString; + } + cmd.Parameters.Clear(); + cmd.CommandText = "delete from OperatingRoomPutDoorRegisterDrugsRecords " + filterString; + //添加参数 + if (parameters != null) + { + foreach (string key in parameters.Keys) + { + cmd.Parameters.Add(new SqlParameter(key, parameters[key])); + } + } + return cmd.ExecuteNonQuery(); + } + + /// + /// 不使用事务的删除方法 + /// + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Delete(string oql, ParameterList parameters) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteDeleteCommand(cmd, oql, parameters); + } + } + } + + /// + /// 使用事务的删除方法 + /// + /// 实现共享Connection的对象 + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Delete(Connection connection, string oql, ParameterList parameters) + { + return ExcuteDeleteCommand(connection.Command, oql, parameters); + } + + #endregion + + #region 更新实体操作 + + /// + /// 更新 + /// + /// Command对象 + /// 实体类对象 + /// 影响的记录行数 + public static int ExcuteUpdateCommand(SqlCommand cmd, OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + cmd.CommandText = "update OperatingRoomPutDoorRegisterDrugsRecords set PutDoorRegisterId=@PutDoorRegisterId,HisPatientId=@HisPatientId,DrugsNo=@DrugsNo,DrugsName=@DrugsName,Dosage=@Dosage,IsValid=@IsValid,state=@state,OperatorTime=@OperatorTime where Id=@Id"; + //从实体中取出值放入Command的参数列表 + cmd.Parameters.Add(new SqlParameter("@PutDoorRegisterId",operatingRoomPutDoorRegisterDrugsRecords.PutDoorRegisterId.HasValue?(object)operatingRoomPutDoorRegisterDrugsRecords.PutDoorRegisterId.Value:(object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@HisPatientId",operatingRoomPutDoorRegisterDrugsRecords.HisPatientId==null?(object)DBNull.Value:(object)operatingRoomPutDoorRegisterDrugsRecords.HisPatientId)); + cmd.Parameters.Add(new SqlParameter("@DrugsNo",operatingRoomPutDoorRegisterDrugsRecords.DrugsNo==null?(object)DBNull.Value:(object)operatingRoomPutDoorRegisterDrugsRecords.DrugsNo)); + cmd.Parameters.Add(new SqlParameter("@DrugsName",operatingRoomPutDoorRegisterDrugsRecords.DrugsName==null?(object)DBNull.Value:(object)operatingRoomPutDoorRegisterDrugsRecords.DrugsName)); + cmd.Parameters.Add(new SqlParameter("@Dosage",operatingRoomPutDoorRegisterDrugsRecords.Dosage.HasValue?(object)operatingRoomPutDoorRegisterDrugsRecords.Dosage.Value:(object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@IsValid",operatingRoomPutDoorRegisterDrugsRecords.IsValid.HasValue?(object)operatingRoomPutDoorRegisterDrugsRecords.IsValid.Value:(object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@state",operatingRoomPutDoorRegisterDrugsRecords.State.HasValue?(object)operatingRoomPutDoorRegisterDrugsRecords.State.Value:(object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OperatorTime",operatingRoomPutDoorRegisterDrugsRecords.OperatorTime.HasValue?(object)operatingRoomPutDoorRegisterDrugsRecords.OperatorTime.Value:(object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@Id", operatingRoomPutDoorRegisterDrugsRecords.Id)); + return cmd.ExecuteNonQuery(); + } + + /// + /// 不使用事务的更新方法 + /// + /// 实体类对象 + /// 影响的记录行数 + public static int Update(OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteUpdateCommand(cmd, operatingRoomPutDoorRegisterDrugsRecords); + } + } + } + /// + /// 使用事务的更新方法 + /// + /// 实现共享Connection的对象 + /// 实体类对象 + /// 影响的记录行数 + public static int Update(Connection connection,OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords) + { + return ExcuteUpdateCommand(connection.Command, operatingRoomPutDoorRegisterDrugsRecords); + } + /// + /// 执行更新命令 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int ExcuteUpdateCommand(SqlCommand cmd, string oql, ParameterList parameters) + { + //解析过滤部份Sql语句 + string updateString = SyntaxAnalyzer.ParseSql(oql, new OperatingRoomPutDoorRegisterDrugsRecordsMap()); + cmd.CommandText = "update OperatingRoomPutDoorRegisterDrugsRecords set " + updateString; + cmd.Parameters.Clear(); + //添加参数 + if (parameters != null) + { + foreach (string key in parameters.Keys) + { + cmd.Parameters.Add(new SqlParameter(key, parameters[key])); + } + } + return cmd.ExecuteNonQuery(); + } + + /// + /// 不使用事务的更新方法 + /// + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Update(string oql, ParameterList parameters) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteUpdateCommand(cmd, oql, parameters); + } + } + } + + /// + /// 使用事务的更新方法 + /// + /// 实现共享Connection的对象 + /// 对象查询语句 + /// 参数列表 + /// 影响的记录行数 + public static int Update(Connection connection, string oql, ParameterList parameters) + { + return ExcuteUpdateCommand(connection.Command, oql, parameters); + } + #endregion + + #region 查询实体集合 + /// + /// 执行Command获取对象列表 + /// + /// Command对象 + /// 递归类型 + /// 递归深度 + /// 实体类对象列表 + public static List ExcuteSelectCommand(SqlCommand cmd,RecursiveType recursiveType,int recursiveDepth) + { + List operatingRoomPutDoorRegisterDrugsRecordsList = new List(); + using (SqlDataReader dr = cmd.ExecuteReader()) + { + while (dr.Read()) + { + OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords = DataReaderToEntity(dr); + operatingRoomPutDoorRegisterDrugsRecordsList.Add(operatingRoomPutDoorRegisterDrugsRecords); + } + } + return operatingRoomPutDoorRegisterDrugsRecordsList; + } + /// + /// 执行查询命令 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List ExcuteSelectCommand(SqlCommand cmd, string oql, ParameterList parameters,RecursiveType recursiveType,int recursiveDepth) + { + //解析过滤部份Sql语句 + string filterString = SyntaxAnalyzer.ParseSql(oql, new OperatingRoomPutDoorRegisterDrugsRecordsMap()); + if (filterString != string.Empty) + { + if(filterString.Trim().ToLower().IndexOf("order ")!=0) + filterString = " where " + filterString; + } + cmd.Parameters.Clear(); + cmd.CommandText = "select * from OperatingRoomPutDoorRegisterDrugsRecords " + filterString; + //添加参数 + if (parameters != null) + { + foreach (string key in parameters.Keys) + { + cmd.Parameters.Add(new SqlParameter(key, parameters[key])); + } + } + return ExcuteSelectCommand(cmd, recursiveType, recursiveDepth); + } + + /// + /// 根据对象查询语句查询实体集合 + /// + /// 实体类对象集合 + public static List Select() + { + using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + cmd.CommandText = "select * from OperatingRoomPutDoorRegisterDrugsRecords"; + return ExcuteSelectCommand(cmd, RecursiveType.Parent, 1); + } + } + } + /// + /// 根据对象查询语句查询实体集合 + /// + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List Select(RecursiveType recursiveType, int recursiveDepth) + { + using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + cmd.CommandText = "select * from OperatingRoomPutDoorRegisterDrugsRecords"; + return ExcuteSelectCommand(cmd, recursiveType, recursiveDepth); + } + } + } + + /// + /// 根据对象查询语句查询实体集合 + /// + /// 对象查询语句 + /// 参数列表 + /// 实体类对象集合 + public static List Select(string oql, ParameterList parameters) + { + using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteSelectCommand(cmd, oql, parameters, RecursiveType.Parent, 1); + } + } + } + + /// + /// 根据对象查询语句查询实体集合 + /// + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List Select(string oql, ParameterList parameters,RecursiveType recursiveType, int recursiveDepth) + { + using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteSelectCommand(cmd, oql, parameters, recursiveType, recursiveDepth); + } + } + } + + /// + /// 根据对象查询语句查询实体集合(启用事务) + /// + /// 连接对象 + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体类对象集合 + public static List Select(Connection connection, string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + return ExcuteSelectCommand(connection.Command, oql, parameters,recursiveType, recursiveDepth); + } + #endregion + + #region 查询单个实体 + + /// + /// 递归查询单个实体 + /// + /// Command对象 + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegisterDrugsRecords ExcuteSelectSingleCommand(SqlCommand cmd,RecursiveType recursiveType,int recursiveDepth) + { + OperatingRoomPutDoorRegisterDrugsRecords operatingRoomPutDoorRegisterDrugsRecords=null; + using (SqlDataReader dr = cmd.ExecuteReader()) + { + if(dr.Read()) + operatingRoomPutDoorRegisterDrugsRecords = DataReaderToEntity(dr); + } + if(operatingRoomPutDoorRegisterDrugsRecords==null) + return operatingRoomPutDoorRegisterDrugsRecords; + return operatingRoomPutDoorRegisterDrugsRecords; + } + /// + /// 更据对象查询语句递归查询单个实体 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegisterDrugsRecords ExcuteSelectSingleCommand(SqlCommand cmd, string oql, ParameterList parameters,RecursiveType recursiveType,int recursiveDepth) + { + //解析过滤部份Sql语句 + string filterString = SyntaxAnalyzer.ParseSql(oql, new OperatingRoomPutDoorRegisterDrugsRecordsMap()); + if(filterString!=string.Empty) + { + filterString=" where "+filterString; + } + cmd.CommandText = "select * from OperatingRoomPutDoorRegisterDrugsRecords " + filterString; + cmd.Parameters.Clear(); + //添加参数 + if (parameters != null) + { + foreach (string key in parameters.Keys) + { + cmd.Parameters.Add(new SqlParameter(key, parameters[key])); + } + } + return ExcuteSelectSingleCommand(cmd, recursiveType, recursiveDepth); + } + + /// + /// 更据对象查询语句递归查询单个实体 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return ExcuteSelectSingleCommand(cmd, oql, parameters, recursiveType, recursiveDepth); + } + } + } + + /// + /// 更据对象查询语句查询单个实体 + /// + /// Command对象 + /// 对象查询语句 + /// 参数列表 + /// 实体对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(string oql, ParameterList parameters) + { + return SelectSingle(oql,parameters,RecursiveType.Parent,1); + } + + /// + /// 更据对象查询语句并启用事务查询单个实体 + /// + /// 连接对象 + /// 对象查询语句 + /// 参数列表 + /// 实体对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(Connection connection, string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) + { + return ExcuteSelectSingleCommand(connection.Command, oql, parameters, recursiveType, recursiveDepth); + } + + /// + /// 更据主键值递归查询单个实体 + /// + /// Command对象 + /// 主键值 + /// 递归类型 + /// 递归深度 + /// 实体对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(SqlCommand cmd, int? id,RecursiveType recursiveType,int recursiveDepth) + { + cmd.Parameters.Clear(); + if(id.HasValue) + { + cmd.CommandText = "select * from OperatingRoomPutDoorRegisterDrugsRecords where Id=@pk"; + cmd.Parameters.Add(new SqlParameter("@pk",id.Value)); + } + else + { + cmd.CommandText = "select * from OperatingRoomPutDoorRegisterDrugsRecords where Id is null"; + } + return ExcuteSelectSingleCommand(cmd, recursiveType, recursiveDepth); + } + + /// + /// 按主键字段查询特定实体 + /// + /// 主键值 + /// 实体类对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(int? id) + { + using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return SelectSingle(cmd,id,RecursiveType.Parent,1); + } + } + } + /// + /// 按主键字段查询特定实体 + /// + /// 主键值 + /// 递归类型 + /// 递归深度 + /// 实体类对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(int? id, RecursiveType recursiveType, int recursiveDepth) + { + using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); + using (SqlCommand cmd = conn.CreateCommand()) + { + return SelectSingle(cmd,id, recursiveType, recursiveDepth); + } + } + } + + /// + /// 使用事务并按主键字段查询特定实体 + /// + /// 连接对象 + /// 主键值 + /// 实体类对象 + public static OperatingRoomPutDoorRegisterDrugsRecords SelectSingle(Connection connection,int? id, RecursiveType recursiveType, int recursiveDepth) + { + return SelectSingle(connection.Command, id, recursiveType, recursiveDepth); + } + #endregion + + + /// + /// 从DataReader中取出值生成实体对象 + /// + /// 查询对象 + /// 过滤条件字符串 + private static OperatingRoomPutDoorRegisterDrugsRecords DataReaderToEntity(SqlDataReader dr) + { + OperatingRoomPutDoorRegisterDrugsRecords entity = new OperatingRoomPutDoorRegisterDrugsRecords (); + if(dr["Id"]!=System.DBNull.Value) + { + entity.Id=Convert.ToInt32(dr["Id"]); + } + if(dr["PutDoorRegisterId"]!=System.DBNull.Value) + { + entity.PutDoorRegisterId=Convert.ToInt32(dr["PutDoorRegisterId"]); + } + if(dr["HisPatientId"]!=System.DBNull.Value) + { + entity.HisPatientId=dr["HisPatientId"].ToString(); + } + if(dr["DrugsNo"]!=System.DBNull.Value) + { + entity.DrugsNo=dr["DrugsNo"].ToString(); + } + if(dr["DrugsName"]!=System.DBNull.Value) + { + entity.DrugsName=dr["DrugsName"].ToString(); + } + if(dr["Dosage"]!=System.DBNull.Value) + { + entity.Dosage=Convert.ToDecimal(dr["Dosage"]); + } + if(dr["IsValid"]!=System.DBNull.Value) + { + entity.IsValid=Convert.ToInt32(dr["IsValid"]); + } + if(dr["state"]!=System.DBNull.Value) + { + entity.State=Convert.ToInt32(dr["state"]); + } + if(dr["OperatorTime"]!=System.DBNull.Value) + { + entity.OperatorTime=Convert.ToDateTime(dr["OperatorTime"]); + } + return entity; + } + } +} + diff --git a/AIMSEntity/Model/AutoGenerate/OperatingRoomPutDoorRegister.cs b/AIMSEntity/Model/AutoGenerate/OperatingRoomPutDoorRegister.cs new file mode 100644 index 0000000..0f79c15 --- /dev/null +++ b/AIMSEntity/Model/AutoGenerate/OperatingRoomPutDoorRegister.cs @@ -0,0 +1,542 @@ +using System; + +namespace AIMSModel +{ + [Serializable] + public partial class OperatingRoomPutDoorRegister + { + private int? id; + private string patientId; + private string hISPatientId; + private string inHospitalNo; + private string visitId; + private string patientModel; + private string patientDeptNo; + private string patientDeptName; + private string patientBedNo; + private string name; + private string sex; + private string age; + private DateTime? birthDay; + private Decimal? height; + private Decimal? weight; + private string idEntityNo; + private string tel; + private string address; + private string contacts; + private string contactsTel; + private string operationType; + private int? isPlanAgainOperation; + private string execDeptNo; + private string execDeptName; + private string anaesthesiaMethod; + private int? isPainClinic; + private string painTreatment; + private string painTreatmentRemark; + private string diagnose; + private string diagnoseRemark; + private string operation; + private string oPerationRemark; + private string anaesthesia; + private string anaesthesiaRemark; + private string aSALevel; + private string operationLevel; + private string operationPosition; + private string anaesthesiaDrugs; + private string complication; + private string operationSituation; + private DateTime? operationDate; + private DateTime? anaesthesiaBeginTime; + private DateTime? anaesthesiaEndTime; + private DateTime? operationBeginTime; + private DateTime? operationEndTime; + private string operationDoctorNo; + private string operationDoctorName; + private string anaesthesiaDoctorNo; + private string anaesthesiaDoctorName; + private string instrumentNurseNo; + private string instrumentNurseName; + private string tourNurseNo; + private string tourNurseName; + private int? isValid; + private int? state; + private string opeatorNo; + private DateTime? operatorTime; + private string remark; + private string hCode; + + + /// + /// 编号,自增 + /// + public int? Id + { + get{ return id; } + set{ id=value; } + } + /// + /// 患者Id + /// + public string PatientId + { + get{ return patientId; } + set{ patientId=value; } + } + /// + /// 患者HISId + /// + public string HISPatientId + { + get{ return hISPatientId; } + set{ hISPatientId=value; } + } + /// + /// 住院/门诊(编号) + /// + public string InHospitalNo + { + get{ return inHospitalNo; } + set{ inHospitalNo=value; } + } + /// + /// 住院次数(就诊次数) + /// + public string VisitId + { + get{ return visitId; } + set{ visitId=value; } + } + /// + /// 患者类别(门诊、住院) + /// + public string PatientModel + { + get{ return patientModel; } + set{ patientModel=value; } + } + /// + /// 患者科室编号 + /// + public string PatientDeptNo + { + get{ return patientDeptNo; } + set{ patientDeptNo=value; } + } + /// + /// 患者科室名称 + /// + public string PatientDeptName + { + get{ return patientDeptName; } + set{ patientDeptName=value; } + } + /// + /// 床位 + /// + public string PatientBedNo + { + get{ return patientBedNo; } + set{ patientBedNo=value; } + } + /// + /// 姓名 + /// + public string Name + { + get{ return name; } + set{ name=value; } + } + /// + /// 性别 + /// + public string Sex + { + get{ return sex; } + set{ sex=value; } + } + /// + /// 年龄 + /// + public string Age + { + get{ return age; } + set{ age=value; } + } + /// + /// 出生日期 + /// + public DateTime? BirthDay + { + get{ return birthDay; } + set{ birthDay=value; } + } + /// + /// 身高 + /// + public Decimal? Height + { + get{ return height; } + set{ height=value; } + } + /// + /// 体重 + /// + public Decimal? Weight + { + get{ return weight; } + set{ weight=value; } + } + /// + /// 身份证号码 + /// + public string IdEntityNo + { + get{ return idEntityNo; } + set{ idEntityNo=value; } + } + /// + /// 电话 + /// + public string Tel + { + get{ return tel; } + set{ tel=value; } + } + /// + /// 住址 + /// + public string Address + { + get{ return address; } + set{ address=value; } + } + /// + /// 联系人 + /// + public string Contacts + { + get{ return contacts; } + set{ contacts=value; } + } + /// + /// 联系人电话 + /// + public string ContactsTel + { + get{ return contactsTel; } + set{ contactsTel=value; } + } + /// + /// 手术类型(择期、急诊、日间) + /// + public string OperationType + { + get{ return operationType; } + set{ operationType=value; } + } + /// + /// 是否计划再次手术 + /// + public int? IsPlanAgainOperation + { + get{ return isPlanAgainOperation; } + set{ isPlanAgainOperation=value; } + } + /// + /// 执行科室编号 + /// + public string ExecDeptNo + { + get{ return execDeptNo; } + set{ execDeptNo=value; } + } + /// + /// 执行科室名称 + /// + public string ExecDeptName + { + get{ return execDeptName; } + set{ execDeptName=value; } + } + /// + /// 其他麻醉方式(分娩镇痛,无痛人流、无痛胃镜、无痛肠镜、无痛气管镜、无痛介入、急救插管、ERCP、MECT)等 + /// + public string AnaesthesiaMethod + { + get{ return anaesthesiaMethod; } + set{ anaesthesiaMethod=value; } + } + /// + /// 是否疼痛门诊 + /// + public int? IsPainClinic + { + get{ return isPainClinic; } + set{ isPainClinic=value; } + } + /// + /// 疼痛治疗 + /// + public string PainTreatment + { + get{ return painTreatment; } + set{ painTreatment=value; } + } + /// + /// 疼痛治疗备注 + /// + public string PainTreatmentRemark + { + get{ return painTreatmentRemark; } + set{ painTreatmentRemark=value; } + } + /// + /// 诊断 + /// + public string Diagnose + { + get{ return diagnose; } + set{ diagnose=value; } + } + /// + /// 诊断备注 + /// + public string DiagnoseRemark + { + get{ return diagnoseRemark; } + set{ diagnoseRemark=value; } + } + /// + /// 手术 + /// + public string Operation + { + get{ return operation; } + set{ operation=value; } + } + /// + /// 手术备注 + /// + public string OPerationRemark + { + get{ return oPerationRemark; } + set{ oPerationRemark=value; } + } + /// + /// 麻醉 + /// + public string Anaesthesia + { + get{ return anaesthesia; } + set{ anaesthesia=value; } + } + /// + /// 麻醉备注 + /// + public string AnaesthesiaRemark + { + get{ return anaesthesiaRemark; } + set{ anaesthesiaRemark=value; } + } + /// + /// ASA分级 + /// + public string ASALevel + { + get{ return aSALevel; } + set{ aSALevel=value; } + } + /// + /// 手术分级 + /// + public string OperationLevel + { + get{ return operationLevel; } + set{ operationLevel=value; } + } + /// + /// 手术体位 + /// + public string OperationPosition + { + get{ return operationPosition; } + set{ operationPosition=value; } + } + /// + /// 麻醉用药 + /// + public string AnaesthesiaDrugs + { + get{ return anaesthesiaDrugs; } + set{ anaesthesiaDrugs=value; } + } + /// + /// 合并症 + /// + public string Complication + { + get{ return complication; } + set{ complication=value; } + } + /// + /// 术中情况 + /// + public string OperationSituation + { + get{ return operationSituation; } + set{ operationSituation=value; } + } + /// + /// 手术日期 + /// + public DateTime? OperationDate + { + get{ return operationDate; } + set{ operationDate=value; } + } + /// + /// 麻醉开始时间 + /// + public DateTime? AnaesthesiaBeginTime + { + get{ return anaesthesiaBeginTime; } + set{ anaesthesiaBeginTime=value; } + } + /// + /// 麻醉结束时间 + /// + public DateTime? AnaesthesiaEndTime + { + get{ return anaesthesiaEndTime; } + set{ anaesthesiaEndTime=value; } + } + /// + /// 手术开始时间 + /// + public DateTime? OperationBeginTime + { + get{ return operationBeginTime; } + set{ operationBeginTime=value; } + } + /// + /// 手术结束时间 + /// + public DateTime? OperationEndTime + { + get{ return operationEndTime; } + set{ operationEndTime=value; } + } + /// + /// 手术医生工号 + /// + public string OperationDoctorNo + { + get{ return operationDoctorNo; } + set{ operationDoctorNo=value; } + } + /// + /// 手术医生姓名 + /// + public string OperationDoctorName + { + get{ return operationDoctorName; } + set{ operationDoctorName=value; } + } + /// + /// 麻醉医生工号 + /// + public string AnaesthesiaDoctorNo + { + get{ return anaesthesiaDoctorNo; } + set{ anaesthesiaDoctorNo=value; } + } + /// + /// 麻醉医生姓名 + /// + public string AnaesthesiaDoctorName + { + get{ return anaesthesiaDoctorName; } + set{ anaesthesiaDoctorName=value; } + } + /// + /// 器械护士工号 + /// + public string InstrumentNurseNo + { + get{ return instrumentNurseNo; } + set{ instrumentNurseNo=value; } + } + /// + /// 器械护士姓名 + /// + public string InstrumentNurseName + { + get{ return instrumentNurseName; } + set{ instrumentNurseName=value; } + } + /// + /// 巡回护士工号 + /// + public string TourNurseNo + { + get{ return tourNurseNo; } + set{ tourNurseNo=value; } + } + /// + /// 巡回护士姓名 + /// + public string TourNurseName + { + get{ return tourNurseName; } + set{ tourNurseName=value; } + } + /// + /// 是否有效 + /// + public int? IsValid + { + get{ return isValid; } + set{ isValid=value; } + } + /// + /// 状态 + /// + public int? State + { + get{ return state; } + set{ state=value; } + } + /// + /// 登记人工号 + /// + public string OpeatorNo + { + get{ return opeatorNo; } + set{ opeatorNo=value; } + } + /// + /// 登记时间 + /// + public DateTime? OperatorTime + { + get{ return operatorTime; } + set{ operatorTime=value; } + } + /// + /// 备注 + /// + public string Remark + { + get{ return remark; } + set{ remark=value; } + } + /// + /// 拼音码 + /// + public string HCode + { + get{ return hCode; } + set{ hCode=value; } + } + } +} diff --git a/AIMSEntity/Model/AutoGenerate/OperatingRoomPutDoorRegisterDrugsRecords.cs b/AIMSEntity/Model/AutoGenerate/OperatingRoomPutDoorRegisterDrugsRecords.cs new file mode 100644 index 0000000..fed804d --- /dev/null +++ b/AIMSEntity/Model/AutoGenerate/OperatingRoomPutDoorRegisterDrugsRecords.cs @@ -0,0 +1,92 @@ +using System; + +namespace AIMSModel +{ + [Serializable] + public partial class OperatingRoomPutDoorRegisterDrugsRecords + { + private int? id; + private int? putDoorRegisterId; + private string hisPatientId; + private string drugsNo; + private string drugsName; + private Decimal? dosage; + private int? isValid; + private int? state; + private DateTime? operatorTime; + + + /// + /// 编号,自增 + /// + public int? Id + { + get{ return id; } + set{ id=value; } + } + /// + /// 手术室外登记编号 + /// + public int? PutDoorRegisterId + { + get{ return putDoorRegisterId; } + set{ putDoorRegisterId=value; } + } + /// + /// 患者His编号 + /// + public string HisPatientId + { + get{ return hisPatientId; } + set{ hisPatientId=value; } + } + /// + /// 药品编号 + /// + public string DrugsNo + { + get{ return drugsNo; } + set{ drugsNo=value; } + } + /// + /// 药品名称 + /// + public string DrugsName + { + get{ return drugsName; } + set{ drugsName=value; } + } + /// + /// 使用剂量 + /// + public Decimal? Dosage + { + get{ return dosage; } + set{ dosage=value; } + } + /// + /// 是否有效 + /// + public int? IsValid + { + get{ return isValid; } + set{ isValid=value; } + } + /// + /// 状态 + /// + public int? State + { + get{ return state; } + set{ state=value; } + } + /// + /// 登记时间 + /// + public DateTime? OperatorTime + { + get{ return operatorTime; } + set{ operatorTime=value; } + } + } +} diff --git a/AIMSEntity/ObjectQuery/OperatingRoomPutDoorRegisterDrugsRecordsMap.cs b/AIMSEntity/ObjectQuery/OperatingRoomPutDoorRegisterDrugsRecordsMap.cs new file mode 100644 index 0000000..4a5d9f3 --- /dev/null +++ b/AIMSEntity/ObjectQuery/OperatingRoomPutDoorRegisterDrugsRecordsMap.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; + +namespace AIMSObjectQuery +{ + internal partial class OperatingRoomPutDoorRegisterDrugsRecordsMap:IMap + { + private Dictionary dictionary = new Dictionary(); + public OperatingRoomPutDoorRegisterDrugsRecordsMap() + { + dictionary.Add("id", "Id"); + dictionary.Add("putdoorregisterid", "PutDoorRegisterId"); + dictionary.Add("hispatientid", "HisPatientId"); + dictionary.Add("drugsno", "DrugsNo"); + dictionary.Add("drugsname", "DrugsName"); + dictionary.Add("dosage", "Dosage"); + dictionary.Add("isvalid", "IsValid"); + dictionary.Add("state", "state"); + dictionary.Add("operatortime", "OperatorTime"); + } + + #region IMap 成员 + + public string this[string propertyName] + { + get + { + try + { + return dictionary[propertyName.ToLower()]; + } + catch (KeyNotFoundException) + { + throw new Exception(propertyName + "属性不存在"); + } + } + } + + #endregion + } +} diff --git a/AIMSEntity/ObjectQuery/OperatingRoomPutDoorRegisterMap.cs b/AIMSEntity/ObjectQuery/OperatingRoomPutDoorRegisterMap.cs new file mode 100644 index 0000000..666cd4f --- /dev/null +++ b/AIMSEntity/ObjectQuery/OperatingRoomPutDoorRegisterMap.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace AIMSObjectQuery +{ + internal partial class OperatingRoomPutDoorRegisterMap:IMap + { + private Dictionary dictionary = new Dictionary(); + public OperatingRoomPutDoorRegisterMap() + { + dictionary.Add("id", "Id"); + dictionary.Add("patientid", "PatientId"); + dictionary.Add("hispatientid", "HISPatientId"); + dictionary.Add("inhospitalno", "InHospitalNo"); + dictionary.Add("visitid", "VisitId"); + dictionary.Add("patientmodel", "PatientModel"); + dictionary.Add("patientdeptno", "PatientDeptNo"); + dictionary.Add("patientdeptname", "PatientDeptName"); + dictionary.Add("patientbedno", "PatientBedNo"); + dictionary.Add("name", "Name"); + dictionary.Add("sex", "Sex"); + dictionary.Add("age", "Age"); + dictionary.Add("birthday", "BirthDay"); + dictionary.Add("height", "Height"); + dictionary.Add("weight", "Weight"); + dictionary.Add("identityno", "IdEntityNo"); + dictionary.Add("tel", "Tel"); + dictionary.Add("address", "Address"); + dictionary.Add("contacts", "Contacts"); + dictionary.Add("contactstel", "ContactsTel"); + dictionary.Add("operationtype", "OperationType"); + dictionary.Add("isplanagainoperation", "IsPlanAgainOperation"); + dictionary.Add("execdeptno", "ExecDeptNo"); + dictionary.Add("execdeptname", "ExecDeptName"); + dictionary.Add("anaesthesiamethod", "AnaesthesiaMethod"); + dictionary.Add("ispainclinic", "IsPainClinic"); + dictionary.Add("paintreatment", "PainTreatment"); + dictionary.Add("paintreatmentremark", "PainTreatmentRemark"); + dictionary.Add("diagnose", "Diagnose"); + dictionary.Add("diagnoseremark", "DiagnoseRemark"); + dictionary.Add("operation", "Operation"); + dictionary.Add("operationremark", "OPerationRemark"); + dictionary.Add("anaesthesia", "Anaesthesia"); + dictionary.Add("anaesthesiaremark", "AnaesthesiaRemark"); + dictionary.Add("asalevel", "ASALevel"); + dictionary.Add("operationlevel", "OperationLevel"); + dictionary.Add("operationposition", "OperationPosition"); + dictionary.Add("anaesthesiadrugs", "AnaesthesiaDrugs"); + dictionary.Add("complication", "Complication"); + dictionary.Add("operationsituation", "OperationSituation"); + dictionary.Add("operationdate", "OperationDate"); + dictionary.Add("anaesthesiabegintime", "AnaesthesiaBeginTime"); + dictionary.Add("anaesthesiaendtime", "AnaesthesiaEndTime"); + dictionary.Add("operationbegintime", "OperationBeginTime"); + dictionary.Add("operationendtime", "OperationEndTime"); + dictionary.Add("operationdoctorno", "OperationDoctorNo"); + dictionary.Add("operationdoctorname", "OperationDoctorName"); + dictionary.Add("anaesthesiadoctorno", "AnaesthesiaDoctorNo"); + dictionary.Add("anaesthesiadoctorname", "AnaesthesiaDoctorName"); + dictionary.Add("instrumentnurseno", "InstrumentNurseNo"); + dictionary.Add("instrumentnursename", "InstrumentNurseName"); + dictionary.Add("tournurseno", "TourNurseNo"); + dictionary.Add("tournursename", "TourNurseName"); + dictionary.Add("isvalid", "IsValid"); + dictionary.Add("state", "State"); + dictionary.Add("opeatorno", "OpeatorNo"); + dictionary.Add("operatortime", "OperatorTime"); + dictionary.Add("remark", "Remark"); + dictionary.Add("hcode", "HCode"); + } + + #region IMap 成员 + + public string this[string propertyName] + { + get + { + try + { + return dictionary[propertyName.ToLower()]; + } + catch (KeyNotFoundException) + { + throw new Exception(propertyName + "属性不存在"); + } + } + } + + #endregion + } +} diff --git a/DrawGraph/AreaManage/BaseInfoTopManage.cs b/DrawGraph/AreaManage/BaseInfoTopManage.cs index 56464fc..f2db69f 100644 --- a/DrawGraph/AreaManage/BaseInfoTopManage.cs +++ b/DrawGraph/AreaManage/BaseInfoTopManage.cs @@ -177,7 +177,7 @@ namespace DrawGraph break; case EControlType.Directory: value = ableEdit.PackValue; - text = DBManage.GetDictionaryValuesById(ableEdit.PackValue, ableEdit.ControlTitleText); + text = DBManage.GetDictionaryValuesById(ableEdit.PackValue, ableEdit.ControlTitleText); //设置属性的值 template.SetObjValue(OpeRecord, ableEdit.ClassDataSourceName, text, value); break;