/// <summary>Error Check Before Import
        ///
        /// </summary>
        /// <param name="FilePath">import file path</param>
        /// <returns></returns>
        private bool ErrorCheck(ArrayList FilePath)
        {
            if (!string.IsNullOrWhiteSpace(ucSupplier.UC_Code))
            {
                if (!ucSupplier.SelectData())
                {
                    DSP_MSG("E101", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                    ucSupplier.SetFocus();
                    return(false);
                }
                else if (!psks0103ibl.MakerBrandSelect("MakerCD", "M_MakerBrand", "Where DataSourseMakerCD ='" + ucSupplier.UC_Code + "'"))
                {
                    DSP_MSG("E101", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                    ucSupplier.SetFocus();
                    return(false);
                }
            }
            else
            {
                DSP_MSG("E102", "名前", string.Empty, string.Empty, string.Empty, string.Empty);
                ucSupplier.SetFocus();
                return(false);
            }

            //ErrChkFlg = "0";
            foreach (DataGridViewRow row1 in dgvImportRireki.Rows)
            {
                DataGridViewCheckBoxCell chk1 = row1.Cells["chk1"] as DataGridViewCheckBoxCell;
                DataGridViewCheckBoxCell chk2 = row1.Cells["chk2"] as DataGridViewCheckBoxCell;
                DataGridViewCheckBoxCell chk3 = row1.Cells["chk3"] as DataGridViewCheckBoxCell;

                if (chk1.Value == null)
                {
                    chk1.Value = false;
                }
                if (chk2.Value == null)
                {
                    chk2.Value = false;
                }
                if (chk3.Value == null)
                {
                    chk3.Value = false;
                }

                if (Convert.ToBoolean(chk1.Value) != false && Convert.ToBoolean(chk2.Value) != false)// check「結果」「エラー」
                {
                    DSP_MSG("E126", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                    return(false);
                }
                else if (Convert.ToBoolean(chk3.Value) == false)//Check File Type and Folder path
                {
                    if (FilePath.Count <= 0)
                    {
                        DSP_MSG("E127", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                        return(false);
                    }
                }
                else
                {
                    ErrChkFlg  = "3";
                    Delete_row = row1.Index;
                    return(false);
                }
            }

            if (string.IsNullOrWhiteSpace(cboPatternCD.Text))
            {
                MessageBox.Show("フォーマット Doesn't Exists", "メッセージ");
                return(false);
            }

            if (!(Have_opened_Excel(FilePath)))  // Added by Phyoe Gyi  in 03082019   --- for Checking the imported excel are opened or not?
            {
                MessageBox.Show("Some of the imported files are being used by another process. please close those files to be able to import");
                return(false);
            }
            return(true);
        }
        private bool ErrorCheck()
        {
            if (!string.IsNullOrWhiteSpace(ucSupplier.UC_Code))
            {
                if (!ucSupplier.SelectData())
                {
                    DSP_MSG("E101", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                    ucSupplier.SetFocus();
                    //btnImport.Enabled = false;
                    return(false);
                }
                else if (!psks0103ibl.MakerBrandSelect("MakerCD", "M_MakerBrand", "Where MakerCD='" + ucSupplier.UC_Code + "'"))
                {
                    DSP_MSG("E101", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                    ucSupplier.SetFocus();
                    //btnImport.Enabled = false;
                    return(false);
                }
            }
            else
            {
                //DSP_MSG("E102", "名前", string.Empty, string.Empty, string.Empty, string.Empty);
                ucSupplier.SetFocus();
                //btnImport.Enabled = false;
                return(false);
            }

            ErrChkFlg = "0";
            foreach (DataGridViewRow row1 in dgvImportRireki.Rows)
            {
                DataGridViewCheckBoxCell chk1 = row1.Cells["chk1"] as DataGridViewCheckBoxCell;
                DataGridViewCheckBoxCell chk2 = row1.Cells["chk2"] as DataGridViewCheckBoxCell;
                DataGridViewCheckBoxCell chk3 = row1.Cells["chk3"] as DataGridViewCheckBoxCell;

                if (chk1.Value == null)
                {
                    chk1.Value = false;
                }
                if (chk2.Value == null)
                {
                    chk2.Value = false;
                }
                if (chk3.Value == null)
                {
                    chk3.Value = false;
                }

                if ((bool)chk1.Value != false && (bool)chk2.Value != false)// check「結果」「エラー」
                {
                    DSP_MSG("E126", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                    return(false);
                }
                else if ((bool)chk3.Value == false)//Check File Type and Folder path
                {
                    //if (!File.Exists(getFilePath()))
                    if (getFilePath().Count <= 0)
                    {
                        DSP_MSG("E127", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                        return(false);
                    }
                }
                else
                {
                    ErrChkFlg  = "3";
                    Delete_row = row1.Index;
                    return(false);
                }
            }


            if (string.IsNullOrWhiteSpace(lblFormatCD.Text))
            {
                MessageBox.Show("フォーマット Doesn't Exists", "メッセージ");
                return(false);
            }
            if (psks0103ibl.JANCD_PositionCheck(ucSupplier.UC_Code).Equals("0"))
            {
                MessageBox.Show("JAN Position Not Found!", "メッセージ");
                return(false);
            }

            return(true);
        }