Example #1
0
        public void SaveCategory(CategoriesListViewModel p)
        {
            CATEGORY cat = new CATEGORY();

            cat.PARAMTYPE = this.PARAM;
            DbContext.CATEGORY.Add(cat);
            DbContext.SaveChanges();
            p.CategoriesList.Add(new CategoryViewModel(cat));
        }
Example #2
0
        //public ObservableCollection<OWNERS> OWNERS { get; set; }

        public PropertyViewModel()
        {
            //TestCommand = new RelayCommand(Refresh);
            SaveCommand        = new RelayCommand(Save, CanSave);
            BrowseImageCommand = new RelayCommand(Browse);
            DeleteImageCommand = new RelayCommand(Delete);
            //RefreshCommand = new RelayCommand(Refresh);
            SearchCommand = new RelayCommand(Search, () => { return(!(this.PROPERTYID == 0)); }); // Намери подходящи условия за вкл/изкл на бутона "Търсене"!


            CITIES        = new CitiesViewModel();
            PROPERTYTYPES = new PropertyTypesViewModel();
            //OWNERS = new OwnersViewModel();
            CATEGORIES    = new CategoriesListViewModel();
            IMAGES        = new ImagesViewModel();
            isActive      = true;
            ChangeTracker = new Dictionary <string, int>();
            ChangeTracker.Add(new KeyValuePair <string, int>(("PROPERTYTYPES"), PROPERTYTYPES.PropertyTypesList.Count));
        }
Example #3
0
 public void DeleteCategory(CategoriesListViewModel p)
 {
     DbContext.CATEGORY.Remove(DbContext.CATEGORY.Where(c => this.CATEGORYID == c.CATEGORYID).FirstOrDefault());
     DbContext.SaveChanges();
     p.CategoriesList.Remove(this);
 }