Пример #1
0
 public bool UpdateSirket(Sirket entity)
 {
     try
     {
         bool isSuccess;
         using (var repo = new SirketRepository())
         {
             isSuccess = repo.Update(entity);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         throw new Exception("SirketBusiness:SirketRepository:Güncelleme Hatası", ex);
     }
 }
Пример #2
0
 public Sirket SirketIdSec(int sirketId)
 {
     try
     {
         Sirket responseEntitiy = null;
         using (var repo = new SirketRepository())
         {
             responseEntitiy = repo.IdSec(sirketId);
         }
         return(responseEntitiy);
     }
     catch (Exception ex)
     {
         throw new Exception("SirketBusiness:SirketRepository:Seçme Hatası", ex);
     }
 }
Пример #3
0
 public bool InsertSirket(Sirket entity)
 {
     try
     {
         bool isSuccess;
         using (var repo = new SirketRepository())
         {
             isSuccess = repo.Insert(entity);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         throw new Exception("SOABusiness:SirketBusiness::InsertSirket::Error occured.", ex);
     }
 }
Пример #4
0
 public bool SirketDelete(int SirketId)
 {
     try
     {
         bool isSuccess;
         using (var repo = new SirketRepository())
         {
             isSuccess = repo.Delete(SirketId);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         throw new Exception("SirketBusiness::SirketRepository:Silme Hatası", ex);
     }
 }
Пример #5
0
 public bool DeleteSirketById(int ID)
 {
     try
     {
         bool isSuccess;
         using (var repo = new SirketRepository())
         {
             isSuccess = repo.DeletedById(ID);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("BusinessLogic:SirketBusiness::DeleteSirket::Error occured.", ex);
     }
 }
Пример #6
0
 public bool SirketSilById(int sirketID)
 {
     try
     {
         bool isSuccess;
         using (var repo = new SirketRepository())
         {
             isSuccess = repo.DeletedById(sirketID);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("Business:SirketBusiness::SirketSilById::Hata Oluştu.", ex);
     }
 }
Пример #7
0
 public bool UpdateSirket(Sirket entity)
 {
     try
     {
         bool isSuccess;
         using (var repo = new SirketRepository())
         {
             isSuccess = repo.Update(entity);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("BusinessLogic:SirketBusiness::UpdateSirket::Error occured.", ex);
     }
 }
Пример #8
0
 public bool SirketGuncelle(Sirket sirket)
 {
     try
     {
         bool isSuccess;
         using (var repo = new SirketRepository())
         {
             isSuccess = repo.Update(sirket);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("Business:SirketBusiness::SirketGuncelle::Hata Oluştu.", ex);
     }
 }
Пример #9
0
 public Sirket SirketIdSil(int sirketId)
 {
     try
     {
         using (var repo = new SirketRepository())
         {
             if (repo.IdSil(sirketId))
             {
                 return(repo.IdSec(sirketId));
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         throw new Exception("SirketBusiness:SirketRepository:Silme Hatası", ex);
     }
 }
Пример #10
0
 public Sirket SirketGuncelle(Sirket entity)
 {
     try
     {
         using (var repo = new SirketRepository())
         {
             if (repo.Guncelle(entity))
             {
                 return(entity);
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         throw new Exception("SirketBusiness:SirketRepository:Güncelleme Hatası", ex);
     }
 }
Пример #11
0
        public List <Sirket> SirketHepsiniSec()
        {
            var responseEntities = new List <Sirket>();

            try
            {
                using (var repo = new SirketRepository())
                {
                    foreach (var entity in repo.HepsiniSec())
                    {
                        responseEntities.Add(entity);
                    }
                }
                return(responseEntities);
            }
            catch (Exception ex)
            {
                throw new Exception("SirketBusiness:SirketRepository:Hepsini Seçme Hatası", ex);
            }
        }
Пример #12
0
 public Sirket SelectedIdSirket(int SirketId)
 {
     try
     {
         Sirket responseEntitiy;
         using (var repo = new SirketRepository())
         {
             responseEntitiy = repo.IdSelect(SirketId);
             if (responseEntitiy == null)
             {
                 throw new NullReferenceException("Sirket doesnt exists!");
             }
         }
         return(responseEntitiy);
     }
     catch (Exception ex)
     {
         throw new Exception("SirketBusiness::SelectSirketrById::Error occured.", ex);
     }
 }
Пример #13
0
        public List <Sirket> SelectAllSirket()
        {
            var responseEntities = new List <Sirket>();

            try
            {
                using (var repo = new SirketRepository())
                {
                    foreach (var entity in repo.SelectAll())
                    {
                        responseEntities.Add(entity);
                    }
                }
                return(responseEntities);
            }
            catch (Exception ex)
            {
                throw new Exception("SOABusiness:SirketBusiness::SelectAllSirket::Error occured.", ex);
            }
        }
Пример #14
0
        public List <Sirket> SelectAllSirket()
        {
            var sirketListesi = new List <Sirket>();

            try
            {
                using (var repo = new SirketRepository())
                {
                    foreach (var sirket in repo.SelectAll())
                    {
                        sirketListesi.Add(sirket);
                    }
                }
                return(sirketListesi);
            }
            catch (Exception ex)
            {
                //LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
                throw new Exception("Business:SirketBusiness::SelectAllSirket::Hata Oluştu.", ex);
            }
        }
Пример #15
0
 public Sirket SirketSecById(int sirketID)
 {
     try
     {
         Sirket secilenSirket;
         using (var repo = new SirketRepository())
         {
             secilenSirket = repo.SelectedById(sirketID);
             if (secilenSirket == null)
             {
                 throw new NullReferenceException("Girilen SirketID bulunamadi!");
             }
         }
         return(secilenSirket);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("Business:SirketBusiness::SirketSecById::Hata Oluştu.", ex);
     }
 }
Пример #16
0
        public List <Sirket> SelectAllSirket()
        {
            var responseEntities = new List <Sirket>();

            try
            {
                using (var repo = new SirketRepository())
                {
                    foreach (var entity in repo.SelectAll())
                    {
                        responseEntities.Add(entity);
                    }
                }
                return(responseEntities);
            }
            catch (Exception ex)
            {
                LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
                throw new Exception("BusinessLogic:SirketBusiness::SelectAllSirket::Error occured.", ex);
            }
        }
Пример #17
0
 public Sirket SelectSirketById(int SirketId)
 {
     try
     {
         Sirket responseEntitiy;
         using (var repo = new SirketRepository())
         {
             responseEntitiy = repo.SelectedById(SirketId);
             if (responseEntitiy == null)
             {
                 throw new NullReferenceException("Sirket doesnt exists!");
             }
         }
         return(responseEntitiy);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("BusinessLogic:SirketBusiness::SelectSirketById::Error occured.", ex);
     }
 }
Пример #18
0
 public Sirket SirketLogin(string sirketKullaniciAdi, string sirketSifre)
 {
     try
     {
         Sirket sirket = null;
         using (var repo = new SirketRepository())
         {
             sirket = repo.Login(sirketKullaniciAdi, sirketSifre);
             if (sirket == null)
             {
                 throw new NullReferenceException("Sirket doesnt exists!");
             }
         }
         return(sirket);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("BusinessLogic:SirketBusiness::SirketLogin::Error occured.", ex);
     }
 }
Пример #19
0
 public UnitOfWork(SirketContext context)
 {
     _sirketContext   = context;
     SirketRepository = new SirketRepository(_sirketContext);
 }