示例#1
0
        public bool Banka_Update(Banka user)
        {
            using (TIYATROEntities te = new TIYATROEntities())
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    try
                    {
                        Banka banka = te.Banka.FirstOrDefault(f => f.BankaID == user.BankaID);

                        banka.BankaID           = user.BankaID;
                        banka.HesapNo           = user.HesapNo;
                        banka.SonKullanmaTarihi = user.SonKullanmaTarihi;
                        banka.guvanlikkodu      = user.guvanlikkodu;
                        banka.IBANNo            = user.IBANNo;
                        banka.BankaAdi          = user.BankaAdi;

                        te.SaveChanges();
                        scope.Complete();
                        return(true);
                    }
                    catch (Exception)
                    {
                        scope.Dispose();
                        return(false);
                    }
                }
            }
        }
示例#2
0
        public bool Banka_Insert(Banka user)
        {
            using (TIYATROEntities te = new TIYATROEntities())
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    try
                    {
                        Banka bnk = new Banka();
                        bnk.BankaID           = user.BankaID;
                        bnk.HesapNo           = user.HesapNo;
                        bnk.SonKullanmaTarihi = user.SonKullanmaTarihi;
                        bnk.guvanlikkodu      = user.guvanlikkodu;
                        bnk.IBANNo            = user.IBANNo;
                        bnk.BankaAdi          = user.BankaAdi;

                        te.Banka.Add(bnk);
                        te.SaveChanges();
                        scope.Complete();
                        return(true);
                    }
                    catch (Exception)
                    {
                        scope.Dispose();
                        return(false);
                    }
                }
            }
        }
示例#3
0
        public bool Banka_Delete(Banka user)
        {
            using (TIYATROEntities te = new TIYATROEntities())
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    try
                    {
                        Banka banka = te.Banka.FirstOrDefault(f => f.BankaID == user.BankaID);

                        te.Banka.Remove(banka);

                        te.SaveChanges();
                        scope.Complete();
                        return(true);
                    }
                    catch (Exception)
                    {
                        scope.Dispose();
                        return(false);
                    }
                }
            }
        }