// 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);
        }
示例#3
0
 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
         });
     });
 }
示例#4
0
        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();
        }
示例#5
0
        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);
        }
示例#6
0
 public PlacesController(AllPlaces allPlaces)
 {
     _allPlaces = allPlaces;
 }
示例#7
0
 public void Setup()
 {
     _mongoDB   = new Mock <Garcom.Models.MongoWrapper>(MockBehavior.Loose);
     _allPlaces = new AllPlaces(_mongoDB.Object);
 }
示例#8
0
 public MenuItemsController(AllPlaces allPlaces)
 {
     _allPlaces = allPlaces;
 }