Пример #1
0
        public List <MovieImportData> GetList(MySqlDbConnection myDbCon)
        {
            List <MovieImportData> listData = new List <MovieImportData>();

            MySqlDbConnection dbcon;
            string            sqlcmd = "";

            // 引数にコネクションが指定されていた場合は指定されたコネクションを使用
            if (myDbCon != null)
            {
                dbcon = myDbCon;
            }
            else
            {
                dbcon = new MySqlDbConnection();
            }

            sqlcmd = "SELECT ID, copy_text, KIND, MATCH_PRODUCT, PRODUCT_NUMBER, sell_date, MAKER, TITLE, ACTRESSES, RAR_FLAG, SPLIT_FLAG, NAME_ONLY_FLAG, TAG, FILENAME, CREATED_AT, UPDATED_AT, HD_KIND, movie_file_id, RATING, JAV_POST_DATE, SIZE, PACKAGE, THUMBNAIL, DOWNLOAD_FILES, SEARCH_RESULT, DETAIL, jav_id, is_target, jav_url ";
            sqlcmd = sqlcmd + "FROM import ";
            sqlcmd = sqlcmd + "ORDER BY JAV_POST_DATE ";

            MySqlDataReader reader = null;

            try
            {
                reader = dbcon.GetExecuteReader(sqlcmd);

                do
                {
                    if (reader.IsClosed)
                    {
                        //_logger.Debug("reader.IsClosed");
                        throw new Exception("MOVIE_SITESTOREの取得でreaderがクローズされています");
                    }

                    while (reader.Read())
                    {
                        MovieImportData data = new MovieImportData();

                        data.Id            = MysqlExportCommon.GetDbInt(reader, 0);
                        data.CopyText      = MysqlExportCommon.GetDbString(reader, 1);
                        data.Kind          = MysqlExportCommon.GetDbInt(reader, 2);
                        data.MatchProduct  = MysqlExportCommon.GetDbString(reader, 3);
                        data.ProductNumber = MysqlExportCommon.GetDbString(reader, 4);
                        data.ProductDate   = MysqlExportCommon.GetDbDateTime(reader, 5);
                        data.StrMaker      = MysqlExportCommon.GetDbString(reader, 6);
                        data.Title         = MysqlExportCommon.GetDbString(reader, 7);
                        data.Actresses     = MysqlExportCommon.GetDbString(reader, 8);
                        data.RarFlag       = Convert.ToBoolean(MysqlExportCommon.GetDbInt(reader, 9));
                        data.SplitFlag     = Convert.ToBoolean(MysqlExportCommon.GetDbInt(reader, 10));
                        data.NameOnlyFlag  = Convert.ToBoolean(MysqlExportCommon.GetDbInt(reader, 11));
                        data.Tag           = MysqlExportCommon.GetDbString(reader, 12);
                        data.Filename      = MysqlExportCommon.GetDbString(reader, 13);
                        data.CreateDate    = MysqlExportCommon.GetDbDateTime(reader, 14);
                        data.UpdateDate    = MysqlExportCommon.GetDbDateTime(reader, 15);
                        data.SetHdKind(MysqlExportCommon.GetDbInt(reader, 16));
                        data.FileId        = MysqlExportCommon.GetDbInt(reader, 17);
                        data.Rating        = MysqlExportCommon.GetDbInt(reader, 18);
                        data.JavPostDate   = MysqlExportCommon.GetDbDateTime(reader, 19);
                        data.Size          = MysqlExportCommon.GetDbLong(reader, 20);
                        data.Package       = MysqlExportCommon.GetDbString(reader, 21);
                        data.Thumbnail     = MysqlExportCommon.GetDbString(reader, 22);
                        data.DownloadFiles = MysqlExportCommon.GetDbString(reader, 23);
                        data.SearchResult  = MysqlExportCommon.GetDbString(reader, 24);
                        data.Detail        = MysqlExportCommon.GetDbString(reader, 25);
                        data.JavId         = MysqlExportCommon.GetDbLong(reader, 26);
                        data.IsTarget      = MysqlExportCommon.GetDbBool(reader, 27);
                        data.JavUrl        = MysqlExportCommon.GetDbString(reader, 28);

                        listData.Add(data);
                    }
                } while (reader.NextResult());
            }
            finally
            {
                reader.Close();
            }

            myDbCon.closeConnection();

            return(listData);
        }
Пример #2
0
        public MovieImportData GetNewest(MySqlDbConnection myDbCon)
        {
            MovieImportData newestData = new MovieImportData();

            MySqlDbConnection dbcon;
            string            sqlcmd = "";

            // 引数にコネクションが指定されていた場合は指定されたコネクションを使用
            if (myDbCon != null)
            {
                dbcon = myDbCon;
            }
            else
            {
                dbcon = new MySqlDbConnection();
            }

            sqlcmd = "SELECT ID, COPY_TEXT, KIND, MATCH_PRODUCT, PRODUCT_NUMBER, SELL_DATE, MAKER, TITLE, ACTRESSES, RAR_FLAG, SPLIT_FLAG, NAME_ONLY_FLAG, TAG, FILENAME, RATING, JAV_POST_DATE, PACKAGE, THUMBNAIL, DOWNLOAD_FILES, jav_id, is_target, CREATED_AT, UPDATED_AT ";
            sqlcmd = sqlcmd + "FROM import ";
            sqlcmd = sqlcmd + "ORDER BY CREATED_AT DESC";

            MySqlDataReader reader = null;

            try
            {
                reader = myDbCon.GetExecuteReader(sqlcmd);

                if (reader.IsClosed)
                {
                    //_logger.Debug("reader.IsClosed");
                    throw new Exception("MOVIE_SITESTOREの取得でreaderがクローズされています");
                }

                if (reader.Read())
                {
                    newestData.Id            = MysqlExportCommon.GetDbInt(reader, 0);
                    newestData.CopyText      = MysqlExportCommon.GetDbString(reader, 1);
                    newestData.Kind          = MysqlExportCommon.GetDbInt(reader, 2);
                    newestData.MatchProduct  = MysqlExportCommon.GetDbString(reader, 3);
                    newestData.ProductNumber = MysqlExportCommon.GetDbString(reader, 4);
                    newestData.ProductDate   = MysqlExportCommon.GetDbDateTime(reader, 5);
                    newestData.StrMaker      = MysqlExportCommon.GetDbString(reader, 6);
                    newestData.Title         = MysqlExportCommon.GetDbString(reader, 7);
                    newestData.Actresses     = MysqlExportCommon.GetDbString(reader, 8);
                    newestData.RarFlag       = Convert.ToBoolean(MysqlExportCommon.GetDbInt(reader, 9));
                    newestData.SplitFlag     = Convert.ToBoolean(MysqlExportCommon.GetDbInt(reader, 10));
                    newestData.NameOnlyFlag  = Convert.ToBoolean(MysqlExportCommon.GetDbInt(reader, 11));
                    newestData.Tag           = MysqlExportCommon.GetDbString(reader, 12);
                    newestData.Filename      = MysqlExportCommon.GetDbString(reader, 13);
                    newestData.Rating        = MysqlExportCommon.GetDbInt(reader, 14);
                    newestData.JavPostDate   = MysqlExportCommon.GetDbDateTime(reader, 15);
                    newestData.Package       = MysqlExportCommon.GetDbString(reader, 16);
                    newestData.Thumbnail     = MysqlExportCommon.GetDbString(reader, 17);
                    newestData.DownloadFiles = MysqlExportCommon.GetDbString(reader, 18);
                    newestData.JavId         = MysqlExportCommon.GetDbLong(reader, 19);
                    newestData.IsTarget      = MysqlExportCommon.GetDbBool(reader, 20);
                    newestData.CreateDate    = MysqlExportCommon.GetDbDateTime(reader, 21);
                    newestData.UpdateDate    = MysqlExportCommon.GetDbDateTime(reader, 22);
                }
            }
            finally
            {
                reader.Close();
            }

            reader.Close();

            myDbCon.closeConnection();

            return(newestData);
        }