Example #1
0
        public H_ViewDto getH_ViewById(int id)
        {
            H_ViewDto dto = new H_ViewDto();
            var       x   = _unitOfWork.H_ViewRepository.FindById(id);

            dto.Id   = x.Id;
            dto.name = x.name;
            return(dto);
        }
Example #2
0
        public int addH_View(H_ViewDto dto)
        {
            H_View f = new H_View();

            f.name = dto.name;
            _unitOfWork.H_ViewRepository.Add(f);
            _unitOfWork.SaveChanges();
            return(f.Id);
        }
Example #3
0
        public bool EditH_View(int id, H_ViewDto dto)
        {
            var d = _unitOfWork.H_ViewRepository.FindById(id);

            if (d == null)
            {
                return(false);
            }
            d.name = dto.name;
            _unitOfWork.H_ViewRepository.Update(d);
            _unitOfWork.SaveChanges();
            return(true);
        }
Example #4
0
        public List <H_ViewDto> getAllH_Views()
        {
            List <H_ViewDto> res = new List <H_ViewDto>();
            H_ViewDto        dto = new H_ViewDto();

            foreach (var item in _unitOfWork.H_ViewRepository.GetAll())
            {
                dto.Id   = item.Id;
                dto.name = item.name;
                res.Add(dto);
                dto = new H_ViewDto();
            }
            return(res);
        }
        public ActionResult EditH_View(int id, H_ViewDto dto)
        {
            var x = _IAuctionService.EditH_View(id, dto);

            return(RedirectToAction("AddH_View"));
        }
 public ActionResult AddH_View(H_ViewDto dto)
 {
     _IAuctionService.addH_View(dto);
     return(RedirectToAction("AddH_View"));
 }