public async Task <IActionResult> PutBusyo(int id, Busyo busyo) { if (id != busyo.Id) { return(BadRequest()); } _context.Entry(busyo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BusyoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Busyo> > PostBusyo(Busyo busyo) { _context.Busyoes.Add(busyo); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBusyo", new { id = busyo.Id }, busyo)); }
public async void SubmitB() { Busyo createdBusyo = await BusyoP.PostBusyoAsync(this.BusyoP); //TODO: Error handling Messenger.Raise(new WindowActionMessage(WindowAction.Close, "ShowSubmitCommandB")); }
public async Task <Busyo> PutBusyoAsync(Busyo busyo) { var jObject = JsonConvert.SerializeObject(busyo); //Make Json object into content type var content = new StringContent(jObject); //Adding header of the contenttype content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); Busyo responseUser = null; try { var response = await Client.PutAsync(this.BaseUrl + "/api/Busyo/" + busyo.Id, content); if (response.IsSuccessStatusCode) { var responseContent = await response.Content.ReadAsStringAsync(); responseUser = JsonConvert.DeserializeObject <Busyo>(responseContent); } } catch (Exception e) { System.Diagnostics.Debug.WriteLine("Exception in RestService.PutBusyoAsync: " + e); } return(responseUser); }
public async void Initialize() { Busyo busyo = new Busyo(); this.Busyo = await busyo.GetBusyoAsync(); // Ka ka = new Ka(); // this.Ka = await ka.GetKaAsync(); }
public async void BusyoPut(Busyo Busyo) { System.Diagnostics.Debug.WriteLine("PutCommand" + Busyo.Id); BusyoP = Busyo; Busyo putBusyo = await Busyo.PutBusyoAsync(this.BusyoP); //TODO: Error handling Messenger.Raise(new WindowActionMessage(WindowAction.Close, "Put")); }
public async void Initialize() { Employee employee = new Employee(); this.Employee = await employee.GetEmployeeAsync(); this.CEmployee = new Employee(); Ka ka = new Ka(); this.Ka = await ka.GetKaAsync(); Busyo busyo = new Busyo(); this.Busyo = await busyo.GetBusyoAsync(); }
public async Task <Busyo> DeleteBusyoAsync(int Id) { Busyo responseBusyo = null; try { var response = await Client.DeleteAsync(this.BaseUrl + "/api/Busyoes/" + Id); if (response.IsSuccessStatusCode) { var responseContent = await response.Content.ReadAsStringAsync(); responseBusyo = JsonConvert.DeserializeObject <Busyo>(responseContent); } } catch (Exception e) { System.Diagnostics.Debug.WriteLine("Exception in RestService.DeleteBusyoAsync: " + e); } return(responseBusyo); }
public async void Initialize() { Busyo busyo = new Busyo(); this.Busyo = await busyo.GetBusyoAsync(); }
public async void BusyoDelete(Busyo Busyo) { Busyo deletedBusyo = await Busyo.DeleteBusyoAsync(Busyo.Id); Messenger.Raise(new WindowActionMessage(WindowAction.Close, "ShowBusyoDeleteCommand")); }