Beispiel #1
0
        /// <summary>
        /// 判断车型配置是否和数据库中的LoaderCode表中配置重复
        /// 重复弹出重复的配置表对应条目
        /// 不重复弹出null值,注意:还有一种读不到数据的情况,事后要考虑!
        /// </summary>
        private LoaderCode JudgeLoaderCodeRepeat(LoaderCode newLoaderCode, JudgePara judgePara)
        {
            LoaderCode tempLoaderCode;
            object     tempObject = null;
            string     tempString = null, tempLCstr = null;

            if (judgePara == JudgePara.useWholeCode)
            {
                tempLCstr = newLoaderCode.wholeCode;
            }
            if (judgePara == JudgePara.usewholeConfigration)
            {
                tempLCstr = newLoaderCode.wholeConfigration;
            }
            LoaderCodeService loaderCodeService = new LoaderCodeService();

            loaderCodeIdRecord  = (int)loaderCodeService.GetLoaderCodeCount();
            loaderCodeIdRecord += 100;
            for (int id = 100; id < loaderCodeIdRecord; id++)
            {
                if (null == (tempObject = loaderCodeService.GetLoaderCodeDataById(id, (string)paraLCStr[(int)judgePara])))
                {
                    break;
                }
                tempString = tempObject.ToString();
                if (String.Compare(tempString, tempLCstr) == 0)
                {
                    tempLoaderCode = loaderCodeService.ReaderLoaderCodeById(id);
                    return(tempLoaderCode);
                }
            }
            return(null);
        }