예제 #1
0
 public bool Evrk_Durum_Delete(Evrak_Durum a)
 {
     try
     {
         using (TransactionScope ts = new TransactionScope())
         {
             using (SobelediyeEntities sb = new SobelediyeEntities())
             {
                 Evrak_Durum ed = sb.Evrak_Durum.FirstOrDefault(x => x.Durum_ID == a.Durum_ID);
                 sb.Evrak_Durum.Remove(ed);
                 sb.SaveChanges();
                 ts.Complete();
             }
         }
     }
     catch
     {
         return(false);
     }
     return(true);
 }
예제 #2
0
 public bool EvrakDurum_Update(Evrak_Durum a)
 {
     try
     {
         using (TransactionScope ts = new TransactionScope()) //linq ile where primary key'de sql transaction (türleri) scope transaction türleri read commit dirty data darboğaz nedir kullandığın transaction scope'u bil
         {
             using (SobelediyeEntities sb = new SobelediyeEntities())
             {
                 Evrak_Durum ed = sb.Evrak_Durum.FirstOrDefault(x => x.Durum_ID == a.Durum_ID);
                 ed.Durum_ID = a.Durum_ID;
                 ed.Durumu   = a.Durumu;
                 sb.SaveChanges();
                 ts.Complete();
             }
         }
     }
     catch (SystemException ex)
     {
         return(false);
     }
     return(true);
 }
예제 #3
0
 public bool EvrakDurum_Insert(Evrak_Durum a)
 {
     try
     {
         using (TransactionScope ts = new TransactionScope())
         {
             using (SobelediyeEntities sb = new SobelediyeEntities())
             {
                 Evrak_Durum ed = new Evrak_Durum();
                 ed.Durum_ID = a.Durum_ID;
                 ed.Durumu   = a.Durumu;
                 sb.Evrak_Durum.Add(ed);
                 sb.SaveChanges();
                 ts.Complete();
             }
         }
     }
     catch (SystemException ex)
     {
         return(false);
     }
     return(true);
 }