コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
 private void TaskEkle_Click(object sender, EventArgs e)
 {   //bu buton ile form2 ekranında girilen tas bilgileri veri tabanına kaydedilmiştir.
     if (ProjeAdi.Text != "")
     {
         //süre tahminini hesaplayan metod çağırılmıştır.
         Tahmin();
         //veri tabanı bağlantısı açılır
         conn.Open();
         //veri tabanının tasks tablosuna form2 ye girilen bilgiler kaydedilir.
         SqlCommand kmt = new SqlCommand("Insert into  Tasks (KartNo,TaskName,PersonelName,Descr,Note,TaskDate,PreDate,RealDate) VALUES  ('" + KartNo.Text + "','" + ProjeAdi.Text + "','" + TeknikUzman.Text + "','" + Aciklama.Text + "','" + Notlar.Text + "','" + Tarih.Text + "','" + TahminiSure.Text + "','" + GerceklesenSure.Text + "')", conn);
         kmt.ExecuteNonQuery();
         //veri tabanı bağlantısı kapanır.
         conn.Close();
         MessageBox.Show("Kayit Eklendi");
     }
     //tekrar giriş yapabilmek için form2 deki alanlar temizlenir.
     KartNo.Clear();
     Tarih.Clear();
     ProjeAdi.Clear();
     TeknikUzman.Clear();
     TahminiSure.Clear();
     GerceklesenSure.Clear();
     Aciklama.Clear();
     Notlar.Clear();
 }
コード例 #5
0
        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();
            }
        }
コード例 #6
0
        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();
            }
        }
コード例 #7
0
        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();
            }
        }
コード例 #8
0
        private Aciklama ornekAciklamaGetir()
        {
            Aciklama a = new Aciklama();

            a.AciklamaKey      = Guid.NewGuid();
            a.AciklamaProperty = "Ornek Aciklama";
            return(a);
        }
コード例 #9
0
        public void Ekle()
        {
            Aciklama    a   = new Aciklama();
            AciklamaDal dal = new AciklamaDal();

            a.AciklamaKey      = Guid.NewGuid();
            a.AciklamaProperty = "Deneme";

            dal.Ekle(a);
        }
コード例 #10
0
        public void Ekle()
        {
            Aciklama   a  = new Aciklama();
            AciklamaBs bs = new AciklamaBs();

            a.AciklamaKey      = Guid.NewGuid();
            a.AciklamaProperty = "Deneme";

            bs.Ekle(a);
        }
コード例 #11
0
        public void Guncelle()
        {
            AciklamaBs      bsWrapper = new AciklamaBs();
            List <Aciklama> liste     = bsWrapper.SorgulaHepsiniGetir();

            if (liste.Count > 0)
            {
                Aciklama m  = liste[0];
                Guid     pk = m.AciklamaKey;
                m.AciklamaProperty = m.AciklamaProperty + "D";
                bsWrapper.Guncelle(m);

                Aciklama veritabanindakiRow = bsWrapper.SorgulaAciklamaKeyIle(pk);
                Assert.AreEqual(veritabanindakiRow.AciklamaProperty, m.AciklamaProperty);
            }
        }
コード例 #12
0
        private void frmHatirlatma_Load(object sender, EventArgs e)
        {
            HatirlatmaAnimsatDurum();

            if (DB.pkHatirlatmaAnimsat == 0)
            {
                BtnKaydet.Text = "Kaydet";
                lueHatirlatmaDurum.EditValue = 1;
                //dateEdit1.DateTime = BasTar;
                //dtBitTarih.DateTime = BitisTarihi;
                Aciklama.Focus();
            }
            else
            {
                BtnKaydet.Text = "Güncelle";
                HatirlatmaGetir();
            }
        }
コード例 #13
0
        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();
            }
        }
コード例 #14
0
    protected void KaydetButton_Click(object sender, EventArgs e)
    {
        Aciklama a = new Aciklama();

        a.AciklamaKey      = Guid.NewGuid();
        a.AciklamaProperty = AciklamaTextBox.Text;

        AciklamaBsWrapper bsWrapper = new AciklamaBsWrapper();

        try
        {
            bsWrapper.Ekle(a);
            MessageBox("Acıklama Başarı ile Kayıt edildi");
        }
        catch (Exception ex)
        {
            MessageBox("Hata Oluştu :" + ex.Message);
        }
    }
コード例 #15
0
        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();
            }
        }
コード例 #16
0
        public void ornekMusteriEkleGuncelleSil()
        {
            AciklamaBs wrapper = new AciklamaBs();
            Aciklama   a       = ornekAciklamaGetir();

            wrapper.Ekle(a);

            Aciklama veritabanindakiRow = wrapper.SorgulaAciklamaKeyIle(a.AciklamaKey);

            AciklamaKolonlariEsitMi(a, veritabanindakiRow);

            a.AciklamaProperty = a.AciklamaProperty + "d";
            wrapper.Guncelle(a);
            veritabanindakiRow = wrapper.SorgulaAciklamaKeyIle(a.AciklamaKey);
            AciklamaKolonlariEsitMi(a, veritabanindakiRow);

            wrapper.Sil(a);
            veritabanindakiRow = wrapper.SorgulaAciklamaKeyIle(a.AciklamaKey);
            Assert.IsNull(veritabanindakiRow);
        }
コード例 #17
0
        static void Main(string[] args)
        {
            Aciklama a = new Aciklama();

            a.AciklamaKey      = Guid.NewGuid();
            a.AciklamaProperty = "Deneme";

            AciklamaBs wrapper = new AciklamaBs();

            wrapper.Ekle(a);


            AdoTemplate template = new AdoTemplate();
            DataTable   dt       = template.DataTableOlustur("SELECT * FROM ORNEKLER.ACIKLAMA");



            //AciklamaBsWrapper wrapper = new AciklamaBsWrapper();
            //Aciklama a = new Aciklama();
            //a.AciklamaKey = Guid.NewGuid();
            //a.AciklamaProperty = "Deneme Atilladan";
            //wrapper.Ekle(a);
        }
コード例 #18
0
 private void AciklamaKolonlariEsitMi(Aciklama p1, Aciklama p2)
 {
     Assert.AreEqual(p1.AciklamaKey, p2.AciklamaKey);
     Assert.AreEqual(p1.AciklamaProperty, p2.AciklamaProperty);
 }