예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AgricultureSpecialist agricultureSpecialist = db.AgricultureSpecialists.Find(id);

            db.AgricultureSpecialists.Remove(agricultureSpecialist);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Organization,Rates,Name,Email,MobileNumber,CityId,CreatedDate")] AgricultureSpecialist agricultureSpecialist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(agricultureSpecialist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CityId = new SelectList(db.Cities, "Id", "Name", agricultureSpecialist.CityId);
     return(View(agricultureSpecialist));
 }
예제 #3
0
        // GET: AgricultureSpecialists/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AgricultureSpecialist agricultureSpecialist = db.AgricultureSpecialists.Find(id);

            if (agricultureSpecialist == null)
            {
                return(HttpNotFound());
            }
            return(View(agricultureSpecialist));
        }
예제 #4
0
        // GET: AgricultureSpecialists/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AgricultureSpecialist agricultureSpecialist = db.AgricultureSpecialists.Find(id);

            if (agricultureSpecialist == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CityId = new SelectList(db.Cities, "Id", "Name", agricultureSpecialist.CityId);
            return(View(agricultureSpecialist));
        }