예제 #1
0
        /// <summary>
        /// 查询某日的住院日报
        /// </summary>
        /// <param name="statTime"></param>
        public ArrayList QueryByStatTime(DateTime statTime)
        {
            string strSql = "";

            if (this.Sql.GetSql("HealthRecord.DayReport.QueryByStatTime", ref strSql) == -1)
            {
                return(null);
            }
            try
            {
                strSql = string.Format(strSql, statTime.ToString());
            }
            catch (Exception e)
            {
                this.Err     = "[HealthRecord.DayReport.QueryByStatTime]格式不匹配!" + e.Message;
                this.ErrCode = e.Message;
                return(null);
            }
            if (this.ExecQuery(strSql) == -1)
            {
                return(null);
            }
            ArrayList al = new ArrayList();

            try
            {
                while (this.Reader.Read())
                {
                    Neusoft.HISFC.Models.HealthRecord.DayReport dayReport;
                    dayReport           = new Neusoft.HISFC.Models.HealthRecord.DayReport();
                    dayReport.DateStat  = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.Reader["DateStat"].ToString());
                    dayReport.Dept.ID   = this.Reader["DeptID"].ToString();
                    dayReport.Dept.Name = this.Reader["DeptName"].ToString();

                    if (!String.IsNullOrEmpty(this.Reader["BedStandNum"].ToString()))
                    {
                        dayReport.BedStandNum = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader["BedStandNum"].ToString());
                    }
                    if (!String.IsNullOrEmpty(this.Reader["RemainYesterdayNum"].ToString()))
                    {
                        dayReport.RemainYesterdayNum = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader["RemainYesterdayNum"].ToString());
                    }
                    if (!String.IsNullOrEmpty(this.Reader["InNormalNum"].ToString()))
                    {
                        dayReport.InNormalNum = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader["InNormalNum"].ToString());
                    }
                    if (!String.IsNullOrEmpty(this.Reader["InChangeNum"].ToString()))
                    {
                        dayReport.InChangeNum = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader["InChangeNum"].ToString());
                    }
                    if (!String.IsNullOrEmpty(this.Reader["OutNormalNum"].ToString()))
                    {
                        dayReport.OutNormalNum = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader["OutNormalNum"].ToString());
                    }
                    if (!String.IsNullOrEmpty(this.Reader["OutChangeNum"].ToString()))
                    {
                        dayReport.OutChangeNum = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader["OutChangeNum"].ToString());
                    }
                    if (!String.IsNullOrEmpty(this.Reader["AccNum"].ToString()))
                    {
                        dayReport.AccNum = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader["AccNum"].ToString());
                    }
                    if (!String.IsNullOrEmpty(this.Reader["BanpNum"].ToString()))
                    {
                        dayReport.BanpNum = Neusoft.FrameWork.Function.NConvert.ToInt32(this.Reader["BanpNum"].ToString());
                    }
                    dayReport.HasRecord = this.Reader["HasRecord"].ToString();
                    al.Add(dayReport);
                }

                this.Reader.Close();
            }
            catch (Exception e)
            {
                this.Err     = "查询某日的住院日报!" + e.Message;
                this.ErrCode = e.Message;
                return(null);
            }
            return(al);
        }
예제 #2
0
        private int Save()
        {
            this.neuSpread1.StopCellEditing();

            if (neuSpread1_Sheet1.RowCount > 0)
            {
                dtDayReport.Rows[neuSpread1_Sheet1.ActiveRowIndex].EndEdit();
            }
            //保存
            System.Collections.ArrayList al = new System.Collections.ArrayList();
            if (dtDayReport != null)
            {
                try
                {
                    foreach (DataRow dtRow in dtDayReport.Rows)
                    {
                        Neusoft.HISFC.Models.HealthRecord.DayReport dr;
                        dr                    = new Neusoft.HISFC.Models.HealthRecord.DayReport();
                        dr.DateStat           = DateTime.Parse(dtRow["DateStat"].ToString());
                        dr.Dept.ID            = dtRow["DeptID"].ToString();
                        dr.Dept.Name          = dtRow["DeptName"].ToString();
                        dr.BedStandNum        = int.Parse(dtRow["BedStandNum"].ToString());
                        dr.RemainYesterdayNum = int.Parse(dtRow["RemainYesterdayNum"].ToString());
                        dr.InNormalNum        = int.Parse(dtRow["InNormalNum"].ToString());
                        dr.InChangeNum        = int.Parse(dtRow["InChangeNum"].ToString());
                        dr.OutNormalNum       = int.Parse(dtRow["OutNormalNum"].ToString());
                        dr.OutChangeNum       = int.Parse(dtRow["OutChangeNum"].ToString());
                        dr.AccNum             = int.Parse(dtRow["AccNum"].ToString());
                        dr.BanpNum            = int.Parse(dtRow["BanpNum"].ToString());
                        dr.HasRecord          = dtRow["HasRecord"].ToString();
                        al.Add(dr);
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show("保存住院日报信息,生成实体集合时出错!" + e.Message, "提示");
                    return(-1);
                }
            }

            try
            {
                Neusoft.HISFC.BizLogic.HealthRecord.DayReport dayReport;
                dayReport = new Neusoft.HISFC.BizLogic.HealthRecord.DayReport();
                if (dayReport.Save(al) == -1)
                {
                    MessageBox.Show("保存住院日报信息失败!" + dayReport.Err, "提示");
                    return(-1);
                }
            }
            catch (Exception e)
            {
                return(-1);
            }

            //dtDayReport.AcceptChanges();
            //foreach (DataRow  dr in dtDayReport.Rows )
            //{
            //    dr["HasRecord"] = "1";
            //}
            //dtDayReport.AcceptChanges();
            InitFrp(dtDay);
            return(0);
        }