Пример #1
0
        public ActionResult Create([Bind(Include = "Id,Name,Description")] FeedType feedType)
        {
            if (ModelState.IsValid)
            {
                db.FeedType.Add(feedType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(feedType));
        }
Пример #2
0
        public ActionResult Create([Bind(Include = "Id,Title")] Image image)
        {
            if (ModelState.IsValid)
            {
                db.Image.Add(image);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(image));
        }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,Name,Sign,FirstAid,Description,MedicineTypeId,ImageId,VideoId")] Disease disease)
        {
            if (ModelState.IsValid)
            {
                db.Disease.Add(disease);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(disease));
        }
Пример #4
0
        public ActionResult Create([Bind(Include = "Id,Name,Power,SideEffect,Description,MedicineTypeId,CompanyId,ShopId,ImageId,VideoId")] Medicine medicine)
        {
            if (ModelState.IsValid)
            {
                db.Medicine.Add(medicine);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(medicine));
        }
Пример #5
0
        public ActionResult Create([Bind(Include = "Id,Name")] Country country)
        {
            if (ModelState.IsValid)
            {
                db.Country.Add(country);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(country));
        }
Пример #6
0
        public ActionResult Create([Bind(Include = "Id,Name,Link")] Video video)
        {
            if (ModelState.IsValid)
            {
                db.Video.Add(video);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(video));
        }
Пример #7
0
        public ActionResult Create([Bind(Include = "Id,Name,Contact,Description,CityId,ImageId")] Company company)
        {
            if (ModelState.IsValid)
            {
                db.Company.Add(company);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.CityId = new SelectList(db.City, "Id", "Name", company.CityId);
            return View(company);
        }
Пример #8
0
        public ActionResult Create([Bind(Include = "Id,Name,Contact,Location,Description,CityId")] Shop shop)
        {
            if (ModelState.IsValid)
            {
                db.Shop.Add(shop);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CityId = new SelectList(db.City, "Id", "Name", shop.CityId);
            return(View(shop));
        }
Пример #9
0
        public ActionResult Create([Bind(Include = "Id,Name,Description,FeedTypeId,CompanyId,ShopId,ImageId,VideoId")] Feed feed)
        {
            if (ModelState.IsValid)
            {
                db.Feed.Add(feed);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.FeedTypeId = new SelectList(db.FeedType, "Id", "Name", feed.FeedTypeId);
            return(View(feed));
        }
Пример #10
0
        public ActionResult Create([Bind(Include = "Id,Name,CountryId")] City city)
        {
            if (ModelState.IsValid)
            {
                db.City.Add(city);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CountryId = new SelectList(db.Country, "Id", "Name", city.CountryId);
            return(View(city));
        }
Пример #11
0
        public ActionResult Create([Bind(Include = "Id,Name,CategoryId")] Category category)
        {
            if (ModelState.IsValid)
            {
                db.Category.Add(category);
                db.SaveChanges();
                ViewBag.TopCategoryList = db.Category.OrderByDescending(c => c.Id).Take(10).ToList();
                return(RedirectToAction("Create"));
            }
            ViewBag.CategoryId = new SelectList(db.Category, "Id", "Name", category.CategoryId);

            return(View(category));
        }