Example #1
0
 public void DeleteAsync(NaslovDto value)
 {
     HttpClient          httpClient          = GetHttpClient();
     UrlBuilder          urlBuilder          = new UrlBuilder(this.ApiSettings);
     HttpContent         content             = new StringContent(JsonConvert.SerializeObject(value), Encoding.UTF8, "application/json");
     HttpResponseMessage httpResponseMessage =
         httpClient.PostAsync(ControllerName + "/delete", content).Result;
 }
Example #2
0
        public ActionResult Edit(int id)
        {
            List <JezikDto> jezici    = new List <JezikDto>(_naslovClient.GetJezike());
            List <VrstaDto> vrste     = new List <VrstaDto>(_naslovClient.GetVrste());
            NaslovDto       naslovDto = _naslovClient.GetById(id);

            ViewBag.Vrste  = vrste;
            ViewBag.Jezici = jezici;
            return(View(naslovDto));
        }
Example #3
0
 public ActionResult Create(NaslovDto value)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _naslovClient.AddAsync(value);
             return(RedirectToAction(nameof(Index)));
         }
     }
     catch (Exception ex)
     {
         //Log the error (uncomment ex variable name and write a log.
         ModelState.AddModelError("", "Nije moguce sacuvati promene. " +
                                  "Pokusaj ponovo, ako se problem nastavi " +
                                  "kontaktiraj administratora.");
     }
     return(View(value));
 }
Example #4
0
        public ActionResult Details(int id)
        {
            NaslovDto naslovDto = _naslovClient.GetById(id);

            return(View(naslovDto));
        }
 public ActionResult<NaslovDto> GetNaslovById(int id)
 {
     NaslovDto naslovDto = _evidencijaDugovanjaClient.GetNaslovById(id);
     return naslovDto;
 }
Example #6
0
 public void Update(NaslovDto value)
 {
     Naslov naslov = _naslovMapper.Map<Naslov>(value);
     _naslovRepository.Update(naslov);
 }
Example #7
0
 public void Add(NaslovDto value)
 {
     Naslov naslov = _naslovMapper.Map<Naslov>(value);
     _naslovRepository.Save(naslov);
 }
Example #8
0
 public ActionResult Delete(NaslovDto value)
 {
     _naslovService.Delete(value);
     return Ok();
 }
Example #9
0
 public ActionResult Update(NaslovDto value)
 {
     _naslovService.Update(value);
     return Ok();
 }
Example #10
0
 public ActionResult Add(NaslovDto value)
 {
     _naslovService.Add(value);
     return Ok();
 }