public async void InsertClient(Client c, ClientTicket ticket, bool isChecked) { ClientNeeded cn = new ClientNeeded { address = c.address, email = c.email, barCode = c.barCode, isDeleted = c.isDeleted, comments = c.comments, insertedDate = c.insertedDate, name = c.name, personalIdentity = c.personalIdentity, photo = c.photo, telefon = c.telefon }; PushResponse response = await client.PushTaskAsync("Clients", cn); if (isChecked) { Dictionary <string, string> dict = new Dictionary <string, string>(); dict = JsonConvert.DeserializeObject <Dictionary <string, string> >(response.Body); ticket.clientId = dict["name"]; InsertClientTicket(ticket); } }
public async void UpdateClient(Client c) { ClientNeeded clientNeeded = new ClientNeeded { address = c.address, barCode = c.barCode, email = c.email, comments = c.comments, insertedDate = c.insertedDate, isDeleted = c.isDeleted, name = c.name, personalIdentity = c.personalIdentity, photo = c.photo, telefon = c.telefon }; await client.UpdateTaskAsync($"Clients/{c.id}", clientNeeded); }