public IResult Delete(int id)
 {
     try
     {
         _baseDal.Delete(new TEntity {
             Id = id
         });
         return(new SuccessResult());
     }
     catch (Exception e)
     {
         return(new ErrorResult(e.Message));
     }
 }
Beispiel #2
0
        /// <summary>
        /// 删除单条数据
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public virtual JsonModel Delete(int id)
        {
            JsonModel jsonModel = null;

            try
            {
                bool result = CurrentDal.Delete(CurrentEntity, id);

                jsonModel = new JsonModel()
                {
                    errNum  = 0,
                    errMsg  = "success",
                    retData = result
                };
                return(jsonModel);
            }
            catch (Exception ex)
            {
                jsonModel = new JsonModel()
                {
                    errNum  = 400,
                    errMsg  = ex.Message,
                    retData = ""
                };
                return(jsonModel);
            }
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="WhereLambda">删除条件的lambda的表达式</param>
        /// <returns>符合此lambda的集合</returns>
        public int Delete(Expression <Func <TModel, bool> > WhereLambda)
        {
            //DbContextEnity.SaveChanges();
            int Count = CurrentDal.Delete(WhereLambda);

            dbSession.SaveChanges();
            return(Count);
        }
Beispiel #4
0
        internal void Delete(int id)
        {
            Gelir _gelir = new Gelir();

            _gelir.Id   = id;
            ReturnValue = gelirDal.Delete(_gelir);
            if (ReturnValue > 0)
            {
                Helper.Message.Information("Kayıt Silindi.");
            }
            else
            {
                Helper.Message.Error("Silme işleminiz başarısız.");
            }
        }
Beispiel #5
0
 internal void Delete(Kategori selectedKategori)
 {
     try
     {
         ReturnValue = kategoriDal.Delete(selectedKategori);
     }
     catch (Exception exception)
     {
         Helper.Message.Error(exception.Message);
     }
     if (ReturnValue > 0)
     {
         Helper.Message.Information("Silme işlemi başarılı");
     }
 }
Beispiel #6
0
 internal void Delete(AltKategori selectedAltKategori)
 {
     ReturnValue = 0;
     try
     {
         ReturnValue = _altKategoriDal.Delete(selectedAltKategori);
         if (ReturnValue > 0)
         {
             Helper.Message.Information("Kaydınız silindi.");
         }
     }
     catch (Exception exception)
     {
         Helper.Message.Error(exception.Message);
     }
 }
        public async Task <IResult> Delete(TEntity entity)
        {
            IResult result;

            try
            {
                await _baseDal.Delete(entity);

                result      = new SuccessResult("Deleting was succesed");
                _identityId = _baseDal.SCOPE_IDENTY_ID;
            }
            catch (Exception ex)
            {
                result = new ErrorResult(ex.Message);
            }

            return(result);
        }
Beispiel #8
0
 public virtual bool Delete(T model)
 {
     CurrentDal.Delete(model);
     return(dbSession.SaveChanges() > 0);
 }
Beispiel #9
0
 public virtual void Delete(T model, bool isAdded)
 {
     basedal.Delete(model, isAdded);
 }
Beispiel #10
0
 public void Delete(Brand brand) => _brandDal.Delete(brand);
Beispiel #11
0
 public async Task <bool> Delete(T t)
 {
     return(await Task.Run <bool>(() => ibaseDal.Delete(t)));
 }
Beispiel #12
0
 public void Delete(Car car) => _carDal.Delete(car);
Beispiel #13
0
 public int Delete(T entity)
 {
     return(_dao.Delete(entity));
 }
Beispiel #14
0
 public void Delete(T entity)
 {
     dal.Delete(entity);
     DbSession.SaveChange();
 }
Beispiel #15
0
 public bool Delete(T entity)
 {
     CurrentDal.Delete(entity);
     return(dbSession.SaveChanges() > 0);
 }
Beispiel #16
0
 public bool Delete(int id)
 {
     return(dbClient.Delete(id));
 }
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="entity"></param>
 public virtual void Delete(T entity)
 {
     m_dal.Delete(entity);
 }
Beispiel #18
0
 /// <summary>
 /// 删除某个对象
 /// </summary>
 /// <param name="t"></param>
 /// <returns></returns>
 public int Delete(T t)
 {
     return(_dal.Delete(t));
 }
Beispiel #19
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public bool Delete(T entity)
 {
     return(_dal.Delete(entity));
 }
Beispiel #20
0
 public virtual bool Delete(int id)
 {
     return(dal.Delete(id));
 }
Beispiel #21
0
 public void Delete(Color color) => _colorDal.Delete(color);
Beispiel #22
0
 public virtual Boolean Delete(T entity)
 {
     return(Basedal.Delete(entity));
 }
Beispiel #23
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="Entity"></param>
 /// <returns></returns>
 public bool Delete(T Entity)
 {
     currentDal.Delete(Entity);
     return(DBSession.SaveChanges() > 0);
 }
Beispiel #24
0
 public void Delete(TEntity model, bool isaddedContext)
 {
     basedal.Delete(model, isaddedContext);
 }
Beispiel #25
0
        public void Delete(long id)
        {
            var entity = _baseDal.GetById(id);

            _baseDal.Delete(entity);
        }