public static async void obrisiUposlenika(string p) { try { var lista = App.MobileService.GetTable <TabelaUposlenik>(); var listatmp = await lista.ToListAsync(); TabelaUposlenik tk = listatmp.Find(x => x.username.Equals(p)); await lista.DeleteAsync(tk); } catch (Exception e) { Debug.WriteLine("Greska"); throw; } }
public static async void registrujUposlenika(string jmbg, string ime, string prezime, string adresa, string brTel, string un, string pass) { IMobileServiceTable <TabelaUposlenik> Uposlenici = App.MobileService.GetTable <TabelaUposlenik>(); TabelaUposlenik tu = new TabelaUposlenik(); tu.id = jmbg; tu.ime = ime; tu.prezime = prezime; tu.adresa = adresa; tu.brTel = brTel; tu.username = un; tu.password = pass; try { await Uposlenici.InsertAsync(tu); } catch (Exception e) { throw; } }