예제 #1
0
 public tblSirket sirketiGetir(int id)
 {
     try
     {
         tblSirket sirket = uow.SirketRepository.GetById(id);
         return(sirket);
     }
     catch (Exception)
     {
         return(null);
     }
 }
        public int SirketEkle(tblSirket s)
        {
            try
            {
                int deger = sirket.sirketEkle(s);

                return(deger);
            }
            catch (Exception)
            {
                return(0);
            }
        }
예제 #3
0
 public bool sirketSil(tblSirket s)
 {
     try
     {
         uow.SirketRepository.Remove(s);
         uow.commit();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #4
0
 public bool sirketGuncelle(tblSirket s)
 {
     try
     {
         uow.SirketRepository.Update(s);
         uow.commit();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public IHttpActionResult Post(tblSirket sirket)
 {
     try
     {
         uow.SirketRepository.sirketEkle(sirket);
         uow.Commit();
         return(Ok(new { results = sirket }));
     }
     catch (Exception e)
     {
         HttpResponseMessage errorResponse = new HttpResponseMessage(HttpStatusCode.BadGateway);
         errorResponse.ReasonPhrase = e.Message;
         throw new HttpResponseException(errorResponse);
     }
 }
예제 #6
0
        public int sirketEkle(tblSirket s)
        {
            try
            {
                uow.SirketRepository.kullaniciEkle(s);
                uow.commit();

                int id = uow.SirketRepository.ıdGetiAd(s.sirketAdi);
                if (id == 0)
                {
                    return(0);
                }
                else
                {
                    return(id);
                }
            }
            catch (Exception)
            {
                return(0);
            }
        }
 public IHttpActionResult Delete(int id)
 {
     try
     {
         if (uow.SirketRepository.GetById(id) == null)
         {
             return(NotFound());
         }
         else
         {
             tblSirket sirket = uow.SirketRepository.GetById(id);
             uow.SirketRepository.Remove(sirket);
             uow.Commit();
             return(Ok(new { results = sirket }));
         }
     }
     catch (Exception e)
     {
         HttpResponseMessage errorResponse = new HttpResponseMessage(HttpStatusCode.BadGateway);
         errorResponse.ReasonPhrase = e.Message;
         throw new HttpResponseException(errorResponse);
     }
 }
 public bool sirketUpdate(tblSirket s)
 {
     return(sirket.sirketGuncelle(s));
 }
 public bool sirketDelete(tblSirket s)
 {
     return(sirket.sirketSil(s));
 }