Пример #1
0
        public void UpdateProduct(ProductCreate collection)
        {
            Product prods = MapViewModels.MapObject <ProductCreate, Product>(collection);

            prods.CategoryId = collection.CategoryId;
            base.Update(prods);
            base.SaveChanges();
        }
Пример #2
0
        public ActionResult Index()
        {
            MapViewModels model = new MapViewModels();

            model.Regions = db.Regions.ToList().Select(x => new SelectListItem {
                Value = x.Name,
                Text  = x.Name
            });
            model.Activities = db.Activities.ToList().Select(x => new SelectListItem
            {
                Value = x.Title,
                Text  = x.Title
            });
            model.Cities = db.Cities.ToList().Select(x => new SelectListItem
            {
                Value = x.Name,
                Text  = x.Name
            });
            return(View(model));
        }