public void OrnekTransactionTemplate() { DenemeGuidIdentity dgi = new DenemeGuidIdentity(); dgi.DenemeKey = Guid.NewGuid(); dgi.DenemeKolon = "Erkan"; Aciklama aciklama = new Aciklama(); aciklama.AciklamaKey = Guid.NewGuid(); try { this.BeginTransaction(); AciklamaDal aciklamaDal = this.GetDalInstance <AciklamaDal, Aciklama>(); long no = dal.Ekle(dgi); long denemeNo = dal.DenemeNoBul(dgi.DenemeKey); aciklama.AciklamaProperty = "" + denemeNo + " " + dgi.DenemeKeyAsString; aciklamaDal.Ekle(aciklama); this.CommitTransaction(); } finally { this.ClearTransactionInformation(); } }
public void TransactionRollBackBekliyoruz() { Musteri m = new Musteri(); m.Adi = "atilla"; m.Soyadi = "ozgur"; m.MusteriKey = Guid.NewGuid(); Aciklama acik = new Aciklama(); acik.AciklamaKey = Guid.NewGuid(); try { this.BeginTransaction(); AciklamaDal aciklamaDal = this.GetDalInstance <AciklamaDal, Aciklama>(); BasitTabloDal btDal = this.GetDalInstance <BasitTabloDal, BasitTablo>(); dal.Ekle(m); aciklamaDal.Ekle(acik); btDal.Guncelle(null); this.CommitTransaction(); } finally { this.ClearTransactionInformation(); } }
public void OrnekTransactionDataTableDondur() { DenemeGuidIdentity dgi = new DenemeGuidIdentity(); dgi.DenemeKey = Guid.NewGuid(); dgi.DenemeKolon = "Erkan"; Aciklama aciklama = new Aciklama(); aciklama.AciklamaKey = Guid.NewGuid(); try { this.BeginTransaction(); AciklamaDal aciklamaDal = this.GetDalInstance <AciklamaDal, Aciklama>(); int no = (int )dal.Ekle(dgi); DataTable dt = dal.SatirGetir(no); aciklama.AciklamaProperty = dt.Rows[0]["DenemeKolon"].ToString(); aciklamaDal.Ekle(aciklama); this.CommitTransaction(); } finally { this.ClearTransactionInformation(); } }
public void TransactionBasarili() { Musteri m = new Musteri(); m.Adi = "atilla"; m.Soyadi = "ozgur"; m.MusteriKey = Guid.NewGuid(); Aciklama acik = new Aciklama(); acik.AciklamaKey = Guid.NewGuid(); acik.AciklamaProperty = m.Adi + " " + m.Soyadi; try { this.BeginTransaction(); AciklamaDal aciklamaDal = this.GetDalInstance <AciklamaDal, Aciklama>(); dal.Ekle(m); aciklamaDal.Ekle(acik); this.CommitTransaction(); } finally { this.ClearTransactionInformation(); } }
public void TemplateTransactionOrnek() { BasitTablo bt = new BasitTablo(); bt.Adi = "Deneme Ad"; bt.Soyadi = "Deneme Soyad"; bt.BasitTabloKey = Guid.NewGuid(); Aciklama aciklama = new Aciklama(); aciklama.AciklamaKey = Guid.NewGuid(); aciklama.AciklamaProperty = bt.Adi + " " + bt.Soyadi; dal.Ekle(bt); try { this.BeginTransaction(); AciklamaDal aciklamaDal = this.GetDalInstance <AciklamaDal, Aciklama>(); dal.AdSoyadiBuyukHarfeCevir(bt.BasitTabloKey); aciklamaDal.Ekle(aciklama); this.CommitTransaction(); } finally { this.ClearTransactionInformation(); } }
public void TransactionBasarili() { BasitTabloIdentity bti = new BasitTabloIdentity(); bti.Adi = "atilla"; bti.Soyadi = "ozgur"; Aciklama acik = new Aciklama(); acik.AciklamaKey = Guid.NewGuid(); acik.AciklamaProperty = bti.Adi + " " + bti.Soyadi; try { this.BeginTransaction(); AciklamaDal aciklamaDal = this.GetDalInstance <AciklamaDal, Aciklama>(); dal.Ekle(bti); aciklamaDal.Ekle(acik); this.CommitTransaction(); } finally { this.ClearTransactionInformation(); } }
public void Ekle() { Aciklama a = new Aciklama(); AciklamaDal dal = new AciklamaDal(); a.AciklamaKey = Guid.NewGuid(); a.AciklamaProperty = "Deneme"; dal.Ekle(a); }
public void TransactionRollBackBekliyoruzAdoTemplateConnectionYonetimiIle() { AdoTemplate adotemplate = new AdoTemplate(); adotemplate.Connection = ConnectionSingleton.Instance.getConnection("KARKAS_ORNEK"); Musteri m = new Musteri(); m.Adi = "Erkan"; m.Soyadi = "UYGUN"; m.MusteriKey = Guid.NewGuid(); Aciklama acik = new Aciklama(); acik.AciklamaKey = Guid.NewGuid(); // bilerek aciklama yazmiyoruzki transaction veritabaninda rollback etsin. //acik.AciklamaPropertyAsString = "Aciklama"; try { adotemplate.OtomatikConnectionYonetimi = false; adotemplate.Connection.Open(); adotemplate.CurrentTransaction = (SqlTransaction)adotemplate.Connection.BeginTransaction(); AciklamaDal aciklamaDal = this.GetDalInstance <AciklamaDal, Aciklama>(); dal.Connection = adotemplate.Connection; dal.OtomatikConnectionYonetimi = adotemplate.OtomatikConnectionYonetimi; dal.CurrentTransaction = adotemplate.CurrentTransaction; aciklamaDal.Connection = adotemplate.Connection; aciklamaDal.OtomatikConnectionYonetimi = adotemplate.OtomatikConnectionYonetimi; aciklamaDal.CurrentTransaction = adotemplate.CurrentTransaction; dal.Ekle(m); aciklamaDal.Ekle(acik); adotemplate.CurrentTransaction.Commit(); } finally { //adotemplate.Connection.Close(); this.ClearTransactionInformation(); } }
public void TransactionBasariliAdoTemplateConnectionYonetimiIle() { AdoTemplate adotemplate = new AdoTemplate(); adotemplate.Connection = ConnectionSingleton.Instance.getConnection("KARKAS_ORNEK"); Musteri m = new Musteri(); m.Adi = "Erkan"; m.Soyadi = "UYGUN"; m.MusteriKey = Guid.NewGuid(); Aciklama acik = new Aciklama(); acik.AciklamaKey = Guid.NewGuid(); acik.AciklamaProperty = m.Adi + " " + m.Soyadi; try { adotemplate.OtomatikConnectionYonetimi = false; adotemplate.Connection.Open(); adotemplate.CurrentTransaction = (SqlTransaction)adotemplate.Connection.BeginTransaction(); AciklamaDal aciklamaDal = this.GetDalInstance <AciklamaDal, Aciklama>(); dal.Connection = adotemplate.Connection; dal.OtomatikConnectionYonetimi = adotemplate.OtomatikConnectionYonetimi; dal.CurrentTransaction = adotemplate.CurrentTransaction; aciklamaDal.Connection = adotemplate.Connection; aciklamaDal.OtomatikConnectionYonetimi = adotemplate.OtomatikConnectionYonetimi; aciklamaDal.CurrentTransaction = adotemplate.CurrentTransaction; dal.Ekle(m); aciklamaDal.Ekle(acik); adotemplate.CurrentTransaction.Commit(); } finally { //adotemplate.Connection.Close(); this.ClearTransactionInformation(); } }
public void ornekMusteriEkleGuncelleSil() { AciklamaDal dal = new AciklamaDal(); Aciklama a = ornekAciklamaGetir(); dal.Ekle(a); Aciklama veritabanindakiRow = dal.SorgulaAciklamaKeyIle(a.AciklamaKey); AciklamaKolonlariEsitMi(a, veritabanindakiRow); a.AciklamaProperty = a.AciklamaProperty + "d"; dal.Guncelle(a); veritabanindakiRow = dal.SorgulaAciklamaKeyIle(a.AciklamaKey); AciklamaKolonlariEsitMi(a, veritabanindakiRow); dal.Sil(a); veritabanindakiRow = dal.SorgulaAciklamaKeyIle(a.AciklamaKey); Assert.IsNull(veritabanindakiRow); }