예제 #1
0
        /*************** Constructor *************/
        public MainViewModel()
        {
            DAOF = new DAOFacadeSingleton();

            SignIn = new RelayCommand(SignInExe, SignInCanExe);
            SignUp = new RelayCommand(SignUpExe, SignUpCanExe);
        }
예제 #2
0
 /** *********** Constructor ******** **/
 public MovieCardViewModel()
 {
     DAOF       = new DAOFacadeSingleton();
     AddComment = new RelayCommand(AddCommentExe, AddCommentCanExe);
     Validator  = new ValidationHelper();
     Validator.AddRequiredRule(() => NoteAdd, "Note obligatoire");
     Validator.AddRequiredRule(() => CommentAdd, "Commentaire obligatoire");
 }
예제 #3
0
        /************* Constructor **********/
        public AccountCreatorViewModel()
        {
            DAOF = new DAOFacadeSingleton();

            AccountCreator = new RelayCommand(AccountCreatorExe, AccountCreatorCanExe);
            Validator      = new ValidationHelper();
            Validator.AddRequiredRule(() => Login, "Login obligatoire");
            Validator.AddRequiredRule(() => Mdp, "Mot de passe obligatoire");
        }
예제 #4
0
 /************************** Constructor ********************/
 public CreateMovieViewModel()
 {
     DAOF        = new DAOFacadeSingleton();
     CreateMovie = new RelayCommand(CreateMovieExe, CreateMovieCanExe);
     UpdateMovie = new RelayCommand(UpdateMovieExe, UpdateMovieCanExe);
     Validator   = new ValidationHelper();
     Validator.AddRequiredRule(() => Summary, "Sommaire obligatoire");
     Validator.AddRequiredRule(() => Genre, "Genre obligatoire");
     Validator.AddRequiredRule(() => Title, "Titre obligatoire");
 }
예제 #5
0
        public void deleteMovy(Movy movy)
        {
            DAOFacadeSingleton DAOF = new DAOFacadeSingleton();

            if (movy.Avis.Count != 0)
            {
                foreach (Avi a in movy.Avis.ToList())
                {
                    Avi aa = DAOF.getAvi(a.Id);
                    DMCCTX.ctx.Avis.Attach(aa);
                    DMCCTX.ctx.Avis.Remove(aa);
                }
            }

            DMCCTX.ctx.Movies.Attach(movy);
            DMCCTX.ctx.Movies.Remove(movy);

            DMCCTX.ctx.SaveChanges();
        }
예제 #6
0
        /** *********** Constructor ******** **/
        public HomeViewModel()
        {
            DAOF = new DAOFacadeSingleton();
            List <Movy> mls = new List <Movy>();

            mls = DAOF.getAllMovys();
            if (mls.Count != 0)
            {
                SelectedMovie = mls.First();
            }


            foreach (Movy currentMovie in mls)
            {
                _movieList.Add(currentMovie);
            }

            DeleteMovie       = new RelayCommand(DeleteMovieExe, DeleteMovieCanExe);
            AddMovie          = new RelayCommand(AddMovieExe, AddMovieCanExe);
            ModificationMovie = new RelayCommand(ModificationMovieExe, ModificationMovieCanExe);
            ConsultationMovie = new RelayCommand(ConsultationMovieExe, ConsultationMovieCanExe);
        }