/// <summary> /// 获取改变的信息,转化为实体 /// </summary> /// <param name="dt"></param> /// <returns></returns> private ArrayList GetChanges(DataTable dt) { this.al = new ArrayList(); if (dt != null) { try { foreach (DataRow row in dt.Rows) { Neusoft.HISFC.Models.Registration.RegLvlFee info = new Neusoft.HISFC.Models.Registration.RegLvlFee(); info.ID = row["流水号"].ToString(); info.RegFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(row["挂号费"].ToString()); info.ChkFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(row["检查费"].ToString()); info.OwnDigFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(row["自费诊疗费"].ToString()); info.PubDigFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(row["记帐诊疗费"].ToString()); info.OthFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(row["附加费"].ToString()); this.al.Add(info); } } catch (Exception e) { MessageBox.Show("生成实体集合时出错!" + e.Message, "提示"); return(null); } } return(al); }
private void MakeAll(string pactCode) { al = regFeeMgr.Query(pactCode, true); // if(al.Count != alLevel.Count) // { bool IsFound = false; foreach (Neusoft.HISFC.Models.Registration.RegLevel level in alLevel) { IsFound = false; foreach (Neusoft.HISFC.Models.Registration.RegLvlFee obj in al) { if (level.ID == obj.RegLevel.ID) { IsFound = true; break; } } if (!IsFound) { //级别代码中有,但是该合同单位没有维护。 Neusoft.HISFC.Models.Registration.RegLvlFee regFee = this.Insert(pactCode, level.ID); //直接添加到窗口中,防止再次检索数据库。 al.Add(regFee); } } // } }
/// <summary> /// /// </summary> /// <param name="sql"></param> /// <returns></returns> private ArrayList QueryPact(string sql) { if (this.ExecQuery(sql) == -1) { return(null); } try { this.al = new ArrayList(); while (this.Reader.Read()) { this.regFee = new Neusoft.HISFC.Models.Registration.RegLvlFee(); //流水号 regFee.ID = this.Reader[0].ToString(); //合同单位 regFee.Pact.ID = this.Reader[1].ToString(); //挂号级别 regFee.RegLevel.ID = this.Reader[2].ToString(); //挂号费 regFee.RegFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[4].ToString()); //检查费 regFee.ChkFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[5].ToString()); //诊查费 regFee.OwnDigFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[6].ToString()); //附加费 regFee.OthFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[7].ToString()); //操作员 regFee.Oper.ID = this.Reader[8].ToString(); //操作时间 regFee.Oper.OperTime = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader[9].ToString()); regFee.PubDigFee = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.Reader[10].ToString()); this.al.Add(regFee); } this.Reader.Close(); } catch (Exception e) { this.Err = "查询挂号费出错!" + e.Message; this.ErrCode = e.Message; return(null); } return(al); }
/// <summary> /// 获取挂号费 /// </summary> /// <param name="pactID"></param> /// <param name="regLvlID"></param> /// <param name="regFee"></param> /// <param name="chkFee"></param> /// <param name="digFee"></param> /// <param name="othFee"></param> /// <param name="digPubFee"></param> /// <returns></returns> private int GetRegFee(string pactID, string regLvlID, ref decimal regFee, ref decimal chkFee, ref decimal digFee, ref decimal othFee) { Neusoft.HISFC.Models.Registration.RegLvlFee p = this.regFeeMgr.Get(pactID, regLvlID); if (p == null)//出错 { return(-1); } if (p.ID == null || p.ID == "")//没有维护挂号费 { return(1); } regFee = p.RegFee; chkFee = p.ChkFee; digFee = p.OwnDigFee; othFee = p.OthFee; return(0); }
/// <summary> /// /// </summary> /// <param name="regObj"></param> /// <returns></returns> private int GetRegFee(Neusoft.HISFC.Models.Registration.Register regObj) { Neusoft.HISFC.Models.Registration.RegLvlFee p = this.regFeeMgr.Get(regObj.Pact.ID, regObj.DoctorInfo.Templet.RegLevel.ID); if (p == null)//出错 { return(-1); } if (p.ID == null || p.ID == "")//没有维护挂号费 { return(1); } regObj.RegLvlFee = p; regObj.OwnCost = p.ChkFee + p.OwnDigFee + p.RegFee + p.OthFee; regObj.PayCost = 0; regObj.PubCost = 0; return(0); }
/// <summary> /// 更新合同单位挂号费分配信息 /// </summary> /// <param name="info"></param> public int Update(Neusoft.HISFC.Models.Registration.RegLvlFee info) { string sql = ""; if (this.Sql.GetSql("Registration.RegFee.Update.1", ref sql) == -1) { return(-1); } try { sql = string.Format(sql, info.ID, info.RegFee, info.ChkFee, info.OwnDigFee, info.OthFee, info.PubDigFee); return(this.ExecNoQuery(sql)); } catch (Exception e) { this.Err = "[Registration.RegFee.Update.1]格式不匹配!" + e.Message; this.ErrCode = e.Message; return(-1); } }
/// <summary> /// 插入一条新的记录 /// </summary> /// <param name="pactCode"></param> /// <param name="levelCode"></param> /// <returns></returns> private Neusoft.HISFC.Models.Registration.RegLvlFee Insert(string pactCode, string levelCode) { Neusoft.HISFC.Models.Registration.RegLvlFee info = new Neusoft.HISFC.Models.Registration.RegLvlFee(); info.ID = regFeeMgr.GetSequence("Registration.RegLevel.GetSeqNo"); info.Pact.ID = pactCode; info.RegLevel.ID = levelCode; info.RegFee = 0; info.ChkFee = 0; info.OwnDigFee = 0; info.PubDigFee = 0; info.OthFee = 0; info.Oper.ID = this.regFeeMgr.Operator.ID; info.Oper.OperTime = regFeeMgr.GetDateTimeFromSysDateTime(); if (regFeeMgr.Insert(info) == -1) { MessageBox.Show("添加合同单位挂号费分配信息失败![Registration.RegFee.Insert.1]" + regFeeMgr.Err); } return(info); }
/// <summary> /// 插入一条挂号费 /// </summary> /// <param name="regFee"></param> /// <returns></returns> public int Insert(Neusoft.HISFC.Models.Registration.RegLvlFee regFee) { string sql = ""; if (this.Sql.GetSql("Registration.RegFee.Insert.1", ref sql) == -1) { return(-1); } try { sql = string.Format(sql, regFee.ID, regFee.Pact.ID, regFee.RegLevel.ID, "", regFee.RegFee, regFee.ChkFee, regFee.OwnDigFee, regFee.OthFee, regFee.Oper.ID, regFee.Oper.OperTime.ToString(), regFee.PubDigFee); } catch (Exception e) { this.Err = "[Registration.RegFee.Insert.1]格式不匹配!" + e.Message; this.ErrCode = e.Message; return(-1); } return(this.ExecNoQuery(sql)); }