Example #1
0
        public ActionResult Create([Bind(Include = "ID,Name,Type,Country,Company,InternationalName,Component,PharmaAction,Contrindiction,Effect,MethodsOfUse,StorageCondition,Image,Dosage,Recipe")] Medicine medicine)
        {
            if (ModelState.IsValid)
            {
                db.Medicines.Add(medicine);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(medicine));
        }
Example #2
0
        public ActionResult Create([Bind(Include = "ID,Name,Address,PhoneNumber,Email,Website,SrcYandex,CityID")] Hospital hospital)
        {
            if (ModelState.IsValid)
            {
                db.Hospitals.Add(hospital);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CityID = new SelectList(db.Cities, "CityID", "CityName", hospital.CityID);
            return(View(hospital));
        }