Exemple #1
0
        private bool InsertUs()
        {
            TUSInfo usinfo = new TUSInfo(_dbpath, PassWord);

            usinfo.OpenDB();
            bool ret = usinfo.Insert_USInfo(ListUS);
            usinfo.CloseDB();
            return ret;
        }
Exemple #2
0
        protected int InsterDb(Pipe pipe , Cover injunc , Cover outjunc)
        {
            CPipeInfo pipeInfo = new CPipeInfo();
            CPipeExtInfo pipeExtInfo = new CPipeExtInfo();
            CUSInfo UsInfo = new CUSInfo();
            pipeInfo.PipeName = pipe.Name;
            pipeInfo.In_JunID = injunc.juncInfo.ID;
            pipeInfo.Out_JunID = outjunc.juncInfo.ID;

            pipeInfo.Pipe_Category = pipe.pipeInfo.Pipe_Category;
            UsInfo.Struct_Class = 0;

            TPipeInfo tpipeinfo = new TPipeInfo(App._dbpath, App.PassWord);
            TPipeExtInfo tpipextinfo = new TPipeExtInfo(App._dbpath, App.PassWord);
            TUSInfo tusinfo = new TUSInfo(App._dbpath, App.PassWord);

            tpipeinfo.Insert_PipeInfo(ref pipeInfo);
            pipeExtInfo.PipeID = pipeInfo.ID;
            tpipextinfo.Insert_PipeExtInfo(ref pipeExtInfo);
            UsInfo.PipeID = pipeInfo.ID;
            tusinfo.Insert_USInfo(ref UsInfo);

            return pipeInfo.ID;
        }
Exemple #3
0
        /// <summary>
        /// 插入管道信息,和附加信息,管道检测信息,管道日志,图片,报告,视频信息
        /// </summary>
        /// <returns></returns>
        private bool DoInsert()
        {
            if (ListPipe == null)
                return false;
            TPipeInfo pipeinfo = new TPipeInfo(_dbpath, PassWord);
            TPipeExtInfo pipextinfo = new TPipeExtInfo(_dbpath, PassWord);
            TUSInfo usinfo = new TUSInfo(_dbpath, PassWord);
            

            pipeinfo.OpenDB();
            pipextinfo.OpenDB();
            usinfo.OpenDB();
            

            int i = 0;
            foreach (CPipeInfo pipe in ListPipe)
            {
                CPipeInfo tmp = pipe;
                //插入附加信息
                CPipeExtInfo extmp = null;
                if (!pipeinfo.Insert_PipeInfo(ref tmp))
                {
                    continue;
                }
                if (ListPipeExt == null || ListPipeExt.Count == 0)
                {
                    extmp = new CPipeExtInfo();
                }
                else
                {
                    if (i < ListPipeExt.Count)
                        extmp = ListPipeExt.ElementAt(i);
                    else
                        extmp = new CPipeExtInfo();
                }
                extmp.PipeID = tmp.ID;
                pipextinfo.Insert_PipeExtInfo(ref extmp);

                //插入管道检测信息
                CUSInfo ustmp = null;
                if (ListUS == null || ListUS.Count == 0)
                {
                    ustmp = new CUSInfo();
                }
                else
                {
                    if (i < ListUS.Count)
                        ustmp = ListUS.ElementAt(i);
                    else
                        ustmp = new CUSInfo();
                }
                ustmp.PipeID = tmp.ID;
                usinfo.Insert_USInfo(ref ustmp);
                i++;
            }

            //close the db connection
            pipeinfo.CloseDB();
            pipextinfo.CloseDB();
            usinfo.CloseDB();
           

            return true;
        }