private async Task DeleteServicio(UIServicio serviciodel) { HttpResponseMessage response = serviceObj.DeleteResponse("api/Servicio/Deleteservicio/" + serviciodel.ID.ToString()); response.EnsureSuccessStatusCode(); string result = await response.Content.ReadAsStringAsync(); }
private async Task UpdateServicio(UIServicio servicioact) { HttpResponseMessage response = serviceObj.PostResponse("api/Servicio/Updateservicio", servicioact); response.EnsureSuccessStatusCode(); string result = await response.Content.ReadAsStringAsync(); }
private async Task FindServicio(int id) { HttpResponseMessage response = serviceObj.GetResponse("api/Servicio/getservicio/" + id.ToString()); response.EnsureSuccessStatusCode(); string result = await response.Content.ReadAsStringAsync(); servicioedit = JsonConvert.DeserializeObject <UIServicio>(result); }
public async Task <ActionResult> Delete(UIServicio serviciodel) { await DeleteServicio(serviciodel); return(RedirectToAction("index", "servicio")); }
public async Task <ActionResult> Edit(UIServicio servicioact) { await UpdateServicio(servicioact); return(RedirectToAction("index", "servicio")); }
public async Task <ActionResult> Create(UIServicio newservicio) { await CreateServicio(newservicio); return(RedirectToAction("index", "servicio")); }
public ActionResult Create() { UIServicio servicio = new UIServicio(); return(View(servicio)); }