示例#1
0
        /// <summary>
        /// 删除管道的基本信息,同时删除其他关联信息,
        /// :附加信息,管道检测信息,管道日志,图片,报告,视频信息
        /// </summary>
        /// <returns></returns>
        private bool DoDelete()
        {
            TPipeInfo pipeinfo = new TPipeInfo(_dbpath, PassWord);
            TPipeExtInfo pipextinfo = new TPipeExtInfo(_dbpath, PassWord);
            TUSInfo usinfo = new TUSInfo(_dbpath, PassWord);

            if (ListPipe == null || ListPipe.Count == 0)
                return false;

            foreach (CPipeInfo pipe in ListPipe)
            {
                pipeinfo.Delete_PipeInfo(pipe);
                
                CPipeExtInfo ext = null;
                ListPipeExt = pipextinfo.Sel_PipeExtInfo(pipe.ID);
                if (ListPipeExt != null && ListPipeExt.Count > 0)
                    ext = ListPipeExt.ElementAt(0);
                pipextinfo.Delete_PipeExtInfo(ext);

                CUSInfo us = null;
                ListUS = usinfo.Sel_USInfo(pipe.ID);
                if (ListUS!=null && ListUS.Count > 0)
                    us = ListUS.ElementAt(0);
                usinfo.Delete_USInfo(us);
            }

            return true;
        }
示例#2
0
        /// <summary>
        /// 根据管道名称获取管道信息,附加信息;管道检测信息,管道日志,图片,报告,视频信息
        /// </summary>
        /// <returns></returns>
        private bool DoSelect()
        {
            if (PipeName == null || PipeName.Length <= 0)
                return false;
            TPipeInfo pipeinfo = new TPipeInfo(_dbpath, PassWord);
            TPipeExtInfo pipextinfo = new TPipeExtInfo(_dbpath, PassWord);
            TUSInfo usinfo = new TUSInfo(_dbpath, PassWord);

            ListPipe = pipeinfo.Sel_PipeInfo(PipeName);
            if (ListPipe == null || ListPipe.Count <= 0)
                return false;

            ListPipeExt = new List<CPipeExtInfo>();
            ListUS = new List<CUSInfo>();

            foreach(CPipeInfo pipe in ListPipe)
            {
                int id = pipe.ID;
                List<CPipeExtInfo> list1 = pipextinfo.Sel_PipeExtInfo(id);
                if (list1 != null && list1.Count > 0)
                {
                    ListPipeExt.Add(list1.ElementAt(0));
                }
                List<CUSInfo> list2 = usinfo.Sel_USInfo(id);
                if (list2 != null && list2.Count > 0)
                {
                    ListUS.Add(list2.ElementAt(0));
                }
            }
            return true;
        }