コード例 #1
0
ファイル: JuncRev.cs プロジェクト: chijianfeng/PNManager
        /// <summary>
        /// select command.
        /// </summary>
        /// <returns></returns>
        private bool DoSelect()
        {
            TJuncInfo    juncinfo    = new TJuncInfo(_dbpath, PassWord);
            TJuncExtInfo juncextinfo = new TJuncExtInfo(_dbpath, PassWord);

            if (JuncName != null && JuncName.Length > 0)
            {
                ListJunc = juncinfo.Sel_JuncInfo(JuncName);
                if (ListJunc == null)
                {
                    return(false);
                }
                ListJuncExt = new List <CJuncExtInfo>();
                foreach (CJuncInfo junc in ListJunc)
                {
                    List <CJuncExtInfo> tmplist = juncextinfo.Sel_JuncExtInfo(junc.ID);
                    if (tmplist != null && tmplist.Count > 0)
                    {
                        ListJuncExt.Add(tmplist.ElementAt(0));
                    }
                }
            }
            else
            {
                CJuncInfo ji = juncinfo.Sel_JuncInfo(ID);
                ListJunc = new List <CJuncInfo>();
                if (ji != null)
                {
                    ListJunc.Add(ji);
                }

                ListJuncExt = new List <CJuncExtInfo>();
                foreach (CJuncInfo junc in ListJunc)
                {
                    List <CJuncExtInfo> tmplist = juncextinfo.Sel_JuncExtInfo(junc.ID);
                    if (tmplist != null && tmplist.Count > 0)
                    {
                        ListJuncExt.Add(tmplist.ElementAt(0));
                    }
                }
            }

            return(true);
        }
コード例 #2
0
ファイル: JuncRev.cs プロジェクト: chijianfeng/PNManager
        /// <summary>
        /// 删除检查井信息,同时删除检查井附加信息
        /// </summary>
        /// <returns></returns>
        private bool DoDelete()
        {
            if (ListJunc == null)
            {
                return(false);
            }

            TJuncInfo    juncinfo    = new TJuncInfo(_dbpath, PassWord);
            TJuncExtInfo juncextinfo = new TJuncExtInfo(_dbpath, PassWord);

            foreach (CJuncInfo junc in ListJunc)
            {
                juncinfo.Delete_JuncInfo(junc);
                List <CJuncExtInfo> list = juncextinfo.Sel_JuncExtInfo(junc.ID);
                if (list != null && list.Count > 0)
                {
                    juncextinfo.Delete_JuncExtInfo(list.ElementAt(0));
                }
            }
            return(true);
        }