public void DbUpdate(DbConnection myDbCon)
        {
            string sqlCommand = "UPDATE MOVIE_SITECONTENTS ";
            sqlCommand += "SET SITE_NAME = @pSiteName, NAME = @pName, PARENT_PATH = @pParentPath, MOVIE_NEWDATE = @pMovieNewDate, MOVIE_COUNT = @pMovieCount, PHOTO_COUNT = @pPhotoCount, EXTENSION = @pExtension ";
            sqlCommand += "WHERE ID = @pId ";

            MovieFileContentsParent parent = new MovieFileContentsParent();

            SqlCommand command = new SqlCommand();

            command = new SqlCommand(sqlCommand, myDbCon.getSqlConnection());

            SqlParameter[] sqlparams = new SqlParameter[8];
            // Create and append the parameters for the Update command.
            sqlparams[0] = new SqlParameter("@pSiteName", SqlDbType.VarChar);
            sqlparams[0].Value = SiteName;

            sqlparams[1] = new SqlParameter("@pName", SqlDbType.VarChar);
            sqlparams[1].Value = Name;

            sqlparams[2] = new SqlParameter("@pParentPath", SqlDbType.VarChar);
            sqlparams[2].Value = ParentPath;

            sqlparams[3] = new SqlParameter("@pMovieNewDate", SqlDbType.DateTime);
            if (MovieNewDate.Year >= 2000)
                sqlparams[3].Value = MovieNewDate;
            else
                sqlparams[3].Value = Convert.DBNull;

            sqlparams[4] = new SqlParameter("@pMovieCount", SqlDbType.VarChar);
            sqlparams[4].Value = MovieCount;

//            sqlparams[4] = new SqlParameter("@pSellDate", SqlDbType.DateTime);
//            if (data.SellDate.Year >= 2000)
//                sqlparams[4].Value = data.SellDate;
//            else
//                sqlparams[4].Value = Convert.DBNull;

            sqlparams[5] = new SqlParameter("@pPhotoCount", SqlDbType.VarChar);
            sqlparams[5].Value = PhotoCount;

            sqlparams[6] = new SqlParameter("@pExtension", SqlDbType.VarChar);
            sqlparams[6].Value = Extension;

            sqlparams[7] = new SqlParameter("@pId", SqlDbType.Int);
            sqlparams[7].Value = Id;

            myDbCon.SetParameter(sqlparams);
            myDbCon.execSqlCommand(sqlCommand);
        }
        public void DbDelete(DbConnection myDbCon)
        {
            string sqlCommand = "DELETE FROM MOVIE_SITECONTENTS ";
            sqlCommand += "WHERE ID = @pId ";

            MovieFileContentsParent parent = new MovieFileContentsParent();

            SqlCommand command = new SqlCommand();

            command = new SqlCommand(sqlCommand, myDbCon.getSqlConnection());

            SqlParameter[] sqlparams = new SqlParameter[1];

            sqlparams[0] = new SqlParameter("@pId", SqlDbType.Int);
            sqlparams[0].Value = Id;

            myDbCon.SetParameter(sqlparams);
            myDbCon.execSqlCommand(sqlCommand);
        }
        /// <summary>
        /// MOVIE_ACTRESSのACTIVITY_DATEを更新する
        /// </summary>
        /// <param name="myDbCon"></param>
        /// <returns></returns>
        public static List<SiteInfo> UpdateGroupInfoActivityDate(DateTime myUpdateDate, GroupInfo myTargetInfo, DbConnection myDbCon)
        {
            List<SiteInfo> listSiteInfo = new List<SiteInfo>();

            string cmdUpdate = "update MOVIE_ACTRESS set ACTIVITY_DATE = @pActivityDate where ID = @pId";

            SqlParameter[] sqlparams = new SqlParameter[2];

            sqlparams[0] = new SqlParameter("@pActivityDate", SqlDbType.DateTime);
            sqlparams[0].Value = myUpdateDate;

            sqlparams[1] = new SqlParameter("@pId", SqlDbType.Int);
            sqlparams[1].Value = myTargetInfo.id;

            myDbCon.openConnection();

            myDbCon.SetParameter(sqlparams);
            myDbCon.execSqlCommand(cmdUpdate);

            myDbCon.closeConnection();

            return listSiteInfo;
        }
        public void DbExport(DbConnection myDbCon)
        {
            string sqlCommand = "INSERT MOVIE_SITECONTENTS ";
            sqlCommand += "( SITE_NAME, NAME, PARENT_PATH, MOVIE_NEWDATE, MOVIE_COUNT, PHOTO_COUNT, EXTENSION ) ";
            sqlCommand += "VALUES( @pSiteName, @pName, @pParentPath, @pMovieNewDate, @pMovieCount, @pPhotoCount, @pExtension )";

            SqlCommand command = new SqlCommand();

            command = new SqlCommand(sqlCommand, myDbCon.getSqlConnection());

            SqlParameter[] sqlparams = new SqlParameter[7];
            // Create and append the parameters for the Update command.
            sqlparams[0] = new SqlParameter("@pSiteName", SqlDbType.VarChar);
            sqlparams[0].Value = SiteName;

            sqlparams[1] = new SqlParameter("@pName", SqlDbType.VarChar);
            sqlparams[1].Value = Name;

            sqlparams[2] = new SqlParameter("@pParentPath", SqlDbType.VarChar);
            sqlparams[2].Value = ParentPath;

            sqlparams[3] = new SqlParameter("@pMovieNewDate", SqlDbType.DateTime);
            if (MovieNewDate.Year >= 2000)
                sqlparams[3].Value = MovieNewDate;
            else
                sqlparams[3].Value = Convert.DBNull;

            sqlparams[4] = new SqlParameter("@pMovieCount", SqlDbType.VarChar);
            sqlparams[4].Value = MovieCount;

            sqlparams[5] = new SqlParameter("@pPhotoCount", SqlDbType.VarChar);
            sqlparams[5].Value = PhotoCount;

            sqlparams[6] = new SqlParameter("@pExtension", SqlDbType.VarChar);
            sqlparams[6].Value = Extension;

            myDbCon.SetParameter(sqlparams);
            myDbCon.execSqlCommand(sqlCommand);
        }
        /// <summary>
        /// MOVIE_SITESTOREのID一致ROWを削除する
        /// </summary>
        /// <param name="myDbCon"></param>
        /// <returns></returns>
        public static void DeleteSiteStore(SiteStore myTargetData, DbConnection myDbCon)
        {
            List<SiteInfo> listSiteInfo = new List<SiteInfo>();

            string cmdUpdate = "DELETE FROM MOVIE_SITESTORE WHERE ID = @pId";

            SqlParameter[] sqlparams = new SqlParameter[1];

            sqlparams[0] = new SqlParameter("@pId", SqlDbType.Int);
            sqlparams[0].Value = myTargetData.Id;

            myDbCon.openConnection();

            myDbCon.SetParameter(sqlparams);
            myDbCon.execSqlCommand(cmdUpdate);

            myDbCon.closeConnection();

            return;
        }
        /// <summary>
        /// MOVIE_SITESTOREに行の更新をする
        /// </summary>
        /// <param name="myDbCon"></param>
        /// <returns></returns>
        public static void UpdateSiteStore(SiteStore myTargetData, DbConnection myDbCon)
        {
            List<SiteInfo> listSiteInfo = new List<SiteInfo>();

            string cmdUpdate = "UPDATE MOVIE_SITESTORE SET NAME = @pName, LABEL = @pLabel, EXPLANATION = @pExplanation, KIND = @pKind WHERE ID = @pId";

            SqlParameter[] sqlparams = new SqlParameter[5];

            sqlparams[0] = new SqlParameter("@pName", SqlDbType.VarChar);
            sqlparams[0].Value = myTargetData.Name;

            sqlparams[1] = new SqlParameter("@pLabel", SqlDbType.VarChar);
            sqlparams[1].Value = myTargetData.Label;

            sqlparams[2] = new SqlParameter("@pExplanation", SqlDbType.VarChar);
            sqlparams[2].Value = myTargetData.Explanation;

            sqlparams[3] = new SqlParameter("@pKind", SqlDbType.Int);
            sqlparams[3].Value = myTargetData.Kind;

            sqlparams[4] = new SqlParameter("@pId", SqlDbType.Int);
            sqlparams[5].Value = myTargetData.Id;

            myDbCon.openConnection();

            myDbCon.SetParameter(sqlparams);
            myDbCon.execSqlCommand(cmdUpdate);

            myDbCon.closeConnection();

            return;
        }
        /// <summary>
        /// MOVIE_SITESTOREに行を作成する
        /// </summary>
        /// <param name="myDbCon"></param>
        /// <returns></returns>
        public static void InsertSiteStore(SiteStore myTargetData, DbConnection myDbCon)
        {
            List<SiteInfo> listSiteInfo = new List<SiteInfo>();

            string cmdUpdate = "INSERT INTO MOVIE_SITESTORE(NAME, LABEL, EXPLANATION, KIND) VALUES (@pName, @pLabel, @pExplanation, @pKind)";

            SqlParameter[] sqlparams = new SqlParameter[4];

            sqlparams[0] = new SqlParameter("@pName", SqlDbType.VarChar);
            sqlparams[0].Value = myTargetData.Name;

            sqlparams[1] = new SqlParameter("@pLabel", SqlDbType.VarChar);
            sqlparams[1].Value = myTargetData.Label;

            sqlparams[2] = new SqlParameter("@pExplanation", SqlDbType.VarChar);
            sqlparams[2].Value = myTargetData.Explanation;

            sqlparams[3] = new SqlParameter("@pKind", SqlDbType.Int);
            sqlparams[3].Value = myTargetData.Kind;

            myDbCon.openConnection();

            myDbCon.SetParameter(sqlparams);
            myDbCon.execSqlCommand(cmdUpdate);

            myDbCon.closeConnection();

            return;
        }
        public void DbDelete(DbConnection myDbCon)
        {
            string sqlCommand = "DELETE FROM MOVIE_FILES WHERE ID = @pId";
            SqlCommand command = new SqlCommand();

            command = new SqlCommand(sqlCommand, myDbCon.getSqlConnection());

            SqlParameter[] sqlparams = new SqlParameter[1];
            // Create and append the parameters for the Update command.
            sqlparams[0] = new SqlParameter("@pId", SqlDbType.VarChar);
            sqlparams[0].Value = Id;

            myDbCon.SetParameter(sqlparams);
            myDbCon.execSqlCommand(sqlCommand);

            return;
        }
        public void DbExport(DbConnection myDbCon)
        {
            string sqlCommand = "INSERT INTO MOVIE_FILES (NAME, SIZE, FILE_DATE, LABEL, SELL_DATE, PRODUCT_NUMBER, FILE_COUNT, EXTENSION) VALUES( @pName, @pSize, @pFileDate, @pLabel, @pSellDate, @pProductNumber, @pFileCount, @pExtension )";
            SqlCommand command = new SqlCommand();

            command = new SqlCommand(sqlCommand, myDbCon.getSqlConnection());

            SqlParameter[] sqlparams = new SqlParameter[8];
            // Create and append the parameters for the Update command.
            sqlparams[0] = new SqlParameter("@pName", SqlDbType.VarChar);
            sqlparams[0].Value = Name;

            sqlparams[1] = new SqlParameter("@pSize", SqlDbType.Decimal);
            sqlparams[1].Value = Size;

            sqlparams[2] = new SqlParameter("@pFileDate", SqlDbType.DateTime);
            sqlparams[2].Value = FileDate;

            sqlparams[3] = new SqlParameter("@pLabel", SqlDbType.VarChar);
            sqlparams[3].Value = Label;

            sqlparams[4] = new SqlParameter("@pSellDate", SqlDbType.DateTime);
            if (SellDate.Year >= 2000)
                sqlparams[4].Value = SellDate;
            else
                sqlparams[4].Value = Convert.DBNull;

            sqlparams[5] = new SqlParameter("@pProductNumber", SqlDbType.VarChar);
            sqlparams[5].Value = ProductNumber;

            sqlparams[6] = new SqlParameter("@pFileCount", SqlDbType.Int);
            sqlparams[6].Value = FileCount;

            sqlparams[7] = new SqlParameter("@pExtension", SqlDbType.VarChar);
            sqlparams[7].Value = Extension;

            myDbCon.SetParameter(sqlparams);
            myDbCon.execSqlCommand(sqlCommand);

            return;
        }