コード例 #1
0
ファイル: MyAreaPresenter.cs プロジェクト: ometz2012/Cinema
        //Method that extracts all data to populate the tables
        private void LoadData(LoadDataArgs e)
        {
            IUser UserServices = new UserServices();
            //UserID extraction from DataBase
            Guid UserID = UserServices.GetUserID(e.UserName);

            IList <UserCommentDTO>       ListOfComments       = UserServices.GetAllUserComments(UserID);
            IList <UserRatingDTO>        ListOfRatings        = UserServices.GetAllUserRatings(UserID);
            IList <UserFavoriteMovieDTO> ListOfFavoriteMovies = UserServices.GetFavoriteMoviesByUser(UserID);
            IList <String> ListOfMovies = UserServices.GetMoviesToWhichTheUserCommented(UserID);

            //Data transfer to MyAre MODEL
            Myview.Model.ListOfComments  = new List <CommentLine>();
            Myview.Model.ListOfRatings   = new List <RatingLine>();
            Myview.Model.ListOfFavorites = new List <FavoriteLine>();
            Myview.Model.ListOfMovies    = new List <String>();
            foreach (var item in ListOfComments)
            {
                CommentLine row = new CommentLine();
                row.CommentID      = item.commentID;
                row.MovieTitle     = item.MovieTitle;
                row.CommentContent = item.Content;
                row.MovieID        = item.movieID;
                Myview.Model.ListOfComments.Add(row);
            }

            foreach (var item in ListOfMovies)
            {
                String row1 = null;
                row1 = item;
                bool check = Myview.Model.ListOfMovies.Contains(row1);
                if (!check)
                {
                    Myview.Model.ListOfMovies.Add(row1);
                }
            }

            foreach (var item in ListOfRatings)
            {
                RatingLine row = new RatingLine();
                row.MovieTitle = item.MovieTitle;
                row.Rating     = item.rate.ToString();
                Myview.Model.ListOfRatings.Add(row);
            }



            foreach (var item in ListOfFavoriteMovies)
            {
                FavoriteLine row = new FavoriteLine();
                row.MovieTitle = item.MovieTitle;
                Myview.Model.ListOfFavorites.Add(row);
            }
        }
コード例 #2
0
        //Method that extracts all data to populate the tables
        private void LoadData(EventArgs e)
        {
            //Data Extraction from the database
            Guid UserIDTemp = new Guid();

            UserIDTemp = Guid.Parse("e441de1f-9877-4074-bcd7-7b46bf3a7143");

            IUser UserServices = new UserServices();
            IList <UserCommentDTO>       ListOfComments       = UserServices.GetAllUserComments(UserIDTemp);
            IList <UserRatingDTO>        ListOfRatings        = UserServices.GetAllUserRatings(UserIDTemp);
            IList <UserFavoriteMovieDTO> ListOfFavoriteMovies = UserServices.GetFavoriteMoviesByUser(UserIDTemp);

            //Data transfer to MyAre MODEL
            Myview.Model.ListOfComments  = new List <CommentLine>();
            Myview.Model.ListOfRatings   = new List <RatingLine>();
            Myview.Model.ListOfFavorites = new List <FavoriteLine>();
            foreach (var item in ListOfComments)
            {
                CommentLine row = new CommentLine();
                row.MovieTitle     = item.MovieTitle;
                row.CommentContent = item.Content;
                Myview.Model.ListOfComments.Add(row);
            }

            foreach (var item in ListOfRatings)
            {
                RatingLine row = new RatingLine();
                row.MovieTitle = item.MovieTitle;
                row.Rating     = item.rate.ToString();
                Myview.Model.ListOfRatings.Add(row);
            }



            foreach (var item in ListOfFavoriteMovies)
            {
                FavoriteLine row = new FavoriteLine();
                row.MovieTitle = item.MovieTitle;
                Myview.Model.ListOfFavorites.Add(row);
            }



            Myview.Model.ChosenMovie = "It works";
        }
コード例 #3
0
        //Method that extracts all data to populate the tables
        private void LoadData(EventArgs e)
        {
            //Data Extraction from the database
               Guid UserIDTemp = new Guid();
               UserIDTemp=Guid.Parse( "e441de1f-9877-4074-bcd7-7b46bf3a7143");

               IUser UserServices = new UserServices();
               IList<UserCommentDTO> ListOfComments = UserServices.GetAllUserComments(UserIDTemp);
               IList<UserRatingDTO> ListOfRatings = UserServices.GetAllUserRatings(UserIDTemp);
               IList<UserFavoriteMovieDTO> ListOfFavoriteMovies = UserServices.GetFavoriteMoviesByUser(UserIDTemp);

               //Data transfer to MyAre MODEL
               Myview.Model.ListOfComments = new List<CommentLine>();
               Myview.Model.ListOfRatings = new List<RatingLine>();
               Myview.Model.ListOfFavorites = new List<FavoriteLine>();
               foreach (var item in ListOfComments)
               {
               CommentLine row = new CommentLine();
               row.MovieTitle = item.MovieTitle;
               row.CommentContent = item.Content;
               Myview.Model.ListOfComments.Add(row);
               }

               foreach (var item in ListOfRatings)
               {
               RatingLine row = new RatingLine();
               row.MovieTitle = item.MovieTitle;
               row.Rating = item.rate.ToString();
               Myview.Model.ListOfRatings.Add(row);

               }

               foreach (var item in ListOfFavoriteMovies)
               {
               FavoriteLine row = new FavoriteLine();
               row.MovieTitle = item.MovieTitle;
               Myview.Model.ListOfFavorites.Add(row);
               }

               Myview.Model.ChosenMovie = "It works";
        }
コード例 #4
0
        //Method that extracts all data to populate the tables
        private void LoadData(LoadDataArgs e)
        {
            IUser UserServices = new UserServices();
            //UserID extraction from DataBase
            Guid UserID = UserServices.GetUserID(e.UserName);

            IList<UserCommentDTO> ListOfComments = UserServices.GetAllUserComments(UserID);
            IList<UserRatingDTO> ListOfRatings = UserServices.GetAllUserRatings(UserID);
            IList<UserFavoriteMovieDTO> ListOfFavoriteMovies = UserServices.GetFavoriteMoviesByUser(UserID);
            IList<String> ListOfMovies = UserServices.GetMoviesToWhichTheUserCommented(UserID);

            //Data transfer to MyAre MODEL
            Myview.Model.ListOfComments = new List<CommentLine>();
            Myview.Model.ListOfRatings = new List<RatingLine>();
            Myview.Model.ListOfFavorites = new List<FavoriteLine>();
            Myview.Model.ListOfMovies = new List<String>();
            foreach (var item in ListOfComments)
            {
                CommentLine row = new CommentLine();
                row.CommentID = item.commentID;
                row.MovieTitle = item.MovieTitle;
                row.CommentContent = item.Content;
                row.MovieID = item.movieID;
                Myview.Model.ListOfComments.Add(row);
            }

            foreach (var item in ListOfMovies)
            {
                String row1 = null;
                row1 = item;
                bool check = Myview.Model.ListOfMovies.Contains(row1);
                if (!check)
                {
                    Myview.Model.ListOfMovies.Add(row1);
                }
            }

            foreach (var item in ListOfRatings)
            {
                RatingLine row = new RatingLine();
                row.MovieTitle = item.MovieTitle;
                row.Rating = item.rate.ToString();
                Myview.Model.ListOfRatings.Add(row);

            }

            foreach (var item in ListOfFavoriteMovies)
            {
                FavoriteLine row = new FavoriteLine();
                row.MovieTitle = item.MovieTitle;
                Myview.Model.ListOfFavorites.Add(row);
            }
        }