コード例 #1
0
        public ConcurrentIMDBNameParser(uint imdbID)
        {
            person = new ImdbPerson(imdbID);

            mainPageJob = new JobWebPageDownload(Regex.Replace(url, placeholder, imdbID.ToString()));
            this.addJob(mainPageJob);
        }
コード例 #2
0
 public SerialIMDBNameParser(uint imdbID)
 {
     person = new ImdbPerson(imdbID);
 }
コード例 #3
0
 private void initialize(string mainPage, ImdbPerson person)
 {
     this.person = person;
     this.mainPage = mainPage;
 }
コード例 #4
0
 public JobIMDBNameParser(string mainPage, ImdbPerson person)
 {
     this.initialize(mainPage, person);
 }
コード例 #5
0
        public void updateImdbPerson(ImdbPerson person)
        {
            person.idPerson = getIdPersonByImdbId(person.imdbID);
            SQLiteCommand command = new SQLiteCommand(connection);

            command.CommandText = "UPDATE Person SET Name=@Name, " +
                "OriginalName=@OriginalName, " +
                "Biography=@Biography, " +
                "Birthday=@Birthday, " +
                "Deathday=@Deathday, " +
                "gender=@gender, " +
                "CountryofBirth=@CountryofBirth, " +
                "CityofBirth=@CityofBirth, " +
                "lifetimeGross=@lifetimeGross, " +
                "boxofficeAverage=@boxofficeAverage, " +
                "OscarNominations=@OscarNominations, " +
                "OscarWins=@OscarWins, " +
                "OtherNominations=@OtherNominations, " +
                "OtherWins=@OtherWins " +
                " WHERE idPerson=@idPerson";

            var param = new SQLiteParameter("@Name") { Value = person.name };
            command.Parameters.Add(param);
            param = new SQLiteParameter("@OriginalName") { Value = person.birthname };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@Biography") { Value = "" };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@Birthday") { Value = person.birthday };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@Deathday") { Value = person.deathday };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@gender") { Value = person.gender };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@CountryofBirth") { Value = -1 };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@CityofBirth") { Value = "" };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@lifetimeGross") { Value = 0 };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@boxofficeAverage") { Value = -1 };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@OscarNominations") { Value = -1 };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@OscarWins") { Value = -1 };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@OtherNominations") { Value = -1 };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@OtherWins") { Value = -1 };
            command.Parameters.Add(param);
            //TODO
            param = new SQLiteParameter("@idPerson") { Value = person.idPerson };
            command.Parameters.Add(param);

            executeCommandThreadSafe(command);
            if (person.image != null)
            {
                PictureHandler.savePersonPortrait(person.image, person.idPerson);
                person.image.Dispose();
            }
            Console.WriteLine("Done inserting '{0}' in DB", person.name);
        }