public List <MovieExtendModel> GetByWord(string word, string userID) { if (word.Equals(string.Empty) || word.Equals("")) { throw new ArgumentOutOfRangeException(); } if (userID.Equals(string.Empty) || userID.Equals("")) { throw new ArgumentOutOfRangeException(); } DataTable dt = new DataTable(); List <MovieExtendModel> arrMovie = new List <MovieExtendModel>(); using (SqlCommand command = new SqlCommand()) { dt = GetMultipleQuery(MovieExtendStringsSql.GetByWord(word, userID)); } foreach (DataRow ms in dt.Rows) { arrMovie.Add(MovieExtendModel.ToObject(ms)); } return(arrMovie); }
public MovieExtendModel GetByTitle(string title, string userID) { if (title.Equals(string.Empty) || title.Equals("")) { throw new ArgumentOutOfRangeException(); } if (userID.Equals(string.Empty) || userID.Equals("")) { throw new ArgumentOutOfRangeException(); } DataTable dt = new DataTable(); MovieExtendModel movieModel = new MovieExtendModel(); using (SqlCommand command = new SqlCommand()) { dt = GetMultipleQuery(MovieExtendStringsSql.GetByTitle(title, userID)); } foreach (DataRow ms in dt.Rows) { movieModel = MovieExtendModel.ToObject(ms); } return(movieModel); }
public MovieExtendModel UpdateMovie(MovieExtendModel movieModel) { DataTable dt = new DataTable(); using (SqlCommand command = new SqlCommand()) { dt = GetMultipleQuery(MovieExtendStringsSql.UpdateMovie(movieModel)); } foreach (DataRow ms in dt.Rows) { movieModel = MovieExtendModel.ToObject(ms); } return(movieModel); }