Esempio n. 1
0
        public static ViewerProfileEntity SearchViewerProfileByIdDAL(int id)
        {
            ViewerProfileEntity searchViewerProfile = new ViewerProfileEntity();

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();

                var ObjViewerProfile = ObjContext.ViewerProfiles.Find(id);
                if (ObjViewerProfile != null)
                {
                    searchViewerProfile.ViewersId = ObjViewerProfile.ViewersId;
                    searchViewerProfile.FirstName = ObjViewerProfile.FirstName;
                    searchViewerProfile.LastName  = ObjViewerProfile.LastName;
                    searchViewerProfile.MobileNo  = ObjViewerProfile.MobileNo;
                    searchViewerProfile.EmailId   = ObjViewerProfile.EmailId;
                    searchViewerProfile.UserName  = ObjViewerProfile.UserName;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading searching data", ex);
            }
            return(searchViewerProfile);
        }
Esempio n. 2
0
        //public static List<ViewerProfile> GetAllViewerProfilesDAL()
        //{
        //    List<ViewerProfile> ObjViewerProfileList = new List<ViewerProfile>();


        //    try
        //    {
        //        CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
        //        var Query = from ViewerProfile in ObjContext.ViewerProfiles
        //                    select ViewerProfile;
        //        ViewerProfile ObjTempViewerProfile = null;
        //        foreach (var obj in Query)
        //        {
        //            ObjTempViewerProfile = new ViewerProfile();
        //            ObjTempViewerProfile.ViewersId = obj.ViewersId;
        //            ObjTempViewerProfile.FirstName = obj.FirstName;
        //            ObjTempViewerProfile.LastName = obj.LastName;
        //            ObjTempViewerProfile.MobileNo = obj.MobileNo;
        //            ObjTempViewerProfile.EmailId = obj.EmailId;
        //            ObjTempViewerProfile.UserName = obj.UserName;

        //            ObjViewerProfileList.Add(ObjTempViewerProfile);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw new MovieExceptions("Error : Reading data", ex);
        //    }

        //    return ObjViewerProfileList;
        //}


        //public static bool UpdateViewerProfileDAL(ViewerProfile updateViewerProfile)
        //{
        //    bool viewerProfileUpdated = false;
        //    try
        //    {
        //        CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
        //        var ObjViewerProfile = ObjContext.ViewerProfiles.Find(updateViewerProfile.ViewersId);
        //        if (ObjViewerProfile != null)
        //        {
        //            ObjViewerProfile.FirstName = updateViewerProfile.FirstName;
        //            ObjViewerProfile.LastName = updateViewerProfile.LastName;
        //            ObjViewerProfile.MobileNo = updateViewerProfile.MobileNo;
        //            ObjViewerProfile.EmailId = updateViewerProfile.EmailId;
        //            ObjViewerProfile.UserName = updateViewerProfile.UserName;


        //            int NoOfRowsAffected = ObjContext.SaveChanges();
        //            viewerProfileUpdated = NoOfRowsAffected > 0;
        //        }
        //        else
        //        {
        //            viewerProfileUpdated = false;
        //        }


        //    }
        //    catch (Exception ex)
        //    {
        //        throw new MovieExceptions(ex.Message);
        //    }
        //    return viewerProfileUpdated;
        //}
        public static ViewerProfileEntity SearchViewerProfileByUsernameDAL(string id)
        {
            ViewerProfileEntity searchViewerProfile = new ViewerProfileEntity();

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
                var query = from item in ObjContext.ViewerProfiles
                            where item.UserName.Equals(id)
                            select item;
                ViewerProfile profile          = query.FirstOrDefault();
                int           Viewerid         = profile.ViewersId;
                var           ObjViewerProfile = ObjContext.ViewerProfiles.Find(Viewerid);
                if (ObjViewerProfile != null)
                {
                    searchViewerProfile.ViewersId = ObjViewerProfile.ViewersId;
                    searchViewerProfile.FirstName = ObjViewerProfile.FirstName;
                    searchViewerProfile.LastName  = ObjViewerProfile.LastName;
                    searchViewerProfile.MobileNo  = ObjViewerProfile.MobileNo;
                    searchViewerProfile.EmailId   = ObjViewerProfile.EmailId;
                    searchViewerProfile.UserName  = ObjViewerProfile.UserName;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading searching data", ex);
            }
            return(searchViewerProfile);
        }
Esempio n. 3
0
        public static bool AddViewerProfilesDAL(ViewerProfileEntity newViewerProfile)
        {
            bool viewerProfileAdded = false;

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
                var ObjViewerProfile           = new ViewerProfile();


                ObjViewerProfile.FirstName = newViewerProfile.FirstName;
                ObjViewerProfile.LastName  = newViewerProfile.LastName;
                ObjViewerProfile.MobileNo  = newViewerProfile.MobileNo;
                ObjViewerProfile.EmailId   = newViewerProfile.EmailId;
                ObjViewerProfile.UserName  = newViewerProfile.UserName;

                ObjContext.ViewerProfiles.Add(ObjViewerProfile);
                int NoOfRowsAffected = ObjContext.SaveChanges();
                if (NoOfRowsAffected > 0)
                {
                    newViewerProfile.ViewersId = ObjViewerProfile.ViewersId;
                    viewerProfileAdded         = true;
                }
                else
                {
                    viewerProfileAdded = false;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions(ex.Message);
            }
            return(viewerProfileAdded);
        }
Esempio n. 4
0
        public static bool AddScreenLayout(int showId)
        {
            bool layoutAdded = false;

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
                var objSeatLayout = new ShowSeatLayout();
                objSeatLayout.ShowId   = showId;
                objSeatLayout.LayoutId = showId;

                objSeatLayout.UnavailableSeats = string.Empty;

                ObjContext.ShowSeatLayouts.Add(objSeatLayout);
                int NoOfRowsAffected = ObjContext.SaveChanges();
                if (NoOfRowsAffected > 0)
                {
                    layoutAdded = true;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading data", ex);
            }
            return(layoutAdded);
        }
Esempio n. 5
0
        public bool SignUpUserDAL(UserEntity newUser)
        {
            bool userAdded = false;

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
                var ObjUser = new User();

                ObjUser.UserName = newUser.UserName;
                ObjUser.Password = newUser.Password;
                ObjContext.Users.Add(ObjUser);
                int NoOfRowsAffected = ObjContext.SaveChanges();
                if (NoOfRowsAffected > 0)
                {
                    newUser.UserName = ObjUser.UserName;
                    userAdded        = true;
                }
                else
                {
                    userAdded = false;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading data", ex);
            }
            return(userAdded);
        }
Esempio n. 6
0
        public bool AddMovieDAL(MovyEntity newMovie)
        {
            try
            {
                bool isAdded    = false;
                var  ObjContext = new CinestarEntitiesDAL();
                var  objMovie   = new Movy();
                objMovie.MovieId          = newMovie.MovieId;
                objMovie.MovieName        = newMovie.MovieName;
                objMovie.MovieUrl         = newMovie.MovieUrl;
                objMovie.ReleaseDate      = newMovie.ReleaseDate;
                objMovie.GenreId          = newMovie.GenreId;
                objMovie.LanguageId       = newMovie.LanguageId;
                objMovie.MovieDescription = newMovie.MovieDescription;

                ObjContext.Movies.Add(objMovie);
                int NoOfrowsAffected = ObjContext.SaveChanges();
                if (NoOfrowsAffected > 0)
                {
                    isAdded = true;
                }

                return(isAdded);
            }
            catch (Exception Ex)
            {
                return(false);
            }
        }
Esempio n. 7
0
        public static ShowEntity SearchShowByIdDAL(int id)
        {
            ShowEntity searchShow = new ShowEntity();

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();

                var ObjShow = ObjContext.Shows.Find(id);
                if (ObjShow != null)
                {
                    searchShow.ScreenId = ObjShow.ScreenId;
                    searchShow.MovieId  = ObjShow.MovieId;
                    searchShow.Price    = ObjShow.Price;
                    searchShow.ShowDate = ObjShow.ShowDate;
                    searchShow.ShowId   = ObjShow.ShowId;
                    searchShow.ShowTime = ObjShow.ShowTime;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading searching data", ex);
            }
            return(searchShow);
        }
Esempio n. 8
0
        public bool CreateTicketDAL(TicketEntity newTicket)
        {
            bool ticketAdded = false;

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
                Ticket ObjTicket = new Ticket();
                ObjTicket.NoOfTickets     = newTicket.NoOfTickets;
                ObjTicket.ShowId          = newTicket.ShowId;
                ObjTicket.Price           = newTicket.Price;
                ObjTicket.ViewersId       = newTicket.ViewersId;
                ObjTicket.TransactionDate = newTicket.TransactionDate;
                ObjTicket.MovieId         = newTicket.MovieId;
                ObjTicket.Seats           = newTicket.Seats;


                ObjContext.Tickets.Add(ObjTicket);
                int NoOfRowsAffected = ObjContext.SaveChanges();
                if (NoOfRowsAffected > 0)
                {
                    ticketAdded = true;
                }
                else
                {
                    ticketAdded = false;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading data", ex);
            }
            return(ticketAdded);
        }
Esempio n. 9
0
        public List <UserEntity> GetAllUsersDAL()
        {
            List <UserEntity> ObjUserList = new List <UserEntity>();


            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
                var Query = from User in ObjContext.Users
                            select User;
                UserEntity ObjTempUser = null;
                foreach (var obj in Query)
                {
                    ObjTempUser = new UserEntity();

                    ObjTempUser.UserName = obj.UserName;
                    ObjTempUser.Password = obj.Password;

                    ObjUserList.Add(ObjTempUser);
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading data", ex);
            }

            return(ObjUserList);
        }
Esempio n. 10
0
        public List <ShowEntityNew> ViewAllShowsAdminDAL()
        {
            List <ShowEntityNew> result     = new List <ShowEntityNew>();
            CinestarEntitiesDAL  ObjContext = new CinestarEntitiesDAL();
            var Objshow = new ShowEntity();


            var ObjMovieList = from Shows in ObjContext.Shows
                               join Movie in ObjContext.Movies
                               on Shows.MovieId equals Movie.MovieId
                               join Screen in ObjContext.Screens
                               on Shows.ScreenId equals Screen.ScreenId
                               select new ShowEntityNew
            {
                Movie    = Movie.MovieName,
                Screen   = Screen.ScreenName,
                Price    = Shows.Price,
                ShowDate = Shows.ShowDate,
                ShowId   = Shows.ShowId,
                ShowTime = Shows.ShowTime
            };

            foreach (var item in ObjMovieList)
            {
                ShowEntityNew temp = new ShowEntityNew();
                temp.Movie    = item.Movie;
                temp.Price    = item.Price;
                temp.Screen   = item.Screen;
                temp.ShowDate = item.ShowDate;
                temp.ShowId   = item.ShowId;
                temp.ShowTime = item.ShowTime;
                result.Add(temp);
            }
            return(result);
        }
Esempio n. 11
0
        public bool DeleteShowDAL(int deleteShowID)
        {
            bool showDeleted = false;

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
                var objShow = new Show();
                objShow = ObjContext.Shows.Find(deleteShowID);

                if (objShow != null)
                {
                    ObjContext.Shows.Remove(objShow);
                    int NoOfRowsAffected = ObjContext.SaveChanges();
                    showDeleted = NoOfRowsAffected > 0;
                }
                else
                {
                    showDeleted = false;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading data", ex);
            }
            return(showDeleted);
        }
Esempio n. 12
0
        public bool UpdateShowDAL(ShowEntity updateShow)
        {
            bool showUpdated = false;

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
                var objShow = new Show();
                objShow = ObjContext.Shows.Find(updateShow.ShowId);

                if (objShow != null)
                {
                    objShow.ShowDate = updateShow.ShowDate;
                    objShow.ShowTime = updateShow.ShowTime;
                    objShow.MovieId  = updateShow.MovieId;
                    objShow.Price    = updateShow.Price;
                    objShow.ScreenId = updateShow.ScreenId;

                    int NoOfRowsAffected = ObjContext.SaveChanges();
                    showUpdated = NoOfRowsAffected > 0;
                }
                else
                {
                    showUpdated = false;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading data", ex);
            }
            return(showUpdated);
        }
Esempio n. 13
0
        public bool AddShowDAL(ShowEntity newShow)
        {
            bool showAdded = false;

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
                var Objshow = new Show();
                Objshow.ShowDate = newShow.ShowDate;
                Objshow.ShowTime = newShow.ShowTime;
                Objshow.MovieId  = newShow.MovieId;
                Objshow.Price    = newShow.Price;
                Objshow.ScreenId = newShow.ScreenId;
                ObjContext.Shows.Add(Objshow);
                int  NoOfRowsAffected = ObjContext.SaveChanges();
                bool showLayoutAdded  = ShowSeatLayoutDAL.AddScreenLayout(Objshow.ShowId);

                if (NoOfRowsAffected > 0 && showLayoutAdded)
                {
                    showAdded = true;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading data", ex);
            }
            return(showAdded);
        }
Esempio n. 14
0
        public List <TicketEntityNew> MyTicketsDAL(int id)
        {
            var objcontext = new CinestarEntitiesDAL();
            var query      = from tickets in objcontext.Tickets
                             join movie in objcontext.Movies
                             on tickets.MovieId equals movie.MovieId
                             join show in objcontext.Shows
                             on tickets.ShowId equals show.ShowId
                             join viewer in objcontext.ViewerProfiles
                             on tickets.ViewersId equals viewer.ViewersId
                             where tickets.ViewersId == id
                             select new TicketEntityNew
            {
                Movie           = movie.MovieName,
                NoOfTickets     = tickets.NoOfTickets,
                Price           = tickets.Price,
                Seats           = tickets.Seats,
                ShowDate        = show.ShowDate,
                Ticketid        = tickets.Ticketid,
                TransactionDate = tickets.TransactionDate,
                ViewerName      = viewer.FirstName + " " + viewer.LastName
            };


            return(query.ToList());
        }
Esempio n. 15
0
        public bool GiveFeedbackDAL(FeedbackEntity newFeedback)
        {
            try
            {
                bool isAdded     = false;
                var  ObjContext  = new CinestarEntitiesDAL();
                var  objFeedback = new Feedback();
                objFeedback.FeedbackId      = newFeedback.FeedbackId;
                objFeedback.FeedbackDetails = newFeedback.FeedbackDetails;
                objFeedback.ViewersId       = newFeedback.ViewersId;

                ObjContext.Feedbacks.Add(objFeedback);
                int NoOfrowsAffected = ObjContext.SaveChanges();
                if (NoOfrowsAffected > 0)
                {
                    isAdded = true;
                }

                return(isAdded);
            }
            catch (Exception Ex)
            {
                return(false);
            }
        }
Esempio n. 16
0
        public List <FeedbackEntityNew> ViewAllFeedbackDAL()
        {
            var objcontext = new CinestarEntitiesDAL();
            var query      = from feedback in objcontext.Feedbacks
                             join viewer in objcontext.ViewerProfiles
                             on feedback.ViewersId equals viewer.ViewersId
                             select new FeedbackEntityNew {
                Viewer          = viewer.FirstName + " " + viewer.LastName,
                FeedbackDetails = feedback.FeedbackDetails,
                FeedbackId      = feedback.FeedbackId
            };

            return(query.ToList());
        }
Esempio n. 17
0
        public LanguageEntity SearchLanguage(int langId)
        {
            var            ObjContext = new CinestarEntitiesDAL();
            Language       ObjLang    = ObjContext.Languages.Find(langId);
            LanguageEntity feedback   = new LanguageEntity();

            if (ObjLang != null)
            {
                feedback.LanguageId   = ObjLang.LanguageId;
                feedback.LanguageName = ObjLang.LanguageName;
            }


            return(feedback);
        }
Esempio n. 18
0
        public GenreEntity SearchGenre(int genreId)
        {
            var         ObjContext = new CinestarEntitiesDAL();
            Genre       ObjLang    = ObjContext.Genres.Find(genreId);
            GenreEntity genre      = new GenreEntity();

            if (ObjLang != null)
            {
                genre.GenreId   = ObjLang.GenreId;
                genre.GenreName = ObjLang.GenreName;
            }


            return(genre);
        }
Esempio n. 19
0
        public static ShowSeatLayoutEntity ReturnSeatLayoutDAL(int showId)
        {
            CinestarEntitiesDAL cinestar = new CinestarEntitiesDAL();
            var query = from item in cinestar.ShowSeatLayouts
                        where item.ShowId == showId
                        select item;

            ShowSeatLayout       layout = query.FirstOrDefault();
            ShowSeatLayoutEntity entity = new ShowSeatLayoutEntity();

            entity.LayoutId         = layout.LayoutId;
            entity.ShowId           = layout.ShowId;
            entity.UnavailableSeats = layout.UnavailableSeats;
            return(entity);
        }
Esempio n. 20
0
        public FeedbackEntity SearchFeedbackDAL(int feedbackId)
        {
            var            ObjContext  = new CinestarEntitiesDAL();
            var            objFeedback = ObjContext.Feedbacks.Find(feedbackId);
            FeedbackEntity feedback    = new FeedbackEntity();

            if (objFeedback != null)
            {
                feedback.FeedbackId      = objFeedback.FeedbackId;
                feedback.FeedbackDetails = objFeedback.FeedbackDetails;
                feedback.ViewersId       = objFeedback.ViewersId;
            }


            return(feedback);
        }
Esempio n. 21
0
        public List <LanguageEntity> ViewAllLanguageDAL()
        {
            List <LanguageEntity> objGenreList = new List <LanguageEntity>();
            var objcontext = new CinestarEntitiesDAL();
            var query      = from s in objcontext.Languages
                             select s;
            LanguageEntity objGenre = null;

            foreach (var newGenre in query)
            {
                objGenre              = new LanguageEntity();
                objGenre.LanguageId   = newGenre.LanguageId;
                objGenre.LanguageName = newGenre.LanguageName;

                objGenreList.Add(objGenre);
            }
            return(objGenreList);
        }
Esempio n. 22
0
        public bool DeleteMovieDAL(int movieId)
        {
            bool isDeleted  = false;
            var  objContext = new CinestarEntitiesDAL();
            var  objMovie   = objContext.Movies.Find(movieId);

            if (objMovie != null)
            {
                objContext.Movies.Remove(objMovie);
                int NoofRowsAffected = objContext.SaveChanges();
                isDeleted = (NoofRowsAffected > 0);
            }
            else
            {
                isDeleted = false;
            }
            return(isDeleted);
        }
Esempio n. 23
0
        public List <ScreenEntity> ViewAllScreenDAL()
        {
            List <ScreenEntity> ObjLanguageList = new List <ScreenEntity>();
            var objcontext = new CinestarEntitiesDAL();
            var query      = from s in objcontext.Screens
                             select s;
            ScreenEntity objLanguageL = null;

            foreach (var newGenre in query)
            {
                objLanguageL            = new ScreenEntity();
                objLanguageL.ScreenId   = newGenre.ScreenId;
                objLanguageL.ScreenName = newGenre.ScreenName;

                ObjLanguageList.Add(objLanguageL);
            }
            return(ObjLanguageList);
        }
Esempio n. 24
0
        public static MovyEntity SearchMovieByIdDAL(int id)
        {
            CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();

            var movieQuery = from item in ObjContext.Movies
                             where item.MovieId == id
                             select item;
            Movy       movie  = ObjContext.Movies.Find(id);
            MovyEntity entity = new MovyEntity();

            entity.GenreId          = movie.GenreId;
            entity.LanguageId       = movie.LanguageId;
            entity.MovieDescription = movie.MovieDescription;
            entity.MovieId          = movie.MovieId;
            entity.MovieName        = movie.MovieName;
            entity.MovieUrl         = movie.MovieUrl;
            entity.ReleaseDate      = movie.ReleaseDate;
            return(entity);
        }
Esempio n. 25
0
        public static TicketEntity SearchTicketById(int id)
        {
            TicketEntity objTicket = new TicketEntity();

            var    objcontext = new CinestarEntitiesDAL();
            Ticket ticket     = objcontext.Tickets.Find(id);

            objTicket.MovieId         = ticket.MovieId;
            objTicket.Price           = ticket.Price;
            objTicket.NoOfTickets     = ticket.NoOfTickets;
            objTicket.ShowId          = ticket.ShowId;
            objTicket.Ticketid        = ticket.Ticketid;
            objTicket.TransactionDate = ticket.TransactionDate;
            objTicket.ViewersId       = ticket.ViewersId;
            objTicket.Seats           = ticket.Seats;



            return(objTicket);;
        }
Esempio n. 26
0
        public bool UpdateMovieDAL(MovyEntity updateMovie)
        {
            bool movieUpdated = false;
            var  ObjContext   = new CinestarEntitiesDAL();
            var  objMovie     = ObjContext.Movies.Find(updateMovie.MovieId);

            if (objMovie != null)
            {
                objMovie.MovieId          = updateMovie.MovieId;
                objMovie.MovieName        = updateMovie.MovieName;
                objMovie.MovieUrl         = updateMovie.MovieUrl;
                objMovie.ReleaseDate      = updateMovie.ReleaseDate;
                objMovie.GenreId          = updateMovie.GenreId;
                objMovie.LanguageId       = updateMovie.LanguageId;
                objMovie.MovieDescription = updateMovie.MovieDescription;
                int NoofRowsAffected = ObjContext.SaveChanges();
                movieUpdated = (NoofRowsAffected > 0);
            }
            return(movieUpdated);
        }
Esempio n. 27
0
        public static bool UpdateLayoutDAL(ShowSeatLayoutEntity layout)
        {
            CinestarEntitiesDAL cinestar   = new CinestarEntitiesDAL();
            ShowSeatLayout      seatLayout = new ShowSeatLayout();

            seatLayout.LayoutId              = layout.LayoutId;
            seatLayout.ShowId                = layout.ShowId;
            seatLayout.UnavailableSeats      = layout.UnavailableSeats;
            cinestar.Entry(seatLayout).State = EntityState.Modified;
            int rowsaffected = cinestar.SaveChanges();

            if (rowsaffected > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 28
0
        public static ScreenEntity SearchScreenByIdDAL(int id)
        {
            ScreenEntity searchScreen = new ScreenEntity();

            try
            {
                CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();

                var ObjScreen = ObjContext.Screens.Find(id);
                if (ObjScreen != null)
                {
                    searchScreen.ScreenId   = ObjScreen.ScreenId;
                    searchScreen.ScreenName = ObjScreen.ScreenName;
                }
            }
            catch (Exception ex)
            {
                throw new MovieExceptions("Error : Reading searching data", ex);
            }
            return(searchScreen);
        }
Esempio n. 29
0
        public bool LoginUserDAL(UserEntity userlogin)
        {
            CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();
            User test = ObjContext.Users.Find(userlogin.UserName);

            if (test != null)
            {
                if (test.UserName.Equals(userlogin.UserName) && test.Password.Equals(userlogin.Password))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Esempio n. 30
0
        public List <MovyEntityNew> GetAllMoviesDAL()
        {
            List <MovyEntityNew> result = new List <MovyEntityNew>();

            CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL();

            var ObjMovieList = from Movie in ObjContext.Movies
                               join Genre in ObjContext.Genres
                               on Movie.GenreId equals Genre.GenreId
                               join Language in ObjContext.Languages
                               on Movie.LanguageId equals Language.LanguageId
                               select new MovyEntityNew {
                Genre            = Genre.GenreName,
                Language         = Language.LanguageName,
                MovieDescription = Movie.MovieDescription,
                MovieId          = Movie.MovieId,
                MovieName        = Movie.MovieName,
                MovieUrl         = Movie.MovieUrl,
                ReleaseDate      = Movie.ReleaseDate
            };


            foreach (var item in ObjMovieList)
            {
                MovyEntityNew entity = new MovyEntityNew();
                entity.Genre            = item.Genre;
                entity.Language         = item.Language;
                entity.MovieDescription = item.MovieDescription;
                entity.MovieId          = item.MovieId;
                entity.MovieName        = item.MovieName;
                entity.MovieUrl         = item.MovieUrl;
                entity.ReleaseDate      = item.ReleaseDate;
                result.Add(entity);
            }



            return(result);
        }