Beispiel #1
0
        public KeyWordDto Get(int id)
        {
            KeyWords   keyWord    = _dB.Get(id);
            KeyWordDto keyWordDto = Mapper.KeyWords_To_KeyWordDto(keyWord);

            return(keyWordDto);
        }
 public ActionResult Edit(KeyWordDto keyWords)
 {
     if (ModelState.IsValid)
     {
         _searchKeywordsDTO.Add(keyWords);
         return(RedirectToAction("Index"));
     }
     return(View(keyWords));
 }
Beispiel #3
0
        public static KeyWordDto KeyWords_To_KeyWordDto(KeyWords keyWord)
        {
            var keyWordDto = new KeyWordDto
            {
                Id         = keyWord.Id,
                KeyWord    = keyWord.KeyWord,
                IsCategory = keyWord.IsCategory ?? false
            };

            return(keyWordDto);
        }
Beispiel #4
0
        public static KeyWords KeyWordDto_To_KeyWords(KeyWordDto keyWordDto)
        {
            var keyWords = new KeyWords
            {
                Id         = keyWordDto.Id,
                KeyWord    = keyWordDto.KeyWord,
                IsCategory = keyWordDto.IsCategory
            };

            return(keyWords);
        }
        // GET: KeyWords/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            KeyWordDto keyWords = _searchKeywordsDTO.Get((int)id);

            if (keyWords == null)
            {
                return(HttpNotFound());
            }
            return(View(keyWords));
        }
Beispiel #6
0
 public IActionResult GuardarKeyWords(KeyWordDto keyWordDto)
 {
     try
     {
         ApiCallResult result = this.blogService.GuardarKeyWord(keyWordDto.Nombre);
         return(StatusCode((int)System.Net.HttpStatusCode.OK, result));
     }
     catch (NegocioExecption e)
     {
         return(StatusCode((int)System.Net.HttpStatusCode.NotFound, e.Message));
     }
     catch (Exception e)
     {
         return(StatusCode((int)System.Net.HttpStatusCode.InternalServerError, e.Message));
     }
 }
Beispiel #7
0
        public void Update(KeyWordDto keyWords)
        {
            KeyWords keyWord = Mapper.KeyWordDto_To_KeyWords(keyWords);

            _dB.Update(keyWord);
        }
Beispiel #8
0
        public void Add(KeyWordDto keyWords)
        {
            KeyWords keyWord = Mapper.KeyWordDto_To_KeyWords(keyWords);

            _dB.Create(keyWord);
        }