public void Clear() { _contexts.Clear(); EnvironmentTable.Clear(); SubscriptionTable.Clear(); AccountTable.Clear(); }
public IHttpActionResult PutSubscriptionTable(int id, SubscriptionTable subscriptionTable) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != subscriptionTable.Subscription_Id) { return(BadRequest()); } db.Entry(subscriptionTable).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!SubscriptionTableExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult DeleteEventsTable(int id) { EventsTable eventsTable = db.EventsTables.Find(id); var sub = from n in db.SubscriptionTables where n.Event_Id == id select n; var book = from n in db.BookingTables where n.EventId == id select n; SubscriptionTable st = (SubscriptionTable)sub.FirstOrDefault(); BookingTable bt = (BookingTable)book.FirstOrDefault(); if (st != null) { db.SubscriptionTables.Remove(st); db.SaveChanges(); } if (bt != null) { db.BookingTables.Remove(bt); db.SaveChanges(); } //EventsTable eventsTable = db.EventsTables.Find(id); if (eventsTable == null) { return(NotFound()); } db.EventsTables.Remove(eventsTable); db.SaveChanges(); return(Ok(eventsTable)); }
public IHttpActionResult GetSubscriptionTable(int id) { SubscriptionTable subscriptionTable = db.SubscriptionTables.Find(id); if (subscriptionTable == null) { return(NotFound()); } return(Ok(subscriptionTable)); }
public IHttpActionResult DeleteSubscriptionTable(int id) { SubscriptionTable subscriptionTable = db.SubscriptionTables.Find(id); if (subscriptionTable == null) { return(NotFound()); } db.SubscriptionTables.Remove(subscriptionTable); db.SaveChanges(); return(Ok(subscriptionTable)); }
public IHttpActionResult PostSubscriptionTable(SubscriptionTable subscriptionTable) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var check = from n in db.SubscriptionTables where n.Event_Id == subscriptionTable.Event_Id && n.User_Id == subscriptionTable.User_Id select n; if (check != null) { db.SubscriptionTables.Add(subscriptionTable); db.SaveChanges(); } else { } return(CreatedAtRoute("DefaultApi", new { id = subscriptionTable.Subscription_Id }, subscriptionTable)); } catch { return(NotFound()); } }
private async void InsertToAzureMobileServicesTable(SubscriptionTable item) { // This code inserts a new Prize into the database. The Insert script on the Mobile Services back end will send a new message to the Service Bus queue. try { await subscriptionTable.InsertAsync(item); //change pivotitem view } catch (Exception e) { } }
private void TrackBtn_Click(object sender, RoutedEventArgs e) { firstPoint = true; App.CountLocation = 0; if(LastRutte!=null) MapView.RemoveRoute(LastRutte); MapView.Layers.Clear(); MapView.UpdateLayout(); App.CurrentViewerSession = TrackTxt.Text; PivotControlViwer.SelectedIndex = PivotControlViwer.Items.IndexOf(Pivot2); //insertar registro en la tabla de suscriptores de azure mobile services //insert the location data to windows azure mobile services table var newItem = new SubscriptionTable { Clientuniquecode=App.ClientUniqueNumber,Session=TrackTxt.Text}; InsertToAzureMobileServicesTable(newItem); GetLocalizationsAsync(); }