Beispiel #1
0
        // GET: RoomType/Delete/5
        public ActionResult Delete(int id)
        {
            var roomtype = _repo.FindById(id);

            if (roomtype == null)
            {
                return(NotFound());
            }
            var isSuccess = _repo.Delete(roomtype);

            if (!isSuccess)
            {
                return(BadRequest());
            }
            return(RedirectToAction(nameof(Index)));
        }
        public ActionResult Delete()
        {
            if (ItemId < 0)
            {
                return(RedirectToAction("Index"));
            }

            _roomTypeRepository.Delete(ItemId);
            SetSuccessNotification("Xóa loại phòng thành công");

            return(RedirectToAction("Index"));
        }
Beispiel #3
0
        public RoomType Delete(int id)
        {
            RoomType room = new RoomType();

            try
            {
                room = _roomTypeRepository.Delete(id);
                _unitOfWork.Commit();
            }
            catch (Exception ex)
            {
                string FunctionName = string.Format("DeleteRoomtype('{0}')", id);
                Common.Logs.LogCommon.WriteError(ex.ToString(), FunctionName);
                return(null);
            }
            return(room);
        }
 /// <summary>
 /// Method To Delete RoomType By Given id
 /// </summary>
 /// <param name="id"></param>
 public void DeleteRoomType(int id)
 {
     roomtypeRepository.Delete(id);
 }
 public async Task <ActionsResult> Delete(int id)
 {
     return(await roomTypeRepository.Delete(id));
 }
Beispiel #6
0
 public bool Delete(RoomType roomType)
 {
     return(_roomTypeRepository.Delete(roomType));
 }
Beispiel #7
0
 public void Delete(RoomType entity)
 {
     roomService.DeleteRoomsByRoomType(entity);
     _repository.Delete(entity);
 }