예제 #1
0
        private void CreareMatriceLocuri_Click(object sender, EventArgs e)
        {
            int    index = -1;
            Button b     = (Button)sender;

            index = Convert.ToInt32(b.Name.Substring(9, b.Name.Length - 9));
            Spectacol s = spectacolRepo.getSpectacole()[index];

            view.setMatriceLocuri(index, spectacolRepo.getBileteBySpectacol(s), MoveMatrice_Event, MatriceLeave_Event, Matrice_Click);
        }
예제 #2
0
        public AdminController(AdminView adminView, UserRepository userRepoModel, SpectacolRepository spectacoleRepoModel)
        {
            view           = adminView;
            userRepo       = userRepoModel;
            spectacoleRepo = spectacoleRepoModel;

            view.logout(Logout_Click);
            view.minimize(Minimize_Click);
            view.populateTable(userRepo.getCasieri(), ModificareCont_Click);
            view.addCasier(InsertCasier_Click);
            view.modificareCasier(UpdateCasier_Click);
            view.stergereCasier(DeleteCasier_Click);

            //spectacole
            view.populateTableSpectacole(spectacoleRepo.getSpectacole(), ModificareSpectacol_Click);
            view.addSpectacol(InsertSpectacol_Click);
            view.modificareSpectacol(UpdateSpectacol_Click);
            view.stergereSpectacol(DeleteSpectacol_Click);

            //actori
            view.populateComboBox();
            view.cautareActoriSpectacol(cautare_Click);
            view.addActor(InsertActor_Click);
            view.modificareActor(UpdateActor_Click);
            view.stergereActor(DeleteActor_Click);
        }
예제 #3
0
        private void InsertSpectacol_Click(object senser, EventArgs e)
        {
            Spectacol s = view.getSpectacol();

            if (s != null)
            {
                spectacoleRepo.operatiiSpectacol(s, 0);
                view.clearSpectacolTextboxes();
                view.populateTableSpectacole(spectacoleRepo.getSpectacole(), ModificareSpectacol_Click);
                view.showMessage("Spectacol adaugat cu succes");
                view.populateComboBox();
            }
            else
            {
                view.showMessage("NU ati completat toate campurile");
            }
        }
예제 #4
0
 public CasierController(CasierView casierView, SpectacolRepository spectacolRepoModel)
 {
     view          = casierView;
     spectacolRepo = spectacolRepoModel;
     view.logout(Logout_Click);
     view.minimize(Minimize_Click);
     view.populateTable(spectacolRepo.getSpectacole(), CreareMatriceLocuri_Click);
     view.buyTicket(Buy_Click);
     view.exportBilet(Export_Click);
     view.showInfoSpectacol(InfoSpectacol_Click);
 }
예제 #5
0
        public void test4()
        {
            //insert spectacol
            Spectacol s = new Spectacol();

            s.Titlu        = "Boema";
            s.Regia        = "Ina Hudea";
            s.Gen          = "Operă";
            s.DataPremiere = "2018-12-27 18:00:00";
            s.NumarBilete  = 75;

            _spectacolRepo.operatiiSpectacol(s, 0);//insert

            List <Spectacol> ls    = _spectacolRepo.getSpectacole();
            Spectacol        stest = ls.Where(x => x.Titlu == s.Titlu).SingleOrDefault();

            s.IdSpectacol  = 6;
            s.DataPremiere = "27.12.2018 18:00:00";

            //System.Windows.MessageBox.Show(stest.ToString());
            //System.Windows.MessageBox.Show(s.ToString());

            Assert.IsTrue(stest.ToString() == s.ToString());
        }