Esempio n. 1
0
        public bool Sahne_Update(Sahneler user)
        {
            using (TIYATROEntities te = new TIYATROEntities())
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    try
                    {
                        Sahneler sahneler = te.Sahneler.FirstOrDefault(f => f.SahneId == user.SahneId);

                        sahneler.SahneId      = user.SahneId;
                        sahneler.SahneAdi     = user.SahneAdi;
                        sahneler.OyunlarNo    = user.OyunlarNo;
                        sahneler.SahneAdresi  = user.SahneAdresi;
                        sahneler.SahneTelefon = user.SahneTelefon;
                        sahneler.TiyatroNo    = user.TiyatroNo;

                        te.SaveChanges();
                        scope.Complete();
                    }
                    catch (Exception)
                    {
                        scope.Dispose();
                    }
                }
            }
            return(true);
        }
Esempio n. 2
0
        public bool Sahne_Insert(Sahneler user)
        {
            using (TIYATROEntities te = new TIYATROEntities())
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    try
                    {
                        Sahneler sahne = new Sahneler();

                        sahne.SahneId      = user.SahneId;
                        sahne.SahneAdi     = user.SahneAdi;
                        sahne.OyunlarNo    = user.OyunlarNo;
                        sahne.SahneAdresi  = user.SahneAdresi;
                        sahne.SahneTelefon = user.SahneTelefon;
                        sahne.TiyatroNo    = user.TiyatroNo;

                        te.Sahneler.Add(sahne);
                        te.SaveChanges();
                        scope.Complete();
                    }
                    catch (Exception)
                    {
                        scope.Dispose();
                    }
                }
            }
            return(true);
        }
Esempio n. 3
0
        public bool Sahne_Delete(Sahneler user)
        {
            using (TIYATROEntities te = new TIYATROEntities())
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    try
                    {
                        Sahneler sahneler = te.Sahneler.FirstOrDefault(f => f.SahneId == user.SahneId);

                        te.Sahneler.Remove(sahneler);
                        te.SaveChanges();
                        scope.Complete();
                    }
                    catch (Exception)
                    {
                        scope.Dispose();
                    }
                }
            }
            return(true);
        }