private void NewPhase() { this.curePhase = new Neusoft.HISFC.Models.Order.CurePhase(); this.cmbCurePhase.Text = ""; this.cmbDoct.Text = ""; this.ckbVaild.Checked = true; this.txtRemark.Text = ""; this.cmbCurePhase.Focus(); }
/// <summary> /// 设置选中行的数据到界面 /// </summary> /// <param name="row">行数</param> private void SetCurePhaseToControl(int row) { this.curePhase = this.curePhaseManagement.QuerCurePhaseBySeq(this.fpCurePhase_Sheet1.Cells[row, 1].Text); this.cmbCurePhase.Tag = this.curePhase.CurePhaseInfo.ID; this.cmbDoct.Tag = this.curePhase.Doctor.ID; this.dtStart.Value = this.curePhase.StartTime; this.dtEnd.Value = this.curePhase.EndTime; this.ckbVaild.Checked = this.curePhase.IsVaild; this.txtRemark.Text = this.curePhase.Remark; }
/// <summary> /// 查询 /// </summary> /// <param name="strSql"></param> /// <returns></returns> private ArrayList myCurePhaseQuery(string strSql) { ArrayList al = new ArrayList(); if (this.ExecQuery(strSql) == -1) { return(null); } try { while (this.Reader.Read()) { Neusoft.HISFC.Models.Order.CurePhase curePhase = new Neusoft.HISFC.Models.Order.CurePhase(); try { curePhase.PatientID = this.Reader[0].ToString(); curePhase.ID = this.Reader[1].ToString(); //序列号 curePhase.Dept.ID = this.Reader[2].ToString(); //科室代码 curePhase.Dept.Name = this.Reader[3].ToString(); //科室名称 curePhase.CurePhaseInfo.ID = this.Reader[4].ToString(); //治疗阶段信息编码 curePhase.CurePhaseInfo.Name = this.Reader[5].ToString(); //治疗阶段信息名称 curePhase.StartTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[6].ToString()); //开始时间 curePhase.EndTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[7].ToString()); //结束时间 curePhase.Doctor.ID = this.Reader[8].ToString(); //诊断 curePhase.Doctor.Name = this.Reader[9].ToString(); //科室名称 curePhase.IsVaild = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.Reader[10].ToString()); //有效性 curePhase.Remark = this.Reader[11].ToString(); //备注 curePhase.Oper.ID = this.Reader[12].ToString(); //操作员 curePhase.Oper.OperTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[13].ToString()); //操作日期 } catch (Exception ex) { this.Err = "获得患者治疗阶段信息出错!" + ex.Message; this.WriteErr(); return(null); } al.Add(curePhase); } } catch (Exception ex) { this.Err = "获得患者治疗阶段信息出错!" + ex.Message; this.WriteErr(); return(null); } finally { this.Reader.Close(); } return(al); }
/// <summary> /// 更新治疗阶段信息 /// </summary> /// <param name="curePhase"></param> /// <returns></returns> public int UpdateCurePhase(Neusoft.HISFC.Models.Order.CurePhase curePhase) { string strSql = ""; if (this.Sql.GetSql("Order.CurePhase.Update.1", ref strSql) == -1) { this.Err = this.Sql.Err; return(-1); } strSql = this.FormatCurePhaseInfo(strSql, curePhase); if (strSql == null) { this.Err = "格式化Sql语句时出错"; this.WriteErr(); return(-1); } return(this.ExecNoQuery(strSql)); }
/// <summary> /// 格式化SQL语句 /// </summary> /// <param name="strSql"></param> /// <param name="curePhase"></param> /// <returns></returns> private string FormatCurePhaseInfo(string strSql, Neusoft.HISFC.Models.Order.CurePhase curePhase) { string mySql = ""; try { System.Object[] s = { curePhase.PatientID, //住院流水号 curePhase.ID, //序列号 curePhase.Dept.ID, //科室代码 curePhase.Dept.Name, //科室名称 curePhase.CurePhaseInfo.ID, //治疗阶段信息编码 curePhase.CurePhaseInfo.Name, //治疗阶段信息名称 curePhase.StartTime.ToString(), //开始时间 curePhase.EndTime.ToString(), //结束时间 curePhase.Doctor.ID, //诊断 curePhase.Doctor.Name, //科室名称 Neusoft.FrameWork.Function.NConvert.ToInt32(curePhase.IsVaild).ToString(), //有效性 curePhase.Remark, //备注 curePhase.Oper.ID, //操作员 curePhase.Oper.OperTime.ToString(), //操作日期 }; string myErr = ""; if (Neusoft.FrameWork.Public.String.CheckObject(out myErr, s) == -1) { this.Err = myErr; this.WriteErr(); return(null); } mySql = string.Format(strSql, s); } catch (System.Exception ex) { this.Err = "付数值时候出错!" + ex.Message; this.WriteErr(); return(null); } return(mySql); }