/*************** Constructor *************/ public MainViewModel() { DAOF = new DAOFacadeSingleton(); SignIn = new RelayCommand(SignInExe, SignInCanExe); SignUp = new RelayCommand(SignUpExe, SignUpCanExe); }
/** *********** Constructor ******** **/ public MovieCardViewModel() { DAOF = new DAOFacadeSingleton(); AddComment = new RelayCommand(AddCommentExe, AddCommentCanExe); Validator = new ValidationHelper(); Validator.AddRequiredRule(() => NoteAdd, "Note obligatoire"); Validator.AddRequiredRule(() => CommentAdd, "Commentaire obligatoire"); }
/************* 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"); }
/************************** 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"); }
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(); }
/** *********** 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); }