public bool UlkeGuncelle(UlkeTumDTO ul) { try { using (var unitOfWork = new UnitOfWork(new QtekBilisim_MuhasebeContext())) { var temp = unitOfWork.UlkeKayitlari.FindData(ul.UlkeID); if (temp != null) { temp.AktifMi = ul.AktifMi; temp.DilID = ul.DilID; temp.GuncellemeTarih = ul.GuncellemeTarih; temp.SirketID = ul.SirketID; temp.UlkeAd = ul.UlkeAd; temp.KullaniciID = ul.KullaniciID; if (unitOfWork.UlkeKayitlari.IsModified(temp) == true) { int affect = unitOfWork.Complete(); if (affect > 0) { return(true); } else { return(false); } } else { throw new NotModifiedDataOnDatabaseCustomException(); } } else { throw new NullDataOnDatabaseCustomException(); } } } catch (NotImplementedException error) { HataKayitManager.HataKayitEkle(error); throw new MyNotImplementedException(); } catch (DbEntityValidationException error) { HataKayitManager.HataKayitEkle(error); throw new MyDbEntityValidationException(); } catch (ArgumentNullException error) { HataKayitManager.HataKayitEkle(error); throw new MyArgumentNullException(); } catch (ArgumentException error) { HataKayitManager.HataKayitEkle(error); throw new MyArgumentException(); } catch (InvalidOperationException error) { HataKayitManager.HataKayitEkle(error); throw new MyInvalidOperationException(); } catch (NullReferenceException error) { HataKayitManager.HataKayitEkle(error); throw new MyNullReferenceException(); } catch (AggregateException error) { HataKayitManager.HataKayitEkle(error); throw new MyAggregateException(); } catch (FormatException error) { HataKayitManager.HataKayitEkle(error); throw new MyFormatException(); } catch (NullDataOnDatabaseCustomException) { throw new NullDataOnDatabaseCustomException(); } catch (NotModifiedDataOnDatabaseCustomException) { throw new NotModifiedDataOnDatabaseCustomException(); } catch (Exception error) { HataKayitManager.HataKayitEkle(error); throw new Exception(); } }
public bool UlkeEkle(UlkeTumDTO ul) { try { using (var unitOfWork = new UnitOfWork(new QtekBilisim_MuhasebeContext())) { unitOfWork.UlkeKayitlari.AddData(new Ulke() { AktifMi = ul.AktifMi, DilID = ul.DilID, GuncellemeTarih = ul.GuncellemeTarih, KayitTarih = ul.KayitTarih, SilindiMi = ul.SilindiMi, SirketID = ul.SirketID, UlkeAd = ul.UlkeAd, KullaniciID = ul.KullaniciID }); int affect = unitOfWork.Complete(); if (affect > 0) { return(true); } else { return(false); } } } catch (NotImplementedException error) { HataKayitManager.HataKayitEkle(error); throw new MyNotImplementedException(); } catch (DbEntityValidationException error) { HataKayitManager.HataKayitEkle(error); throw new MyDbEntityValidationException(); } catch (ArgumentNullException error) { HataKayitManager.HataKayitEkle(error); throw new MyArgumentNullException(); } catch (ArgumentException error) { HataKayitManager.HataKayitEkle(error); throw new MyArgumentException(); } catch (InvalidOperationException error) { HataKayitManager.HataKayitEkle(error); throw new MyInvalidOperationException(); } catch (NullReferenceException error) { HataKayitManager.HataKayitEkle(error); throw new MyNullReferenceException(); } catch (AggregateException error) { HataKayitManager.HataKayitEkle(error); throw new MyAggregateException(); } catch (FormatException error) { HataKayitManager.HataKayitEkle(error); throw new MyFormatException(); } catch (NullDataOnDatabaseCustomException) { throw new NullDataOnDatabaseCustomException(); } catch (NotModifiedDataOnDatabaseCustomException) { throw new NotModifiedDataOnDatabaseCustomException(); } catch (Exception error) { HataKayitManager.HataKayitEkle(error); throw new Exception(); } }