Exemplo n.º 1
0
 public void DeleteForm(string keyValue)
 {
     if (service.IQueryable().Count(t => t.F_ParentId.Equals(keyValue)) > 0)
     {
         throw new Exception("删除失败!操作的对象包含了下级数据。");
     }
     else
     {
         service.Delete(t => t.F_Id == keyValue);
     }
 }
Exemplo n.º 2
0
        public IActionResult Delete(long Id)
        {
            BaseResponeModel respone;
            int result = navigationRepository.Delete(Id);

            if (result > 0)
            {
                respone = new BaseResponeModel().SetStatus(AppGlobal.Success).SetMessage(AppGlobal.EditSuccess);
            }
            else
            {
                respone = new BaseResponeModel().SetStatus(AppGlobal.Error).SetMessage(AppGlobal.EditError);
            }
            return(Json(respone));
        }
Exemplo n.º 3
0
        public ActionResult <CommonResponeModel> Delete(long Id)
        {
            int result = navigationRepository.Delete(Id);

            if (result > 0)
            {
                Result = new SuccessResultFactory().Factory(ActionType.Delete);
            }
            else
            {
                Result = new ErrorResultFactory().Factory(ActionType.Delete);
            }

            return(GetCommonRespone());
        }
Exemplo n.º 4
0
 public static void Remove(int Id, INavigationRepository Repository)
 {
     Repository.Delete(Id);
 }