public IHttpActionResult PutValidStores(int id, ValidStores validStores) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != validStores.Id) { return(BadRequest()); } db.Entry(validStores).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ValidStoresExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
protected override void OnAppearing() { base.OnAppearing(); /*using (SQLiteConnection conn = new SQLiteConnection(App.FilePath)) * { * conn.CreateTable<Resolved>(); * var Resolved_incidents = conn.Query<Resolved>("SELECT * FROM Resolved ORDER BY TimeResolved DESC"); * * ResolvedList.ItemsSource = Resolved_incidents; * }*/ using (SQLiteConnection conn = new SQLiteConnection(App.FilePath)) { conn.CreateTable <ValidStores>(); var current_store_list = conn.Query <ValidStores>("SELECT * FROM ValidStores"); if (current_store_list.Count() > 0) { current_store = current_store_list[0]; } else { current_store.StoreName = "ST158"; current_store.StoreLocation = "1997 E Beltline Ave NE, Grand Rapids, MI 49525, USA"; previous_store_name = "ST158"; } } //ResolvedIncidents(); }
public ActionResult DeleteConfirmed(int id) { ValidStores validStores = db.ValidStores.Find(id); db.ValidStores.Remove(validStores); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,StoreName,StoreLocation")] ValidStores validStores) { if (ModelState.IsValid) { db.Entry(validStores).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(validStores)); }
public ActionResult Create([Bind(Include = "Id,StoreName,StoreLocation")] ValidStores validStores) { if (ModelState.IsValid) { db.ValidStores.Add(validStores); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(validStores)); }
public IHttpActionResult GetValidStores(int id) { ValidStores validStores = db.ValidStores.Find(id); if (validStores == null) { return(NotFound()); } return(Ok(validStores)); }
public IHttpActionResult PostValidStores(ValidStores validStores) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ValidStores.Add(validStores); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = validStores.Id }, validStores)); }
// GET: ValidStores/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ValidStores validStores = db.ValidStores.Find(id); if (validStores == null) { return(HttpNotFound()); } return(View(validStores)); }
public IHttpActionResult DeleteValidStores(int id) { ValidStores validStores = db.ValidStores.Find(id); if (validStores == null) { return(NotFound()); } db.ValidStores.Remove(validStores); db.SaveChanges(); return(Ok(validStores)); }
private void StoreSelectionList_ItemSelected(object sender, SelectedItemChangedEventArgs e) { ValidStores current_store = (ValidStores)e.SelectedItem; //Application.Current.Properties["StoreNumber"] = current_store.StoreNumber; //Application.Current.Properties["StoreName"] = current_store.StoreName; using (SQLiteConnection conn = new SQLiteConnection(App.FilePath)) { conn.CreateTable <ValidStores>(); conn.Execute("DELETE FROM ValidStores"); int rowsAdded = conn.Insert(current_store); } this.Navigation.PopModalAsync(); }
protected override void OnAppearing() { base.OnAppearing(); using (SQLiteConnection conn = new SQLiteConnection(App.FilePath)) { conn.CreateTable<ValidStores>(); var current_store_list = conn.Query<ValidStores>("SELECT * FROM ValidStores"); if (current_store_list.Count() > 0) { current_store = current_store_list[0]; } else { current_store.StoreName = "ST158"; current_store.StoreLocation = "1997 E Beltline Ave NE, Grand Rapids, MI 49525, USA"; previous_store_name = "ST158"; } } //CurrentConfirmedDevices(); }
protected override void OnAppearing() { base.OnAppearing(); using (SQLiteConnection conn = new SQLiteConnection(App.FilePath)) { conn.CreateTable <ValidStores>(); var current_store_list = conn.Query <ValidStores>("SELECT * FROM ValidStores"); if (current_store_list.Count() > 0) { current_store = current_store_list[0]; } else { current_store.StoreName = "ST158"; current_store.StoreLocation = "1997 E Beltline Ave NE, Grand Rapids, MI 49525, USA"; } } StoreNameField.Text = "You are currently connected to store " + current_store.StoreName; StoreLocationField.Text = current_store.StoreLocation; }