private int CheckData(string strITEM, string strBARCODE, string strPERIOD_BARCODE, string strPRICES, string strCOVER_PRICE, string strCOST_PRICE)
        {
            //檢查匯入項目為 1:新增 2:異動 3:既有品項
            int iResult = 0;
            bool bExistBARCODE = false;        //期別主檔1段碼存在否           (只用BARCODE查詢)
            bool bExistPERIOD_BARCODE = false; //期別主檔2段碼存在否(1段碼存在)(只用BARCODE查詢)
            bool bExistPERIOD = false;        //期別主檔2段碼存在 (用ITEM和2段碼查詢)
            bool bExistItem = false;           //商品主檔存在對應商品品號
            DataTable dt = null;
            ArrayList ParameterList = new ArrayList();

            DBO.MKT_ChainItemInfoDBO dbo = new MKT_ChainItemInfoDBO(ref USEDB);
            //用一段碼查詢期別主檔
            ParameterList.Clear();
            ParameterList.Add("");
            ParameterList.Add(strBARCODE);
            ParameterList.Add("");
            ParameterList.Add("");
            dt = dbo.doQueryITM_PERIOD(ParameterList);
            if (dt.Rows.Count > 0)
            {
                bExistBARCODE = true;
                DataRow[] FindRows = dt.Select("PERIOD_BARCODE='" + strPERIOD_BARCODE + "' or PERIOD_BARCODE is null");
                if (FindRows.Length > 0)
                {
                    bExistPERIOD_BARCODE = true;
                }
            }
            //用品號和二段碼查詢期別主檔           
            ParameterList.Clear();
            ParameterList.Add(strITEM);
            ParameterList.Add("");
            ParameterList.Add(strPERIOD_BARCODE);
            ParameterList.Add("");
            dt = dbo.doQueryITM_PERIOD(ParameterList);
            if (dt.Rows.Count > 0)
            {
                bExistPERIOD = true;
            }

            //查詢商品主檔是否存在品號
            ParameterList.Clear();
            ParameterList.Add(strITEM);
            dt = dbo.doQueryITM_ITEM(ParameterList);
            if (dt.Rows.Count > 0)
            {
                bExistItem = true;
            }

            if ((bExistItem == true) && (bExistBARCODE == false) && (bExistPERIOD == true))
            {
                //1. 商品主檔存在對應商品品號,但  2段碼符合,1段碼不符=>註記原因:調價。
                iResult = 2;//異動品項
            }
            else if ((bExistPERIOD_BARCODE == true) && (bExistBARCODE == true) && (bExistItem == true))
            {

                //假如是異動品項 要判斷是否為調價
                ParameterList.Clear();
                ParameterList.Add(strITEM);
                ParameterList.Add(strBARCODE);
                ParameterList.Add(strPERIOD_BARCODE);
                ParameterList.Add("");
                DataTable dtIPM = dbo.doQueryITM_PERIOD(ParameterList);
                if (dtIPM.Rows.Count > 0)
                {
                    string strIPM_Price = dtIPM.Rows[0]["PRICE"].ToString();
                    if (
                        (strIPM_Price != strPRICES) ||
                        (strIPM_Price != strCOVER_PRICE) ||
                        (strIPM_Price != strCOST_PRICE)
                       )
                    {
                        iResult = 2;//異動品項 調價
                    }
                    else
                    {
                        //1. 商品主檔存在對應品號,且商品期別檔之2段碼、1段碼均相符者。 
                        //   並將[通路對照號]回寫到[期別通路檔]對應通路對照號的通路品號。
                        iResult = 3;//即有品項
                    }
                }
                else
                {
                    //1. 商品主檔存在對應品號,且商品期別檔之2段碼、1段碼均相符者。 
                    //   並將[通路對照號]回寫到[期別通路檔]對應通路對照號的通路品號。
                    iResult = 3;//即有品項
                }

            }
            else
            {
                iResult = 4;//應該不會有這個狀況
            }

            return iResult;
        }