/// <summary> /// 查询是否存在指定的感兴趣病人记录 /// </summary> /// <param name="iinterestPatient"></param> /// <returns></returns> public override bool Exists(IModel iinterestPatient) { MInterestPatient interestPatient = (MInterestPatient)iinterestPatient; strSql = "select * from " + TableName + " where NOTE_ID=" + interestPatient.NOTE_ID; return(recordIsExist(strSql)); }
private void btn_Save_Click(object sender, EventArgs e) { if (Now_Modify_NodeID == "" && Now_Add_NodeID == "") return; if (Now_Modify_NodeID == "" && Now_Add_NodeID != "") Now_Modify_NodeID = Now_Add_NodeID; TreeNode[] tr = trv_InterestPatient.Nodes.Find(Now_Modify_NodeID, true); if (tr.Length > 0) { TreeNode ntr = tr[0]; MInterestPatient mip = new MInterestPatient(); mip.NOTE_ID = Convert.ToInt32(ntr.Name); mip.NOTE_NAME = txt_NOTE_NAME.Text.Trim(); if (ntr.Level == 0) mip.PARENT_NOTE_ID = 0; else mip.PARENT_NOTE_ID = Convert.ToInt32(ntr.Parent.Name); mip.DOCTOR_ID = NowDoctorID; mip.MEMO = txt_MEMO.Text.Trim(); mip.IS_NOTE = 0; bool bl = bItPt.Exists(mip); if (bl) { int i = bItPt.Update(mip, " where NOTE_ID=" + mip.NOTE_ID); if (i >= 0) { MessageBoxEx.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); ntr.Text = txt_NOTE_NAME.Text.Trim(); Now_Add_NodeID = ""; Now_Modify_NodeID = ""; btn_Clean_Click(null, null); } else { MessageBoxEx.Show("修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { int i = bItPt.Add(mip); if (i > 0) { MessageBoxEx.Show("新增成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); ntr.Text = txt_NOTE_NAME.Text.Trim(); Now_Add_NodeID = ""; Now_Modify_NodeID = ""; btn_Clean_Click(null, null); } else { MessageBoxEx.Show("新增失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void tsmi_InterestExam_Click(object sender, EventArgs e) { MInterestPatient mintPat = new MInterestPatient(); mintPat.DOCTOR_ID = ((MUser)frmMainForm.iUser).DOCTOR_ID; mintPat.EXAM_ACCESSION_NUM = this.MworkList.EXAM_ACCESSION_NUM; mintPat.PATIENT_ID = this.MworkList.PATIENT_ID; mintPat.IS_NOTE = 1; BInterestPatient bintPat = new BInterestPatient(); bintPat.Add(mintPat); }
/// <summary> /// 插入一条感兴趣病人记录 /// </summary> /// <param name="iinterestPatient"></param> /// <returns></returns> public override int Add(IModel iinterestPatient) { MInterestPatient interestPatient = (MInterestPatient)iinterestPatient; Hashtable ht = new Hashtable(); ht.Add("NOTE_ID", interestPatient.NOTE_ID); ht.Add("NOTE_NAME", interestPatient.NOTE_NAME); ht.Add("PARENT_NOTE_ID", interestPatient.PARENT_NOTE_ID); ht.Add("IS_NOTE", interestPatient.IS_NOTE); ht.Add("DOCTOR_ID", interestPatient.DOCTOR_ID); ht.Add("PATIENT_ID", interestPatient.PATIENT_ID); ht.Add("EXAM_ACCESSION_NUM", interestPatient.EXAM_ACCESSION_NUM); ht.Add("MEMO", interestPatient.MEMO); return(ExecuteSql(StringConstructor.InsertSql(TableName, ht).ToString())); }
private void btn_SaveNoteName_Click(object sender, EventArgs e) { if (Now_Add_NodeID == "") { return; } if (txt_NOTE_NAME.Text.Trim() == "") { MessageBoxEx.Show("请输入分类名!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //if (Now_Modify_NodeID == "" && Now_Add_NodeID != "") Now_Modify_NodeID = Now_Add_NodeID; TreeNode[] tr = trv_InterestPatient.Nodes.Find(Now_Modify_NodeID, true); if (tr.Length > 0) { MInterestPatient mip = new MInterestPatient(); mip.NOTE_ID = Convert.ToInt32(ID.GetSeqValue()); mip.NOTE_NAME = txt_NOTE_NAME.Text.Trim(); mip.DOCTOR_ID = NowDoctorID; TreeNode ntr = tr[0]; if (ntr.Level == 0) { mip.PARENT_NOTE_ID = 0; } else { mip.PARENT_NOTE_ID = Convert.ToInt32(ntr.Parent.Name); } mip.MEMO = txt_MEMO.Text.Trim(); mip.IS_NOTE = 0; int i = bItPt.Add(mip); if (i > 0) { MessageBoxEx.Show("新增分类成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); ntr.Text = mip.NOTE_NAME; } else { MessageBoxEx.Show("新增分类失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } Now_Modify_NodeID = ""; Now_Add_NodeID = ""; } }
/// <summary> /// 获取指定的NOTE_ID的记录 /// </summary> /// <param name="NOTE_ID"></param> /// <returns></returns> public override IModel GetModel(string NOTE_ID) { strSql = "select * from " + TableName + " where NOTE_ID = " + NOTE_ID; DataTable dt = GetDataTable(strSql); if (dt.Rows.Count == 0) { return(null); } MInterestPatient interestPatient = new MInterestPatient(); interestPatient.NOTE_ID = Convert.ToInt32(dt.Rows[0]["NOTE_ID"].ToString()); interestPatient.NOTE_NAME = dt.Rows[0]["NOTE_NAME"].ToString(); if (dt.Rows[0]["PARENT_NOTE_ID"].ToString() == "") { interestPatient.PARENT_NOTE_ID = null; } else { interestPatient.PARENT_NOTE_ID = Convert.ToInt32(dt.Rows[0]["PARENT_NOTE_ID"].ToString()); } if (dt.Rows[0]["IS_NOTE"].ToString() == "") { interestPatient.IS_NOTE = null; } else { interestPatient.IS_NOTE = Convert.ToInt32(dt.Rows[0]["IS_NOTE"].ToString()); } interestPatient.DOCTOR_ID = dt.Rows[0]["DOCTOR_ID"].ToString(); interestPatient.PATIENT_ID = dt.Rows[0]["PATIENT_ID"].ToString(); interestPatient.EXAM_ACCESSION_NUM = dt.Rows[0]["EXAM_ACCESSION_NUM"].ToString(); interestPatient.MEMO = dt.Rows[0]["MEMO"].ToString(); return(interestPatient); }