コード例 #1
0
        public bool Oyunturu_Insert(OyunTuru user)
        {
            using (TIYATROEntities te = new TIYATROEntities())
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    try
                    {
                        OyunTuru tur = new OyunTuru();

                        tur.OyunTuruID = user.OyunTuruID;
                        tur.OyunTuru1  = user.OyunTuru1;

                        te.OyunTuru.Add(tur);
                        te.SaveChanges();
                        scope.Complete();
                    }
                    catch (Exception)
                    {
                        scope.Dispose();
                    }
                }
            }
            return(true);
        }
コード例 #2
0
        public bool Oyunturu_Delete(OyunTuru user)
        {
            using (TIYATROEntities te = new TIYATROEntities())
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    try
                    {
                        OyunTuru oyuntur = te.OyunTuru.FirstOrDefault(f => f.OyunTuruID == user.OyunTuruID);

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