Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AgricultureSpecialist agricultureSpecialist = db.AgricultureSpecialists.Find(id);

            db.AgricultureSpecialists.Remove(agricultureSpecialist);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 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));
 }
Esempio n. 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));
        }
Esempio n. 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));
        }