// Remove a to-do task item from the database and collections. public void DeletePlace(PlaceDetails placeForDelete) { // Remove a place from the "all" observable collection. AllPlaces.Remove(placeForDelete); // Remove the to-do item from the data context. placeDB.Places.DeleteOnSubmit(placeForDelete); // Save changes to the database. SaveChangesToDB(); }
// Add a place to the database and collections. public void AddPlace(PlaceDetails newPlace) { // Add a place to the data context. placeDB.Places.InsertOnSubmit(newPlace); // Save changes to the database. SaveChangesToDB(); // Add a place to the "all" observable collection. AllPlaces.Add(newPlace); }
public async Task OnGet() { (await _placeService.GetAllPlacesSelectAsync()).ToList().ForEach(x => { AllPlaces.Add(new SelectListItem() { Value = x.Id.ToString(), Text = x.Title }); }); (await _subjectService.GetSubjectSelects()).ToList().ForEach(x => { AllSubject.Add(new SelectListItem() { Value = x.Id.ToString(), Text = x.Title }); }); }
public PlacesViewModel() { Places = new ObservableCollection <Place>(); //seeding some data for test purpose for (int i = 0; i < 40; i++) { AllPlaces.Add(new Place() { Name = "l4", Building = "e3dady", Floor = "first", Description = "Don't go there" }); AllPlaces.Add(new Place() { Name = "k6", Building = "khraba", Floor = "second", Description = "Don't go there, also" }); } PreformFiltering(); }
private void Form1_Load(object sender, EventArgs e) { comboBox1.DisplayMember = "Name"; comboBox1.DataSource = Helpers.HelpUrls.AllHelps; comboBox1.SelectedIndex = 0; comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged; APIHelper.RegisterHotKey(Handle, 100, APIHelper.KeyModifiers.Alt, Keys.S); AllMaps.Init_AllMaps(); comb_map.Items.Clear(); comb_map.DisplayMember = "NameDetail"; comb_map.ValueMember = "Key"; var dt = AllMaps.Data.Select(x => x.Value); comb_map.DataSource = dt.ToArray(); comb_map.SelectedIndex = 0; AllPlaces.Init_Place(); AllPoints.Init_Points(); button7_Click(null, null); }
public PlacesController(AllPlaces allPlaces) { _allPlaces = allPlaces; }
public void Setup() { _mongoDB = new Mock <Garcom.Models.MongoWrapper>(MockBehavior.Loose); _allPlaces = new AllPlaces(_mongoDB.Object); }
public MenuItemsController(AllPlaces allPlaces) { _allPlaces = allPlaces; }