示例#1
0
 private void DeleteSelf([Inject] IRoleDal dal)
 {
     using (BypassPropertyChecks)
     {
         dal.Delete(this.Id);
     }
 }
 public EntityResult Delete(Role model)
 {
     try
     {
         if (_roleDal.Delete(model))
         {
             return(new EntityResult("Başarılı", ResultState.Success));
         }
         return(new EntityResult("Hata Oluştu", ResultState.Warning));
     }
     catch (Exception ex)
     {
         return(new EntityResult("Database hatası " + ex.ToInnestException().Message, ResultState.Error));
     }
 }
示例#3
0
        public bool Delete(int id)
        {
            var deleteObject = _roleDal.GetOne(x => x.id == id);

            if (deleteObject != null)
            {
                bool result = _roleDal.Delete(deleteObject);
                if (result)
                {
                    return(true);
                }

                return(false);
            }
            return(false);
        }
        public DataResponse Delete(Role entity)
        {
            var role = _RoleDal.Delete(entity);

            if (role == null)
            {
                return new DataResponse
                       {
                           Mesaj      = "Aradiginiz Rol Bulunamadi",
                           Tamamlandi = false
                       }
            }
            ;
            return(new DataResponse
            {
                Data = role,
                Mesaj = "Rol Silindi",
                Tamamlandi = true
            });
        }
    }
示例#5
0
        /// <summary>
        /// Deletes the specified item that contains the id.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="errors"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public bool TryDelete(int id, List <IModelError> errors, IModelContext context = null)
        {
            var exists = Exists(id, context);

            if (!exists)
            {
                AddNotExistsError(errors);
                return(false);
            }

            try
            {
                changeHandler.BeforeDelete(id, context);
                dal.Delete(id, context);
                changeHandler.AfterDelete(id, context);
            }
            catch (Exception ex)
            {
                log.Exception(LogName, ex);
                throw new InvalidOperationException("Unable to delete IRoleDataModel", ex);
            }

            return(true);
        }
示例#6
0
 public void Delete(Role role)
 {
     _roleDal.Delete(role);
 }
示例#7
0
 public void Delete(int roleId)
 {
     _roleDal.Delete(new Role {
         Id = roleId
     });
 }
示例#8
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public void Delete(int ID)
 {
     dal.Delete(ID);
 }
示例#9
0
 public void Delete(Role entity)
 {
     _roleDal.Delete(entity);
 }
示例#10
0
 public void Delete(int Id)
 {
     _roleDal.Delete(Id);
 }
 public bool Delete(int id)
 {
     return(_roleDal.Delete(id));
 }
示例#12
0
 public void Delete(int id)
 {
     _roleDal.Delete(id);
 }