示例#1
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");
            }
        }
示例#2
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());
        }