Пример #1
0
        /// <summary>
        /// 更新手术间
        /// </summary>
        /// <param name="room"></param>
        /// <returns></returns>
        public int UpdateOpsRoom(Neusoft.HISFC.Models.Operation.OpsRoom room)
        {
            string strSql   = string.Empty;
            string strValid = Neusoft.FrameWork.Function.NConvert.ToInt32(room.IsValid).ToString();

            if (this.Sql.GetSql("Operator.OpsTableManage.UpdateOpsRoom.1", ref strSql) == -1)
            {
                return(-1);
            }

            try
            {
                strSql = string.Format(strSql, room.Name, room.InputCode,
                                       strValid, room.DeptID, room.OperCode, room.ID);
            }
            catch (Exception ex)
            {
                this.Err     = ex.Message;
                this.ErrCode = ex.Message;
                return(-1);
            }
            if (strSql == null)
            {
                return(-1);
            }

            return(this.ExecNoQuery(strSql));
        }
Пример #2
0
        /// <summary>
        /// 根据科室获得科室下手术间
        /// </summary>
        /// <param name="deptID"></param>
        /// <returns></returns>
        public ArrayList GetRoomsByDept(string deptID)
        {
            ArrayList rooms  = new ArrayList();
            string    strSql = string.Empty;

            if (this.Sql.GetSql("Operator.OpsTableManage.GetRoomsByDept.1", ref strSql) == -1)
            {
                return(rooms);
            }
            try
            {
                strSql = string.Format(strSql, deptID);
            }
            catch (Exception ex)
            {
                this.Err     = ex.Message;
                this.ErrCode = ex.Message;
                return(rooms);
            }
            if (strSql == null)
            {
                return(rooms);
            }
            if (this.ExecQuery(strSql) == -1)
            {
                return(rooms);
            }
            try
            {
                while (Reader.Read())
                {
                    Neusoft.HISFC.Models.Operation.OpsRoom room = new Neusoft.HISFC.Models.Operation.OpsRoom();
                    room.ID        = Reader[2].ToString(); //代码
                    room.Name      = Reader[3].ToString(); //名称
                    room.InputCode = Reader[4].ToString(); //助记码
                    room.DeptID    = deptID;               //所属科室
                    room.IsValid   = Neusoft.FrameWork.Function.NConvert.ToBoolean(Reader[6].ToString());
                    room.OperCode  = Reader[7].ToString();
                    room.OperDate  = Neusoft.FrameWork.Function.NConvert.ToDateTime(Reader[8].ToString());
                    rooms.Add(room);
                }
            }
            catch (Exception ex)
            {
                this.Err     = ex.Message;
                this.ErrCode = ex.Message;
                if (this.Reader.IsClosed == false)
                {
                    Reader.Close();
                }
                return(rooms);
            }

            Reader.Close();
            return(rooms);
        }
Пример #3
0
        /// <summary>
        /// 删除手术间
        /// </summary>
        /// <param name="room"></param>
        /// <returns></returns>
        public int DelOpsRoom(Neusoft.HISFC.Models.Operation.OpsRoom room)
        {
            string strSql = string.Empty;

            if (this.Sql.GetSql("Operator.OpsTableManage.DelOpsRoom.1", ref strSql) == -1)
            {
                return(-1);
            }
            try
            {
                strSql = string.Format(strSql, room.ID);
            }
            catch (Exception ex)
            {
                this.Err     = ex.Message;
                this.ErrCode = ex.Message;
                return(-1);
            }
            if (this.ExecNoQuery(strSql) == -1)
            {
                return(-1);
            }
            //删除手术间下的手术台
            if (this.Sql.GetSql("Operator.OpsTableManage.DelOpsRoom.2", ref strSql) == -1)
            {
                return(-1);
            }
            try
            {
                strSql = string.Format(strSql, room.ID);
            }
            catch (Exception ex)
            {
                this.Err     = ex.Message;
                this.ErrCode = ex.Message;
                return(-1);
            }
            if (this.ExecNoQuery(strSql) == -1)
            {
                return(-1);
            }
            return(0);
        }
Пример #4
0
        public new OpsRoom Clone()
        {
            OpsRoom newOpsRoom = base.Clone() as OpsRoom;

            return(newOpsRoom);
        }