Exemple #1
0
        /// <summary>
        /// Gönderilen depo entity'sini veritabanına ekler.
        /// Hata alması durumunda -1 döner.
        /// </summary>
        /// <param name="depo"></param>
        /// <returns></returns>
        public int DepoEkle(DepoDto depo)
        {
            int result = -1;

            DynamicTryCatch.TryCatchLogla(() =>
            {
                result = _uow.GenericRepository <DepoDto>().InsertWithProcedure("Exec Insert_Depo @DepoKodu, @DepoAdi, @AktifMi",
                                                                                new SqlParameter("@DepoKodu", SqlDbType.VarChar)
                {
                    Value = depo.DepoKodu
                },
                                                                                new SqlParameter("@DepoAdi", SqlDbType.VarChar)
                {
                    Value = depo.DepoAdi
                },
                                                                                new SqlParameter("@AktifMi", SqlDbType.Bit)
                {
                    Value = depo.AktifMi
                });

                _uow.Dispose();
            }
                                          , MethodBase.GetCurrentMethod().Name);
            return(result);
        }
Exemple #2
0
 public static void RestartUnitOfWork()
 {
     if (_unitOfWork != null)
     {
         _unitOfWork.Dispose();
     }
     _unitOfWork = new UnitOfWorkBase(ConnectionString);
 }
Exemple #3
0
 protected void Dispose(bool disposing)
 {
     if (!disposing)
     {
         return;
     }
     if (_unitOfWorkSimple == null)
     {
         return;
     }
     _unitOfWorkSimple.Dispose();
 }
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed && disposing) //service.dispose u çağırdıysam demek
     {
         if (unitOfWork != null)
         {
             unitOfWork.Dispose();
         }
         if (repository != null)
         {
             repository.Dispose();
         }
         if (db != null)
         {
             db.Dispose();
         }
     }
     disposed = true;
 }
Exemple #5
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed && disposing)
     {
         if (unitOfWork != null)
         {
             unitOfWork.Dispose();
         }
         if (repository != null)
         {
             repository.Dispose();
         }
         if (db != null)
         {
             db.Dispose();
         }
     }
     this.disposed = true;
 }
Exemple #6
0
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     _unitOfWork.Dispose();
 }