Esempio n. 1
0
        public static DataTable GetByName(string personName, bool isActor = false, bool isDirector = false)
        {
            try
            {
                string joinActor    = string.Empty;
                string joinDirector = string.Empty;

                if (isActor == true)
                {
                    joinActor = @"inner join Actor 
						        on Person.PersonID=Actor.PersonID"                        ;
                }

                if (isDirector == true)
                {
                    joinDirector = @"inner join Director 
                                   on Person.PersonID=Director.PersonID";
                }

                string finalQuery = QueryRepository.Person_Get_By_Name.Replace("@JoinActor", joinActor);
                finalQuery = finalQuery.Replace("@JoinDirector", joinDirector);

                DataTable dtPersons = new DataTable();
                dtPersons = AccessDatabase.Select(finalQuery,
                                                  "@PersonFullName", personName);

                return(dtPersons);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public static DataTable GetByName(string name)
        {
            name = name.Trim();

            DataTable dtLanguages = new DataTable();

            dtLanguages = AccessDatabase.Select(QueryRepository.Language_Get_By_Name, "@LanguageName", name);

            return(dtLanguages);
        }
Esempio n. 3
0
        public static DataTable GetByMovieID(long movieID)
        {
            try
            {
                DataTable dtLanguage = new DataTable();
                dtLanguage = AccessDatabase.Select(QueryRepository.Language_Get_By_MovieID, "@MovieID", movieID);

                return(dtLanguage);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 4
0
        public static DataTable GetList()
        {
            try
            {
                DataTable dtLanguage = new DataTable();
                dtLanguage = AccessDatabase.Select(QueryRepository.Language_Get_List);

                return(dtLanguage);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
        public static DataTable GetDirectorByMovieID(long movieID)
        {
            try
            {
                DataTable dtPerson = new DataTable();
                dtPerson = AccessDatabase.Select(QueryRepository.Director_Get_By_MovieID, "@MovieID", movieID);

                return(dtPerson);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 6
0
        public static DataTable GetByID(long personID)
        {
            try
            {
                DataTable dtPerson = new DataTable();
                dtPerson = AccessDatabase.Select(QueryRepository.Person_Get_By_PersonID, "@PersonID", personID);

                return(dtPerson);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 7
0
        public static DataTable GetByID(long genreID)
        {
            try
            {
                DataTable dtGenre = new DataTable();
                dtGenre = AccessDatabase.Select(QueryRepository.Genre_Get_By_GenreID, "@GenreID", genreID);

                return(dtGenre);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 8
0
        public static DataTable GetByParamID(long paramID)
        {
            try
            {
                DataTable dt = new DataTable();
                dt = AccessDatabase.Select(QueryRepository.Param_Get_By_ParamID,
                                           "@ParamID", paramID);

                return(dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 9
0
        public static DataTable GetByNameExact(string personName)
        {
            try
            {
                DataTable dtPersons = new DataTable();
                dtPersons = AccessDatabase.Select(QueryRepository.Person_Get_By_Name_Exact,
                                                  "@FullName", personName);

                return(dtPersons);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 10
0
        public static DataTable GetByIMDBLink(string imdbLink)
        {
            try
            {
                DataTable dtPersons = new DataTable();
                dtPersons = AccessDatabase.Select(QueryRepository.Person_Get_By_IMDBLink,
                                                  "@IMDBLink", imdbLink);

                return(dtPersons);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 11
0
        public static void GetTypeByID(long personID, out bool isActor, out bool isDirector)
        {
            try
            {
                DataTable dtType = new DataTable();
                dtType = AccessDatabase.Select(QueryRepository.Person_Get_Type_By_PersonID, "@PersonID", personID);

                isActor    = Convert.ToBoolean(Convert.ToInt64(dtType.Rows[0]["IsValid"]));
                isDirector = Convert.ToBoolean(Convert.ToInt64(dtType.Rows[1]["IsValid"]));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 12
0
        public static DataTable GetByName(string name)
        {
            try
            {
                name = name.Trim();

                DataTable dtGenres = new DataTable();
                dtGenres = AccessDatabase.Select(QueryRepository.Genre_Get_By_Name, "@GenreName", name);

                return(dtGenres);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 13
0
        public static DataTable Login(string username, string password)
        {
            try
            {
                DataTable dtUser = new DataTable();
                dtUser = AccessDatabase.Select(QueryRepository.Users_Login,
                                               "@Username", username,
                                               "@PasswordHash", password.GetHashCode());

                return(dtUser);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }