示例#1
0
 public ActionResult Edit([Bind(Include = "ID,Name,Type,Country,Company,InternationalName,Component,PharmaAction,Contrindiction,Effect,MethodsOfUse,StorageCondition,Image,Dosage,Recipe")] Medicine medicine)
 {
     if (ModelState.IsValid)
     {
         db.Entry(medicine).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(medicine));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "ID,Name,Address,PhoneNumber,Email,Website,SrcYandex,CityID")] Hospital hospital)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hospital).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CityID = new SelectList(db.Cities, "CityID", "CityName", hospital.CityID);
     return(View(hospital));
 }