private void GetDetails() { currentcontact = Db_Helper.ReadContact(2); email.Text = currentcontact.Email; num.Text = currentcontact.PhoneNumber; phn_Number = num.Text; loc.Text = currentcontact.Location; }
public void UpdateContact(Contacts contact) { using (var dbConn = new SQLiteConnection(App.DB_PATH)) { var existingconact = dbConn.Query<Contacts>("select * from Contacts where Id =" + contact.Id).FirstOrDefault(); if (existingconact != null) { existingconact.Name = contact.Name; existingconact.Email = contact.Email; existingconact.PhoneNumber = contact.PhoneNumber; existingconact.Location = contact.Location; dbConn.RunInTransaction(() => { dbConn.Update(existingconact); }); } } }
private void GetPhoneContactToMap() { rows = Db_Helper.TotalRows(); for (int i = 1; i <= rows; i++) { currentcontact = Db_Helper.ReadContact(i); name.Text = currentcontact.Name; loc.Text = currentcontact.Location; contactlocation = loc.Text; contactname = name.Text; mysearchgeoquery = new GeocodeQuery(); mysearchgeoquery.GeoCoordinate = new GeoCoordinate(MyGeoPosition.Coordinate.Latitude, MyGeoPosition.Coordinate.Longitude); mysearchgeoquery.SearchTerm = contactlocation; mysearchgeoquery.QueryCompleted += ContactNumberBinding_QueryCompleted; mysearchgeoquery.QueryAsync(); sayingInfo(contactname); } }
public void Insert(Contacts newcontact) { using (var dbConn = new SQLiteConnection(App.DB_PATH)) { dbConn.RunInTransaction(() => { dbConn.Insert(newcontact); }); } }