示例#1
0
 public void Kaydet(Havayolu ha)
 {
     try
     {
         DtbUcusEntities ctx = new DtbUcusEntities();
         ctx.tblHavayollaris.Add(new tblHavayollari {
             Id_Havayolu = ha.Id_Havayolu, Havayolu_Adi = ha.Havayolu_Adi
         });
         ctx.SaveChanges();
     }
     catch (SqlException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
 public void HavayoluSil(string Id_Havayolu)
 {
     try
     {
         using (DtbUcusEntities ctx = new DtbUcusEntities())
         {
             tblHavayollari hyl = ctx.tblHavayollaris.Find(Id_Havayolu);
             ctx.tblHavayollaris.Remove(hyl);
             ctx.SaveChanges();
         }
     }
     catch (SqlException ex)
     {
         throw ex;
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#3
0
 public void Guncelle(Havayolu ha)
 {
     try
     {
         using (DtbUcusEntities ctx = new DtbUcusEntities())
         {
             tblHavayollari hbl = ctx.tblHavayollaris.Find(ha.Id_Havayolu);
             hbl.Havayolu_Adi = ha.Havayolu_Adi;
             ctx.Entry <tblHavayollari>(hbl).State = EntityState.Modified;
             ctx.SaveChanges();
         }
     }
     catch (SqlException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }